-
-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
It would be good if there was a feature to make a Path to go back one step by new_path = some_path / "..".
Something like this:
from pathlib2 import Path
base_directory = Path("base_directory/source_directory")
data_directory = base_directory / "text_files/text_data"
print(data_directory)
That make this output:
base_directory/source_directory/text_files/text_data
Now with the code below:
file_directory = data_directory / ".."
print(file_directory)
Output this:
base_directory/source_directory/text_files/
Instead this:
base_directory/source_directory/text_files/text_data/..
Metadata
Metadata
Assignees
Labels
No labels