On 2013-10-04 02:21, Chris Angelico wrote:
> > workers = []
> > for params in whatever:
> > thread = threading.Thread(params)
> > thread.start()
> > workers.append(thread)
>
> You could shorten this by iterating twice, if that helps:
>
> workers = [Thread(params).start() for params in whatever]
> for thrd in workers: thrd.start()
Do you mean
workers = [Thread(params) for params in whatever]
for thrd in workers: thrd.start()
? ("Thread(params)" vs. "Thread(params).start()" in your list comp)
-tkc
--
https://mail.python.org/mailman/listinfo/python-list