Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,16 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
animal = st.form('my_animal')
|
4 |
+
|
5 |
+
# This is writing directly to the main body. Since the form container is
|
6 |
+
# defined above, this will appear below everything written in the form.
|
7 |
+
sound = st.selectbox('Sounds like', ['meow','woof','squeak','tweet'])
|
8 |
+
|
9 |
+
# These methods called on the form container, so they appear inside the form.
|
10 |
+
submit = animal.form_submit_button(f'Say it with {sound}!')
|
11 |
+
sentence = animal.text_input('Your sentence:', 'Where\'s the tuna?')
|
12 |
+
say_it = sentence.rstrip('.,!?') + f', {sound}!'
|
13 |
+
if submit:
|
14 |
+
animal.subheader(say_it)
|
15 |
+
else:
|
16 |
+
animal.subheader(' ')
|