Tips How to Use Python Pathlib Rick Donato Jul 24, 2024 1 min read Python Tip: Use pathlib to work with paths. Here is an example 👇from pathlib import Path path = Path('/home/user/file.txt') print(path.parent) # /home/user print(path.stem) # file print(path.suffix) # .txt