Python — From Basics to Advanced · Files and I/O
pathlib — modern path handling
Files and I/O
Introduction
pathlib (Python 3.4+) replaces os.path. A path is an object with methods like read_text(), exists(), iterdir(), and glob() — much cleaner than string concatenation.