Skip to content

Commit 0f63df5

Browse files
committed
Add docs link, FileUpload widget updates
Signed-off-by: Itay Dafna <[email protected]>
1 parent 74942e3 commit 0f63df5

File tree

1 file changed

+66
-2
lines changed

1 file changed

+66
-2
lines changed

notebooks/08.Ipywidgets_8/08.00-ipywidgets_8.ipynb

+66-2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@
5555
"widgets.__version__"
5656
]
5757
},
58+
{
59+
"cell_type": "markdown",
60+
"id": "5581d1e1-e089-4076-941e-872229071f4d",
61+
"metadata": {},
62+
"source": [
63+
"#### Latest documentation here: https://ipywidgets.readthedocs.io/en/latest/index.html"
64+
]
65+
},
5866
{
5967
"cell_type": "markdown",
6068
"id": "a407df5a-d525-46f7-adf2-fac35c2b9d8a",
@@ -211,6 +219,64 @@
211219
"slider"
212220
]
213221
},
222+
{
223+
"cell_type": "markdown",
224+
"id": "5069c5a9-3511-405c-b408-21108772baf0",
225+
"metadata": {},
226+
"source": [
227+
"#### New implementation of `FileUpload` widget\n",
228+
"* New representation of `.value` traitlet\n",
229+
"* Files represented as `memoryview` (can be saved to file system)\n",
230+
"* The `.data` traitlet has been removed.\n",
231+
"* The `.metadata` traitlet has been removed."
232+
]
233+
},
234+
{
235+
"cell_type": "code",
236+
"execution_count": null,
237+
"id": "87b55325-56e1-4d88-b266-0f30bf5fc764",
238+
"metadata": {},
239+
"outputs": [],
240+
"source": [
241+
"from ipywidgets import FileUpload\n",
242+
"\n",
243+
"fileupload = FileUpload(multiple=True)\n",
244+
"fileupload"
245+
]
246+
},
247+
{
248+
"cell_type": "code",
249+
"execution_count": null,
250+
"id": "594948f5-32ad-464e-8429-31a52e40b5a2",
251+
"metadata": {},
252+
"outputs": [],
253+
"source": [
254+
"# fileupload.value"
255+
]
256+
},
257+
{
258+
"cell_type": "code",
259+
"execution_count": null,
260+
"id": "296e0340-322a-4611-87bc-11e477563fb1",
261+
"metadata": {},
262+
"outputs": [],
263+
"source": [
264+
"# Text file\n",
265+
"# import codecs\n",
266+
"# print(codecs.decode(fileupload.value[0].content))"
267+
]
268+
},
269+
{
270+
"cell_type": "code",
271+
"execution_count": null,
272+
"id": "18f077d9-d133-4d9e-9f0c-8816a3b85f9c",
273+
"metadata": {},
274+
"outputs": [],
275+
"source": [
276+
"# from ipywidgets import Image\n",
277+
"# Image(value=fileupload.value[1].content.tobytes())"
278+
]
279+
},
214280
{
215281
"cell_type": "markdown",
216282
"id": "709e5005-1569-4232-a618-5bde081247db",
@@ -226,8 +292,6 @@
226292
"metadata": {},
227293
"outputs": [],
228294
"source": [
229-
"from ipywidgets import FileUpload\n",
230-
"\n",
231295
"fileupload = FileUpload(tooltip='Upload a file because this tooltip says so')\n",
232296
"fileupload"
233297
]

0 commit comments

Comments
 (0)