The title sums it up, what is the difference between __file__
and os.path.realpath(__file__)
?
import os
print((__file__)) #/Users/tom/Documents/Code/Python/LearnPython/playingname.py
print(os.path.realpath(__file__)) #/Users/tom/Documents/Code/Python/LearnPython/playingname.py
print(type(__file__)) #<class 'str'>
print(type(os.path.realpath(__file__))) #<class 'str'>
Is os.path.realpath
redundant?