File size: 678 Bytes
e8c85ec
 
3d07878
e8c85ec
 
 
3d07878
e8c85ec
 
 
 
 
 
 
3d07878
e8c85ec
 
 
3d07878
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import subprocess
import sys

# Function to install a package using pip
def install(package):
    subprocess.check_call([sys.executable, "-m", "pip", "install", package])

# Install Streamlit if it's not already installed
try:
    import streamlit as st
except ImportError:
    print("Streamlit is not installed. Installing now...")
    install("streamlit")
    import streamlit as st

# Streamlit app code
st.set_page_config(page_title="Hello World App")
st.title("Hello, World!")
st.write("This is a Streamlit app that says 'Hello, World!'.")

# Add some interactivity (optional)
user_name = st.text_input("Enter your name:")
if user_name:
    st.write(f"Hello, {user_name}!")