Hello Streamlit experts,
I am fairly new to using Streamlit, so excuse me if my query seems very basic. I am trying to achieve the following:
- Get input from user
- On click of a button, run a function (say func1) which uses the input from user
3.The func1 gives a list as output. Display the list as options from which the user can choose. - After all options are selected, display the options.
I have used the following code to achieve the above:
import streamlit as st
import SessionState
session_state = SessionState.get(name="", button_sent=False)
button_sent = st.button("SUBMIT")
if button_sent:
session_state.button_sent = True
if session_state.button_sent:
temp_list = func1(<input paramters>)
for num,name in enumerate(temp_list):
options = st.checkbox(name, value=False, key=num)
Issue: The problem that I am facing is , whenever I select an option from the list, the list is displayed again. That is , if there are 5 elements in the list, on selection of 1 item, 10 items get displayed ( the same 5 repeated again)
If there is any clearer way to achieve what is needed, please do let me know.
Thanks in advance