打印进度条——(progress bar才是专业的)
# 打印进度条——(progress bar是专业的)
import time
for i in range(0,101,2):
time.sleep(0.1)
char_num = i//2 #打印多少个*
# per_str = '%s%% : %s\n' % (i,'*' * char_num) if i == 100 else '%s%% : %s'%(i,'*' *char_num)
# \r回到行首
per_str = '\r%s%% : %s\n' % (i,'*' * char_num) \
if i == 100 else '\r%s%% : %s'%(i,'*' *char_num)
print(per_str,end='',flush=True)
运行结果:
打印进度条——(progress bar才是专业的)的更多相关文章
- python3+2 不换行打印,多用于进度条 process bar
python3 不换行打印,多用于进度条 process bar process = 0 # process bar for i in user: process += 1 print("\ ...
- python 之 time模块、datetime模块(打印进度条)
6.9 time 模块 方法 含义 备注 time.time() 时间戳 1561013092.997079 time.strftime('%Y-%m-%d %H:%M:%S %p') 结构化时间st ...
- amazeui学习笔记--css(常用组件13)--进度条Progress
amazeui学习笔记--css(常用组件13)--进度条Progress 一.总结 1.进度条基本使用:进度条组件,.am-progress 为容器,.am-progress-bar 为进度显示信息 ...
- python3如何打印进度条
Python3 中打印进度条(#)信息: 代码: import sys,time for i in range(50): sys.stdout.write("#") sys.std ...
- 利用sys打印进度条
在很多常见中,需要对当前处理的进度进行显示,这个时候就需要进度条了,在python中,也有封装好的进度条模块,当然,也可以自己编写一个简单的进度条来帮助理解进度条的实现. 首先,需要理解一个概念,就是 ...
- 【451】python 同一行打印进度条
参考:Python3 Print 同一行打印显示进度条效果 参考:\r\n, \r and \n what is the difference between them? [duplicate] 参考 ...
- 详解HTML5中的进度条progress元素简介及兼容性处理
一.progress元素基本了解 1.基本知识 progress元素属于HTML5家族,指进度条.IE10+以及其他靠谱浏览器都支持. 注释:Internet Explorer 9 以及更早的版本不支 ...
- 小技巧:with用法 pycharm控制台输出带颜色的文字 打印进度条的
with用法 with用法在python中是一个很独特的用法,因为别的语言的中没有这个用法.所以针对这个特点我们来做一次总结,什么样的情况下可以同with 我们学到的有文件的操作,和acquire ...
- vue 渐变 进度条 progress
废话 不多少说 ,直接上代码 新建文件 gradual-progress.vue <!-- * @Author: gfc * @Date: 2019-11-07 14:00:11 * @Last ...
随机推荐
- Eclipse配置tomcat8.5.7报错:The Apache Tomcat installation at this directory is version 8.5.27. A Tomcat 8.0 installation is...
Eclipse配置tomcat8.5.7报错:The Apache Tomcat installation at this directory is version 8.5.27. A Tomcat ...
- Java之网络爬虫WebCollector2.1.2+selenium2.44+phantomjs2.1.1
Java之网络爬虫WebCollector2.1.2+selenium2.44+phantomjs2.1.1 一.简介 版本匹配: WebCollector2.12 + selenium2.44.0 ...
- WinterCamp2017 游记
Winter is coming! Day0 Day0前一天打了一轮CF,做完了ABCD,Div2 Rank59.然后就去开开心心的睡觉,准备第二天的行程. 快到一点的时候躺在了床上,睡不着,翻来覆去 ...
- 20145307陈俊达《网络对抗》逆向及Bof基础
20145307陈俊达<网络对抗>逆向及Bof基础 实践目标 本次实践的对象是一个名为pwn1的linux可执行文件. 该程序正常执行流程是:main调用foo函数,foo函数会简单回显任 ...
- Anchor、Dock
转:http://blog.sina.com.cn/s/blog_7f7cd96601013trt.html 在设计可供用户调整大小的窗体时,如何实现该窗体上的控件也应能正确地随窗体的改变而自动调整大 ...
- xss总结(一直更新)
反射型: 在表单输入jack网页源代码:<pre>Hello jack</pre> 测试: 低级别:<script>alert('xss')</script& ...
- HDU 4990 Reading comprehension(矩阵快速幂)题解
思路: 如图找到推导公式,然后一通乱搞就好了 要开long long,否则红橙作伴 代码: #include<set> #include<cstring> #include&l ...
- [微信开发] - 使用weixin4j进行二次开发
1. 服务器连接配置OK, 配置文件在classpath:weixin4j.properties中 # weixin4j-spring-demo### 使用weixin4j(岸思版)springboo ...
- IDEA使用Git管理项目
今天将项目使用Git管理了,IDEA. 第一步: 第二步:
- 更换Ubuntu14.04主题
闲暇之余,想玩一玩Ubuntu的主题,想把原来的主题换成Numix主题,说干就干. sudo add-apt-repository ppa:numix/ppa sudo apt-get update ...