Learn Before
Concept icon
Concept

Closing the window using button click

We can use the destroy() method to quit a window.

button = tk.Button(text="Quit", foreground="red", command=window.destroy) button.pack()

We can pass command=window.destroy as a parameter to close a window with a button click

Image 0

0

1

Concept icon
Updated 2021-05-12

Tags

Python Programming Language

Data Science