raganmd
5/3/2018 - 10:11 PM

Get windows temperature zones with WMI and pywin32

Get windows temperature zones with WMI and pywin32

# dependencies:
# WMI
# pywin32

# use:
# python -m pip install wmi
# python -m pip install pywin32

import wmi

w                   = wmi.WMI(namespace="root\wmi")
temperature_info    = w.MSAcpi_ThermalZoneTemperature()

for temp in temperature_info:
    kelvinTemp      = temp.CurrentTemperature
    c_temp          = round( (kelvinTemp - 2723) * 0.1, 3 )

    print(c_temp)