Re: [Tutor] how to return an object generated during a python threading code

2011-12-11 Thread Lie Ryan
On 12/11/2011 03:46 AM, Massimo Di Stefano wrote: Hi All, > Trying to read the documentation, i'm looking on how to use " threading.Lock() " and its methods "acquire() and release()" that seems to be the solution to my issue ... but i'm really far to understand how to implement it in my exampl

Re: [Tutor] how to return an object generated during a python threading code

2011-12-10 Thread Steven D'Aprano
Massimo Di Stefano wrote: [...] it just print out the list generated during the thread execution, while i'm tring to return it. Since lista is a mutable global variable, you don't need to return it. Just look at lista once the threads have completed its work and you will find the content you

Re: [Tutor] how to return an object generated during a python threading code

2011-12-10 Thread Emile van Sebille
On 12/10/2011 8:46 AM Massimo Di Stefano said... Hi All, i'm tring to learn how to use threads in python to save a list of object. i'm starting from this code : Moving lista into the instance seems to do it... Emile # import threading import urllib from tempfile import NamedTempora

[Tutor] how to return an object generated during a python threading code

2011-12-10 Thread Massimo Di Stefano
Hi All, i'm tring to learn how to use threads in python to save a list of object. i'm starting from this code : # import threading import urllib from tempfile import NamedTemporaryFile singlelock = threading.Lock() class download(threading.Thread): def __init__(self, sitecode, lista):