How to use Platform module In Python
Installation of the platform module can be done using the below command:
pip install platform
Example:
Python3
import platform my_system = platform.uname() print (f "System: {my_system.system}" ) print (f "Node Name: {my_system.node}" ) print (f "Release: {my_system.release}" ) print (f "Version: {my_system.version}" ) print (f "Machine: {my_system.machine}" ) print (f "Processor: {my_system.processor}" ) |
Output:
System: Windows Node Name: LAPTOP-PRKUI1Q9 Release: 10 Version: 10.0.18362 Machine: AMD64 Processor: Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
Get Your System Information – Using Python Script
Getting system information for your system can easily be done by the operating system in use, Ubuntu let’s say. But won’t it be fun to get this System information using Python script? In this article, we will look into various ways to derive your system information using Python.
There are two ways to get information:
- Using Platform module
- subprocess