##// END OF EJS Templates
regen rst
Matthias BUSSONNIER -
Show More
@@ -28,17 +28,18 b' In[1]:'
28 pwd
28 pwd
29
29
30 Out[1]:
30 Out[1]:
31
32 .. parsed-literal::
31 .. parsed-literal::
33
32
34 u'/Users/minrk/dev/ip/mine/docs/examples/notebooks'
33 u'/Users/minrk/dev/ip/mine/docs/examples/notebooks'
35
34
35
36 In[2]:
36 In[2]:
37
37
38 .. code:: python
38 .. code:: python
39
39
40 ls
40 ls
41
41
42
42 .. parsed-literal::
43 .. parsed-literal::
43
44
44 00_notebook_tour.ipynb callbacks.ipynb python-logo.svg
45 00_notebook_tour.ipynb callbacks.ipynb python-logo.svg
@@ -48,7 +49,6 b' In[2]:'
48 Script Magics.ipynb octavemagic_extension.ipynb trapezoid_rule.ipynb
49 Script Magics.ipynb octavemagic_extension.ipynb trapezoid_rule.ipynb
49 animation.m4v progbar.ipynb
50 animation.m4v progbar.ipynb
50
51
51
52 In[3]:
52 In[3]:
53
53
54 .. code:: python
54 .. code:: python
@@ -57,11 +57,11 b' In[3]:'
57 # note: the echo command does not run on Windows, it's a unix command.
57 # note: the echo command does not run on Windows, it's a unix command.
58 !echo $message
58 !echo $message
59
59
60
60 .. parsed-literal::
61 .. parsed-literal::
61
62
62 The IPython notebook is great!
63 The IPython notebook is great!
63
64
64
65 Plots with matplotlib
65 Plots with matplotlib
66 ---------------------
66 ---------------------
67
67
@@ -74,13 +74,13 b' In[4]:'
74
74
75 %pylab inline
75 %pylab inline
76
76
77
77 .. parsed-literal::
78 .. parsed-literal::
78
79
79
80
80 Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].
81 Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].
81 For more information, type 'help(pylab)'.
82 For more information, type 'help(pylab)'.
82
83
83
84 In[5]:
84 In[5]:
85
85
86 .. code:: python
86 .. code:: python
@@ -89,7 +89,7 b' In[5]:'
89 plot(x, sin(x**2))
89 plot(x, sin(x**2))
90 title('A simple chirp');
90 title('A simple chirp');
91
91
92 .. image:: tests/ipynbref/00_notebook_tour_orig_files/00_notebook_tour_orig_fig_00.png
92 .. image:: _fig_07.png
93
93
94 You can paste blocks of input with prompt markers, such as those from
94 You can paste blocks of input with prompt markers, such as those from
95 `the official Python
95 `the official Python
@@ -103,11 +103,11 b' In[6]:'
103 >>> if the_world_is_flat:
103 >>> if the_world_is_flat:
104 ... print "Be careful not to fall off!"
104 ... print "Be careful not to fall off!"
105
105
106
106 .. parsed-literal::
107 .. parsed-literal::
107
108
108 Be careful not to fall off!
109 Be careful not to fall off!
109
110
110
111 Errors are shown in informative ways:
111 Errors are shown in informative ways:
112
112
113 In[7]:
113 In[7]:
@@ -116,10 +116,10 b' In[7]:'
116
116
117 %run non_existent_file
117 %run non_existent_file
118
118
119
119 .. parsed-literal::
120 .. parsed-literal::
120
121
121 ERROR: File `u'non_existent_file.py'` not found.
122 ERROR: File `u'non_existent_file.py'` not found.
122
123 In[8]:
123 In[8]:
124
124
125 .. code:: python
125 .. code:: python
@@ -138,7 +138,6 b' In[8]:'
138 ----> 3 z = y/(1-x)
138 ----> 3 z = y/(1-x)
139
139
140 ZeroDivisionError: integer division or modulo by zero
140 ZeroDivisionError: integer division or modulo by zero
141
142 When IPython needs to display additional information (such as providing
141 When IPython needs to display additional information (such as providing
143 details on an object via ``x?`` it will automatically invoke a pager at
142 details on an object via ``x?`` it will automatically invoke a pager at
144 the bottom of the screen:
143 the bottom of the screen:
@@ -164,38 +163,10 b' In[19]:'
164 print i,
163 print i,
165 time.sleep(0.5)
164 time.sleep(0.5)
166
165
167 .. parsed-literal::
168
169 0
170
166
171 .. parsed-literal::
167 .. parsed-literal::
172
168
173 1
169 0 1 2 3 4 5 6 7
174
175 .. parsed-literal::
176
177 2
178
179 .. parsed-literal::
180
181 3
182
183 .. parsed-literal::
184
185 4
186
187 .. parsed-literal::
188
189 5
190
191 .. parsed-literal::
192
193 6
194
195 .. parsed-literal::
196
197 7
198
199
170
200 Clean crash and restart
171 Clean crash and restart
201 -----------------------
172 -----------------------
@@ -265,10 +236,8 b' In[1]:'
265 Image(filename='../../source/_static/logo.png')
236 Image(filename='../../source/_static/logo.png')
266
237
267 Out[1]:
238 Out[1]:
239 .. image:: _fig_22.png
268
240
269 .. parsed-literal::
270
271 <IPython.core.display.Image at 0x10faeafd0>
272
241
273 An image can also be displayed from raw data or a url
242 An image can also be displayed from raw data or a url
274
243
@@ -279,11 +248,11 b' In[2]:'
279 Image(url='http://python.org/images/python-logo.gif')
248 Image(url='http://python.org/images/python-logo.gif')
280
249
281 Out[2]:
250 Out[2]:
282
283 .. parsed-literal::
251 .. parsed-literal::
284
252
285 <IPython.core.display.Image at 0x1060e7410>
253 <IPython.core.display.Image at 0x1060e7410>
286
254
255
287 SVG images are also supported out of the box (since modern browsers do a
256 SVG images are also supported out of the box (since modern browsers do a
288 good job of rendering them):
257 good job of rendering them):
289
258
@@ -295,10 +264,8 b' In[3]:'
295 SVG(filename='python-logo.svg')
264 SVG(filename='python-logo.svg')
296
265
297 Out[3]:
266 Out[3]:
267 .. image:: _fig_26.svg
298
268
299 .. parsed-literal::
300
301 <IPython.core.display.SVG at 0x10fb998d0>
302
269
303 Embedded vs Non-embedded Images
270 Embedded vs Non-embedded Images
304 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
271 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -334,10 +301,8 b' In[5]:'
334 Embed
301 Embed
335
302
336 Out[5]:
303 Out[5]:
304 ..jpg image::
337
305
338 .. parsed-literal::
339
340 <IPython.core.display.Image at 0x10fb99b50>
341
306
342 Today's image from same webcam at Berkeley, (refreshed every minutes, if
307 Today's image from same webcam at Berkeley, (refreshed every minutes, if
343 you reload the notebook), visible only with an active internet
308 you reload the notebook), visible only with an active internet
@@ -353,11 +318,11 b' In[6]:'
353 SoftLinked
318 SoftLinked
354
319
355 Out[6]:
320 Out[6]:
356
357 .. parsed-literal::
321 .. parsed-literal::
358
322
359 <IPython.core.display.Image at 0x10fb99b10>
323 <IPython.core.display.Image at 0x10fb99b10>
360
324
325
361 Of course, if you re-run the all notebook, the two images will be the
326 Of course, if you re-run the all notebook, the two images will be the
362 same again.
327 same again.
363
328
@@ -381,11 +346,11 b' In[7]:'
381 YouTubeVideo('1j_HxD4iLn8')
346 YouTubeVideo('1j_HxD4iLn8')
382
347
383 Out[7]:
348 Out[7]:
384
385 .. parsed-literal::
349 .. parsed-literal::
386
350
387 <IPython.lib.display.YouTubeVideo at 0x10fba2190>
351 <IPython.lib.display.YouTubeVideo at 0x10fba2190>
388
352
353
389 Using the nascent video capabilities of modern browsers, you may also be
354 Using the nascent video capabilities of modern browsers, you may also be
390 able to display local videos. At the moment this doesn't work very well
355 able to display local videos. At the moment this doesn't work very well
391 in all browsers, so it may or may not work for you; we will continue
356 in all browsers, so it may or may not work for you; we will continue
@@ -407,11 +372,11 b' In[8]:'
407 HTML(data=video_tag)
372 HTML(data=video_tag)
408
373
409 Out[8]:
374 Out[8]:
410
411 .. parsed-literal::
375 .. parsed-literal::
412
376
413 <IPython.core.display.HTML at 0x10fba28d0>
377 <IPython.core.display.HTML at 0x10fba28d0>
414
378
379
415 Local Files
380 Local Files
416 -----------
381 -----------
417
382
@@ -474,6 +439,7 b' In[1]:'
474
439
475 ls
440 ls
476
441
442
477 .. parsed-literal::
443 .. parsed-literal::
478
444
479 00_notebook_tour.ipynb formatting.ipynb
445 00_notebook_tour.ipynb formatting.ipynb
@@ -485,7 +451,6 b' In[1]:'
485 cython_extension.ipynb sympy_quantum_computing.ipynb
451 cython_extension.ipynb sympy_quantum_computing.ipynb
486 display_protocol.ipynb trapezoid_rule.ipynb
452 display_protocol.ipynb trapezoid_rule.ipynb
487
453
488
489 If we want to create a link to one of them, we can call use the
454 If we want to create a link to one of them, we can call use the
490 ``FileLink`` object.
455 ``FileLink`` object.
491
456
@@ -497,11 +462,11 b' In[2]:'
497 FileLink('00_notebook_tour.ipynb')
462 FileLink('00_notebook_tour.ipynb')
498
463
499 Out[2]:
464 Out[2]:
500
501 .. parsed-literal::
465 .. parsed-literal::
502
466
503 <IPython.lib.display.FileLink at 0x10f7ea3d0>
467 <IPython.lib.display.FileLink at 0x10f7ea3d0>
504
468
469
505 Alternatively, if we want to link to all of them, we can use the
470 Alternatively, if we want to link to all of them, we can use the
506 ``FileLinks`` object, passing ``'.'`` to indicate that we want links
471 ``FileLinks`` object, passing ``'.'`` to indicate that we want links
507 generated for the current working directory. Note that if there were
472 generated for the current working directory. Note that if there were
@@ -517,11 +482,11 b' In[7]:'
517 FileLinks('.')
482 FileLinks('.')
518
483
519 Out[7]:
484 Out[7]:
520
521 .. parsed-literal::
485 .. parsed-literal::
522
486
523 <IPython.lib.display.FileLinks at 0x10f7eaad0>
487 <IPython.lib.display.FileLinks at 0x10f7eaad0>
524
488
489
525 External sites
490 External sites
526 ~~~~~~~~~~~~~~
491 ~~~~~~~~~~~~~~
527
492
@@ -535,11 +500,11 b' In[9]:'
535 HTML('<iframe src=http://en.mobile.wikipedia.org/?useformat=mobile width=700 height=350></iframe>')
500 HTML('<iframe src=http://en.mobile.wikipedia.org/?useformat=mobile width=700 height=350></iframe>')
536
501
537 Out[9]:
502 Out[9]:
538
539 .. parsed-literal::
503 .. parsed-literal::
540
504
541 <IPython.core.display.HTML at 0x1094900d0>
505 <IPython.core.display.HTML at 0x1094900d0>
542
506
507
543 Mathematics
508 Mathematics
544 ~~~~~~~~~~~
509 ~~~~~~~~~~~
545
510
@@ -562,14 +527,10 b' In[10]:'
562 Math(r'F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx')
527 Math(r'F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx')
563
528
564 Out[10]:
529 Out[10]:
565
566 .. math::
530 .. math::
567
531
568 $$F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx$$
532 $$F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx$$
569
533
570 .. parsed-literal::
571
572 <IPython.core.display.Math at 0x10fba26d0>
573
534
574 With the ``Latex`` class, you have to include the delimiters yourself.
535 With the ``Latex`` class, you have to include the delimiters yourself.
575 This allows you to use other LaTeX modes such as ``eqnarray``:
536 This allows you to use other LaTeX modes such as ``eqnarray``:
@@ -587,7 +548,6 b' In[11]:'
587 \end{eqnarray}""")
548 \end{eqnarray}""")
588
549
589 Out[11]:
550 Out[11]:
590
591 .. math::
551 .. math::
592
552
593 \begin{eqnarray}
553 \begin{eqnarray}
@@ -597,9 +557,6 b' Out[11]:'
597 \nabla \cdot \vec{\mathbf{B}} & = 0
557 \nabla \cdot \vec{\mathbf{B}} & = 0
598 \end{eqnarray}
558 \end{eqnarray}
599
559
600 .. parsed-literal::
601
602 <IPython.core.display.Latex at 0x10fba2c10>
603
560
604 Or you can enter latex directly with the ``%%latex`` cell magic:
561 Or you can enter latex directly with the ``%%latex`` cell magic:
605
562
@@ -615,9 +572,14 b' In[12]:'
615 \nabla \cdot \vec{\mathbf{B}} & = 0
572 \nabla \cdot \vec{\mathbf{B}} & = 0
616 \end{aligned}
573 \end{aligned}
617
574
618 .. parsed-literal::
575 .. math::
619
576
620 <IPython.core.display.Latex at 0x10a617c90>
577 \begin{aligned}
578 \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\
579 \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
580 \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
581 \nabla \cdot \vec{\mathbf{B}} & = 0
582 \end{aligned}
621
583
622 There is also a ``%%javascript`` cell magic for running javascript
584 There is also a ``%%javascript`` cell magic for running javascript
623 directly, and ``%%svg`` for manually entering SVG content.
585 directly, and ``%%svg`` for manually entering SVG content.
@@ -642,13 +604,13 b' In[12]:'
642
604
643 %pylab inline
605 %pylab inline
644
606
607
645 .. parsed-literal::
608 .. parsed-literal::
646
609
647
610
648 Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].
611 Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].
649 For more information, type 'help(pylab)'.
612 For more information, type 'help(pylab)'.
650
613
651
652 In[15]:
614 In[15]:
653
615
654 .. code:: python
616 .. code:: python
@@ -695,4 +657,5 b' In[16]:'
695 show()
657 show()
696
658
697
659
698 .. image:: tests/ipynbref/00_notebook_tour_orig_files/00_notebook_tour_orig_fig_01.png
660 .. image:: _fig_60.png
661
@@ -658,3 +658,4 b' In[16]:'
658
658
659
659
660 .. image:: _fig_60.png
660 .. image:: _fig_60.png
661
General Comments 0
You need to be logged in to leave comments. Login now