Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. from subprocess import PIPE, Popen
  2.  
  3. def get_cpu_temperature():
  4. """get cpu temperature using vcgencmd"""
  5. process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE)
  6. output, _error = process.communicate()
  7. return float(output[output.index('=') + 1:output.rindex("'")])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement