If you want to get the parent path or the grandparent path in Python easily, use pathlib’s .parent.
.parent