def login(acc_list): login_id = input( 'Please, Enter your info(press "Ctrl+C" to go back) \n>>ID: ') login_password = input('>>Password: '******'Wrong ID or Password') login(acc_list) else: acc_file = open('Accounts.txt', 'w') print('Saving changes...') # after logging out of the account # write changes to accounts.txt file for acc in acc_list: for elements in acc: acc_file.write("%s\t" % elements) acc_file.write('\n')
def menu1(): print('>>>>>>>>WELCOME<<<<<<<<\n') choice = int(input('1) Login\n2) Create Account\n3) Exit\n\nchoice>> ')) if choice == 1: clear_screen() try: # to enable the option of (ctrl+c) to go back login(accounts_list) except KeyboardInterrupt: clear_screen() elif choice == 2: create_account(accounts_list) elif choice == 3: # close the program exit(0) else: clear_screen() print("ERROR: Wrong choice\n") menu1()