Answers for "close window in python tkinter"

2

Tk.destroy arguments

root = Tk()
#make sure that you define your Tkinter window , even though if you dont by impoerting tkinter if no Tk() window is defined it will automatically create one

root.destroy()
#here Tk.destroy() WILL NOT WORK
Posted by: Guest on May-18-2020
6

python tkinter close gui window

from tkinter import *
root=tk.Tk()
root.destroy()
Posted by: Guest on May-01-2020
0

close window tkinter

try:
    import Tkinter as tk
except:
    import tkinter as tk

root = tk.Tk()
root.geometry("100x50")

def close_window():
    root.destroy()

button = tk.Button(text = "Click and Quit", command = close_window)
button.pack()

root.mainloop()
Posted by: Guest on November-06-2020

Code answers related to "close window in python tkinter"

Python Answers by Framework

Browse Popular Code Answers by Language