手机
当前位置:查字典教程网 >脚本专栏 >python >python的urllib模块显示下载进度示例
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模拟登陆Tom邮箱示例分享

python ElementTree 基本读操作示例

python解析xml模块封装代码

Python tempfile模块学习笔记(临时文件)

python thread 并发且顺序运行示例

python线程锁(thread)学习示例

python使用urllib模块开发的多线程豆瓣小站mp3下载器

python 合并文件的具体实例

python多线程http下载实现示例

python33 urllib2使用方法细节讲解

精品推荐
分类导航