Skip to content

Instantly share code, notes, and snippets.

@hackerdem
Created May 13, 2016 15:03
Show Gist options
  • Save hackerdem/287185cdc6da43fff6fa8947f3ef7b18 to your computer and use it in GitHub Desktop.
Save hackerdem/287185cdc6da43fff6fa8947f3ef7b18 to your computer and use it in GitHub Desktop.
simple progress bar example
import time,sys
def progbar(increment,num):
if increment==num:
print(" Completed")
pass
else:
for i in range(1,10):
if increment==int(num/10):
print ('{}'.format('-'),end=" ")
#do whatever you want
time.sleep(1)
sys.stdout.flush()
num=15000
for i in range(1,num+1):
progbar(i,num)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment