wut-web-dev cruft input tests wtf
parent
7c9eb3cf32
commit
8ccbaab6ec
|
@ -48,6 +48,25 @@
|
|||
")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def on_click(btn):\n",
|
||||
" n = int(btn.description)\n",
|
||||
" btn.description = str(n+1)\n",
|
||||
" \n",
|
||||
"def test_button():\n",
|
||||
" \"\"\"\n",
|
||||
" Create button that displays number of times it was clicked\n",
|
||||
" \"\"\"\n",
|
||||
" btn = w.Button(description=\"0\")\n",
|
||||
" btn.on_click(on_click)\n",
|
||||
" return btn\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
|
|
Loading…
Reference in New Issue