手机
当前位置:查字典教程网 >脚本专栏 >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 ElementTree 基本读操作示例

python sys模块sys.path使用方法示例

python线程锁(thread)学习示例

python 从远程服务器下载东西的代码

Python urllib模块urlopen()与urlretrieve()详解

python33 urllib2使用方法细节讲解

python实现倒计时的示例

python解析xml模块封装代码

python算法学习之计数排序实例

python从ftp下载数据保存实例

精品推荐
分类导航