Show More
@@ -352,8 +352,8 b' follows is a list of these.' | |||||
352 | Caution for Windows users |
|
352 | Caution for Windows users | |
353 | ------------------------- |
|
353 | ------------------------- | |
354 |
|
354 | |||
355 | Windows, unfortunately, uses the '\' character as a path |
|
355 | Windows, unfortunately, uses the '\\' character as a path | |
356 | separator. This is a terrible choice, because '\' also represents the |
|
356 | separator. This is a terrible choice, because '\\' also represents the | |
357 | escape character in most modern programming languages, including |
|
357 | escape character in most modern programming languages, including | |
358 | Python. For this reason, using '/' character is recommended if you |
|
358 | Python. For this reason, using '/' character is recommended if you | |
359 | have problems with ``\``. However, in Windows commands '/' flags |
|
359 | have problems with ``\``. However, in Windows commands '/' flags | |
@@ -372,14 +372,13 b' IPython itself, plus a lot of system-type features. They are all' | |||||
372 | prefixed with a % character, but parameters are given without |
|
372 | prefixed with a % character, but parameters are given without | |
373 | parentheses or quotes. |
|
373 | parentheses or quotes. | |
374 |
|
374 | |||
375 |
Example: typing |
|
375 | Example: typing ``%cd mydir`` changes your working directory to 'mydir', if it | |
376 | directory to 'mydir', if it exists. |
|
376 | exists. | |
377 |
|
377 | |||
378 |
If you have 'automagic' enabled ( |
|
378 | If you have 'automagic' enabled (as it by default), you don't need | |
379 | line option -automagic or with the %automagic function), you don't need |
|
|||
380 | to type in the % explicitly. IPython will scan its internal list of |
|
379 | to type in the % explicitly. IPython will scan its internal list of | |
381 | magic functions and call one if it exists. With automagic on you can |
|
380 | magic functions and call one if it exists. With automagic on you can | |
382 |
then just type |
|
381 | then just type ``cd mydir`` to go to directory 'mydir'. The automagic | |
383 | system has the lowest possible precedence in name searches, so defining |
|
382 | system has the lowest possible precedence in name searches, so defining | |
384 | an identifier with the same name as an existing magic function will |
|
383 | an identifier with the same name as an existing magic function will | |
385 | shadow it for automagic use. You can still access the shadowed magic |
|
384 | shadow it for automagic use. You can still access the shadowed magic | |
@@ -1243,10 +1242,10 b' For more information on the use of the pdb debugger, read the included' | |||||
1243 | pdb.doc file (part of the standard Python distribution). On a stock |
|
1242 | pdb.doc file (part of the standard Python distribution). On a stock | |
1244 | Linux system it is located at /usr/lib/python2.3/pdb.doc, but the |
|
1243 | Linux system it is located at /usr/lib/python2.3/pdb.doc, but the | |
1245 | easiest way to read it is by using the help() function of the pdb module |
|
1244 | easiest way to read it is by using the help() function of the pdb module | |
1246 | as follows (in an IPython prompt): |
|
1245 | as follows (in an IPython prompt):: | |
1247 |
|
1246 | |||
1248 |
In [1]: import pdb |
|
1247 | In [1]: import pdb | |
1249 | In [2]: pdb.help() |
|
1248 | In [2]: pdb.help() | |
1250 |
|
1249 | |||
1251 | This will load the pdb.doc document in a file viewer for you automatically. |
|
1250 | This will load the pdb.doc document in a file viewer for you automatically. | |
1252 |
|
1251 | |||
@@ -1476,9 +1475,11 b' commands::' | |||||
1476 | from matplotlib import pylab |
|
1475 | from matplotlib import pylab | |
1477 | pylab.interactive(True) |
|
1476 | pylab.interactive(True) | |
1478 |
|
1477 | |||
1479 |
All of this will soon be automated as Matplotlib bein |
|
1478 | All of this will soon be automated as Matplotlib begins to include | |
1480 | new logic that uses our new GUI support. |
|
1479 | new logic that uses our new GUI support. | |
1481 |
|
1480 | |||
|
1481 | .. _Matplotlib: http://matplotlib.sourceforge.net | |||
|
1482 | ||||
1482 | .. _interactive_demos: |
|
1483 | .. _interactive_demos: | |
1483 |
|
1484 | |||
1484 | Interactive demos with IPython |
|
1485 | Interactive demos with IPython | |
@@ -1545,7 +1546,7 b' In order to run a file as a demo, you must first make a Demo object out' | |||||
1545 | of it. If the file is named myscript.py, the following code will make a |
|
1546 | of it. If the file is named myscript.py, the following code will make a | |
1546 | demo:: |
|
1547 | demo:: | |
1547 |
|
1548 | |||
1548 | from IPython.demo import Demo |
|
1549 | from IPython.lib.demo import Demo | |
1549 |
|
1550 | |||
1550 | mydemo = Demo('myscript.py') |
|
1551 | mydemo = Demo('myscript.py') | |
1551 |
|
1552 | |||
@@ -1562,7 +1563,7 b" methods, and call '?' on them to see their docstrings for more usage" | |||||
1562 | details. In addition, the demo module itself contains a comprehensive |
|
1563 | details. In addition, the demo module itself contains a comprehensive | |
1563 | docstring, which you can access via:: |
|
1564 | docstring, which you can access via:: | |
1564 |
|
1565 | |||
1565 | from IPython import demo |
|
1566 | from IPython.lib import demo | |
1566 |
|
1567 | |||
1567 | demo? |
|
1568 | demo? | |
1568 |
|
1569 | |||
@@ -1575,5 +1576,3 b' divisions are allowed. If you want to be able to open an IPython' | |||||
1575 | instance at an arbitrary point in a program, you can use IPython's |
|
1576 | instance at an arbitrary point in a program, you can use IPython's | |
1576 | embedding facilities, described in detail in Sec. 9 |
|
1577 | embedding facilities, described in detail in Sec. 9 | |
1577 |
|
1578 | |||
1578 | .. [Matplotlib] Matplotlib. http://matplotlib.sourceforge.net |
|
|||
1579 |
|
@@ -8,12 +8,7 b' The `IPython cookbook <http://ipython.scipy.org/moin/Cookbook>`_ details more' | |||||
8 | things you can do with IPython. |
|
8 | things you can do with IPython. | |
9 |
|
9 | |||
10 | .. This is not in the current version: |
|
10 | .. This is not in the current version: | |
11 | .. Use IPython to present interactive demos |
|
|||
12 | ---------------------------------------- |
|
|||
13 |
|
11 | |||
14 | .. Use the IPython.demo.Demo class to load any Python script as an interactive |
|
|||
15 | demo. With a minimal amount of simple markup, you can control the execution of |
|
|||
16 | the script, stopping as needed. See :ref:`here <interactive_demos>` for more. |
|
|||
17 |
|
12 | |||
18 | Embed IPython in your programs |
|
13 | Embed IPython in your programs | |
19 | ------------------------------ |
|
14 | ------------------------------ | |
@@ -35,6 +30,13 b' to see your translated history allows for an easy doctest workflow, where you' | |||||
35 | can go from doctest to interactive execution to pasting into valid Python code |
|
30 | can go from doctest to interactive execution to pasting into valid Python code | |
36 | as needed. |
|
31 | as needed. | |
37 |
|
32 | |||
|
33 | Use IPython to present interactive demos | |||
|
34 | ---------------------------------------- | |||
|
35 | ||||
|
36 | Use the :class:`IPython.lib.demo.Demo` class to load any Python script as an interactive | |||
|
37 | demo. With a minimal amount of simple markup, you can control the execution of | |||
|
38 | the script, stopping as needed. See :ref:`here <interactive_demos>` for more. | |||
|
39 | ||||
38 | Suppress output |
|
40 | Suppress output | |
39 | --------------- |
|
41 | --------------- | |
40 |
|
42 |
General Comments 0
You need to be logged in to leave comments.
Login now