Created
June 9, 2023 03:56
-
-
Save c2h2/a72cee60cf8fe19a3d33273f117d8bdf to your computer and use it in GitHub Desktop.
python script to get intel cpu temperautre package temp
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 subprocess | |
import json | |
cmd = "sensors -j" | |
x=subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) | |
temps=json.loads(x) | |
temp0=(temps['coretemp-isa-0000']['Package id 0']['temp1_input']) | |
print(temp0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment