Chapter 10. Files and Strings
Let's take a step back from the higher-level patterns now, and cover several Python constructs we've used in all our examples, but without any details. We'll be looking at files, IO, and serializing and loading data. Along the way, we'll find out how complicated Python's excessively simple strings really are. In particular, we'll see:
The complexities of strings, bytes, and byte array
The ins and outs of string formatting
How to open files
Context managers
A few ways to serialize data