passing argumetns to threading.Thread

sashan mabus at operamail.com
Sat Oct 4 22:10:04 EDT 2003


sashan wrote:
> I'm trying to pass arguments to my the run method of my class  that 
> inherits from threading.Thread.
> 
> class Reader(threading.Thread):
>     def __init__(self, conn):
>         threading.Thread.__init__(self, None, None, None, (conn))
>        
>     def run(self,conn):       
>         while 1:
>             data = conn.recv(1024)
>             print data
> 
woops left out some stuff...

later in the program:

t = Reader(conn)
t.start()





More information about the Python-list mailing list