Py.Cafe

shiny-unofficial/

ipywidgets-interaction-counter

Interactive Button Clicker with ipywidgets

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
# button with counter using regular ipywidgets
import ipywidgets as widgets

count = 0
button = widgets.Button(description="Clicked: 0")

def increment(btn):
    global count
    count += 1
    button.description = f"Clicked: {count}"
button.on_click(increment)
page = button