I am a beginner in python, I used tkinter to build a to-do list program. But the problem is I don't understand how it works.
from tkinter import *
root = Tk()
def insert_Task(name):
name = Checkbutton(root, text=name, command= lambda: del_task(name))
name.pack()
def del_task(name):
name.destroy()
insert_Entry = Entry(root)
insert_Button = Button(root, text="Ok", command=lambda: insert_Task(insert_Entry.get()))
insert_Entry.pack()
insert_Button.pack()
root.mainloop()
The only way this should work is when name is passed into text, it is insert_Entry.get()
and when the function is called it is the Checkbutton
object.
Can someone explain to me if this is the case?