Tuvas, I fully agree with Eric's post above. You may additionnaly have to kill the main window before exit, to avoid a nasty thread related error message and occasionally some zombie procs: import Tkinter,atexit top=Tkinter.Tk() .../... atexit.register(lambda top=top: top.destroy()) top.mainloop()