Getting current directory code example
Example 1: get working directory python
import os
os.getcwd()
Example 2: get the previous working directory in python
path = os.path.dirname(__file__)
print(path)
import os
os.getcwd()
path = os.path.dirname(__file__)
print(path)