In this chapter, we will cover the following recipes:
- Reading and writing text data—reading text encoded in any encoding from a file
- Reading lines of text—reading a text file divided line by line
- Reading and writing binary data—reading binary-structured data from a file
- Zipping a directory—reading and writing a compressed ZIP archive
- Pickling and shelving—how to save Python objects on disk
- Reading configuration files—how to read configuration files in the .ini format
- Writing XML/HTML content—generating XML/HTML content
- Reading XML/HTML content—parsing XML/HTML content from a file or string
- Reading and writing CSV—reading and writing CSV spreadsheet-like files
- Reading and writing to a relational database—loading and saving data into a SQLite database