Spaces:
Sleeping
Sleeping
pr14 (#14)
Browse files- modify10 (bf00b5d620df222a062e3603d4272691d049582d)
app.py
CHANGED
@@ -13,41 +13,40 @@ def delete_callback():
|
|
13 |
del st.session_state.profession
|
14 |
del st.session_state.hobby
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
# st.experimental_rerun()
|
51 |
|
52 |
# _LOREM_IPSUM = """
|
53 |
# Lorem ipsum dolor sit amet, **consectetur adipiscing** elit, sed do eiusmod tempor
|
|
|
13 |
del st.session_state.profession
|
14 |
del st.session_state.hobby
|
15 |
|
16 |
+
# Create two columns
|
17 |
+
col1, col2 = st.columns(2)
|
18 |
+
|
19 |
+
# Place a form in each column
|
20 |
+
with col1:
|
21 |
+
with st.form("my_input"):
|
22 |
+
st.write("Input")
|
23 |
+
# product
|
24 |
+
product=st.text_input("product", key="product")
|
25 |
+
# gender
|
26 |
+
gender=st.radio("gender", ["male", "female"], key="gender")
|
27 |
+
# profession
|
28 |
+
profession=st.text_input("profession", key="profession")
|
29 |
+
# hobby
|
30 |
+
hobby=st.text_input("hobby", key="hobby")
|
31 |
+
# Every form must have a submit button.
|
32 |
+
btn1, btn2=st.columns(2)
|
33 |
+
with btn1:
|
34 |
+
submitted = st.form_submit_button(label='Submit', on_click=submit_callback)
|
35 |
+
with btn2:
|
36 |
+
clear = st.form_submit_button(label='Clear', on_click=delete_callback)
|
37 |
+
|
38 |
+
with col2:
|
39 |
+
with st.form("my_output"):
|
40 |
+
st.write("product", st.session_state.product)
|
41 |
+
st.write("gender", st.session_state.gender)
|
42 |
+
st.write("profession", st.session_state.profession)
|
43 |
+
st.write("hobby", st.session_state.hobby)
|
44 |
+
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
|
49 |
+
|
|
|
50 |
|
51 |
# _LOREM_IPSUM = """
|
52 |
# Lorem ipsum dolor sit amet, **consectetur adipiscing** elit, sed do eiusmod tempor
|