import getpass


def username(default=''):

    """ Return the user name of the user running the current process.

        If no user name can be determined, default is returned.

    """
    try:
        return getpass.getuser()
    except:
        return default