Skip to content

Instantly share code, notes, and snippets.

@robertlugg
Created April 15, 2020 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertlugg/03ba65514675a2d748a5c8b64c2c3990 to your computer and use it in GitHub Desktop.
Save robertlugg/03ba65514675a2d748a5c8b64c2c3990 to your computer and use it in GitHub Desktop.
Timer that prints on same line. Example of CR without newline.
import time
counter = 0
while counter < 10:
print(f'\r{counter}', end='')
time.sleep(1.0)
counter += 1
print("Done.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment