AjayKr09's picture
Update app.py
07dcb77 verified
raw
history blame
616 Bytes
import streamlit as st
def page1():
st.write("This is Page 1!")
def page2():
st.write("This is Page 2!")
# Create a Streamlit app
app = st.StreamlitApp()
# Define the main app logic
def main():
st.title("Welcome to My App")
# Create two buttons
button1 = st.button("Go to Page 1")
button2 = st.button("Go to Page 2")
# Use Streamlit's routing feature to navigate between pages
if button1:
app.page("page1")
elif button2:
app.page("page2")
# Register the pages with Streamlit
app.page("page1", page1)
app.page("page2", page2)
# Run the main app logic
main()