def getCpuTemperature():
tempFile = open( "/sys/class/thermal/thermal_zone0/temp" )
cpu_temp = tempFile.read()
tempFile.close()
return float(cpu_temp)/1000
Verwendet wird diese zum Beispiel so:
import os
def getCpuTemperature():
tempFile = open( "/sys/class/thermal/thermal_zone0/temp" )
cpu_temp = tempFile.read()
tempFile.close()
return float(cpu_temp)/1000
print(getCpuTemperature())
Note: Code Formatierung mit formatmysourcecode
Danke, geht einwandfrei.
AntwortenLöscheninteressant
AntwortenLöschenmfg
thomas von computer 22