def _save_and_exit(wordlist, path):
    while True:
        try:
            wordlist.save(path=path)
            print('WordList successfully saved, goodbye!')
            break
        except PermissionError:
            print('PermissionError! File may be open in another window.')
            retry = force_console_input('Try again? Y/N: ', ['y', 'yes', 'n', 'no'])
            if (retry[0] == 'y'):
                continue
            else:
                print('Exiting without saving changes.')
def _save_and_exit(wordlist, path):
    while True:
        try:
            wordlist.save(path=path)
            print('WordList successfully saved, goodbye!')
            break
        except PermissionError:
            print('PermissionError! File may be open in another window.')
            retry = force_console_input('Try again? Y/N: ', ['y', 'yes', 'n', 'no'])
            if (retry[0] == 'y'):
                continue
            else:
                print('Exiting without saving changes.')