Skip to content

/ ".." to go back one step #87

Description

@Aria-AAs

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions