python run directory code example
Example 1: how to check in which directory python in running
import os
cwd = os.getcwd()
Example 2: get the previous working directory in python
path = os.path.dirname(__file__)
print(path)
import os
cwd = os.getcwd()
path = os.path.dirname(__file__)
print(path)