def prompt_for_new_password():
    """ Prompt the user to enter a new password, with confirmation """
    while True:
        passw = getpass.getpass()
        passw2 = getpass.getpass()
        if passw == passw2: return passw
        print 'Passwords do not match'
Prompt the user to enter a new password, with confirmation