Last active
September 14, 2017 18:55
-
-
Save beefy/ab8472139cdfaa113b56af5196145652 to your computer and use it in GitHub Desktop.
prints the current time
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
import time | |
import datetime | |
CURSOR_UP_ONE = '\x1b[1A' | |
ERASE_LINE = '\x1b[2K' | |
time_format = ['%I:%M:%S %p','%I %M %S %p'] | |
while (True): | |
print CURSOR_UP_ONE + ERASE_LINE + CURSOR_UP_ONE | |
print datetime.datetime.now().strftime(time_format[0]) | |
time_format.reverse() | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment