Ip Project - To-Do-List
Ip Project - To-Do-List
1.Introduction.
2.Objectives.
3.Uses of the programming 4.language .
5.Modules used.
6.System requirements.
7.Working description.
8.Flow of execution.
9.Code.
10.Output screens.
11.Scope of execution.
12.Conclusion.
13.Bibliography.
Introduction
Welcome to the "To-Do List" application, a
user-friendly and efficient software designed to help
individuals organise their tasks .
In our fast-paced lives, juggling multiple
responsibilities and commitments can be challenging,
so having a to-do list may help you prioritise your
work and personal tasks.
This allows you to organise and complete the most
crucial tasks first. To-do lists can be used to improve
time management because all of your tasks are laid
out clearly in advance.
Objectives
Add Task:
● Users can enter a task description in the input
field and select a category from the dropdown
menu.
Delete Task:
● Users can select a task from the listbox by
clicking on it and remove the selected task from
the listbox.
Load Task:
● Clicking the "Load Task" button loads previously
saved tasks from a file named "task.txt" and
displays them in the listbox.
Save Task:
● Clicking the "Save Task" button saves the current
list of tasks in the listbox to a file named
"task.txt."
Show Inspiration:
● Clicking the "Show Inspiration" button displays a
random inspirational quote in a popup message
Flow of execution
Code
import tkinter
from tkinter import *
import tkinter.messagebox
import pickle
import random
root = tkinter.Tk()
root.geometry("400x600")
root.resizable(False, False)
root.title("To-Do List")
quotes = [
"The future belongs to those who believe in the
beauty of their dreams. - Eleanor Roosevelt",
"Believe you can and you're halfway there. -
Theodore Roosevelt",
"The only limit to our realisation of tomorrow will be
our doubts of today. - Franklin D. Roosevelt",
"Your time is limited, don't waste it living someone
else's life. - Steve Jobs",
"Success is not final, failure is not fatal: It is the
courage to continue that counts. - Winston Churchill"
]
def show_inspiration():
random_quote = random.choice(quotes)
tkinter.messagebox.showinfo(title="Inspiration",
message=random_quote)
def add_task():
task = entry_task.get()
category = category_variable.get()
try:
if task != "":
listbox_tasks.insert(tkinter.END, f"{task} -
[{category}]")
entry_task.delete(0, tkinter.END)
except:
tkinter.messagebox.showwarning(title="Warning!",
message="You must enter a task")
def delete_task():
try:
task_index = listbox_tasks.curselection()[0]
listbox_tasks.delete(task_index)
except:
tkinter.messagebox.showwarning(title="Warning!",
message="You must select a task")
def load_task():
try:
tasks = pickle.load(open("D://task.txt", 'rb'))
listbox_tasks.delete(0, tkinter.END)
for task in tasks:
listbox_tasks.insert(tkinter.END, task)
except:
tkinter.messagebox.showwarning(title="Warning!",
message="Cannot find task.txt")
def save_task():
tasks = listbox_tasks.get(0, listbox_tasks.size())
pickle.dump(tasks, open("D://task.txt", 'wb'))
frame_tasks = tkinter.Frame(root)
frame_tasks.pack()
listbox_tasks = tkinter.Listbox(frame_tasks,
height=25, width=50)
listbox_tasks.pack(side=tkinter.LEFT)
scrollbar_tasks = tkinter.Scrollbar(frame_tasks)
scrollbar_tasks.pack(side=tkinter.RIGHT,
fill=tkinter.Y)
listbox_tasks.config(yscrollcommand=scrollbar_tasks
.set)
scrollbar_tasks.config(command=listbox_tasks.yview
)
category_variable = tkinter.StringVar(root)
category_variable.set(task_categories[0])
category_dropdown = tkinter.OptionMenu(root,
category_variable, *task_categories)
category_dropdown.pack()
button_show_inspiration = tkinter.Button(root,
text="Show Inspiration", command=show_inspiration)
button_show_inspiration.pack()
root.mainloop()
Output screen
GUI setup
everything in order.
app.
Bibliography
1. https://www.google.com/
2. https://pythontutor.com/
3. https://replit.com/new/python3.
4. https://stackoverflow.com/