Python task manager from scratch, part 7: Adding and removing tasks

OK! Enough git mechanics for now! It's time to make this a real, albeit very minimal, task manager.

We're going to add some functions to main.py. Specifically, you'll see new functions here.

New Python language features

  1. Overwriting a file
  2. List comprehensions (important!)
  3. The .join method on strings

If you're comfortable with the code, you can play with it in a REPL. If you don't yet know what a REPL is, (i) that's OK, (ii) you can consider it optional for now, and (iii) you'll learn it (and, frankly, need to learn it) eventually.

So! We can add and remove tasks! That's nice, but there are still a bunch of

Pretty big problems with this software

  1. We can only delete an item by typing its name verbatim.
  2. We cannot delete only one instance of an item (so, if you have "Do 10 push-ups" on your list twice, you can't delete exactly one of them).
  3. If we try to delete an item that's not there, we get no indication of that fact.

...and...

Missing features in this software

  1. Tasks should be more than strings of text (don't you want optional due dates, a distinction between the task and related information, and so on?).
  2. Any kind of graphical interface.
  3. Any kind of modern data management (reading from and writing to a single text file is much slower and less resilient than using an actual database; it just doesn't matter yet because we're just one person using a tiny little bit of data).
  4. The ability to edit tasks.
  5. Any kind of task history management.
  6. Any kind of notifications or summaries.
  7. Many, many more. (Have a look at Things, Todoist, or OmniFocus. They do a lot!)

The results are in this commit in the veery/ repository.


Next post: Python task manager from scratch, part 8: Requirements management


Home page