Skip to content

Instantly share code, notes, and snippets.

@elbruno
Created September 23, 2019 20:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save elbruno/4540277aa5ca6ffa053cb28a776cc5eb to your computer and use it in GitHub Desktop.
RaspberryPiGetDeviceTemp.py
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