Download app.py from ricklon/multipage: direct link, hf CLI and curl.
- Browser
- Download file 764 Bytes
-
https://huggingface.co/spaces/ricklon/multipage/resolve/main/app.py
- Command line
-
hf download hf://spaces/ricklon/multipage/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ricklon/multipage/resolve/main/app.py
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') | |