What does the Stop button by the menu bar do?

Hello Streamlit community!

I’m new to Streamlit and loving the experience so far, I was able to create an interface so quickly and painlessly!

As we are testing the interface, we noticed that the process is still running after we click the Stop button at the top right corner of the page, the one appears if there is any process ongoing. By its location we expect it to stop the execution when clicked.

After some reading I’ve learned that there is a stop button I can implement, but it seems it is a separate button from the aforementioned one.

Is there any additional implementation needed for the Stop button by the menu bar to function as intended? Or I misunderstood its functionality?

Thanks in advance!

Hi @owlight, welcome to the Streamlit community!

As I understand it, the Stop button works in the same way you might have for the operating system, which is to say it sends a signal that the process should be stopped. Unfortunately, depending on the process, the computer/server might not respond right away.

st.stop is a different type of functionalty, where you want your code to stop executing upon some condition. For example, you might have a game where once the solution is reached, you terminate a while loop. So you’re right, the difference between this and the menu button are for different things.

Best,
Randy

2 Likes

Hi @randyzwitch,

This is definitely is a weird niche topic, so thank you so much for taking your time and providing detailed clarification! Love it!

Thank you! :slight_smile:

2 Likes