Spaces:
Sleeping
Sleeping
pr13 (#13)
Browse files- modify9 (7db92442e135f2081fcc2d318bbd36471e73eed6)
app.py
CHANGED
@@ -1,12 +1,18 @@
|
|
1 |
import streamlit as st
|
2 |
import time
|
3 |
|
4 |
-
def
|
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=
|
30 |
|
31 |
with col2:
|
32 |
-
clear = st.form_submit_button(
|
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 |
|