Created
December 14, 2020 14:11
-
-
Save rooterkyberian/6ae969acc3b509b444fe238e4eaad0c5 to your computer and use it in GitHub Desktop.
temp sensors dumping to jsonl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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