Python Arquivo pai
from pathlib import Path
path = Path("/here/your/path/file.txt")
print(path.parent.absolute())
Annoyed Alligator
from pathlib import Path
path = Path("/here/your/path/file.txt")
print(path.parent.absolute())