Pathlib
The `pathlib` module offers classes representing filesystem paths with semantics appropriate for different operating systems. It provides an object-oriented approach to path manipulation that replaces many `os.path` functions. The guide walks through Path Basics, Directory Operations, File I/O, Path Properties, PurePath. `Path("/usr/bin/python3")` creates an absolute path. `Path("docs", "readme.md")` joins path components. `Path.home()` returns the user's home directory. `Path.cwd()` returns the current working directory. `/` operator joins paths: `Path("/usr") / "bin" / "python3"`. `.mkdir(parents=True, exist_ok=True)` creates a directory. `.glob("*.py")` yields all Python files matching the pattern. `.rglob("**/*.py")` does recursive globbing. `.iterdir()` yields all entries in the directory. `.rmdir()` removes an empty directory. `.read_text(encoding="utf-8")` reads the entire file as a string. `.write_text(content, encoding="utf-8")` writes a string. `.read_bytes()` reads binary data. `.write_bytes(data)` writes binary data. These are convenience methods that handle opening and closing the file automatically. The guide is organized into 5 sections that build on each other, each pairing a prose explanation with runnable code.