Simple example of threading

Fredrik Lundh effbot at telia.com
Thu Feb 24 10:46:30 EST 2000


Olaf Trygve Berglihn <olafb at pvv.org> wrote:
> * aahz at netcom.com
> > Take a look at this example I posted a while back:
> > http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=570016307&fmt=text
>
> Nice example. But I have a slightly different problem. I'd like to
> have threads that can return a value upon completion to the scope in
> which the threads were started. Any suggestions on how to do that in a
> simple way?

how about this?

let the worker threads push the resulting object to a queue,
which is polled by the main thread:

http://www.python.org/doc/current/lib/module-Queue.html

</F>





More information about the Python-list mailing list