当前位置:网站首页>进度条加载
进度条加载
2022-06-11 12:04:00 【不相信命运,只相信努力】
import datetime
import time
def show_process(counts=500,wait_time=1.25):
# 进度条总步数
steps = counts
# 打印的
length = 80
for step in range(1, steps + 1):
start_time = time.time()
# 模拟运行
time.sleep(wait_time)
end_time = time.time()
# 程序剩余时间
residue_time = str(datetime.timedelta(seconds=(steps - step) * (end_time - start_time))).split('.')[0]
# \r用来在每次输出完成后,将光标移至行首,这样保证进度条始终在同一行输出,即在一行不断刷新的效果; end='',用来保证不换行,不加这句默认换行。
print("\r%d/%d [%s>%s] - ETA: %s" % (
step, steps, '=' * int(length * (step / steps)), '.' * (length - int(length * (step / steps))), residue_time),
end='', flush=True)
print('\nPerform the end!')
if __name__ == '__main__':
print(64%8)
show_process()
边栏推荐
- 程序员常用的命令符
- typescript 编译选项和配置文件
- 数据如何在 Splunk 中老化?
- Software project management 7.1 Basic concept of project schedule
- Fast build elk7.3
- Elk - elastalert largest pit
- Intl.numberformat set number format
- When I saw the sudden death of a 28 year old employee, I wanted to moisten
- Wechat web developers, how to learn web development
- Queuing theory model
猜你喜欢

Hang up the interviewer

阶乘后的零(C语言)

The role of Gerber file in PCB manufacturing

.net core 抛异常对性能影响的求证之路

C# 在PDF文档中应用多种不同字体

解决Splunk kvstore “starting“ 问题

广东市政安全施工资料管理软件2022新表格来啦

Use compiler option '--downleveliteration' to allow iteration of iterations

CentOS installation mysql5.7

Deep learning and CV tutorial (14) | image segmentation (FCN, segnet, u-net, pspnet, deeplab, refinenet)
随机推荐
Splunk Bucket 背后的秘密
When I saw the sudden death of a 28 year old employee, I wanted to moisten
mysql 导入宝塔中数据库data为0000-00-00,enum为null出错
[第二章 基因和染色体的关系]生物知识概括–高一生物
CVPR 2022 𞓜 text guided entity level image manipulation manitrans
What is a Gerber file? Introduction to PCB Gerber file
苹果MobileOne: 移动端仅需1ms的高性能骨干
The wonderful use of XOR (C language)
Typescript compilation options and configuration files
Streaking? Baa!
Interview experience of Xiaomi Android development post~
Intl.numberformat set number format
Using fast and slow pointer method to solve the problem of array (C language)
Network protocol of yyds dry goods inventory: datagram socket for detailed explanation of socket protocol
深度学习与CV教程(14) | 图像分割 (FCN,SegNet,U-Net,PSPNet,DeepLab,RefineNet)
调整数组顺序使奇数位于偶数前面(C语言)
Thread five states (thread life cycle)
JVM class loading process
【LeetCode】1049. Weight of the last stone II (wrong question 2)
yapi安装