Created
April 7, 2017 12:56
-
-
Save Shrhawk/b515cbf8e6c1ae888a2c3300b280150d to your computer and use it in GitHub Desktop.
temperature_sensors
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 sys | |
import re | |
import subprocess | |
sensorsOut = subprocess.getoutput('sensors') | |
trapperStdout = [] | |
boardTempRe = re.findall(r'CPU:\s+\+(\d+)\.\d', sensorsOut, re.I) | |
cpuTempRe = re.findall(r'(?:Core\s+\d+|Core\d+\s+Temp):\s+\+(\d+)\.\d', sensorsOut, re.I) | |
Cores = re.findall(r'(?:Core\s+(\d+):)', sensorsOut, re.I) | |
print(boardTempRe) | |
print(cpuTempRe) | |
print(Cores) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment