输出进度条的图形
Last updated
Last updated
# pip install tqdm
from time import sleep
from tqdm import tqdm
# 这里同样的,tqdm就是这个进度条最常用的一个方法
# 里面存一个可迭代对象
for i in tqdm(range(1, 500)):
# 模拟你的任务
sleep(0.01)
sleep(0.5)
# pip install alive-progress
from alive_progress import alive_bar
import time
# retrieve your set of items
items = range(100)
# declare your expected total
with alive_bar(len(items)) as bar:
# iterate as usual
for item in items:
# process each item
bar()
time.sleep(0.1)img