Created
April 15, 2020 15:59
-
-
Save robertlugg/03ba65514675a2d748a5c8b64c2c3990 to your computer and use it in GitHub Desktop.
Timer that prints on same line. Example of CR without newline.
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 | |
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