On 7/3/07, Emlyn Jones <[EMAIL PROTECTED]> wrote:
> On 7/3/07, Tim Roberts <[EMAIL PROTECTED]> wrote:
 > James Matthews wrote:
> > > So i need to make the list a global variable
> >
> > No, that's not what he did at all.  The names just happened to be the
> > same, that's all.  Consider it this way:
> >
> >     import threading
> >     def foo( threadresult ):
> >         threadresult.extend( range(4) )
> >
> >     result = list()
> >     thread = threading.Thread(target=foo, args=(result,))
> >     thread.start()
> >     result
> >

How about using an object derived from Thread and making 'result' a
member of it?

http://docs.python.org/lib/thread-objects.html

You'd probably also want a variable to tell you if the function has finished.

--
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to