Trey Hunner
Trey Hunner specializes in Python education and corporate training. Trey is a former Python Software Foundation Board Director, a San Diego Python meetup regular. You can learn from Trey through his Python Morsels platform and his weekly Python tips newsletter.
https://mastodon.social/@treyhunner & https://bsky.app/profile/trey.io & https://www.linkedin.com/in/treyhunner/ & https://x.com/treyhunner
Session
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 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
.