簡體   English   中英

我在 Windows 32 位和 Python 中使用 wmi 庫獲取 CPU 溫度,但與 Core Temp 的結果相比,我認為這是錯誤的

[英]I am getting CPU temperature using wmi library in Windows 32-bit with Python but I think it's false when compared with the results of Core Temp

我使用wmi庫通過以下代碼不斷獲得值 30.85°。 這是我的代碼:

import wmi

w = wmi.WMI(namespace=r'root\wmi')

temp = w.MSAcpi_ThermalZoneTemperature()[0].CurrentTemperature

kelvin = temp / 10
celsius = kelvin - 273.15
fahrenheit = (9/5) * celsius + 32

print(f'Kalvin:{kelvin:^10.2f}\tCelsius:{celsius:^10.2f}\tFahrenheit:{fahrenheit:^10.2f}')

結果如下:

Kalvin:  304.00     Celsius:  30.85     Fahrenheit:  87.53   

我還想指出,除非我重新啟動筆記本電腦或等待大約 30 分鍾后,否則該值不會更改。

最后,以下是 Core Temp 1.15.1 中顯示的結果,這些結果不斷變化。

Core Temp 結果在所有核心的溫度

你能幫我解釋一下嗎?

在閱讀wim 文檔以下線程時,我沒有獲得 CPU 的當前溫度,而是從主板的其他地方獲得。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM