Skip to content

Instantly share code, notes, and snippets.

@maluta
Created March 26, 2012 17:14
Show Gist options
  • Select an option

  • Save maluta/2206576 to your computer and use it in GitHub Desktop.

Select an option

Save maluta/2206576 to your computer and use it in GitHub Desktop.
import sys
import time
def progress(message,s=2.0):
for i in range(1,101):
_t = s/100.0
time.sleep(_t)
sys.stdout.write("\r%s%d%%" % (message,i))
sys.stdout.flush()
values = [3,6,1,10] # seconds
for i in enumerate(values):
progress("executing task #%d: " % i[0],i[1])
print ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment