tkinter run function on root close code example Example 1: python tkinter how to close a window root.destroy() Example 2: how to kill tkinter root=Tk() root.destroy()