I'm a beginner working on my self project with some YouTube tutorial help. I came around this OS module, and I'm really confused what is the difference between
os.path.dirname(__file__)
and I've seen many of the experienced ones using:
os.path.dirname(os.path.abspath(__file__))
does this really makes any difference? I've already seen some answers, either they are bit complex for me or I'm not satisfied with their explanation. Plz can anyone explain me in detail each's significance.
import os
p = os.path.dirname(os.path.abspath(__file__))
q = os.path.dirname(__file__)
Output:
C:\Users\ashud\Documents\Python Scripts
C:/Users/ashud/Documents/Python Scripts