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
- Overwriting a file
- List comprehensions (important!)
- 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
- We can only delete an item by typing its name verbatim.
- 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).
- If we try to delete an item that's not there, we get no indication of that fact.
Missing features in this software
- 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?).
- Any kind of graphical interface.
- 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).
- The ability to edit tasks.
- Any kind of task history management.
- Any kind of notifications or summaries.
- 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.