The below code doesn't work on python3.5 (RuntimeError: Calling Tcl from different appartment) But It works well on python 2.7 It is hard to know the reason of problem and how can i fix it.
import tkinter
import threading
class MyTkApp(threading.Thread):
def __init__(self):
self.root=tkinter.Tk()
self.s = tkinter.StringVar()
self.s.set('Foo')
l = tkinter.Label(self.root,textvariable=self.s)
l.pack()
threading.Thread.__init__(self)
def run(self):
self.root.mainloop()
app = MyTkApp()
app.start()