Created
June 18, 2020 15:21
-
-
Save leomaurodesenv/5ff5bc8c27a0dcfdd1d54376f9665d0b to your computer and use it in GitHub Desktop.
Streamlit pagination
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import numpy as np | |
#------------------------------------------------------ | |
#-- Side bar | |
#------------------------------------------------------ | |
st.sidebar.markdown('## Pagination') | |
pagSelected = st.sidebar.radio('Choose a page: ', ['A','B','Crash']) | |
#------------------------------------------------------ | |
#-- Web App | |
#------------------------------------------------------ | |
st.write('# Pagination Example') | |
def pageA(): | |
st.write('## Page A') | |
st.write('Example..') | |
def pageB(): | |
st.write('## Page B') | |
st.write('Example.. Again?') | |
#-- Main pagination | |
def main(selection): | |
if selection == 'A': | |
pageA() | |
elif selection == 'B': | |
pageB() | |
else: | |
st.write('## Error 404') | |
st.write('Thanks for testing!') | |
if __name__ == '__main__': | |
main(pagSelected) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment