Skip to content

Instantly share code, notes, and snippets.

@lrvick
Created March 16, 2011 16:40
Show Gist options
  • Save lrvick/872787 to your computer and use it in GitHub Desktop.
Save lrvick/872787 to your computer and use it in GitHub Desktop.
Python console progress indicator snippet
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