tqdm/tqdm

Troubles regarding removing the progress bar after loop

lensory opened this issue · 1 comments

Hi,
I want to use tqdm in a nested loop and it would help if the progress bar for the inner loop can be removed after finishing the inner loop. I try to pass the parameter "leave=False" as doc said. It did remove the progress bar at the end, but leave a blank line, which means the next progress bar starts at a new line.

image

The mini example is listed as below.

from tqdm.auto import tqdm, trange
import time
for i in trange(4, leave=True):
    for j in trange(5, total=5, leave=False):
        time.sleep(0.5)

I wonder it may relate to my working environment (2 types):

  1. JupyterLab 3.4.4, RHEL 8.8 (linux), jupyterlab 3.4.4, python 3.10.11, tqdm 4.65.0, ipywidgets 7.6.5
  2. Pycharm using jupyter notebook 6.5.2, python 3.10.12, tqdm 4.65.0, ipywidgets 8.0.4

Agreed, I also faced this annoying problem. +1 for fixing