st.stop
Stops execution immediately.
Streamlit will not run any statements after st.stop(). We recommend rendering a message to explain why the script has stopped.
| Function signature[source] | |
|---|---|
st.stop() |
Example
import streamlit as st
name = st.text_input("Name")
if not name:
st.warning('Please input a name.')
st.stop()
st.success("Thank you for inputting a name.")
Tip
Want a new st.stop feature or found a bug? Browse open issues and react with a 👍 on the initial post of the ones that matter to you. Your votes help us prioritize what to work on next.
Still have questions?
Our forums are full of helpful information and Streamlit experts.