Mia2024 commited on
Commit
a2054cf
·
verified ·
1 Parent(s): 05ec09b
Files changed (1) hide show
  1. app.py +46 -11
app.py CHANGED
@@ -1,13 +1,48 @@
1
  import streamlit as st
 
2
 
3
- x = st.slider('Select a value123456')
4
- st.write(x, 'squared is', x * x)
5
-
6
- # product
7
- product=st.text_input("product")
8
- # gender
9
- gender=st.radio("gender", ["male", "female"])
10
- # profession
11
- profession=st.text_input("profession")
12
- # hobby
13
- hobby=st.text_input("hobby")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
+ import time
3
 
4
+ with st.form("my_form"):
5
+ st.write("Input")
6
+ # product
7
+ product=st.text_input("product")
8
+ # gender
9
+ gender=st.radio("gender", ["male", "female"])
10
+ # profession
11
+ profession=st.text_input("profession")
12
+ # hobby
13
+ hobby=st.text_input("hobby")
14
+
15
+
16
+
17
+ # Every form must have a submit button.
18
+ submitted = st.form_submit_button("Submit")
19
+ if submitted:
20
+ st.write("product", product)
21
+ st.write("gender", gender)
22
+ st.write("profession", profession)
23
+ st.write("hobby", hobby)
24
+
25
+ _LOREM_IPSUM = """
26
+ Lorem ipsum dolor sit amet, **consectetur adipiscing** elit, sed do eiusmod tempor
27
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
28
+ nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
29
+ """
30
+
31
+ def stream_data():
32
+ for word in _LOREM_IPSUM.split(" "):
33
+ yield word + " "
34
+ time.sleep(0.02)
35
+
36
+ for word in _LOREM_IPSUM.split(" "):
37
+ yield word + " "
38
+ time.sleep(0.02)
39
+
40
+ st.write_stream(stream_data)
41
+
42
+
43
+
44
+
45
+
46
+
47
+ if st.button("Stream data"):
48
+ st.write_stream(stream_data)