Re: my multi-download program can't finish

2011-09-08 Thread MRAB
On 08/09/2011 05:24, 守株待兔 wrote: 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():

回复: my multi-download program can't finish

2011-09-08 Thread 守株待兔
sometimes,the output is: error: [Errno 104] Connection reset by peer -- 原始邮件 -- 发件人: "Steven D'Aprano"; 发送时间: 2011年9月8日(星期四) 中午1:08 收件人: "python-list"; 主题: Re: my multi-download program can't finish On Thu,

Re: my multi-download program can't finish

2011-09-07 Thread Steven D'Aprano
On Thu, 8 Sep 2011 02:24 pm 守株待兔 wrote: [...] > try: > url = jobs.get() > hx = httplib2.Http() > resp, content = hx.request(url, headers=headers) > jobs.task_done() > except: > print "wr

my multi-download program can't finish

2011-09-07 Thread 守株待兔
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