我是靠谱客的博主 高大大白,这篇文章主要介绍python的urllib模块显示下载进度示例,现在分享给大家,希望可以做个参考。

复制代码 代码如下:

 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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(268)

评论列表共有 0 条评论

立即
投稿
返回
顶部