Closed jiwidi closed 4 years ago
You're in luck, that feature was added recently.
import time
import enlighten
bar_format = u'{desc}{desc_pad} i:{i} {percentage:3.0f}%|{bar}| {count:{len_total}d}/{total:d} ' + \
u'[{elapsed}<{eta}, {rate:.2f}{unit_pad}{unit}/s]'
my_fields = {'i': 0}
pbar = enlighten.Counter(total=100, desc='Basic', unit='ticks',
bar_format=bar_format, additional_fields=my_fields)
for num in range(100):
my_fields['i'] += 1
time.sleep(0.1) # Simulate work
pbar.update()
It might also be good to add an example of this in the docs.
Describe the solution you'd like Hi! I would like to use the library to also display the last value of a variable on each loop execution.
Lets say for example:
Is there anyway to display the value of
i
(being changed on every iteration) on the progress bar?