python的urllib模块显示下载进度示例
时间:2021-01-31 08:09:16|栏目:Python代码|点击: 次
复制代码 代码如下:
def report_hook(count, block_size, total_size):
... print '%02d%%'%(100.0 * count * block_size/ total_size)
...
urllib.urlretrieve("http://sports.sina.com.cn/", reporthook= report_hook)
00%
01%
03%
...
上一篇:python生成器/yield协程/gevent写简单的图片下载器功能示例
栏 目:Python代码
本文地址:http://www.codeinn.net/misctech/54333.html






