Skip to content

Instantly share code, notes, and snippets.

@teshanshanuka
Last active July 1, 2018 08:02
Show Gist options
  • Save teshanshanuka/27c6682781c00780f7b64a4aedb63a3f to your computer and use it in GitHub Desktop.
Save teshanshanuka/27c6682781c00780f7b64a4aedb63a3f to your computer and use it in GitHub Desktop.
import time
with open("logs/myservice.log", "w") as fl:
while True:
try:
fl.write(time.ctime() + '\n')
time.sleep(1)
except KeyboardInterrupt:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment