diff --git a/PasswordGenerator.py b/PasswordGenerator.py index 4bd5f62..3b31624 100644 --- a/PasswordGenerator.py +++ b/PasswordGenerator.py @@ -463,7 +463,7 @@ def __exists_checker__(FilePath) -> None: font='ANSI Shadow') + Fore.RESET) # ======== # getting all file name from user # ======== # - all_password_list_contents: list = list() + FilesContents: list = list() try: file_name: str = input( Fore.MAGENTA + '\n1 - Enter your file path -> ' + Fore.RESET) @@ -480,7 +480,7 @@ def __exists_checker__(FilePath) -> None: exit(Fore.RED + f'We don\'t have permission to read the {file_name} file' + Fore.RESET) #The last line doesn't have \n so when it sorted it will connect to another item FileData[-1] +='\n' - all_password_list_contents.extend(FileData) + FilesContents.extend(FileData) # getting name of the file from user input_number = 2 @@ -504,7 +504,7 @@ def __exists_checker__(FilePath) -> None: #The last line doesn't have \n so when it sorted it will connect to another item FileData[-1] = FileData[-1] +'\n' - all_password_list_contents.extend(FileData) + FilesContents.extend(FileData) user_request: str = input( Fore.YELLOW + '\nWant to add more password list ? [Y/n] ' + Fore.RESET) if user_request.lower() == 'y' or user_request.lower() == 'yes' or user_request == '': @@ -521,7 +521,7 @@ def __exists_checker__(FilePath) -> None: if path.exists(__file__.replace('PasswordGenerator.py', 'passwords.txt')): __rename_if_file_exist__() with open(__file__.replace('PasswordGenerator.py', file_name), 'w') as f: - f.writelines(all_password_list_contents) + f.writelines(FilesContents) print(Fore.YELLOW + 'Your file save as : ' + __file__.replace('PasswordGenerator.py', file_name) + Fore.RESET) print(Fore.GREEN + 'Done !' + Fore.RESET)