Skip to content

Instantly share code, notes, and snippets.

@timothymugayi
Last active December 1, 2019 02:00
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 timothymugayi/cf5a0674c56a7ada11ef7f41321901dd to your computer and use it in GitHub Desktop.
Save timothymugayi/cf5a0674c56a7ada11ef7f41321901dd to your computer and use it in GitHub Desktop.
Tqdm nested loops
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