Fix the user_input problem

#1
by Youssefk - opened
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -19,9 +19,12 @@ st.write("version : alpha 0.0.1")
19
  # creating a single-element container
20
  placeholder = st.empty()
21
 
22
- user_input = st.text_input("What do you do or say ?")
 
 
 
23
  if user_input :
24
- child.sendline(str(user_input))
25
  user_input=""
26
 
27
  while True:
 
19
  # creating a single-element container
20
  placeholder = st.empty()
21
 
22
+ st.session_state["saved_text"] = st.session_state["text"]
23
+ st.session_state["text"] = ""
24
+
25
+ user_input = st.text_input("What do you do or say ?",key = "text")
26
  if user_input :
27
+ child.sendline(str(st.session_state["saved_text"]))
28
  user_input=""
29
 
30
  while True: