Elegant Filesystem Interactions in Python using pathlib
summary
Pathlib provides first‑class, immutable path objects (added in Python 3.4, still provisional) that let code join paths with use slash operator to join paths, query metadata with .stat/.exists/.is_file/.samefile, and atomically replace outputs by writing to a temp path then renaming (temp-file write then rename to preserve previous file). It adds conveniences like read_text/write_text methods and Path.cwd()/Path.home(), but still requires str(path) for many legacy APIs and lacks a built‑in walk/os.scandir integration.
AI-written summary · about
chapters (6)
related talks
27mpathlib: why and how to use it
30m"Hot: Pathlib, Not: String Paths"
30m"Adding File System context to pathlib"
43mPython Improvements (or This Is Not Your Teacher's Python)
51mBuilding useful project utils in Python
01h 18mIntroducing More of the Standard Library
31mPython on Windows
29mGet your resources faster, with importlib.resources
