Python 3 Tkinter root.quit() Method to Close or Quit Window or Application in GUI Desktop App

Python 3 Tkinter root.quit() Method to Close or Quit Window or Application in GUI Desktop App

Python 3 Tkinter root.quit() Method to Close or Quit Window or Application in GUI Desktop App

from tkinter import *
  
# Creating the tkinter window 
root = Tk() 
root.geometry("200x100") 
  
# Button for closing 
exit_button = Button(root, text="Exit", command=root.quit) 
exit_button.pack(pady=20) 
  
root.mainloop() 
exit(0)
Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment