os python get the parent directory name code example
Example 1: working directory python
import os
cwd = os.getcwd()
Example 2: python get parent directory
import os.path
os.path.dirname('C:\Program Files')
import os
cwd = os.getcwd()
import os.path
os.path.dirname('C:\Program Files')