tqdm icon indicating copy to clipboard operation
tqdm copied to clipboard

Add an option to disable progress bar

Open hadim opened this issue 10 years ago • 5 comments

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)

hadim avatar May 28 '15 10:05 hadim

+1 to this feature, I've created small tqdm wrappers which do just that more than once.

kmike avatar May 29 '15 15:05 kmike

+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

minhoryang avatar Jun 03 '15 13:06 minhoryang

That would be nice to see that kind of feature integrated to tqdm indeed.

hadim avatar Jun 03 '15 13:06 hadim

Any news on whether this will be implemented?

jimanvlad avatar Dec 05 '16 16:12 jimanvlad

@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 .

dubek avatar Dec 28 '16 07:12 dubek