Python · Python Foundations · Foundation · 26 min read
Python Files, Paths and Text I/O: pathlib, open modes, Encodings, CSV, JSON and Atomic Writes
Read and write data safely. Learn pathlib for cross-platform paths, opening files with modes and encodings, reading text and bytes, streaming large files, newline handling, the csv and json modules, temporary files and directories, atomic writes with os.replace, file permissions, directory traversal safely, and the mistakes that cause corrupted data and security holes.
Create an account to start
Create a free account to see what this lesson covers
- Every free lesson in every section, in full
- Track your progress and pick up where you left off
- Free practice questions and an incident simulation
- Takes under a minute: name, email and a password
No card needed. Full access to Python is a paid upgrade you can choose later.