Created
March 16, 2011 16:40
-
-
Save lrvick/872787 to your computer and use it in GitHub Desktop.
Python console progress indicator snippet
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
import time,sys | |
total_loops = 500; | |
complete_loops = 0; | |
while (complete_loops < total_loops): | |
percent = int(complete_loops*100/total_loops) | |
time.sleep(1) | |
complete_loops +=1 | |
sys.stdout.write("\rRunning Loops - %s/%s - %d%%" % (complete_loops,total_loops,percent)) | |
sys.stdout.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment