Spaces:
Build error
Build error
| import streamlit as st | |
| import pandas as pd | |
| import random as rd | |
| st.set_page_config( | |
| page_title="Random Password Generator", | |
| page_icon="🔐", | |
| layout="wide") | |
| url = "https://raw.githubusercontent.com/charlesreid1/five-letter-words/master/sgb-words.txt" | |
| df = pd.read_csv(url, delimiter=None, header=None, names=['Word']) | |
| words_len = df.shape[0] | |
| st.title("Random Password Generator") | |
| st.info("This is a simple random password generator. It uses a list of 5 letter words and symbol to generate a password.") | |
| password_length = st.text_input("How Many Words Will You Generate? ", 3) | |
| symbol = st.text_input("Attach Symbol: ", "@") | |
| df['Word'] = df['Word'].astype(str) | |
| if st.button("Generate Password"): | |
| random_number = rd.randint(0, words_len) | |
| password = df['Word'].sample(int(password_length)).str.cat(sep=symbol) + symbol + str(random_number) | |
| st.write("Your Password is: " + password.capitalize()) |