Answers for "how to check current working directory of python files"

19

get working directory python

import os
os.getcwd()
Posted by: Guest on May-23-2020
-1

python get directory of current script file

import os
os.path.abspath(__file__) # Directory of current python script
#Output will look something like: C:UsersUserNameDesktoppy-script.py
Posted by: Guest on January-13-2021

Code answers related to "how to check current working directory of python files"

Python Answers by Framework

Browse Popular Code Answers by Language