Writing safely
Write a flight log without losing it: "w" that wipes the file, "a" that appends, newlines you have to add, print to a file, and an atomic save with os.replace that survives a power cut.
Open it in the simulatorBuild the flight computer of a weather balloon: read and write files without losing them, log a live sensor to CSV, keep settings in JSON, organize folders, survive every disk error, and ship a sensor log tool.
0 of 7 done
7 lessons in 4 chapters, about 5 hours on a simulated Raspberry Pi 4 Model B. Free, in your browser, every step checked by the simulator.
Write a flight log without losing it: "w" that wipes the file, "a" that appends, newlines you have to add, print to a file, and an atomic save with os.replace that survives a power cut.
Open it in the simulatorKeep a flight computer's settings in config.json: load it, fill gaps from defaults, validate it with clear messages, save it back atomically with indent and sort_keys, and learn what JSON changes on the way through.
Open it in the simulatorMake a flight computer that keeps going when files go wrong: a missing config, a config cut off by a power failure, folders where files should be, bad rows in a CSV, try/except/else/finally, and the OSError family by errno.
Open it in the simulatorEach lesson opens when the one before it is done, and each chapter ends in a project.
Read a flight plan, then write a log that survives a power cut.
Read a balloon's flight plan from a text file: the whole file, its lines and their hidden newlines, a loop that skips comments, a key: value parser, and the bytes underneath the text.
0 of 5 steps
Write a flight log without losing it: "w" that wipes the file, "a" that appends, newlines you have to add, print to a file, and an atomic save with os.replace that survives a power cut.
0 of 5 steps
Rows of readings in CSV, settings in JSON.
Read a recorded balloon flight with DictReader, turn pressure into altitude, log the live BME280 to a CSV with csv.writer, append with a header only once, and see how commas and quotes inside values survive.
0 of 5 steps
Keep a flight computer's settings in config.json: load it, fill gaps from defaults, validate it with clear messages, save it back atomically with indent and sort_keys, and learn what JSON changes on the way through.
0 of 5 steps
Organize the files, and keep going when the disk says no.
Organize a flight computer's files: the working folder, folders by date with makedirs, numbered log names that never overwrite, pathlib's Path objects, and a walk over the whole tree with sizes.
0 of 5 steps
Make a flight computer that keeps going when files go wrong: a missing config, a config cut off by a power failure, folders where files should be, bad rows in a CSV, try/except/else/finally, and the OSError family by errno.
0 of 5 steps
A sensor log tool for launch day.
Skylark's ground tool, from everything in the course: a config with defaults, numbered CSV logs of the live BME280 in a folder, a list of logs with rows and sizes, a summary saved as JSON atomically, and temperature alarms from the config.
0 of 5 steps
All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.
Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.
Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kitYes. All 7 lessons of Files, CSV and JSON are free and run in your browser, with nothing to install and no parts to buy before you start.
No. Every lesson runs on a simulated Raspberry Pi 4 Model B with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.
About 5 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.
Each chapter ends in a project that puts it together: Writing safely, JSON config and Errors on disk.
With "Reading files", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.