Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import datetime
|
| 3 |
+
|
| 4 |
+
st.title("Form for the Users")
|
| 5 |
+
st.write("Here, you can answer to some questions in this form.")
|
| 6 |
+
|
| 7 |
+
user_id = st.text_input("ID", value="Your ID", max_chars=7)
|
| 8 |
+
age = st.number_input("Age", min_value=18, max_value=100, step=1)
|
| 9 |
+
b_date = st.date_input("Date of Birth", min_value=datetime.date(1921, 1, 1), max_value=datetime.date(2033, 12, 31))
|
| 10 |
+
smoke = st.checkbox("Do you smoke?")
|
| 11 |
+
genre = st.radio("Which movie genre do you like?", options=['horror', 'adventure', 'romantic'])
|
| 12 |
+
weight = st.slider("Choose your weight", min_value=40., max_value=150., step=0.5)
|
| 13 |
+
p_form = st.selectbox("Select level of your physical condition", options=["Bad", "Normal", "Good"])
|
| 14 |
+
colors = st.multiselect('What are your favorite colors', options=['Green', 'Yellow', 'Red', 'Blue', 'Pink'])
|
| 15 |
+
info = st.text_area("Share some information about you", "Put information here", help='You can write about your hobbies or family')
|
| 16 |
+
image = st.file_uploader("Upload your photo", type=['jpg', 'png'])
|
| 17 |
+
|
| 18 |
+
click = st.sidebar.button('Click me!')
|
| 19 |
+
if click:
|
| 20 |
+
st.sidebar.write("You clicked the button")
|
| 21 |
+
|
| 22 |
+
col1, col2 = st.columns(2)
|
| 23 |
+
with col1:
|
| 24 |
+
st.image("https://static.streamlit.io/examples/cat.jpg", width=300)
|
| 25 |
+
st.button("Like cats")
|
| 26 |
+
with col2:
|
| 27 |
+
st.image("https://static.streamlit.io/examples/dog.jpg", width=355)
|
| 28 |
+
st.button("Like dogs")
|
| 29 |
+
|
| 30 |
+
submit = st.button("Submit")
|
| 31 |
+
if submit:
|
| 32 |
+
st.write("You submitted the form")
|