How do I find the current directory with Python?
I want to get the full path to the directory a Python file is contained in.
To get the current directory path import
os module and use
import os current_directory = os.getcwd() print(current_directory) # C:\Users\user\PycharmProjects\...