Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from PIL import Image
|
3 |
+
|
4 |
+
# Set up the title of the app
|
5 |
+
st.title('Simple Streamlit App')
|
6 |
+
|
7 |
+
# File uploader to allow users to upload images
|
8 |
+
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
9 |
+
|
10 |
+
# Display the uploaded image
|
11 |
+
if uploaded_file is not None:
|
12 |
+
image = Image.open(uploaded_file)
|
13 |
+
st.image(image, caption='Uploaded Image', use_column_width=True)
|
14 |
+
|
15 |
+
# Button to print "Hey you"
|
16 |
+
if st.button('Hey Button'):
|
17 |
+
st.write('Hey you')
|
18 |
+
|
19 |
+
# Text input
|
20 |
+
text_input = st.text_input('Enter some text')
|
21 |
+
|
22 |
+
# Button to print the text from input
|
23 |
+
if st.button('Print Text'):
|
24 |
+
st.write(text_input)
|
25 |
+
|
26 |
+
# Run this with `streamlit run your_script.py`
|