Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
21S2 Assignment 2: To-Do List Application You will need to submit 3 files (where X is replaced with your student ID): aXXXXXXX-a2.ipynb with a text-based application (Part 1 and 2) aXXXXXXX-a2.py with a GUI-based application (Part 3) aXXXXXXX-a2.pdf or aXXXXXXX-a2.jpg with the sketch of your GUI (Part 3) The maximum mark is 100. Marks below add up to 110, and your mark will be capped at 100. Part 0: Comments for your code (15 marks) You need to provide appropriate comments in your code. The comments should clearly state the purpose of every code block that you have. Comments need to be provided for all three parts below. Part 1: Basic To-Do List (25 marks) The goal of the first two parts is to create a text-based to-do list application in Python. It will be the first practical Python application for many of you and it is certainly not a small feast. Don’t be afraid of this long document. We will break down the task into multiple smaller steps and provide guidance along the way! Aim Create a text-based to-do list where users can add and remove tasks. If you are not familiar with to-do list applications, take a look at Microsoft To Do or Google Keep. Task For Parts 1 and 2, you must build your program around the provided template code. Implement a to-do list program with basic functions such as adding or deleting an item from the list and displaying the list. Below are the commands you must implement. add syntax: add item example: after entering add buy milk the string buy milk will be added into the to-do list delete (del) syntax: delete index example: after entering delete 1 the first item from the list will be removed move (mv) syntax: move index1 index2 example: after entering move 3 1 the third item on the list will be moved to the first position, shifting other items down if needed list (ls) after entering list or ls all the items in the to-do list are listed Example User inputs: add buy battery add buy milk add call Mom ls Program outputs: [0] buy battery [1] buy milk [2] call Mom User inputs: mv 2 0 Program outputs [0] call Mom [1] buy battery [2] buy milk User input: del 1 ls Program outputs [0] call Mom [1] buy milk Part 2: Advanced To-Do List (30 marks) To-do list items often contain additional information such as a due date or location. For example, one might want to set the due date for paying a bill, or to add labels for items related to same location, such as home, uni etc. Aim Add functionality for providing tags and due dates. Add functionality for clearing the list. Task For Part 2, you must continue working with Jupter notebook you used in Part 1. Upon completion, you should submit your Jupyter notebook. Implement additional commands for your to-do list as follows. tag syntax: tag index label example: tag 1 uni will add a label of uni to item 1 . Labels should be enclosed with {} . See example below due syntax: due index date example: due 1 23/3 will add a due date of 23/3 on item 1 . Due dates should be enclosed with <> . See example below ls -f syntax: ls -f name this command allows the user to filter her to-do list based on tag or due example: ls -f shop will only list to-do items with tagged with shop example: ls -f 23/3 will only list to-do item with a due on 23/3 reset this command should first ask a confirmation "do you really want to reset the list (y/n)?". If the user enters "y" all items (including their tags and due dates) should be deleted. If the user enters "n", nothing should happen Example User inputs: add buy battery add buy milk add call Mom ls Program outputs: [0] buy battery [1] buy milk [2] call Mom User inputs: tag 0 shop tag 1 shop tag 2 home ls Program outputs [0] buy battery {shop} [1] buy milk {shop} [2] call Mom {home} User inputs: due 0 27/3 due 2 5/4 ls Program outputs [0] buy battery <27/3> {shop} [1] buy milk {shop} [2] call Mom <5/4> {home} User inputs: ls -f shop Program outputs [0] buy battery <27/3> {shop} [1] buy milk {shop} User inputs: ls -f 27/3 Program outputs [0] buy battery <27/3> {shop} User inputs: reset Program outputs do you really want to reset the list (y/n)? User inputs: y ls Program outputs (empty list) (Bonus Challenge) Illegal Input Check (5 marks) A user might accidentally enter incorrect inputs into your program. Update your program so that it will catch those incorrect inputs. Part 3: GUI-based To-Do List (30 marks) In this part, you will write a GUI version of your to-do list program. For many of you, this will be your first desktop application with full graphical user interface! Aim Create a GUI-based to-do list app where users can add and remove errands and other tasks. Task For this part you should create an application in a separate .py python file. You should re-use most of the code you wrote in previous parts. You will need to submit the .py file and a file with your design sketch (see below). Step 1. Draw your GUI Before you start coding, use paper and pen to sketch the GUI prototype. Refer to examples below. You should provide a paragraph of text or annotations describing the functions of your to-do list app. Step 2. Implement GUI with Tkinter Use Tkinter to implement the GUI based on your sketch. Your UI should at least have the following widgets: a widget showing to-do items (the Listbox widget would be a good choice, but you are free to use other widgets) a text entry where the user can input her to-do items an “add item” button or some equivalent UI widget that put text entry onto the item list You can have additional elements/widgets as needed. For this part, when the user wants to reset the list, asking confirmation is optional. Step 3. Re-use Code from the Text-based App The core of your program, i.e. logic, item management, tags, etc. should be identical for both text-based and GUI programs. The GUI is just an interface for your user. Please re-use your code from the text-based to-do list program as much as possible. (Bonus Challenge) Checkbox and Tag Colour (5 marks) Instead of using a listbox, try use Checkbox widget for your TodoItem. Your application should allow the user to select the completed item with the checkbox, then delete them. Following the bonus challenge last week, give each label a unique colour and change the background colour of each to-do item accordingly.