Created
March 28, 2016 01:52
-
-
Save elvinio/f8574f37dd5f55ed0e46 to your computer and use it in GitHub Desktop.
Records the temperature readout from the hardware sensor in a linux env.
This file contains hidden or 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
#!/usr/bin/python | |
import subprocess | |
import time | |
temp = [3, 8, 13, 18, 23, 28, 33, 38, 43, 51, 56, 61, 66, 71, 76, 81, 86, 91, 147, 153, 159, 165, 171, 240, 246, 252, 258, 264] | |
f = open('temp', 'w') | |
while True: | |
output = subprocess.check_output(["sensors", "-u"]) | |
lines = output.split("\n") | |
printstring = str(int(time.time())) | |
for t in temp: | |
ss = lines[t].split(":") | |
printstring += ss[1] | |
time.sleep(60) | |
f.write(printstring + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment