def get_username(prompt="Enter username: ", defaultUser=None):
    user = raw_input(prompt)
    while not len(user):
        if defaultUser:
            user = defaultUser
        else:
            user = raw_input("  You must enter a username: ")
    return user
Prompt for a username, allowing pre-populated *defaultUser*.
dataset/ETHPy150Open ryran/ravshello/rav-notify.py/get_username