Until now, most examples have placed their input directly in Python code. In this chapter, a small text file becomes the input boundary. We will inspect the exact strings Python reads before converting anything, so newlines, invalid rows, and source line numbers remain visible.
The same labelled measurement file continues through the chapter. We will distinguish text from its UTF-8 bytes, convert only the values that match the stated format, compute a report from the accepted rows, write that report, and read it back to verify the saved result.
Paths identify the input and output locations. Modules give reusable parsing and calculation functions a home. Counter and defaultdict shorten two familiar collection loops only after we verify that the shorter versions mean the same thing. The final lesson combines these parts into a small program and runs it twice.