Skip to content

Instantly share code, notes, and snippets.

@yancyn
Last active November 13, 2018 03:25
Show Gist options
  • Save yancyn/76e7cfb35689789326fa8aeafc61c46f to your computer and use it in GitHub Desktop.
Save yancyn/76e7cfb35689789326fa8aeafc61c46f to your computer and use it in GitHub Desktop.
Write Log File to Pi
import datetime
import threading
def refresh():
# refresh every 10 minutes
threading.Timer(600.0, refresh).start()
fs = open("active.log","a")
i=datetime.datetime.now()
print >>fs, i.isoformat()
fs.close()
refresh()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment