Chapter 9. Input/Output, Physical Format, and Logical Layout
In this chapter, we'll look at the following recipes:
Using pathlib to work with filenames
Reading and writing files with context managers
Replacing a file while preserving the previous version
Reading delimited files with the CSV module
Reading complex formats using regular expressions
Reading JSON documents
Reading XML documents
Reading HTML documents
Upgrading CSV from DictReader to namedtuple reader
Upgrading CSV from DictReader to namespace reader
Using multiple contexts for reading and writing files