Skip to content

Instantly share code, notes, and snippets.

@karolzlot
Created October 9, 2021 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karolzlot/5aa03f351346dedca9077dec5242c4ca to your computer and use it in GitHub Desktop.
Save karolzlot/5aa03f351346dedca9077dec5242c4ca to your computer and use it in GitHub Desktop.
tqdm multiline example 2
from tqdm import tqdm
from time import sleep
with tqdm(total=4, desc='1st loop', position=2) as pbar1:
with tqdm(total=5, desc='2nd loop', position=1) as pbar2:
with tqdm(total=50, desc='3rd loop', position=0) as pbar3:
for i in range(4):
pbar2.reset()
for j in range(5):
pbar3.n=15
for k in range(20):
pbar3.update(1)
pbar3.refresh()
sleep(0.1)
for k in range(20):
pbar3.update(-1)
pbar3.refresh()
sleep(0.1)
pbar2.update(1)
pbar1.update(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment