-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path09_ipywidgets.py
44 lines (38 loc) · 1.15 KB
/
09_ipywidgets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# ---
# jupyter:
# kernelspec:
# display_name: Python [conda env:nbpercent-dev] *
# language: python
# name: conda-env-nbpercent-dev-py
# language_info:
# codemirror_mode:
# name: ipython
# version: 3
# file_extension: .py
# mimetype: text/x-python
# name: python
# nbconvert_exporter: python
# pygments_lexer: ipython3
# version: 3.10.4
# ---
# %% 56bffc67-14e7-4f0f-b28e-59e66dbb9fd7
import ipywidgets as widgets
from IPython.display import display
widgets.IntSlider()
# «»
# data:
# application/vnd.jupyter.widget-view+json: 56bffc67-14e7-4f0f-b28e-59e66dbb9fd7_0.json
# text/plain: 56bffc67-14e7-4f0f-b28e-59e66dbb9fd7_0.txt
# %% 04cf0140-692b-4c9c-a490-6c092812bbee
a = widgets.FloatText()
b = widgets.FloatSlider()
display(a,b)
mylink = widgets.jslink((a, 'value'), (b, 'value'))
# «»
# data:
# application/vnd.jupyter.widget-view+json: 04cf0140-692b-4c9c-a490-6c092812bbee_0.json
# text/plain: 04cf0140-692b-4c9c-a490-6c092812bbee_0.txt
# «»
# data:
# application/vnd.jupyter.widget-view+json: 04cf0140-692b-4c9c-a490-6c092812bbee_1.json
# text/plain: 04cf0140-692b-4c9c-a490-6c092812bbee_1.txt