os.path join parent and child folders code example
Example 1: how do i get parent directory python
from pathlib import Path
path = Path(Path.cwd())
print(path.parent)
Example 2: How do I get the parent directory in Python?
from pathlib import Path
Path(Path.cwd()).parent