Skip to content

Instantly share code, notes, and snippets.

@elbruno
Created September 23, 2019 20:24
Show Gist options
  • Save elbruno/4540277aa5ca6ffa053cb28a776cc5eb to your computer and use it in GitHub Desktop.
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