Skip to content

Instantly share code, notes, and snippets.

@c2h2
Created June 9, 2023 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save c2h2/a72cee60cf8fe19a3d33273f117d8bdf to your computer and use it in GitHub Desktop.
Save c2h2/a72cee60cf8fe19a3d33273f117d8bdf to your computer and use it in GitHub Desktop.
python script to get intel cpu temperautre package temp
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