All topics / Build a CLI To-Do App (Python)

Build a CLI To-Do App (Python)

Build a command-line to-do app in Python - add, list, complete, and save tasks to a file - runnable in your browser, then ready to run for real.

  1. Tasks in Memory Model each task as a dictionary, collect them in a list, and write add and list functions you can watch grow.
  2. Saving to a File Use the json module to write your task list to a text file and load it back, so tasks survive after the program ends.
  3. Complete, Delete, and Filter Write functions to mark a task done, remove one by id, and split the list into open and finished tasks.
  4. A Real CLI Read the command word you typed, dispatch to the right function, and assemble everything into a todo.py you run from your terminal.