How do I update the value of selectbox in streamlit dynamically?
here is a minimum non-working example
import streamlit as st
import time
def main():
st.session_state['choice'] = list(range(2))
st.selectbox("myoptions", options=st.session_state['choice'])
while True:
st.session_state['choice'] = list(range(5))
time.sleep(2)
The reason I try to do this is to simulate the process of fetching new data and then updating the options.
In reality, i'll update the options every hour or so