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