python tkinter with threading causing crash

后端 未结 3 1879
小蘑菇
小蘑菇 2020-11-28 14:13

I have written a python tkinter code using threads so as the tkinter wizard updates automatically by tkinter mainloop running in the main thread and background process runni

相关标签:
3条回答
  • 2020-11-28 14:26

    Tkinter is not thread safe; you cannot access Tkinter widgets from anywhere but the main thread. You will need to refactor your code so that QueueHandler runs in the main thread.

    0 讨论(0)
  • 2020-11-28 14:39

    As Bryan says Tkinter is not thread safe. Here is a modification that attempts to make it so: http://tkinter.unpythonic.net/wiki/mtTkinter

    0 讨论(0)
  • 2020-11-28 14:51

    Tkinter is designed to be thread-safe but isn't due to bugs, in both 2.x and 3.x.

    Until fixes are released (and in older versions), you should use mtTkinter (which is designed to be a drop-in replacement) as a workaround.

    0 讨论(0)
提交回复
热议问题