[python-win32] Threading Issue

Tim Roberts timr at probo.com
Tue Jul 3 23:00:44 CEST 2007


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

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-win32 mailing list