Spaces:
Sleeping
Sleeping
Commit
•
345cd4f
1
Parent(s):
148de08
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
def generate_blog_title(name, audience, word_count):
|
4 |
+
title = f"**Title:** {name} - A {audience} Guide to {word_count} Words"
|
5 |
+
return title
|
6 |
+
|
7 |
+
def main():
|
8 |
+
st.title("Blog Title Generator")
|
9 |
+
|
10 |
+
st.sidebar.header("Input Parameters")
|
11 |
+
name = st.sidebar.text_input("Name of the Blog", "10 Tips for Success")
|
12 |
+
audience = st.sidebar.selectbox("Intended Audience", ["Beginner", "Intermediate", "Expert"])
|
13 |
+
word_count = st.sidebar.number_input("Word Count", min_value=100, max_value=5000, value=100, step=100)
|
14 |
+
|
15 |
+
if st.sidebar.button("Generate Title"):
|
16 |
+
blog_title = generate_blog_title(name, audience, word_count)
|
17 |
+
st.success(blog_title)
|
18 |
+
|
19 |
+
if __name__ == "__main__":
|
20 |
+
main()
|