python and os.path.realpath difference in os.path.abspath

python os.path.abspath differs in the os.path.realpath
CD / Home
mkdir A
mkdir B
Touch A / 1.txt
LN -s /home/a/1.txt /home/b/1.txt

python
enter real mode
>>> Import OS
>>> os.path.abspath with ( "A / 1.txt")
'/root/a/1.txt'
>>> os.path.abspath with ( "B /. 1. TXT ")
'/root/b/1.txt'
>>> the os.path.realpath (" B / 1.txt ")
'/root/a/1.txt'
>>> the os.path.realpath (" a / 1.txt ")
'/root/a/1.txt'
>>>

the os.path.realpath returned using soft real address
os.path.abspath return destination address

 

Guess you like

Origin www.cnblogs.com/WebLinuxStudy/p/12107671.html