Skip to content

Instantly share code, notes, and snippets.

@goraj
goraj / st_rerun.py
Last active April 2, 2021 19:15 — forked from demmerichs/st_rerun.py
Rerun a Streamlit 0.57.3 app from the top! See https://discuss.streamlit.io/t/update-sidebar/531
import streamlit.ReportThread as ReportThread
from streamlit.ScriptRequestQueue import RerunData
from streamlit.ScriptRunner import RerunException
from streamlit.server.Server import Server
def rerun():
"""Rerun a Streamlit app from the top!"""
widget_states = _get_widget_states()
raise RerunException(RerunData(widget_states))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.