Each Shiny app involves:
The Python process runs your code and sends results back to the browser.
Each Shiny app consists of:
#| '!! shinylive warning !!': |
#| shinylive does not work in self-contained HTML documents.
#| Please set `embed-resources: false` in your metadata.
#| standalone: true
#| components: [viewer]
#| viewerHeight: 600
from palmerpenguins import load_penguins
from plotnine import aes, geom_point, ggplot, theme_minimal
from shiny.express import input, render, ui
dat = load_penguins().dropna()
num_cols = dat.select_dtypes("float64").columns.tolist()
ui.input_select("x", "", num_cols, selected="bill_depth_mm")
ui.input_select("y", "", num_cols, selected="body_mass_g")
@render.plot
def plot():
return (ggplot(dat, aes(x=input.x(), y=input.y(), color="species")) +
geom_point(alpha=0.7) +
theme_minimal()
)When an input changes, Shiny reacts by rebuilding the outputs that depend on it β and only those outputs.
No callbacks. No manual refresh. No cache management.
Think of a spreadsheet:
When you change a value cell, only the formula cells that depend on it recalculate.
Shiny works the same way.
Shiny lets you build reactive web apps without worrying about:
Important
Shiny for Python has two syntaxes for writing the same apps. There is full feature parody between the 2 syntax modes.
Today weβll use Shiny Express.
Or in Positron / VS Code: click the Run App button in the editor toolbar.
Open URL:Port (e.g., http://127.0.0.1:8000) in your browser.
PyCon US 2026. chendaniely/pycon-2026-shiny