764 shaares
94 liens privés
94 liens privés
As a Python developer, it is handy to use third-party libraries that do the job you actually want instead of reinventing the wheel each time. In this tutorial, you will be familiar with the psutil module which is a cross-platform library for process and system monitoring in Python, as well as the built-in platform module to extract your system and hardware information in Python.
In the end, I'll show you how to extract GPU information (if you have one, of course) in Python using GPUtil.
There are quite popular tools to extract system and hardware information in Linux, such as lshw, uname and hostnamectl. However, we'll be using the psutil library in Python so it can run on all operating systems and get almost identical results.