Team Ai
Apppublic

Ajay1100/numpy

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
app.py25 linesDownload Raw Back to root
1import streamlit as st2 3# Initialize session state for navigation4if "current_page" not in st.session_state:5    st.session_state.current_page = "Page 1"6 7# Function to navigate to the next page8def navigate_to(page):9    st.session_state.current_page = page10 11# Render content based on the current page12if st.session_state.current_page == "Page 1":13    st.title("Welcome to Page 1")14    st.write("This is the first page.")15    if st.button("Go to Page 2"):16        navigate_to("pages/1.dog.py")17        st.experimental_rerun()18 19elif st.session_state.current_page == "Page 2":20    st.title("Welcome to Page 2")21    st.write("You navigated here from Page 1.")22    if st.button("Go back to Page 1"):23        navigate_to("pages/1.dog.py")24        st.experimental_rerun()25