iteration over non-sequence ,how can I resolve it?

python dongdonglove8 at hotmail.com
Sun May 28 09:20:20 EDT 2006


at line "for j in  linkReturned:" , raise an error:
File "C:\pythonProgram\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(threading.Thread):
  def __init__(self, urlList):
      threading.Thread.__init__(self)
      urllist=[]
      self.urllist=urlList
   def run(self):
      urllink=[]
      ......
      return urllink


for i in range(0,2):
        thread=PrintThread(links)
        threadList.append(thread)
    linkReturned=[]
    for i in threadList:
        linkReturned=i.start()
        for j in  linkReturned:
            links.append(j)




More information about the Python-list mailing list