Py.Cafe

Interactive Slider with Dynamic Calculation - Shiny

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
# original from https://shinylive.io/py/examples/#basic-app
from shiny.express import input, render, ui

ui.input_slider("n", "N", 0, 100, 20)


@render.code
def txt():
    return f"n*2 is {input.n() * 2}"