Skip to content

Instantly share code, notes, and snippets.

@teshanshanuka
Created July 1, 2018 08:00
Show Gist options
  • Save teshanshanuka/846dc179e1fa80ede0df3c1a76d99592 to your computer and use it in GitHub Desktop.
Save teshanshanuka/846dc179e1fa80ede0df3c1a76d99592 to your computer and use it in GitHub Desktop.
import time
filename = "/home/<username>/myprogram/logs/myservice.log"
with open(filename, "w") as fl:
while True:
fl.write(time.ctime() + '\n')
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment