Last active
December 1, 2019 02:00
-
-
Save timothymugayi/cf5a0674c56a7ada11ef7f41321901dd to your computer and use it in GitHub Desktop.
Tqdm nested loops
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
import time | |
import sys | |
from tqdm import trange | |
def do_something(): | |
time.sleep(1) | |
def do_another_something(): | |
time.sleep(1) | |
for i in trange(10, file=sys.stdout, desc='outer loop'): | |
do_something() | |
for j in trange(100,file=sys.stdout, leave=False, unit_scale=True, desc='inner loop'): | |
do_another_something() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment