sdchy 发表于 2017-4-28 09:41:55

python urllib模块显示下载进度

python的urllib模块显示下载进度.
def report_hook(count, block_size, total_size):
...   print '%02d%%'%(100.0 * count * block_size/ total_size)
...
urllib.urlretrieve("http://www.jbxue.com/", reporthook= report_hook)
00%
01%
03%
...
页: [1]
查看完整版本: python urllib模块显示下载进度