python - 哪个python模块用于读取Windows中的CPU温度和处理器风扇速度?

标签 python wmi

哪个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/

相关文章:

ruby - 如何在不使用 Ruby 和 WMI 进行轮询的情况下检测 USB 插入?

python - 如何在 matplotlib 中注释 x 轴的范围?

python - django-compress 没有用绝对 url 替换 css 中的相对 url

python - Pandas :计算每组行内的正弦距离

string - 在Powershell中将字符串变量作为参数传递

c# - 如何访问隐藏的分区/卷

Java 以特定用户身份访问 WMI

python - 如何在python服务器中保存视频的<httpfile>

python - 如何逐步增加类次并进行训练?

asp.net - 从 ASP.NET 查询远程计算机时出现 WMI 访问被拒绝错误