Python tqdm package - how to configure for less frequent status bar updates

python python-3.x loops statusbar tqdm

794 观看


1428 作者的声誉

I'm using a tqdm package (v4.19.5) for a loop with 200K+ iterations in Python 3.6 (Anaconda 3, Windows 10 x64, PyCharm IDE). It prints the status bar too frequently, so that my earlier history disappears in the console.

Is there a way to limit the frequency of status bar updates? I can't seem to find this solution online or tqdm website.

Currently, my status bar prints like this. Ideally, I'd like to set put a cap on percentage change. For example, update it not more frequently than once per 1% change/progress.

enter image description here

作者: Oleg Melnikov 的来源 发布者: 2017 年 12 月 27 日

回应 1


161 作者的声誉


You can use miniters parameter i have it from source code

tqdm.tqdm(iterable, miniters=int(223265/100))
作者: miroB 发布者: 2018 年 5 月 17 日