-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
61 lines (40 loc) · 1.19 KB
/
app.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
import streamlit as st
from datetime import date, datetime
import os
from PIL import Image
import pandas as pd
import numpy as np
image_file = "Champs fleurs printemps.jpg"
audio_file = "Crimson Fly.mp3"
image = Image.open(image_file)
st.image(image, caption='I love flowers!!', use_column_width=True)
st.header("Wandi's Website")
name = st.text_input("Enter your name")
st.write(f"Hello {name}, and welcome to my humble website!")
number = st.number_input("Enter a number to get its square:")
st.write(f"Number² is equal to : {number*number}")
@st.cache
def load_music(file):
audio_file = open(file, 'rb')
audio_bytes = audio_file.read()
return audio_bytes
audio_bytes = load_music(audio_file)
st.audio(audio_bytes, format="audio/mp3")
# Let's print out a great interactive graph !
st.subheader("Random graph")
n_graphs = st.slider("Number of graphs",
min_value=1,
max_value=10,
format="%i"
)
n_max = st.slider("Max number",
min_value=1,
max_value=1000,
format="%i"
)
chart_data = pd.DataFrame(
np.random.randn(n_max, n_graphs),
# columns=[f"x{i}" for i in range(n_max)]
)
st.area_chart(chart_data)
st.header("Testw")