def get_platform():
    """get Mac OS X version or kernel version if mac version is not found"""
    mac_version = str(platform.mac_ver()[0]).strip()    # e.g. 10.11.2
    if mac_version:
        return 'OS X %s' % mac_version
    return platform.platform().strip()
get Mac OS X version or kernel version if mac version is not found