I know how to build nested progress bar using tqdm.
from tqdm import trange
from time import sleep
for i in trange(10, desc='1st loop'):
for j in trange(5, desc='2nd loop', leave=False):
for k in trange(100, desc='3nd loop'): sleep(0.01)
I also know how to add postfixes and description to a bar
from tqdm import trange
from random import random, randint
from time import sleep
with trange(100) as t:
for i in t:
t.set_description('GEN %i' % i)
t.set_postfix(loss=random(), gen=randint(1,999), str='h', lst=[1, 2])
sleep(0.1)
Question
How can I add description and postfixes to nested progress bars in tqdm? I would like to add independent postfixes to each nested bar.