import os dir_where_my_py_code_is_running = os.getcwd() print(dir_where_my_py_code_is_running) #prints the directory