Created
February 4, 2019 17:43
-
-
Save blaylockbk/62353961963e5ad5f27dbb6cbb649a8f to your computer and use it in GitHub Desktop.
Print progress to show completion of a loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Print a progress bar for a loop completion | |
from time import sleep | |
F = range(10) | |
num = len(F) | |
for i in F: | |
sleep(1) | |
sys.stdout.write('\r%.1f%% Complete (%s of %s)' % (i/num*100, i, num)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment