Closing Windows in Python
How to Close a Tkinter Window in Python Using destroy() Method

Learn the simple way to close a Tkinter window in Python with the destroy() method that ends the mainloop and terminates your GUI application.