Skip to content

Instantly share code, notes, and snippets.

@kirreen
Last active August 29, 2015 14:01
Show Gist options
  • Save kirreen/f1ca3df0379fe87e71e2 to your computer and use it in GitHub Desktop.
Save kirreen/f1ca3df0379fe87e71e2 to your computer and use it in GitHub Desktop.
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