I am using Streamlit and is very good so far.
I have a simple setup where on the left bar I have a list of files that been uploaded:
def original_file_selector(folder_path=UPLOAD_ORIGINAL_FOLDER): filenames = os.listdir(folder_path) selection = st.sidebar.selectbox('Original file', tuple(filenames)) return selection filename_old = original_file_selector()
And then I have a button to upload a new file:
uploaded_file = st.file_uploader("File type", type=['xlsx', 'csv'])
Now the problem is that after the file is uploaded I want to be able to refresh the filename_old options without telling the user to hit a page refresh (which will loose all the input values even if I use SessionState trick).
I tried something like this:
filename_old.options([list of files]) but that is not a method of the object so I am not sure how to achieve this.
Any help would be great.