๐Ÿ’ŽStreamlit Application #2

Our Application Preview

Screenshot of our app

Explanation

External Dependencies

AI-generated code. Review and use carefully. More info on FAQarrow-up-right.

  • 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