2007年05月16日 星期三 17:58
使用这样的代码: conn = httplib.HTTPConnection(www.nuc.edu.cn) conn.request("GET", "/index.htm") r1 = conn.getresponse() 如果有 socket.error: (10060, 'Operation timed out') 这样的错误代码就直接退出了,如果我想让它重试连接,该怎么办呢? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070516/2cba08fa/attachment.html
2007年05月16日 星期三 18:02
handle this exception,then retry 在 07-5-16,pesoft在126.com<pesoft在126.com> 写道: > 使用这样的代码: > conn = httplib.HTTPConnection(www.nuc.edu.cn) > conn.request("GET", "/index.htm") > r1 = conn.getresponse() > 如果有 > socket.error: (10060, 'Operation timed out') > 这样的错误代码就直接退出了,如果我想让它重试连接,该怎么办呢? > > ________________________________ > 免费试玩2006中国最佳网络游戏--梦幻西游 > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to > python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request在lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > -- The ideal situation occurs when the things that we regard as beautiful are also regarded by other people as useful. --- Donald Knuth
2007年05月16日 星期三 19:34
On 5/16/07, pesoft at 126.com <pesoft at 126.com> wrote: > > 使用这样的代码: > conn = httplib.HTTPConnection(www.nuc.edu.cn) > conn.request("GET", "/index.htm") > r1 = conn.getresponse() > 如果有 > socket.error: (10060, 'Operation timed out') > 这样的错误代码就直接退出了,如果我想让它重试连接,该怎么办呢? > > try...except,捕获后重试 -- I like Python & Linux. Blog: http://recordus.cublog.cn -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070516/013f67fc/attachment.html
2007年05月28日 星期一 21:12
http_timeout.py ¸ÄÒ»ÏÂÀïÃæµÄ²ÎÊý On 5/16/07, pesoft在126.com <pesoft在126.com> wrote: > > ʹÓÃÕâÑùµÄ´úÂ룺 > conn = httplib.HTTPConnection(www.nuc.edu.cn) > conn.request("GET", "/index.htm") > r1 = conn.getresponse() > Èç¹ûÓÐ > socket.error: (10060, 'Operation timed out') > ÕâÑùµÄ´íÎó´úÂë¾ÍÖ±½ÓÍ˳öÁË£¬Èç¹ûÎÒÏëÈÃËüÖØÊÔÁ¬½Ó£¬¸ÃÔõô°ìÄØ£¿ > > > ------------------------------ > Ãâ·ÑÊÔÍæ2006Öйú×î¼ÑÍøÂçÓÎÏ·--ÃλÃÎ÷ÓÎ <http://event.mail.163.com/chanel/xyq.htm?from=126> > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070528/491837b0/attachment.html
Zeuux © 2025
京ICP备05028076号