Mia2024 commited on
Commit
c9e23c5
·
verified ·
1 Parent(s): a16ad43
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -1,12 +1,18 @@
1
  import streamlit as st
2
  import time
3
 
4
- def form_callback():
5
  st.write(st.session_state.product)
6
  st.write(st.session_state.gender)
7
  st.write(st.session_state.profession)
8
  st.write(st.session_state.hobby)
9
 
 
 
 
 
 
 
10
  with st.form("my_input"):
11
  st.write("Input")
12
  # product
@@ -26,10 +32,10 @@ with st.form("my_input"):
26
 
27
  # Place a button in each column
28
  with col1:
29
- submitted = st.form_submit_button(label='Submit', on_click=form_callback)
30
 
31
  with col2:
32
- clear = st.form_submit_button("Clear")
33
 
34
 
35
 
 
1
  import streamlit as st
2
  import time
3
 
4
+ def submit_callback():
5
  st.write(st.session_state.product)
6
  st.write(st.session_state.gender)
7
  st.write(st.session_state.profession)
8
  st.write(st.session_state.hobby)
9
 
10
+ def delete_callback():
11
+ del st.session_state.product
12
+ del st.session_state.gender
13
+ del st.session_state.profession
14
+ del st.session_state.hobby
15
+
16
  with st.form("my_input"):
17
  st.write("Input")
18
  # product
 
32
 
33
  # Place a button in each column
34
  with col1:
35
+ submitted = st.form_submit_button(label='Submit', on_click=submit_callback)
36
 
37
  with col2:
38
+ clear = st.form_submit_button(label='Clear', on_click=delete_callback)
39
 
40
 
41