at line "for j in linkReturned:" , raise an error:
File "C:\pythonProgr am\test.py", line 308, in main
for j in linkReturned:
TypeError: iteration over non-sequence
how can I get a list from the return of thread.start() ?
below is the codes:
class PrintThread(thr eading.Thread):
def __init__(self, urlList):
threading.Threa d.__init__(self )
urllist=[]
self.urllist=ur lList
def run(self):
urllink=[]
......
return urllink
for i in range(0,2):
thread=PrintThr ead(links)
threadList.appe nd(thread)
linkReturned=[]
for i in threadList:
linkReturned=i. start()
for j in linkReturned:
links.append(j)
File "C:\pythonProgr am\test.py", line 308, in main
for j in linkReturned:
TypeError: iteration over non-sequence
how can I get a list from the return of thread.start() ?
below is the codes:
class PrintThread(thr eading.Thread):
def __init__(self, urlList):
threading.Threa d.__init__(self )
urllist=[]
self.urllist=ur lList
def run(self):
urllink=[]
......
return urllink
for i in range(0,2):
thread=PrintThr ead(links)
threadList.appe nd(thread)
linkReturned=[]
for i in threadList:
linkReturned=i. start()
for j in linkReturned:
links.append(j)
Comment