def existing_user_view(): """ User is directed here if they choose that they are an existing user In this function, user enters a password and user name And these are validated through calls to the database. If they are acceptable, they enter the database viewer, if they are not, They are returned to the main menu :return: """ screen = curses.initscr() screen.clear() screen.addstr(5, 5, 'Enter Username:'******'Enter Password:'******'Logging you in...') screen.refresh() time.sleep(2) dashboard_database.database_menu(username) else: screen.addstr(11, 5, 'Invalid username/password. Try again...') screen.refresh() time.sleep(2) dashboard_program.main_menu()
from utility_user import validate_user if __name__ == "__main__": test_user = raw_input('Enter test username: '******'Enter test password: ') if validate_user(test_user, test_password) is True: print "Valid username and password" else: print "Invalid username and password"