python cpu温度
by Ori Roza
通过Ori Roza
使用Python(和其他一些不错的技巧)检查CPU的温度 (Check the temperature of your CPU using Python (and other cool tricks))
Python’s psutil module provides an interface with all the PC resources and processes.
Python的psutil模块提供了与所有PC资源和进程的接口。
This module is very helpful whether we want to get some data on a specific resource or manage a resource according to its state.
无论我们要获取特定资源上的某些数据还是根据其状态管理资源,此模块都非常有用。
In this article, I will show you the main features of this module and how to use them.
在本文中,我将向您展示该模块的主要功能以及如何使用它们。
获取PC资源信息 (Getting PC resources information)
Let’s see how we can get some info about our PC’s current system state.
让我们看看如何获取有关PC当前系统状态的信息。
We can get some info about the CPU since boot time, including how many system calls and context switches it has made: