Avoid rerunning for intermediate values for number_input, slider etc

Hi @ansks,

All your questions sound similar in that case and I’d refer you again to the post at Have a widget not trigger an immediate update? for a comprehensive discussion on approaches and possible solutions.

One way to do it is to put all your heavy calculations behind an st.button().

if st.button('button'):
   ... heavy calculations ...

If there is something that is not working for you after following one of the approaches please let us know!

2 Likes