Turn a Python script into a web app you can share
Streamlit turns a short Python file into a real web page with sliders, dropdowns, file uploads, charts and download buttons. You'll have a working quote calculator in your browser within ten minutes, then build a sales dashboard and put it online for free. No HTML, no JavaScript.
- Both apps working at phone width, and the steps to share them on your Wi-Fi or put them online free at a .streamlit.app address
- Windows, Mac or Linux, with about 300MB of free disk space (the project folder comes to about 274MB)
- uv installed. It's a small, official tool that installs Python apps cleanly. Step 1 shows you how
- Notepad or any code editor. You'll paste the code, not write it from scratch
- No Python experience. If you can change a word in quotes, you can change these apps
Install Streamlit
Streamlit lives in its own project folder, so it can't clash with anything else on your PC.
Streamlit ↗ is a free, open-source Python library. You write an ordinary script, and every
st.line becomes something on a web page: a heading, a slider, a chart, an upload box. When someone clicks, Streamlit runs your script again with the new values.You install it with uv. If you don't have it yet, install it first, then close the terminal and open a new one:
Windows (only if you don't have uv)winget install --id astral-sh.uv -eMac or Linux (only if you don't have uv)curl -LsSf https://astral.sh/uv/install.sh | shNow make a project folder called
my-appswith Streamlit inside it. Run these one at a time:Terminaluv init --python 3.12 my-apps cd my-apps uv add streamlitOutputInitialized project `my-apps` at `...\my-apps` Using CPython 3.12.13 Creating virtual environment at: .venv Resolved 38 packages in 471ms Downloading pyarrow (26.7MiB) ... Installed 37 packages in 4.46s ... + pandas==3.0.6 ... + streamlit==1.65.0 ...It takes about 15 seconds on a decent connection, and the project folder comes to about 274MB. Streamlit brings its own helpers with it, including pandas (for tables of data) and Altair (for charts), so there's nothing else to install.
Terminaluv run streamlit versionOutputStreamlit, version 1.65.0TipEvery command in this mission starts withuv run. That tells uv to use the Streamlit inside this folder, so alwayscd my-appsfirst when you open a new terminal. uv also made amain.pyfile. You can ignore it.
uv run streamlit version prints Streamlit, version 1.65.0 (or newer).If it breakserror: Failed to spawn: streamlit and program not found
error: Failed to spawn: streamlit and program not found
cd my-apps (from the folder you made it in) and try again.