Created
September 23, 2019 20:24
-
-
Save elbruno/4540277aa5ca6ffa053cb28a776cc5eb to your computer and use it in GitHub Desktop.
RaspberryPiGetDeviceTemp.py
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 os | |
def getCPUtemperature(): | |
res = os.popen('vcgencmd measure_temp').readline() | |
return(res.replace("temp=","").replace("'C\n","")) | |
print(getCPUtemperature()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment