tqdm
tqdm copied to clipboard
Add an option to disable progress bar
Sometime it's convenient to not have progress bar. So it would be really nice to add an option to disable tqdm so the code does not need to be modified, only an option to turn off.
for i in tqdm.tqdm(range(10), total=10, disable=True):
print(i)
Whith disable being False by default of course.
I can make a PR but I don't want to bother if the project is not maintained anymore... (see #18)
+1 to this feature, I've created small tqdm wrappers which do just that more than once.
+1
FYI, this is what I did when I needed to disable it:
tqdm = lambda *i, **kwargs: i[0]
and It also used like this (whether tqdm existed or not, overall codes will run smoothly.):
try:
from tqdm import tqdm
except ImportError:
tqdm = lambda *i, **kwargs: i[0] # pylint:disable=invalid-name
That would be nice to see that kind of feature integrated to tqdm indeed.
Any news on whether this will be implemented?
@jimanvlad This already exists in latest tqdm. Note that per #24 this repo is out-of-sync, the real repo is https://github.com/tqdm/tqdm .