Last active
August 29, 2015 14:05
-
-
Save jepio/53a145a69196439ef7c0 to your computer and use it in GitHub Desktop.
Printing an updating line of text to stdout.
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
"""Updating timer that shows progress.""" | |
import time | |
i = 0 | |
while i < 1: | |
print("Completed: {:6.2%}".format(i), end='\r', flush=True) | |
i += 1/10000 # update by 1 permil | |
time.sleep(1/1000) # 1 ms | |
print() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment