If you want to get the parent directory of a file, use Path(file).parents[index].
Path(file).parents[0] gets the parent directory one level up. Path(file).parents[1] gets the parent directory two levels up.
Find an example of this method in the code above.


