python中tqmd函数实现for循环的进度条

 

001、python中tqmd函数实现for循环的进度条

[root@PC1 test]# ls
test.py
[root@PC1 test]# cat test.py
#!/usr/bin/env python
# -*- coding:utf-8 -*-

from tqdm import tqdm       ## 导入该函数
import time

for i in tqdm(range(10)):     ## 实现for循环进度条
    time.sleep(0.3)
[root@PC1 test]# python test.py
100%|██████████████████████████████████████████████████████████████████████████████| 10/10 [00:03<00:00,  3.32it/s]
[root@PC1 test]# ls
test.py

image

。 

 

posted @ 2025-07-29 17:13  小鲨鱼2018  阅读(19)  评论(0)    收藏  举报