Last active
August 29, 2015 14:17
-
-
Save zeffii/e69990047b89707c3461 to your computer and use it in GitHub Desktop.
progress bar
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
# gleaned from http://stackoverflow.com/a/3160819/1243487 | |
import sys, time | |
def make_progressbar(toolbar_width): | |
fspace = "-" * toolbar_width | |
sys.stdout.write("[" + fspace + "]") | |
sys.stdout.flush() | |
sys.stdout.write("\b" * (toolbar_width + 1)) | |
for i in fspace: | |
time.sleep(0.1) | |
sys.stdout.write("|") | |
sys.stdout.flush() | |
sys.stdout.write("\n") | |
make_progressbar(44) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment