File size: 656 Bytes
d205e74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import streamlit as st

# Define the menu structure with labels and their associated script names
menu = {
    "GB-GB": "GB-GB.py",
    "BG": "BG.py",
    "MultiL": "MultiL.py",
}

# Sidebar title
st.sidebar.title("Navigation")

# Initialize session state for selected script
if "selected_script" not in st.session_state:
    st.session_state.selected_script = "GB-GB.py"  # Default script

# Sidebar menu implementation
for label, script in menu.items():
    if st.sidebar.button(label):
        st.session_state.selected_script = script

# Execute the selected script
selected_script = st.session_state.selected_script
exec(open(selected_script).read())