Python Forum

Full Version: Window unresponsive when executed.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I ran the following code in Spyder with Python3 interpreter in windows7.

import tkinter
import tkinter.simpledialog

root = tkinter.Tk()

name = tkinter.simpledialog.askstring('Name','entername')

After I enter the name in prompt and click OK the tk window get unresponsive. Finally when I close the window after many clicks the Kernel dies and is restarted. Please tell me why this happens and a way to fix it.
You should have root.mainloop() in there somewhere, so the gui will listen to os events (like the CloseWindow event).