Spaces:
Sleeping
Sleeping
File size: 1,107 Bytes
8caf9d5 a2054cf 8caf9d5 a2054cf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 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 |
import streamlit as st
import time
with st.form("my_form"):
st.write("Input")
# product
product=st.text_input("product")
# gender
gender=st.radio("gender", ["male", "female"])
# profession
profession=st.text_input("profession")
# hobby
hobby=st.text_input("hobby")
# Every form must have a submit button.
submitted = st.form_submit_button("Submit")
if submitted:
st.write("product", product)
st.write("gender", gender)
st.write("profession", profession)
st.write("hobby", hobby)
_LOREM_IPSUM = """
Lorem ipsum dolor sit amet, **consectetur adipiscing** elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
"""
def stream_data():
for word in _LOREM_IPSUM.split(" "):
yield word + " "
time.sleep(0.02)
for word in _LOREM_IPSUM.split(" "):
yield word + " "
time.sleep(0.02)
st.write_stream(stream_data)
if st.button("Stream data"):
st.write_stream(stream_data) |