Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在WINDOWS中,哪个python模块用于读取CPU温度和处理器风扇速度。。?_Python - Fatal编程技术网

在WINDOWS中,哪个python模块用于读取CPU温度和处理器风扇速度。。?

在WINDOWS中,哪个python模块用于读取CPU温度和处理器风扇速度。。?,python,Python,在WINDOWS中,哪个python模块用于读取CPU温度和处理器风扇速度 探索了WMI python模块,但我始终无法找到正确的选项或函数来捕获上述信息 实际上,我尝试了下面的代码剪切,但它返回“nothing” import wmi w = wmi.WMI() print w.Win32_TemperatureProbe()[0].CurrentReading 请给出一些建议来获取这些信息 比尔, -Srk符合以下要求: Win32_TemperatureProbe WMI类提供的大部分信

在WINDOWS中,哪个python模块用于读取CPU温度和处理器风扇速度

探索了WMI python模块,但我始终无法找到正确的选项或函数来捕获上述信息

实际上,我尝试了下面的代码剪切,但它返回“nothing”

import wmi
w = wmi.WMI()
print w.Win32_TemperatureProbe()[0].CurrentReading
请给出一些建议来获取这些信息

比尔, -Srk符合以下要求:

Win32_TemperatureProbe WMI类提供的大部分信息 提供的源于SMBIOS。当前读数的实时读数 无法从SMBIOS表中提取属性因此, WMI的当前实现不填充CurrentReading 属性。CurrentReading属性的存在是为保留的 未来用途

您可以改用
MSAcpi\u ThermalZoneTemperature

import wmi

w = wmi.WMI(namespace="root\\wmi")
print (w.MSAcpi_ThermalZoneTemperature()[0].CurrentTemperature/10.0)-273.15
这非常有效:

import wmi

w = wmi.WMI(namespace="root\\wmi")
print (w.MSAcpi_ThermalZoneTemperature()[0].CurrentTemperature / 10.0) - 273.15

请确保您以管理员身份运行该程序,否则在尝试测试/运行/执行代码时,该程序将失败或给出错误代码。

可能重复,并且仅在以管理员身份运行时有效谢谢您提供的解决方案。有可能使用python读取CPU风扇速度吗?当我尝试这样做时,会出现一系列“意外”的OLE/COM异常,为什么会这样?