import progressbar
# 先定义一个进度条
# http://blog.useasp.net/
pbar = progressbar.ProgressBar(maxval=100,
widgets=[progressbar.Bar('=', '[', ']'), ' ',
progressbar.Percentage()])
for i in xrange(100):
# 更新进度条
pbar.update(i+1)
pbar.finish()
# 在使用本方法之前,请先做如下import
# from __future__ import division
# import math
# import sys
# ##blog.useasp.net##
def progressbar(cur, total):
percent = '{:.2%}'.format(cur / total)
sys.stdout.write('r')
sys.stdout.write("[%-50s] %s" % (
'=' * int(math.floor(cur * 50 / total)),
percent))
sys.stdout.flush()
# 调用方式举例 progressbar(2, 100) progressbar(3.9, 10) progressbar(3283, 27379)
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有