here is the program,

# basic structure,omit something
import Queue
 import httplib2
 import threading
 jobs = Queue.Queue()
name=something   #omit ,it is a web list to download
 for  x  in  name:
   jobs.put(x)
 
 def download():
     while not jobs.empty():
             try:
                 url = jobs.get()
                 hx = httplib2.Http()
                 resp, content = hx.request(url, headers=headers)
                 jobs.task_done()
             except:
                 print  "wrong" , url          
           
 if __name__ == '__main__':
    
     for i in range(10):
           threading.Thread(target=download).start()   
     jobs.join()

when it run ,it can download someting ,
it is strang:there is wrong output ,some web can't get,but  the program can't 
stop,it stay ,run ,can't fininsh,
i don't know why?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to