Open this example in the interactive library
Source code
from pathlib import PurePosixPath
print(PurePosixPath('data') / '2026' / 'report.csv')Sample output
data/2026/report.csv

Join path segments. A self-contained example using the Python standard library.
Open this example in the interactive library
from pathlib import PurePosixPath
print(PurePosixPath('data') / '2026' / 'report.csv')data/2026/report.csv