tqdm是一个快速、可扩展的Python进度条,说白了就是在终端运行时,显示程序的执行进度
可在Python长循环中添加一个进度提示信息,用户只需要封装任意迭代器
使用方法:
导入tqdm模块
for i in tqdm.tqdm(可迭代对象【列表、字符串之类的】):
do something
废话不多说,直接上代码:
import tqdm
import time
for i in tqdm.tqdm("hello world"):
time.sleep(1)
运行结果为: