|
14 | 14 | "source": [ |
15 | 15 | "# Jupyter Widgets Tutorial Introduction\n", |
16 | 16 | "\n", |
17 | | - "## Matt Craig, Martin Renou, Mehmet Bektas, Itay Dafna\n", |
| 17 | + "### Matt Craig, Martin Renou, Itay Dafna, Mariana Meireles, Youness Bennani\n", |
18 | 18 | "\n", |
19 | 19 | "## Jupyter lab essentials\n", |
20 | 20 | "\n", |
|
28 | 28 | "cell_type": "markdown", |
29 | 29 | "metadata": {}, |
30 | 30 | "source": [ |
31 | | - "# Interactive Jupyter widgets\n", |
| 31 | + "## Interactive Jupyter widgets\n", |
32 | 32 | "\n", |
33 | 33 | "A Python widget is an object that represents a control on the front end, like a slider. A single control can be displayed multiple times - they all represent the same python object." |
34 | 34 | ] |
|
59 | 59 | "slider" |
60 | 60 | ] |
61 | 61 | }, |
62 | | - { |
63 | | - "cell_type": "code", |
64 | | - "execution_count": null, |
65 | | - "metadata": {}, |
66 | | - "outputs": [], |
67 | | - "source": [ |
68 | | - "slider" |
69 | | - ] |
70 | | - }, |
71 | | - { |
72 | | - "cell_type": "markdown", |
73 | | - "metadata": {}, |
74 | | - "source": [ |
75 | | - "The control attributes, like its value, are automatically synced between the frontend and the kernel." |
76 | | - ] |
77 | | - }, |
78 | | - { |
79 | | - "cell_type": "code", |
80 | | - "execution_count": null, |
81 | | - "metadata": {}, |
82 | | - "outputs": [], |
83 | | - "source": [ |
84 | | - "slider.value" |
85 | | - ] |
86 | | - }, |
87 | | - { |
88 | | - "cell_type": "code", |
89 | | - "execution_count": null, |
90 | | - "metadata": {}, |
91 | | - "outputs": [], |
92 | | - "source": [ |
93 | | - "slider.value = 8" |
94 | | - ] |
95 | | - }, |
96 | 62 | { |
97 | 63 | "cell_type": "markdown", |
98 | 64 | "metadata": {}, |
|
126 | 92 | "square" |
127 | 93 | ] |
128 | 94 | }, |
129 | | - { |
130 | | - "cell_type": "markdown", |
131 | | - "metadata": {}, |
132 | | - "source": [ |
133 | | - "You can link control attributes and lay them out together." |
134 | | - ] |
135 | | - }, |
136 | | - { |
137 | | - "cell_type": "code", |
138 | | - "execution_count": null, |
139 | | - "metadata": {}, |
140 | | - "outputs": [], |
141 | | - "source": [ |
142 | | - "# Create text box to hold slider value\n", |
143 | | - "text = widgets.FloatText(description='Value')\n", |
144 | | - "\n", |
145 | | - "# Link slider value and text box value\n", |
146 | | - "widgets.link((slider, 'value'), (text, 'value'))\n", |
147 | | - "\n", |
148 | | - "# Put them in a vertical box\n", |
149 | | - "widgets.VBox([slider, text])" |
150 | | - ] |
151 | | - }, |
152 | 95 | { |
153 | 96 | "cell_type": "markdown", |
154 | 97 | "metadata": {}, |
|
199 | 142 | "cell_type": "markdown", |
200 | 143 | "metadata": {}, |
201 | 144 | "source": [ |
202 | | - "### How to load exercise solutions \n", |
| 145 | + "## How to load exercise solutions \n", |
203 | 146 | "\n", |
204 | 147 | "Some exercises have solutions you can load if you prefer. To do that, uncomment the line with `%load` in it, then run the cell **twice**. The first time loads the solution, the second time runs the solution.\n", |
205 | 148 | "\n", |
|
214 | 157 | "metadata": {}, |
215 | 158 | "outputs": [], |
216 | 159 | "source": [ |
217 | | - "# %load solutions/intro/intro-example.py\n" |
| 160 | + "# %load solutions/intro/intro-example.py" |
218 | 161 | ] |
219 | 162 | }, |
220 | 163 | { |
221 | 164 | "cell_type": "markdown", |
222 | 165 | "metadata": {}, |
223 | 166 | "source": [ |
224 | | - "# Behind the scenes\n", |
| 167 | + "## Additional reading\n", |
| 168 | + "\n", |
| 169 | + "### Behind the scenes\n", |
225 | 170 | "\n", |
226 | 171 | "Behind the scenes, even pure Python widgets are composed of two pieces:\n", |
227 | 172 | "\n", |
|
237 | 182 | "cell_type": "markdown", |
238 | 183 | "metadata": {}, |
239 | 184 | "source": [ |
240 | | - "# Jupyter widgets as a framework\n", |
| 185 | + "### Jupyter widgets as a framework\n", |
241 | 186 | "\n", |
242 | 187 | "Jupyter widgets forms a framework for representing python objects interactively. Some large open-source interactive controls based on Jupyter widgets include:\n", |
243 | 188 | "\n", |
|
279 | 224 | "name": "python", |
280 | 225 | "nbconvert_exporter": "python", |
281 | 226 | "pygments_lexer": "ipython3", |
282 | | - "version": "3.8.3" |
| 227 | + "version": "3.8.10" |
283 | 228 | }, |
284 | 229 | "widgets": { |
285 | 230 | "state": { |
|
0 commit comments