-
Notifications
You must be signed in to change notification settings - Fork 3
Description
In the Password_Generator_v1.1.0.py file, when the "Generate" button is clicked without selecting any options (Ascii, Punctuation, Digits), there is no error message displayed to notify the user about the requirement of selecting at least one option.
Steps to Reproduce:
- Run the
Password_Generator_v1.1.0.pyfile. - Leave all the checkboxes (Ascii, Punctuation, Digits) unchecked.
- Click on the "Generate" button.
Expected Behavior:
An error message should be displayed, informing the user that at least one option needs to be selected.
Actual Behavior:
No error message is shown, and the program continues without generating a password.
Proposed Solution:
To improve the user experience and provide clear feedback, it is recommended to add an error message when no option is selected. This can be achieved using the tkinter.messagebox module to display a messagebox with an appropriate error message.
import tkinter.messagebox as messagebox
# Inside the generate_func() function
if check1var.get() == 0 and check2var.get() == 0 and check3var.get() == 0:
messagebox.showinfo("Error", "Please select at least one option!")By adding this code snippet, an error messagebox will be displayed when the user tries to generate a password without selecting any option. The message will prompt the user to select at least one option before generating the password.