```from tkinter import * from tkinter import messagebox

def newTask(): task = my_entry.get() if task != "": lb.insert(END, task) my_entry.delete(0, "end") else: messagebox.showwarning("warning", "Please enter some task.")

def deleteTask(): lb.delete(ANCHOR)

ws = Tk() ws.geometry('500x450+500+200') ws.title('lolo_do') ws.config(bg='#223241') ws.resizable(width=False, height=False)

frame = Frame(ws) frame.pack(pady=10)

lb = Listbox( frame, width=25, height=8, font=('Times', 18), bd=0, fg='#464654', highlightthickness=0, selectbackground='#a3a6a6', activestyle="none",

) lb.pack(side=RIGHT, fill=BOTH)

task_list = [ 'mlh lhd', 'rose hacks', 'do hw', 'check bank acc', 'write a brief data', 'take a nap', 'Learn something', 'draw illustrations' ]

for item in task_list: lb.insert(END, item)

sb = Scrollbar(frame) sb.pack(side=RIGHT, fill=BOTH)

lb.config(yscrollcommand=sb.set) sb.config(command=lb.yview)

my_entry = Entry( ws, font=('times', 24) )

my_entry.pack(pady=20)

button_frame = Frame(ws) button_frame.pack(pady=20)

addTask_btn = Button( button_frame, text='+Task', font=('times 14'), bg='#c5f776', padx=20, pady=10, command=newTask ) addTask_btn.pack(fill=BOTH, expand=True, side=LEFT)

delTask_btn = Button( button_frame, text='Dlt Task', font=('times 14'), bg='#ff8b20', padx=20, pady=10, command=deleteTask ) delTask_btn.pack(fill=BOTH, expand=True, side=LEFT)

ws.mainloop()```

Built With

Share this project:

Updates