multipage / app.py
ricklon's picture
Update app.py
a7b5082 verified
raw
history blame contribute delete
764 Bytes
import streamlit as st
# Optionally, set the initial configuration of the app or display a welcome message
st.set_page_config(page_title="My Multi-Page App", page_icon=":rocket:", layout="wide")
# The actual navigation and page content are handled by Streamlit's automatic page discovery
st.write("App!")
st.write("Testing multipage")
st.write("If Data from Page1:")
# Displaying shared data from Page 1
if 'shared_data' in st.session_state:
st.write(f"Data from Page 1: {st.session_state['shared_data']}")
# Button to go back to Page 1
if st.button('Back to Page 1'):
st.switch_page('pages/page1.py')
# Button to navigate to Page 2 and pass data
if st.button('Go to Page 2 with Data'):
# Navigating to Page 2
st.switch_page('pages/page2.py')