On Tue, Jun 28, 2011 at 1:33 PM, hisan <santosh.s...@gmail.com> wrote: > How to create n number thread in python. i want iterate over the for loop and > create a thread for each iteration . > sample code > for i in range(o,50): > i want to create 50 thread here which call the same function. how start and > stop each thread after completion
from threading import Thread threads = [Thread(target=func) for i in range(50)] for thread in threads: thread.start() for thread in threads: thread.join() -- http://mail.python.org/mailman/listinfo/python-list