import tkinter as tk import gui def run(): root = tk.Tk() app = gui.Application(master=root) app.mainloop() try: root.destroy() except tk.TclError: pass if __name__ == '__main__': run()