Spaces:
Runtime error
Runtime error
Commit
路
a882dd0
1
Parent(s):
a7bf2cb
Update app.py
Browse files
app.py
CHANGED
@@ -211,34 +211,34 @@ def analizar_frase(frase):
|
|
211 |
|
212 |
def run():
|
213 |
col1, col2, col3 = st.columns(3)
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
|
244 |
run()
|
|
|
211 |
|
212 |
def run():
|
213 |
col1, col2, col3 = st.columns(3)
|
214 |
+
with col1.form("my_form"):
|
215 |
+
search_words = st.text_input("Introduzca la frase, el usuario o localidad para analizar y pulse el check correspondiente")
|
216 |
+
number_of_tweets = st.number_input('Introduzca n煤mero de tweets a analizar del usuario M谩ximo 50', 0,50,0)
|
217 |
+
st.write("Escoja una Opci贸n")
|
218 |
+
termino=st.checkbox('Frase')
|
219 |
+
usuario=st.checkbox('Usuario')
|
220 |
+
localidad=st.checkbox('Localidad')
|
221 |
+
submit_button = st.form_submit_button(label='Analizar')
|
222 |
+
error =False
|
223 |
|
224 |
+
if submit_button:
|
225 |
+
# Condici贸n para el caso de que esten dos check seleccionados
|
226 |
+
if ( termino == False and usuario == False and localidad == False):
|
227 |
+
st.text('Error no se ha seleccionado ningun check')
|
228 |
+
error=True
|
229 |
+
elif ( termino == True and usuario == True and localidad == True):
|
230 |
+
st.text('Error se han seleccionado varios check')
|
231 |
+
error=True
|
232 |
|
233 |
+
if (error == False):
|
234 |
+
if (termino):
|
235 |
+
with col2:
|
236 |
+
analizar_frase(search_words)
|
237 |
+
elif (usuario):
|
238 |
+
with col2:
|
239 |
+
tweets_usuario(search_words,number_of_tweets)
|
240 |
+
elif (localidad):
|
241 |
+
with col2:
|
242 |
+
tweets_localidad(search_words)
|
243 |
|
244 |
run()
|