Python Forum
[Tkinter] Window unresponsive when executed.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Window unresponsive when executed.
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).
there are some examples here:

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] program unresponsive during pynput mouse click RobotTech 1 1,095 May-07-2020, 04:43 PM
Last Post: RobotTech
  [Tkinter] messagebox is not being executed please help erwinsiuda 2 674 Apr-02-2020, 01:56 AM
Last Post: Larz60+
  tkinter window and turtle window error 1885 3 2,629 Nov-02-2019, 12:18 PM
Last Post: 1885
  Tkinter GUI is unresponsive in a thread sandarbhasthana 2 2,532 May-06-2019, 03:20 PM
Last Post: sandarbhasthana
  update a variable in parent window after closing its toplevel window gray 5 5,087 Mar-20-2017, 10:35 PM
Last Post: Larz60+
  [WxPython] Which def is executed? merlem 10 4,751 Feb-10-2017, 11:28 AM
Last Post: Yoriz
  [xbmc] How to block the code from executed twice under the loop chris0147 29 13,396 Oct-26-2016, 05:34 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020