Learn pathlib
Object-oriented file system paths that work the same on every OS
pathlib represents file system paths as objects with methods for joining, inspecting, reading, writing, globbing and resolving them. It replaces most uses of os.path, glob and open with one readable API that handles Windows and POSIX differences. It's the modern default for any Python code that touches files.
Before you start
How deep do you want to go?
1. EssentialsRead and write simple code, do the everyday basics
2. PracticalUse it productively at work, with the usual idioms
3. AdvancedThe less common features, performance and trade-offs
4. ExpertInternals and the edge cases experts know