Concepts: File Handling¶
Short essays on why file handling in Python works the way it does. These are the pieces you read once and keep coming back to when something surprises you in practice — the "ah, that's why" layer beneath the syntax.
Essays in this section¶
- Why context managers matter — the case for
with, what closing actually does, and what goes wrong when you forget. - Understanding file encodings — bytes versus text, UTF-8 versus the alternatives, and the encoding errors you'll meet sooner or later.