Skip to content

Instantly share code, notes, and snippets.

@DennyLoko
Created December 1, 2015 19:50
Show Gist options
  • Save DennyLoko/cb85d9329587b22247e3 to your computer and use it in GitHub Desktop.
Save DennyLoko/cb85d9329587b22247e3 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
#
# Show current CPU temperature
#
import os
import json
cpu_temp = float(os.popen('cat /sys/class/thermal/thermal_zone0/temp').read()) / 1000
print json.dumps({'cpu': cpu_temp})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment