当前位置 : 主页 > 编程语言 > python >

Python之进度条

来源:互联网 收集:自由互联 发布时间:2022-07-17
pip install tqdm from tqdm import tqdm,trange import time for char in tqdm(['a','b','c','d']): time.sleep(0.2) for i in trange(4): time.sleep(0.2) for i in trange(10): time.sleep(0.2) pbar = tqdm(["a", "b", "c", "d"]) for char in pbar: time

pip install tqdm

 

from tqdm import tqdm,trange
import time

for char in tqdm(['a','b','c','d']):
time.sleep(0.2)
for i in trange(4):
time.sleep(0.2)

for i in trange(10):
time.sleep(0.2)

pbar = tqdm(["a", "b", "c", "d"])
for char in pbar:
time.sleep(0.8)
pbar.set_description("Processing %s" % char)

with tqdm(total=100) as pbar:
for i in range(10):
time.sleep(1)
pbar.update(10)

 

黄世宇/Shiyu Huang's Personal Page:​​https://huangshiyu13.github.io/​​



上一篇:Python之FLAGS用法
下一篇:没有了
网友评论