How do I update the “options” of the selectbox dynamically?
Here is a mockup that I created. In the below mockup, I can only set the value for “options” only after I have fetched the data.
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 list of options in select box do not update