2007年03月25日 星期日 01:49
Äã°Ñhttplib.pyÖ±½ÓÐÞ¸ÄһϹþ¹þ ÎÒÊÇÕâô×öµÄ ÎÒ¿½±´httplib.py->httplib_timeout.py È»ºóÐÞ¸Ätimeout²ÎÊý ÒýÓõÄʱºòÓà import httplib_timeout 1071 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 1072 socket.setdefaulttimeout(100) On 1/10/07, bnuzhengbin在163.com <bnuzhengbin在163.com> wrote: > > ÎÒʹÓõÄÊÇpython2.2.3°æ±¾£¬ÇëÎÊÔÚ´Ë°æ±¾pythonÖÐÈç¹ûÔÚʹÓÃhttplibµÄʱºòÉèÖó¬Ê±£¿£¨socket³¬Ê±ºÍ¶ÁÈ¡³¬Ê±£© > > òËÆÔÚhttplibÖеİüº¬µÄÀàºÍ·½·¨ÀïÃæûÓÐÕÒµ½ÉèÖó¬Ê±µÄ²¿·Ö¡£ > > _______________________________________________ > 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/20070325/c9780b2a/attachment.htm
2007年03月25日 星期日 02:27
h=httplib.HTTP() .... ..... h._conn.sock.settimeout(120) 在07-3-25,alex yu <yu.alex.z.y at gmail.com> 写道: > > 你把httplib.py直接修改一下哈哈 > 我是这么做的 > 我拷贝httplib.py->httplib_timeout.py > 然后修改timeout参数 > 引用的时候用 import httplib_timeout > 1071 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > 1072 socket.setdefaulttimeout(100) > > > > On 1/10/07, bnuzhengbin at 163.com <bnuzhengbin at 163.com> wrote: > > > > 我使用的是python2.2.3 版本,请问在此版本python中如果在使用 httplib的时候设置超时?( socket超时和读取超时) > > > > 貌似在httplib 中的包含的类和方法里面没有找到设置超时的部分。 > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- devdoer devdoer at gmail.com http://devdoer.blog.sohu.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070325/98dc162f/attachment.html
Zeuux © 2025
京ICP备05028076号