Python todo notebook (6/6): the complete project
Wire main(), default to taches.json or take a path argument, then extend the finished notebook with a priority, a due date and a one-row CSV export.
Getting started
Home Assistant
Buying
Wire main(), default to taches.json or take a path argument, then extend the finished notebook with a priority, a due date and a one-row CSV export.


AI-generated illustration
Some links on this page are affiliate links. The button opens Amazon so you can check today’s price.
import json
import sys
from pathlib import Path
def main():
chemin = Path(sys.argv[1]) if len(sys.argv) > 1 else Path("taches.json")
data = charger_securise(chemin)
try:
boucle(data, chemin)
finally:
sauvegarder(chemin, data)
print("Goodbye — data saved.")
if __name__ == "__main__":
main()
Adjust this to match your save strategy. If you already save on every action, finally can only confirm the last version, or you can remove it.
Do not forget import json in the file that defines charger_securise.
todo.py — everything in one file while you are startingtodo/ folder with storage.py, model.py and cli.pyensure_ascii=False when you dump.prochain_id that still matches them.int(input) are handled.1 to 3 on each task, and sort when you display the list.2026-04-01. You do not need a date module at first.Todo notebook contents — other series: Hangman, Connect Four, Battleship.
A book search for learning Python 3 through projects: Check today’s price on Amazon.
Was this page helpful?
Thank you!
What should we improve?
Torn between two models or stuck on a build? Drop us a line and we will get back to you by email.
Cookies and analytics
We use Google Analytics 4 to understand how the site is used (page views, navigation). It is only switched on if you accept. Declining does not stop you using the site. More: cookie settings and privacy policy (in French).