INNER CODE UNIT · Python

python_version

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

def python_version():
    "Get the python version"
    try:
        return sys.version.split('(')[0].rstrip()
    except (AttributeError, IndexError) as e:
        return str(e)


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)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…