INNER CODE UNIT · Python

system_name

fralau/mkdocs-macros-plugin · mkdocs_macros/context.py:202

def system_name():
    "Get the system name"
    r = platform.system()
    if not r:
        # you never know
        return "<UNKNOWN>"
    # print("Found:", r)
    CONV = {'Win': 'Windows', 'Darwin': 'MacOs'}
    return CONV.get(r, r)


def system_version():
    "Get the system version"
    try:
        return platform.mac_ver()[0] or platform.release()
    except (AttributeError, IndexError) as e:
        return str(e)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…