End tkinter program - python

0 votes
How do I close the tkinter program? Can you give an example? Thank you!
Aug 9, 2019 in Python by Faiza
175 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, 2019 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
99 views
+1 vote
3 answers

How to run the Python program forever?

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

answered Jun 10, 2019 in Python by brianno
3,958 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 aryya
• 7,420 points
157 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
• 58,100 points
688 views
0 votes
2 answers
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,840 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
1,419 views
0 votes
2 answers

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

there is sum() function as a built ...READ MORE

answered Oct 24, 2020 in Python by anonymous
12,801 views
0 votes
4 answers