哪个python模块用于读取Windows中的CPU温度和处理器风扇速度?
我探索了 WMI python 模块,但是我无法找到正确的选项或函数来捕获上述信息。
实际上我尝试了以下代码片段,但它返回“无”。
import wmi
w = wmi.WMI()
print w.Win32_TemperatureProbe()[0].CurrentReading
有没有办法获取这些信息?
最佳答案
根据 Microsoft's MSDN :
Most of the information that the Win32_TemperatureProbe WMI class provides comes from SMBIOS. Real-time readings for the CurrentReading property cannot be extracted from SMBIOS tables. For this reason, current implementations of WMI do not populate the CurrentReading property. The CurrentReading property's presence is reserved for future use.
您可以改用 MSAcpi_ThermalZoneTemperature
:
import wmi
w = wmi.WMI(namespace="root\\wmi")
print (w.MSAcpi_ThermalZoneTemperature()[0].CurrentTemperature/10.0)-273.15
关于python - 哪个python模块用于读取Windows中的CPU温度和处理器风扇速度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10776802/