Created
May 13, 2016 15:03
-
-
Save hackerdem/287185cdc6da43fff6fa8947f3ef7b18 to your computer and use it in GitHub Desktop.
simple progress bar example
This file contains hidden or 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 | |
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