Python/Tkinter: Are Tkinter StringVar (IntVar, etc) thread safe?
Are Tkinter StringVar (IntVar, FloatVar, etc) thread safe, eg. can a background thread read or write to these objects? Or must I use a Queue to pass information between my background thread and my main Tkinter GUI thread and have my main Tkinter thread pop the Queue and update the application's StringVar's accordingly?
I know my application's background threads must not read or write a Tkinter widget directly but I'm unclear on whether StringVar's (or their ilk) are considered widgets or if they are objects far enough removed from widgets that they are thread safe f开发者_如何学运维or background threads to read and/or write.
Definitely go the Queue route. Nothing in Tkinter is setup for being threadsafe :(
精彩评论