-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.py
More file actions
32 lines (24 loc) · 785 Bytes
/
Copy pathexample.py
File metadata and controls
32 lines (24 loc) · 785 Bytes
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
import streamlit as st
from google_auth_decorator import google_auth_required
def is_empty(text_input):
if text_input:
return True, "Done"
else:
return False, "Empty input is not allowed"
@google_auth_required
def homepage():
# Home page content goes here...
placeholder = st.empty()
# placeholder.empty()
with placeholder.container(), st.form(key='home', clear_on_submit=True):
st.title("Home page")
text_input = st.text_input(label='Input something')
submit_button = st.form_submit_button(label='Submit')
if submit_button:
status, message = is_empty(text_input)
if status:
st.write(message)
else:
st.warning(message)
if __name__ == "__main__":
homepage()