GameInsightify / module /__selectpage__.py
po5302006's picture
changed __selectpage__ format
f3bfb18
raw
history blame
647 Bytes
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)
pages = [
"Overall",
"Category", "Genre", "DLC Counts", "Price", "Age Restriction",
"Settings", "OS", "Publisher", "Developer",
]
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)