Skip to content

Instantly share code, notes, and snippets.

@jepio
Last active August 29, 2015 14:05
Show Gist options
  • Save jepio/53a145a69196439ef7c0 to your computer and use it in GitHub Desktop.
Save jepio/53a145a69196439ef7c0 to your computer and use it in GitHub Desktop.
Printing an updating line of text to stdout.
"""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