-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path121streamlitpractice4.py
69 lines (48 loc) · 1.38 KB
/
121streamlitpractice4.py
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import streamlit as st
import pandas as pd
# st.selectbox
st.header('st.selectbox')
option = st.selectbox(
'What is your favorite color?',
('Blue', 'Red', 'Green')
)
st.write('Your favorite color is ', option)
# st.multiselect
st.subheader('st.multiselect')
options = st.multiselect(
'What are your favorite colors',
['Green', 'Yellow', 'Red', 'Blue'],
['Yellow', 'Red']
)
st.write("You selected:", options)
# st.checkbox
st.subheader('st.checkbox')
st.write('What would you like to order?')
icecream = st.checkbox('Ice cream')
coffee = st.checkbox('Coffee')
cola = st.checkbox('Cola')
if icecream:
st.write("Great! Here's some mroe 🍦")
if coffee:
st.write("Okay! Here's some mroe ☕")
if cola:
st.write("Here you go 🥤")
# st.latex
st.subheader('st.latex')
st.latex(r'''
a + ar + a r^2 + a r^3 + \cdots + a r^{n-1} =
\sum_{k=0}^{n-1} ar^k =
a \left(\frac{1-r^{n}}{1-r}\right)
''')
st.title('Customizing the theme of Streamlit apps')
st.write('Contents of the `.streamlit/config.toml` file of this app')
st.code("""
[theme]
primaryColor="#F39C12"
backgroundColor="#2E86C1"
secondaryBackgroundColor="#AED6F1"
textColor="#FFFFFF"
font="monospace"
""")
number = st.sidebar.slider('Select a number:', 0, 10, 5)
st.write('Selected number from slider widget is:', number)