Python – Get Hardware and System information using platform module
Last Updated :
26 Mar, 2020
In this article, we will see how we can show information about our system i.e processor name, name of system etc.
The Platform module is used to retrieve as much possible information about the platform on which the program is being currently executed. Now by platform info, it means information about the device, it’s OS, node, OS version, Python version, etc. This module plays a crucial role when you want to check whether your program is compatible with the python version installed on a particular system or whether the hardware specifications meet the requirements of your program.
In order to do this we need to import platform
module.
import platform
Below is the Python implementation –
import platform
info = {}
platform_details = platform.platform()
info[ "platform details" ] = platform_details
system_name = platform.system()
info[ "system name" ] = system_name
processor_name = platform.processor()
info[ "processor name" ] = processor_name
architecture_details = platform.architecture()
info[ "architectural detail" ] = architecture_details
for i, j in info.items():
print (i, " - " , j)
|
Output :
platform details - Windows-10-10.0.17134-SP0
system name - Windows
processor name - Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
architectural detail - ('64bit', 'WindowsPE')
Note : Output may vary based on you system architecture.
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...