python
from pathlib import Path
python
path = Path('path/to/file')
python
subpath = path.joinpath('subdirectory', 'file.txt')
python
new_dir = Path('new_directory')
new_dir.mkdir()
python
with path.open() as file:
content = file.read()
print(content)