File size: 490 Bytes
5e55a06
 
 
 
2fdfcc2
5e55a06
8ad83f6
2fdfcc2
 
 
5e55a06
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import streamlit as st
from streamlit_extras.switch_page_button import switch_page 
import os

pages = ["Overall"]

files = os.listdir('pages')
for name in files:
    name = name.split()[1].replace('.py', '').replace('_', ' ')
    pages.append(name)


def st_page_selectbox(current_page):
    current_index = pages.index(current_page)
    selected_page = st.selectbox("Select a category", pages, index=current_index)
    if selected_page != current_page:
        switch_page(selected_page)