platform.system()
platform.system() is a Python function in the Platform Module category. Returns the OS/system name (Linux, Windows, Darwin, Java). The syntax is platform.system(). Returns: System name string. A typical example: import platform
platform.system() # "Linux" or "Windows" or "Darwin". A close sibling is platform.release(), which returns the system release version. A close sibling is platform.version(), which returns the system version string. A close sibling is platform.machine(), which returns the machine type (x86_64, arm64, etc.). A close sibling is platform.processor(), which returns the processor type (may return empty string). More about this category: System platform info — system, release, python_version, uname. Related Platform Module entries: platform.release(), platform.version(), platform.machine(), platform.processor(), platform.python_version(), platform.python_version_tuple(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try platform.system() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.