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
38 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
41 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
1,056 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,350 points
55 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
• 57,510 points
287 views
0 votes
1 answer
+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 556 views
0 votes
0 answers
+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, 2019 in Python by Mohammad
• 3,210 points
1,211 views
0 votes
4 answers