Covering Extras
00:00 In the last lesson, you worked on the remove command. In this lesson, you’ll have an overview of what you’ve built so far. Then I’ll show you some extra bits you can find in the final code provided in the additional resources section.
00:13
First is a remove_all
command. Just as you have the remove command to remove a single to-do item from the database. With this remove_all
, you’ll be able to remove all the to-do items in the database. In the ToDoer
class, a remove_all()
method was included and all it does is just clears the database of all the to-do items and writes an empty list back into the database.
00:35
The remove_all
command is aliased with clear.
00:40
Try this out in the terminal with python3 -m
rp_todo
and passing the clear command.
00:48 This will ask for a confirmation to clear the to-do database, and approving this clears all to-do items from the database, and this can be confirmed by calling the list command again. If you include this in your code, you should now have a fully functional to-do CLI application with features to add to-do items to a database, list to-do items, set to-do items as complete, and then remove all to-do items from the database.
01:21 Great. You have just built a fully functional Typer CLI to-do application. Again, under the additional resources section you’ll find the source code.
Become a Member to join the conversation.