立即停止执行。
Streamlit 不会在 st.stop()
之后运行任何语句。我们建议呈现一条消息来解释脚本停止的原因。在 Streamlit 之外运行时,这将引发异常。
函数签名
st.stop()
示例
name = st.text_input('Name')
if not name:
st.warning('Please input a name.')
st.stop()
st.success('Thank you for inputting a name.')
相关用法
- Python Streamlit st.slider用法及代码示例
- Python Streamlit st.spinner用法及代码示例
- Python Streamlit st.subheader用法及代码示例
- Python Streamlit st.success用法及代码示例
- Python Streamlit st.set_page_config用法及代码示例
- Python Streamlit st.selectbox用法及代码示例
- Python Streamlit st.select_slider用法及代码示例
- Python Streamlit st.snow用法及代码示例
- Python Streamlit st.experimental_singleton.clear用法及代码示例
- Python Streamlit st.bokeh_chart用法及代码示例
- Python Streamlit st.caption用法及代码示例
- Python Streamlit st.text_input用法及代码示例
- Python Streamlit st.area_chart用法及代码示例
- Python Streamlit st.title用法及代码示例
- Python Streamlit st.cache用法及代码示例
- Python Streamlit st.experimental_singleton用法及代码示例
- Python Streamlit st.empty用法及代码示例
- Python Streamlit st.error用法及代码示例
- Python Streamlit st.video用法及代码示例
- Python Streamlit st.vega_lite_chart用法及代码示例
- Python Streamlit st.header用法及代码示例
- Python Streamlit st.container用法及代码示例
- Python Streamlit st.form_submit_button用法及代码示例
- Python Streamlit st.form用法及代码示例
- Python Streamlit st.plotly_chart用法及代码示例
注:本文由纯净天空筛选整理自streamlit.io大神的英文原创作品 st.stop。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。