Inspired Python
◆◆◆
>>> from pathlib import Path
>>> p = Path('/srv/inspiredpython/')
>>> hello_path = p.parent.joinpath('documents', 'hello.txt')
>>> print(hello_path)
'/srv/documents/hello.txt'
>>> print(hello_path.with_suffix('.md').with_stem('greetings'))
'/srv/documents/greetings.md'