-2

okok,i tried making a button that'd close the window,but it doesn't work,and now I am once again asking for your python support...

schaltf1 = tkinter.Button(root, text="EXIT", width=20, command=root.destroy()) #command=root.destroy())
schaltf1.pack()
root.mainloop()

Thats the source code,maybe you could help me? That'd be very nice, Thank you!

1 Answers1

1
command = root.destroy

you pass the function itself without calling it.

So your source code should be:

schaltf1 = tkinter.Button(root, text="EXIT", width=20, command=root.destroy)
Bemwa Malak
  • 1,182
  • 1
  • 5
  • 18