Summary
The dirname() function can be used to extract the directory name from the path as a string.
1
To get only the directory name directly above the file, os.path can be used.
2
3
According to