作者:手机用户2502857731 | 来源:互联网 | 2017-05-14 02:44
代码如下:
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%
...