python how to find the parent file in directory 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