What I’m trying to do is to create a
text_area that can be filled by hand or by a random value. I have two buttons one to insert a random number on the text area and another to write down the text inside it. This is the code:
st.write( """ # Biopsias classification demo """ ) print(st.session_state) text_area = st.empty() text = text_area.text_area("Text to analyze", "Write a number") button1 = st.button("Random") button2 = st.button("Run") if button1: text = text_area.text_area("Text to analyze", str(random.random())) if button2: st.write(text)
The random button works because it changes the value inside the
text_area, but when I click on
Run it always write “Write a number”.