my_area = st.text_area(":blue[My text here :]",height=2000)
new_text = My_function(my_area)
my_area = st.text_area(":blue[My text here :]",new_text,height=2000)
I’m not entirely clear on the flow you want, but one way to accomplish this is to set the default value of your textbox to be based on a value in st.session_state, and then update that value in the session state and rerun the app
import streamlit as st
if "default" not in st.session_state:
st.session_state["default"] = "Default text" * 100
my_area = st.text_area(
":blue[My text here :]", value=st.session_state["default"], height=2000
)
if st.button("Update default example"):
st.session_state["default"] = "Updated text" * 100
st.experimental_rerun()