tqdm 进度条完成后无法消除,在jupyter中可以实现
Closed this issue · 1 comments
lanourain commented
代码参考如下,jupyter中进度条完成后可消除,libro中还存在。
from tqdm.notebook import tqdm_notebook
import time
# 创建一个 total 为 100 的进度条,设置 leave=False 确保进度条在完成后自动清除
tqdm = tqdm_notebook(total=100, leave=False)
# 模拟每 0.5 秒增加 10%
for _ in range(10):
tqdm.update(10) # 更新进度10%
time.sleep(0.5) # 模拟等待时间
# 确保进度条在完成后被清除
tqdm.clear()
tqdm.close()
BroKun commented
releases 0.2.42