import os,sys print(__file__) path = os.path.abspath(__file__) path = os.path.dirname(path) print(path)