a command line progress bar for your loops
When I was working on Project Euler, there were several problems that I solved with a brute force approach and thus the runtime was several hours. To see some changes and to know approximately when it finishes, I added a simple counter to the main loop that showed the progress in percentage.
Is there a simpler way to add a progress bar to a loop?
import time from tqdm import tqdm def main(): for i in tqdm(range(10000)): time.sleep(.005)
- you can use
- you can write
On the github page of the project you will find an animated gif too.