0

I have a Tkinter app. Two of the buttons in the UI code call other class functions. I start a thread for each of them like so:

t = threading.Thread(target=self.classOne.method_one())
        t.daemon = True
        t.start()

And again for the second class method.

The second thread I start calls a resource intensive method and this freezes the app.

Is the reason it is freezing because I have not properly set up the threads? And should I be explicitly closing the threads?

eggman
  • 383
  • 1
  • 5
  • 17
  • Possible duplicate of [Tkinter locks python when Icon loaded and tk.mainloop in a thread](http://stackoverflow.com/questions/1198262/tkinter-locks-python-when-icon-loaded-and-tk-mainloop-in-a-thread) – Don Kirkby May 13 '16 at 18:04
  • If you are accessing the Tkinter GUI objects from the second thread, then look at the duplicate question I linked to. If not, please include a small runnable example that shows the problem. – Don Kirkby May 13 '16 at 18:05
  • `target` needs to be a function. `threading.Thread(target=self.classOne.method_one)` is probably right unless `method_one()` returns a function. – J.J. Hakala May 13 '16 at 19:29

0 Answers0