In <[EMAIL PROTECTED]>, Flyzone wrote:
> I need to run in thread a command, one thread for one parameter.
> So i made a for loop, creating 5 threads and waiting their stop with:
> Main {
> open file BW2 for write
> ..... (creating list of thread with a counter)....
> Stopped=False
> while (Stopped == False):
> if not thread5.isAlive():
> if not thread4.isAlive():
> if not thread3.isAlive():
> if not thread2.isAlive():
> if not thread1.isAlive():
> Stopped=True
> if (Stopped == False):
> time.sleep(0.3)
If you create a list with threads where do the names `thread1` to
`thread5` come from? This snippet expects the threads in a list or
another iterable:
for thread in threads:
thread.join()
Much shorter, isn't it!? :-)
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list