def save_and_log_out():
        
    '''Function  to overwrite the account file with the current state of
       the account object (i.e. including any new transactions), remove
       all widgets and display the login screen.'''
    global account

    # Save the account with any new transactions
    #print(account)
    account.save_to_file()
    
    # Reset the bank acount object
    account = BankAccount()

    # Reset the account number and pin to blank
    account.account_number = ''
    account.pin_number = ''
    

    # Remove all widgets and display the login screen again    
    remove_all_widgets()
    create_login_screen()