os.path.dirname(os.getcwd()) code example
Example: python os get dir path
from os import getcwd # only import "getcwd" from os
getcwd() # Get the current working directory
from os import getcwd # only import "getcwd" from os
getcwd() # Get the current working directory