Menu Close

Python Platform Module

Python Platform Module

In this guide, we are going to learn about the Python Platform module. Platform module is a built-in module in Python programming which is used to retrieve the system information.

In the previous tutorial, we have seen all about the Python base64 module. If you get the information about the system or machine, Then the Python platform is the best module.

What is Python Platform Module?

In Python, Platform is a built-in Python module that means you don’t need to install this module using the pip command.
Python platform module is used to access underlying’s data of the machine or system such as hardware, interpreter version, and operating system, etc.

How to Use Python Platform Module?

As you know, the platform is a built-in Python module, Which means the Platform comes pre-installed with Python. To use the Platform module, you have to import it using the import keyword.

import platform

Python Platform Module Function:

In Python programming, the Platform module provides various useful functions that are used to get information about your system.


The platform.architecture() function return the information about system architecture.

import platform
x = platform.architecture()

Output will be:- (’32bit’, ‘WindowsPE’)


The platform.machine() function return the information about machine type.

import platform
x = platform.machine()

The output will be:- x86


The platform.node() function returns the computer network name.

import platform
x = platform.node()

The output will be:- DESKTOP-00V9AQU


The platform.platform() function returns a single string that identifies the underlying platform.

import platform
x = platform.platform()

The output will be:- Windows-10-10.0.18362-SP0


The platform.processor() function returns the processor.

import platform
x = platform.processor()

The output will be:- x86 Family 6 Model 37 Stepping 2, GenuineIntel


The platform.python_build() function returns the python build number and date as a string.

import platform
x = platform.python_build()

Output will be:- (‘v3.7.1:260ec2c36a’, ‘Oct 20 2018 14:57:15’)


The platform.python_compiler() function returns the compiler used for compiling Python.

import platform
x = platform.python_compiler()

The output will be:- MSC v.1926 32 bit (Intel)


The platform.python_implementation() function return the string identify the python implementation.

import platform
x = platform.python_implementation()

The Output will be:- CPython


The platform.python_version() function return the python version.

import platform
x = platform.python_version()

Output will be:- 3.8.5

The platform.release()

The platform.release() function return the system release.

import platform
x = platform.release()

Output will be:- 10


The platform.system() function return the system name.

import platform
x = platform.system()

Output will be:- Windows


The platform.version() function return the system version.

import platform
x = platform.version()

Output will be:- 10.0.18362


The platform.uname() function returns the combination of system, node, release, processor, version, and machine.

import platform
x = platform.uname()

Output will be:- uname_result(system=’Windows’, node=’DESKTOP 00V9AQU’, release=’10’, version=’10.0.18362′, machine=’x86′, processor=’x86 Family 6 Model 37 Stepping 2, GenuineIntel’)


The platform.win32_ver() function returns the tuple that contains additional information such as OS release, OS version, service pack, and OS Type.

import platform
x = platform.win32_ver()

Output will be:- (’10’, ‘10.0.18362’, ‘SP0’, ‘Multiprocessor Free’)


The platform.libc_ver() function return the tuple additional information such as library and version.


The platform.mac_ver() function returns the tuple additional information such as release, version, and machine of Mac OS.

Note:- All the output comes according to our operating system. It might be different in your case.


In this article, you have learned the Python Platform module. The platform module is the best Python built-in module to get information about the system.
if you want to work with the system, Then you can go with the Python platform module.

I hope this tutorial will help you. If you like this article, please share it with your friends who want to learn Python programming from scratch to advanced.

For More Information: Click Here

Python HTML Module Tutorial
Python Array Module Tutorial

Related Posts