End tkinter program - python

0 votes
How do I close the tkinter program? Can you give an example? Thank you!
Aug 9 in Python by Faiza
18 views

1 answer to this question.

0 votes

You can use the destroy() to close a tkinter window.

from Tkinter import *

toss = Tk()
Button(toss, text="Exit", command=root.destroy).pack()
toss.mainloop()
answered Aug 9 by Barbara

Related Questions In Python

0 votes
1 answer

Exiting a python program

Use the quit() function. This function can ...READ MORE

answered May 8, 2018 in Python by Nietzsche's daemon
• 4,260 points
23 views
+1 vote
3 answers

How to run the Python program forever?

you can also do the old fashioned ...READ MORE

answered Jun 10 in Python by brianno
643 views
0 votes
1 answer

Need help with Tkinter window formatting using Python

Tkininter comes with the columnspan argument to span the labels ...READ MORE

answered Sep 7, 2018 in Python by ariaholic
• 7,340 points
46 views
0 votes
1 answer

Python: Issue with 'unexpected end of pattern'

I should start by stating that using ...READ MORE

answered Sep 12, 2018 in Python by Priyaj
• 56,900 points
203 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 281 views
+4 votes
6 answers
0 votes
1 answer

How can I write a program to add two numbers using functions in python?

def add(a,b):      return a + b #when i call ...READ MORE

answered May 20 in Python by Mohammad
• 3,060 points
153 views
0 votes
4 answers