Skip to content

Commit e82fe72

Browse files
committed
Add basic express app
1 parent 18c6627 commit e82fe72

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Shiny for Python Getting Started
22

3+
## Start from scratch
4+
5+
Create a Python Shiny environment:
6+
37
```bash
48
uv init [-p 3.9]
59
uv add shiny
@@ -13,3 +17,14 @@ shiny --help
1317
shiny create --help
1418
```
1519

20+
Create a new Shiny Express app from template:
21+
22+
```bash
23+
shiny create -d basic_app -t basic-app -m express
24+
25+
shiny run basic_app/app.py
26+
```
27+
28+
## Templates
29+
30+
* [posit-dev/py-shiny-templates](https://github.com/posit-dev/py-shiny-templates)

basic_app/app.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from shiny import render, ui
2+
from shiny.express import input
3+
4+
ui.panel_title("Hello Shiny!")
5+
ui.input_slider("n", "N", 0, 100, 20)
6+
7+
8+
@render.text
9+
def txt():
10+
return f"n*2 is {input.n() * 2}"

0 commit comments

Comments
 (0)