import streamlit as st
# Title of the application
st.title("My Streamlit App")
# Header
st.header("Welcome to my app!")
# Subheader
st.subheader("This is a demo of Streamlit")
# Text
st.write("Streamlit is great for building interactive web applications.")
# Markdown
st.markdown("## Instructions")
st.markdown("1. Enter your name in the text box on the left.")
st.markdown("2. Click the 'Submit' button.")
# Text Input
name = st.text_input("Enter your name")
# Button
submit_button = st.button("Submit")
# Check if the button is clicked
if submit_button:
st.write(f"Hello, {name}!")
# Display an image
st.image("path/to/image.png", caption="Image Caption")
# Display a dataframe
import pandas as pd
data = {'Name': ['John', 'Jane', 'Mike'],
'Age': [25, 30, 35]}
df = pd.DataFrame(data)
st.dataframe(df)
# Display a plot
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4, 5])
st.pyplot(plt)
# Display a map
import folium
map_data = pd.DataFrame({'lat': [37.7749], 'lon': [-122.4194]})
st.map(map_data)
# Display progress bar
import time
progress_bar = st.progress(0)
for i in range(100):
time.sleep(0.1)
progress_bar.progress(i + 1)
# Display a selectbox
option = st.selectbox("Choose an option", ["Option 1", "Option 2", "Option 3"])
st.write("You selected:", option)