Hard
[===> ]50% I want this.
https://gist.github.com/wassen/3f559de866415472b9b2 I made. Analysis over there. I've noticed that there is already this, but it's too late.
Create an instance by inserting the list you want to turn or whatever, and call display_progressbar in the for statement.
sample1.py
from ProgressBar import ProgressBar as pb
import time
list1 = "I love you"
list2 = range(3)
list3 = [0,1]
pb1 = pb(list1,list2,list3)
for _ in list1:
for _ in list2:
for _ in list3:
time.sleep(0.1)
pb1.display_progressbar()
Create an instance in the same way and have the method return the list.
sample2.py
#Same as above
pb2 = pb(list1, list2, list3)
for _ in pb2.generator(0):
for _ in pb2.generator(1):
for _ in pb2.generator(2):
time.sleep(0.1)
Just wrap the list without creating an instance. It's the easiest, but the drawback is that you can only see the rough progress.
sample3.py
#Same as above
for _ in pb.single_generator(list1):
for _ in list2:
for _ in list3:
time.sleep(0.1)
-Instance initialization can be done with the length of the list instead of the list, but there is a bug when using the second. So the usage is unknown -You can explicitly specify the index when calling display_progressbar. It's like display_progressbar (i, j, k). The usage is unknown ・ I want to be able to add a list in the middle of a for statement when there is a list in the list. -You can add a list from the middle of the add method, but adding it in the middle of the for statement causes a bug. -Note that the elapsed time is measured when the instance is initialized. ・ I chose a color that seems to be kind to the eyes. ・ If you have any problems or suggestions for improvement, please do not hesitate to contact us.
Thank you very much. http://www.yunabe.jp/docs/terminal_progress_bar.html