Showing temperatures with Python (WMI Problem)

0

This is my code:

import wmi
w = wmi.WMI(namespace="root\OpenHardwareMonitor")
temperature_infos = w.Sensor()
#print(temperature_infos)
for sensor in temperature_infos:
    #print(sensor)
    if sensor.SensorType == 'Temperature':
        print(sensor.Name)
        print(sensor.Value)

And i get this error:

Exception has occurred: x_wmi
<x_wmi: Unexpected COM Error (-2147217394, 'OLE error 0x8004100e', None, None)>

And I think the problem is that I can't add the dll. Some help?

python
windows
wmi
asked on Stack Overflow Nov 1, 2019 by Liniuta • edited Nov 1, 2019 by martineau

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0