platform module

A standard module that reports facts about the host: its operating system, hardware and Python build.

In more detail

platform.system(), machine(), processor(), version() and platform() describe the operating system and hardware as strings. python_implementation() names the interpreter, usually 'CPython', and python_version_tuple() returns three strings. The values depend on where the code runs.

Example

import platform
print(platform.python_version_tuple())   # ('3', '14', '7')

Related terms

Taught in

References

Certification courses