with open parent directory pyton code example
Example 1: python get parent directory
from pathlib import Path
Path('C:\Program Files').parent
Example 2: How do I get the parent directory in Python?
from pathlib import Path
Path(Path.cwd()).parent