Spaces:
Sleeping
Sleeping
nan-motherboard
commited on
Commit
·
d85ee32
1
Parent(s):
970dd77
modify11
Browse files
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
import streamlit as st
|
2 |
import time
|
3 |
|
4 |
-
def submit_callback():
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
|
10 |
def delete_callback():
|
11 |
del st.session_state.product
|
@@ -13,11 +13,11 @@ def delete_callback():
|
|
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
|
@@ -31,17 +31,23 @@ with col1:
|
|
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 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
|
47 |
|
|
|
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
|
|
|
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
|
|
|
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 |
+
submitted = st.form_submit_button(label='Submit')
|
36 |
with btn2:
|
37 |
clear = st.form_submit_button(label='Clear', on_click=delete_callback)
|
38 |
|
39 |
+
# with col2:
|
40 |
+
_LOREM_IPSUM = "product" + st.session_state.product + "\n"
|
41 |
+
+ "gender" + st.session_state.gender + "\n"
|
42 |
+
+ "profession" + st.session_state.profession + "\n"
|
43 |
+
+ "hobby" + st.session_state.hobby +"\n"
|
44 |
+
|
45 |
+
def stream_data():
|
46 |
+
for word in _LOREM_IPSUM.split(" "):
|
47 |
+
yield word + " "
|
48 |
+
time.sleep(0.02)
|
49 |
+
|
50 |
+
st.write_stream(stream_data)
|
51 |
|
52 |
|
53 |
|