Python / Tkinter: is Tkinter StringVar thread safe (IntVar etc.)?

Are Tkinter StringVar threads safe (IntVar, FloatVar, etc.), for example. can a background thread read or write these objects? Or should I use Queue to transfer information between my background thread and my main Tkinter GUI thread, and my main Tkinter thread queues and updates the StringVar app accordingly?

I know that the background threads of my application should not read or write the Tkinter widget directly, but I don’t understand whether StringVar (or their ilk) are considered widgets or if they are objects removed from widgets that are thread safe for background threads for reading and / or writing.

+2
source share
1 answer

Definitely follow the queue route. Nothing in Tkinter is configured for thread safety :(

0
source

Source: https://habr.com/ru/post/973946/


All Articles