Streamlit tools
git+https://github.com/Hu-Wentao/st_tools.git
or
pip install git+https://github.com/Hu-Wentao/st_tools.git
import streamlit as st
from st_tools import tool_s_state
# 0. Define
def s_count(update: int = None, init=lambda: 2) -> int:
return tool_s_state(
update, 's_count',
init=init
)
# 1. setter
s_count(1)
# 2. getter
value = s_count()
# show
st.write(value)
import streamlit
from st_tools.widgets import st_path_selector
_path = st_path_selector(path='./')
streamlit.write(f"You Selected# {_path}")