|
20 | 20 | "source": [
|
21 | 21 | "# code cell, no output\n",
|
22 | 22 | "import sys\n",
|
| 23 | + "\n", |
23 | 24 | "from IPython import display"
|
24 | 25 | ]
|
25 | 26 | },
|
|
38 | 39 | ],
|
39 | 40 | "source": [
|
40 | 41 | "# code cell + stdout\n",
|
41 |
| - "print('hallo')" |
| 42 | + "print(\"hallo\")" |
42 | 43 | ]
|
43 | 44 | },
|
44 | 45 | {
|
|
57 | 58 | ],
|
58 | 59 | "source": [
|
59 | 60 | "# code cell + stdout + stdout\n",
|
60 |
| - "print('hallo1')\n", |
61 |
| - "print('hallo2')" |
| 61 | + "print(\"hallo1\")\n", |
| 62 | + "print(\"hallo2\")" |
62 | 63 | ]
|
63 | 64 | },
|
64 | 65 | {
|
|
76 | 77 | ],
|
77 | 78 | "source": [
|
78 | 79 | "# code cell + stderr\n",
|
79 |
| - "print('hallo', file=sys.stderr)" |
| 80 | + "print(\"hallo\", file=sys.stderr)" |
80 | 81 | ]
|
81 | 82 | },
|
82 | 83 | {
|
|
101 | 102 | ],
|
102 | 103 | "source": [
|
103 | 104 | "# code cell + stderr + stdout\n",
|
104 |
| - "print('hallo1', file=sys.stderr)\n", |
105 |
| - "print('hallo2')" |
| 105 | + "print(\"hallo1\", file=sys.stderr)\n", |
| 106 | + "print(\"hallo2\")" |
106 | 107 | ]
|
107 | 108 | },
|
108 | 109 | {
|
|
126 | 127 | ],
|
127 | 128 | "source": [
|
128 | 129 | "# code cell + latex\n",
|
129 |
| - "display.Latex('\\\\textit{hallo}')" |
| 130 | + "display.Latex(\"\\\\textit{hallo}\")" |
130 | 131 | ]
|
131 | 132 | },
|
132 | 133 | {
|
|
194 | 195 | ],
|
195 | 196 | "source": [
|
196 | 197 | "# code cell + json\n",
|
197 |
| - "display.JSON({'a': [1, 2, 3, 4,], 'b': {'inner1': 'helloworld', 'inner2': 'foobar'}})" |
| 198 | + "display.JSON(\n", |
| 199 | + " {\n", |
| 200 | + " \"a\": [\n", |
| 201 | + " 1,\n", |
| 202 | + " 2,\n", |
| 203 | + " 3,\n", |
| 204 | + " 4,\n", |
| 205 | + " ],\n", |
| 206 | + " \"b\": {\"inner1\": \"helloworld\", \"inner2\": \"foobar\"},\n", |
| 207 | + " }\n", |
| 208 | + ")" |
198 | 209 | ]
|
199 | 210 | },
|
200 | 211 | {
|
|
220 | 231 | ],
|
221 | 232 | "source": [
|
222 | 233 | "# code cell + markdown\n",
|
223 |
| - "display.Markdown('## Header\\n\\n- bullet')" |
| 234 | + "display.Markdown(\"## Header\\n\\n- bullet\")" |
224 | 235 | ]
|
225 | 236 | },
|
226 | 237 | {
|
|
300 | 311 | ],
|
301 | 312 | "source": [
|
302 | 313 | "# code cell + png\n",
|
303 |
| - "display.Image(filename='128x128.png', width=200, unconfined=True)" |
| 314 | + "display.Image(filename=\"128x128.png\", width=200, unconfined=True)" |
304 | 315 | ]
|
305 | 316 | },
|
306 | 317 | {
|
|
327 | 338 | ],
|
328 | 339 | "source": [
|
329 | 340 | "# code cell + jpg\n",
|
330 |
| - "display.Image(filename='128x128.jpg', width=200, unconfined=True)" |
| 341 | + "display.Image(filename=\"128x128.jpg\", width=200, unconfined=True)" |
331 | 342 | ]
|
332 | 343 | },
|
333 | 344 | {
|
|
381 | 392 | }
|
382 | 393 | ],
|
383 | 394 | "source": [
|
384 |
| - "display.display(display.Image(filename='128x128.png', width=200, unconfined=False))\n", |
385 |
| - "print('hallo1', file=sys.stderr)\n", |
386 |
| - "print('hallo2')\n", |
387 |
| - "display.Image(filename='128x128.jpg', width=200, unconfined=True)" |
| 395 | + "display.display(display.Image(filename=\"128x128.png\", width=200, unconfined=False))\n", |
| 396 | + "print(\"hallo1\", file=sys.stderr)\n", |
| 397 | + "print(\"hallo2\")\n", |
| 398 | + "display.Image(filename=\"128x128.jpg\", width=200, unconfined=True)" |
388 | 399 | ]
|
389 | 400 | },
|
390 | 401 | {
|
|
417 | 428 | }
|
418 | 429 | ],
|
419 | 430 | "source": [
|
420 |
| - "print('before exception')\n", |
| 431 | + "print(\"before exception\")\n", |
| 432 | + "\n", |
| 433 | + "\n", |
421 | 434 | "def func(b):\n",
|
422 |
| - " raise ValueError('there was an error')\n", |
| 435 | + " raise ValueError(\"there was an error\")\n", |
| 436 | + "\n", |
| 437 | + "\n", |
423 | 438 | "for i in range(10):\n",
|
424 | 439 | " func(i)"
|
425 | 440 | ]
|
|
0 commit comments