The following script illustrates how to implement a simple progress bar which advances each time a loop counter increases.
import fish
import time
steps=input('How many steps? ')
# Progress bar initialization
peixe = fish.ProgressFish(total=steps)
for i in range(steps):
# Progress bar
peixe.animate(amount=i)
time.sleep(0.1)
Here is a screenshot of what the progress bar looks like in action:
No comments:
Post a Comment