Python -Datei übergeordnet

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