The Platform Module in Python

·

The platform module in Python provides access to system information such as the OS name, version, and Python version. For example, to get the system’s platform name, use:

import platform
print(platform.system())

You can also get the Python version using:

print(platform.python_version())

The platform module is useful when writing cross-platform applications, where system-specific information is required.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *