Skip to content

Instantly share code, notes, and snippets.

@rooterkyberian
Created December 14, 2020 14:11
Show Gist options
  • Save rooterkyberian/6ae969acc3b509b444fe238e4eaad0c5 to your computer and use it in GitHub Desktop.
Save rooterkyberian/6ae969acc3b509b444fe238e4eaad0c5 to your computer and use it in GitHub Desktop.
temp sensors dumping to jsonl
import time, json, subprocess
f = open("sensors.jsonl", "a")
while True:
sensors_data = json.loads(subprocess.check_output(["sensors", "-j"], text=True))
data = {"time": time.time(), "sensors": sensors_data}
print(data)
json.dump(data, f)
f.write("\n")
time.sleep(60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment