python get location of file with respect to source code example Example: python how to get directory of script import os print(os.path.abspath(''))