python的urllib模块显示下载进度示例
摘要:复制代码代码如下:defreport_hook(count,block_size,total_size):...print'%02d%%'%...
复制代码 代码如下:
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的urllib模块显示下载进度示例】相关文章:
★ Python urllib模块urlopen()与urlretrieve()详解
上一篇:
Python中for循环详解
下一篇:
vc6编写python扩展的方法分享