def get_os_info(filepath='/etc/os-release'):
 if os.path.isfile(filepath):
  (os_name, os_version) = get_systemd_os_info(filepath=filepath)
  if os_name:
   return (os_name, os_version)
 return get_python_os_info()

def get_os_info ( filepath = '/etc/os-release' ) : if os . path . isfile ( filepath ) : ( os_name , os_version ) = get_systemd_os_info ( filepath = filepath ) if os_name : return ( os_name , os_version ) return get_python_os_info ( )
get os name and version .