Skip to content

Instantly share code, notes, and snippets.

@leomaurodesenv
Created June 18, 2020 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leomaurodesenv/5ff5bc8c27a0dcfdd1d54376f9665d0b to your computer and use it in GitHub Desktop.
Save leomaurodesenv/5ff5bc8c27a0dcfdd1d54376f9665d0b to your computer and use it in GitHub Desktop.
Streamlit pagination
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