Created
October 9, 2021 01:03
-
-
Save karolzlot/5aa03f351346dedca9077dec5242c4ca to your computer and use it in GitHub Desktop.
tqdm multiline example 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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