Add the ability to programatically re-run the streamlit script
See original GitHub issueProblem
I am building a small labeling too where I read in an example, the user will select labels from a list of check boxes and click submit in order to save the labels, when they submit a field in the data for it being labeled is added so in the next read it skips that example. The problem is that the submit button will cause a rerun where the labels are collected and saved but it doesn’t cause another re-run that will cause the data to be reread (this will move the app on to the next question)
Solution
I think a solution would be a st.rerun()
function that you can call to reexecute the script from the top. In my cause this would be called after my save and trigger a re-read. Basically it would do the same thing I am currently using a second Next
button for but remove the need for user interaction.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:14
- Comments:34 (21 by maintainers)
Top GitHub Comments
The code for this has changed to:
A neater fix seems to be the following:
Worked this out from the comment written over at:
Meaning, passing
None
toRerunData
defaults to no change in state.