Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
# Set the title of the app
|
| 4 |
+
st.title("Basic Streamlit App")
|
| 5 |
+
|
| 6 |
+
# Display a header
|
| 7 |
+
st.header("Welcome to Streamlit!")
|
| 8 |
+
|
| 9 |
+
# Add a text input widget
|
| 10 |
+
user_input = st.text_input("Enter your name:")
|
| 11 |
+
|
| 12 |
+
# Display the user's input
|
| 13 |
+
if user_input:
|
| 14 |
+
st.write(f"Hello, {user_input}!")
|
| 15 |
+
|
| 16 |
+
# Add a slider widget
|
| 17 |
+
age = st.slider("Select your age:", 0, 100, 25)
|
| 18 |
+
|
| 19 |
+
# Display the selected age
|
| 20 |
+
st.write(f"You are {age} years old.")
|
| 21 |
+
|
| 22 |
+
# Add an image
|
| 23 |
+
st.image("https://via.placeholder.com/150", caption="Sample Image")
|