Overview
By the end of the last part, you reorganized your study log into a small set of named, tested functions. The program is now cleaner to read, easier to change, and ready for the next thing it has been missing all along: a way to remember what you logged.
So far, every run of the program has started from scratch. You enter sessions, the program reacts to them, and then the program ends — and the next time you start it, the sessions are gone. The sandbox cannot help with this. It runs your code, but it forgets everything the moment it closes.
This part is about leaving the sandbox. You move the project onto your own computer, install Python locally, and learn to read and write files — the mechanism programs use to remember things between runs. By the end of this part, your study log will save your sessions to a file on disk, load them back the next time you start it, and behave like a small but real piece of software.
The structure of this part is as follows:
- Working on Your Own Computer walks through installing Python, installing an editor, and using the terminal.
- Reading Text Files covers the
with/openpattern, reading line by line, and using.split()to break a line into fields. - Writing Files covers writing modes and the danger of accidentally erasing data.
- CSV Basics introduces the
csvmodule for reading and writing tabular data robustly. - Multidimensional Lists for Grid-Shaped Data shows that tables, images, and game boards are all the same shape in memory.
- Everything Is a File: A Wider View of Data Formats is the conceptual breather chapter on what other kinds of files exist and what makes them different.
- Defensive Programming with Files and External Data is about handling things that go wrong when the data comes from outside your program.
- Plausible but Wrong: Detecting AI File Code That Runs but Does Not Work is this part’s AI-collaboration chapter.
- Making Your Study Log Persistent is the project checkpoint.
Finally, the recap and feedback chapter at the end of the part briefly summarizes what was covered and asks for feedback.
Recommended Order of Work
- read Working on Your Own Computer and complete the installation,
- then read the regular chapters in order, completing exercises as you go,
- then complete the project checkpoint in Making Your Study Log Persistent,
- and finish with the recap and feedback.
The installation step is the only part of the course where things vary by operating system. Allow a little more time for it if it is your first time setting up Python locally.