get folder a python script runs in code example Example: python how to get directory of script import os print(os.path.abspath(''))