python wrote: > To BJörn Lindqvist : > thank you . how to write the code specifically ?Could you give a > example?
Use Queue module: import threading from Queue import Queue class PrintThread(threading.Thread): def __init__(self, urlList, results_queue): threading.Thread.__init__(self) urllist=[] self.urllist=urlList self.results_queue = results_queue def run(self): urllink=[self.urllist] * 2 self.results_queue.put(urllink) results = Queue() threadList = [] for i in range(0,2): thread=PrintThread("Thread"+str(i), results) threadList.append(thread) thread.start() for i in threadList: linkReturned = results.get() for j in linkReturned: print j -- http://mail.python.org/mailman/listinfo/python-list