menu

arrow_back How do I correct this error?

by
1 vote
How do I correct this error?
I am writing code with tkinter. I made a while loop with Thread. There I made itemconfig.
Error:
RuntimeError: main thread is not in main loop
How do I correct this error?

4 Answers

by
 
Best answer
0 votes
The GUI libraries, including Tk, are not thread-safe. Consequently, the event loop must be started in the main thread and you cannot directly interact with GUI components from a thread other than the thread in which the event loop is started.
by
0 votes
You're running your main GUI loop in a thread besides the main thread. You cannot do this.
by
0 votes
thread.setDaemon(True)
by
0 votes