How to stop streamlit to reseting after using .radio?

Viewed 16

I have this code(A sample of a larger one).

import streamlit as st
from PIL import Image
import datetime as dt
from streamlit_option_menu import option_menu

img_16 = Image.open("PATH/81.png")
with st.container():
    st.write("---")
    left_column, middle_column, right_column = st.columns(3)

    with left_column:
        st.subheader(16) 
        st.image(img_16)       
        if st.button("Click me ⤵️",key=16):
            st.write("""
            Team:    ABC\n
            """ )
            st.write("---")

            condition_now = st.radio(label = "Have a live ",options = ["ichi", "ni", "san"])
            st.write('<style>div.row-widget.stRadio > div{flex-direction:row;}</style>', unsafe_allow_html=True)
            if condition_now == "ichi":
                st.write("ichi da!")
            elif condition_now == "ni":
                st.write("ni da!")
            else:
                st.write("san?")

After clicking the "click me" button I want to choose one one the radio buttons, yet when I click on any radio button all will dissapear or get rest. How can I stop resetting?

The st.session_stat could be the key, but couldn't figure how.

0 Answers
Related