💎Streamlit Application #2
Our Application Preview
Explanation
External Dependencies
AI-generated code. Review and use carefully. More info on FAQ.
Streamlit is imported to create the web interface.
Random is imported to generate random characters for the password.
Initializations
These lists represent ASCII values for different character sets:
lowercase
: ASCII values for ‘a’ to ‘z’.uppercase
: ASCII values for ‘A’ to ‘Z’.digits
: ASCII values for ‘0’ to ‘9’.special
: ASCII values for special characters like!
,@
,#
, etc.
Streamlit App
Sets up the header and description for the app.
User Inputs
size: Input for the length of the password (minimum 8 characters).
has_upper: Toggle for including uppercase letters.
has_digit: Toggle for including digits.
has_special: Toggle for including special characters.
make_pwd: Button to generate the password.
Password Generation
Condition: Checks if the button is clicked and the size is at least 8.
Options Update: Adds selected character sets to the options list.
Password Loop: Generates a password by randomly selecting characters from the options list until it reaches the desired length.
Display: Shows the generated password.
Reset: Resets the options list for reuse.
Code
Last updated