Last active
August 29, 2015 14:01
-
-
Save kirreen/f1ca3df0379fe87e71e2 to your computer and use it in GitHub Desktop.
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, datetime | |
while True: | |
log = input() | |
if log != 'Exit' and log != 'exit' and log != 'Quit' and log != 'quit': | |
ts = time.time() | |
st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S') | |
file = open('C:\log.txt', 'a') | |
file.write(st + ': ' + log + '\n') | |
file.close() | |
else: | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment