Python platform Module
Example
Get information about the current Python and OS:
import platform
print(platform.system())
print(platform.python_version())
Try it Yourself »
Definition and Usage
The platform module reports details about the running interpreter and operating system.
Use it to show OS name and release, CPU info, and Python version/implementation.
Members
Member | Description |
---|---|
architecture() | Identify the bit architecture of the current executable. |
machine() | Return the machine type (e.g. 'x86_64' ). |
node() | Return the network name (hostname) of this computer. |
platform() | Return a single string with a compact OS + Python description. |
processor() | Return the (vendor-specific) CPU description string. |
python_build() | Return a tuple with build number and date of this Python. |
python_implementation() | Return the Python implementation (CPython, PyPy, etc.). |
python_version() | Return the Python version as a string. |
release() | Return the system’s release level. |
system() | Return the system/OS name (e.g. 'Windows' , 'Linux' ). |
version() | Return the system’s version string. |