On 8 Okt, 09:17, Ulrich Eckhardt <[email protected]> wrote:
> I'm looking at the 'threading' module and see that other than the 'thread'
> module it doesn't have a simple function to start a new thread. Instead,
> you first have to instantiate a threading object and then start the new
> thread on it:
>
> t = threading.Thread(target=my_function)
> t.start()
One usually want to subclass threading.Thread instead of specifying a
target function.
class mythread(threading.Thread):
def run():
# whatever
pass
t = mythread()
t.start()
Also, you may want to set the daemon flag before starting the thread,
which is why the thread is created in a suspended state.
--
http://mail.python.org/mailman/listinfo/python-list