Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from subprocess import PIPE, Popen
- def get_cpu_temperature():
- """get cpu temperature using vcgencmd"""
- process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE)
- output, _error = process.communicate()
- return float(output[output.index('=') + 1:output.rindex("'")])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement