Getting CPU temperature using Python?

后端 未结 10 1172
失恋的感觉
失恋的感觉 2020-12-03 05:08

How do I retrieve the temperature of my CPU using Python? (Assuming I\'m on Linux)

10条回答
  •  执笔经年
    2020-12-03 05:34

    If your Linux supports ACPI, reading pseudo-file /proc/acpi/thermal_zone/THM0/temperature (the path may differ, I know it's /proc/acpi/thermal_zone/THRM/temperature in some systems) should do it. But I don't think there's a way that works in every Linux system in the world, so you'll have to be more specific about exactly what Linux you have!-)

提交回复
热议问题