()
Get the current user name.
Get the current user name.
Get the current user name .
def get_user_name():
    """Get the current user name."""
    if _user_name_override is not None:
        return _user_name_override
    elif platform.system() == "Windows":
        return os.getlogin()
    elif platform.system() == "Linux":
        try:
            import pwd
            return pwd.getpwuid(os.geteuid()).pw_name
        except:
            return "unknown"
    else:
        raise RuntimeError("Unknown platform")
def get_user_name ( ) : if _user_name_override is not None : return _user_name_override elif platform . system ( ) == "Windows" : return os . getlogin ( ) elif platform . system ( ) == "Linux" : try : import pwd return pwd . getpwuid ( os . geteuid ( ) ) . pw_name except : return "unknown" else : raise RuntimeError ( "Unknown platform" )