tubeshowcase●1,524,254 videos♡ My collection 0
← Learn to Code

Learn to Code26:35

pathlib: why and how to use it - Trey Hunner

PyCon US ↗

From the creator

If your Python code works with file paths, you should be using pathlib. This standard library module may seem a bit cumbersome at first, but pathlib-using code is often more readable than the alternative. Python's many path-oriented utilities used to expect a string representation for all file paths. That's not the case anymore. Now every important path-consuming library will accept pathlib.Path objects. During this talk, we'll see why pathlib.Path objects make for more maintainable code. We'll visit a number of useful pathlib examples and recipes along the way. By the end of this talk, you'll be tempted to convert all your path-handling code to use pathlib.

Published 2026-07-02 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code