I know that I can create and start a thread in Python using the following syntax:
import threading
tracker_thread = threading.Thread(target=func, args=(x,y,z))
tracker_thread.daemon = True
tracker_thread.start()
What I need is to use a class constructor as target. I know that a solution for this is the following:
def wrap_function(x,y,z):
MyClas(x,y,z)
tracker_thread = threading.Thread(target=wrap_function, args=(x,y,z))
But I am trying to avoid the use of a similar "wrap function", by using only the constructor in the initialization of Thread.
How can I do this?
threading.Thread(target=MyClass, args=(x, y, z))didn't work?