You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 13, 2020. It is now read-only.
The simple usage example assumes that the total number of items to process is 5 and iterates over range(5 + 1) (= 6) items in order to draw a full 100%. Obviously you cannot iterate six times in a loop over a list of five items.
The following shows a "real life" usage example:
progress_set = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
total = len(progress_set)
bar = ProgressBar(total)
for index, item in enumerate(progress_set):
bar.numerator = index
print(bar, end = '\r')
# do stuff with item of progress_set
time.sleep(0.25)
bar.numerator += 1
print(bar)
example.py shows in progress_bar()print(bar) # Always print one last time. This is probably an - incomplete - remainder of the correct usage. The author just forgot to increment the numerator.