For Unix OS
platform.libc_ver()
This function returns a tuple storing information such as library and version of the Unix OS. The output is in the following manner:
(lib, version)
Platform Module in Python
Python defines an in-built module platform that provides system information.
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.
This module already exists in the python library and does not require any installation using pip.
It can be imported using the following syntax:
import platform
Example 1: Displaying the platform processor
# Python program to display platform processor # import module import platform # displaying platform processor print ( 'Platform processor:' , platform.processor()) |
Output:
Contact Us