Show More
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -325,25 +325,23 b' All options with a [no] prepended can be specified in negated form' | |||||
325 | Interactive use |
|
325 | Interactive use | |
326 | =============== |
|
326 | =============== | |
327 |
|
327 | |||
328 | IPython is meant to work as a drop-in |
|
328 | IPython is meant to work as a drop-in replacement for the standard interactive | |
329 | replacement for the standard interactive interpreter. As such, any code |
|
329 | interpreter. As such, any code which is valid python should execute normally | |
330 | which is valid python should execute normally under IPython (cases where |
|
330 | under IPython (cases where this is not true should be reported as bugs). It | |
331 | this is not true should be reported as bugs). It does, however, offer |
|
331 | does, however, offer many features which are not available at a standard python | |
332 | many features which are not available at a standard python prompt. What |
|
332 | prompt. What follows is a list of these. | |
333 | follows is a list of these. |
|
|||
334 |
|
333 | |||
335 |
|
334 | |||
336 | Caution for Windows users |
|
335 | Caution for Windows users | |
337 | ------------------------- |
|
336 | ------------------------- | |
338 |
|
337 | |||
339 | Windows, unfortunately, uses the '\\' character as a path |
|
338 | Windows, unfortunately, uses the '\\' character as a path separator. This is a | |
340 |
|
|
339 | terrible choice, because '\\' also represents the escape character in most | |
341 | escape character in most modern programming languages, including |
|
340 | modern programming languages, including Python. For this reason, using '/' | |
342 | Python. For this reason, using '/' character is recommended if you |
|
341 | character is recommended if you have problems with ``\``. However, in Windows | |
343 | have problems with ``\``. However, in Windows commands '/' flags |
|
342 | commands '/' flags options, so you can not use it for the root directory. This | |
344 | options, so you can not use it for the root directory. This means that |
|
343 | means that paths beginning at the root must be typed in a contrived manner | |
345 | paths beginning at the root must be typed in a contrived manner like: |
|
344 | like: ``%copy \opt/foo/bar.txt \tmp`` | |
346 | ``%copy \opt/foo/bar.txt \tmp`` |
|
|||
347 |
|
345 | |||
348 | .. _magic: |
|
346 | .. _magic: | |
349 |
|
347 | |||
@@ -419,11 +417,11 b' following example defines a new magic command, %impall:' | |||||
419 |
|
417 | |||
420 | ip.expose_magic('impall', doimp) |
|
418 | ip.expose_magic('impall', doimp) | |
421 |
|
419 | |||
422 | Type %magic for more information, including a list of all available |
|
420 | Type `%magic` for more information, including a list of all available magic | |
423 |
|
|
421 | functions at any time and their docstrings. You can also type | |
424 |
%magic_function_name? (see |
|
422 | %magic_function_name? (see :ref:`below <dynamic_object_info` for information on | |
425 |
|
|
423 | the '?' system) to get information about any particular magic function you are | |
426 | magic function you are interested in. |
|
424 | interested in. | |
427 |
|
425 | |||
428 | The API documentation for the :mod:`IPython.core.magic` module contains the full |
|
426 | The API documentation for the :mod:`IPython.core.magic` module contains the full | |
429 | docstrings of all currently available magic commands. |
|
427 | docstrings of all currently available magic commands. | |
@@ -444,20 +442,20 b' PYTHONDOCS for this feature to work correctly.' | |||||
444 | Dynamic object information |
|
442 | Dynamic object information | |
445 | -------------------------- |
|
443 | -------------------------- | |
446 |
|
444 | |||
447 | Typing ?word or word? prints detailed information about an object. If |
|
445 | Typing ``?word`` or ``word?`` prints detailed information about an object. If | |
448 | certain strings in the object are too long (docstrings, code, etc.) they |
|
446 | certain strings in the object are too long (docstrings, code, etc.) they get | |
449 |
|
|
447 | snipped in the center for brevity. This system gives access variable types and | |
450 |
|
|
448 | values, full source code for any object (if available), function prototypes and | |
451 |
|
|
449 | other useful information. | |
452 |
|
450 | |||
453 | Typing ??word or word?? gives access to the full information without |
|
451 | Typing ``??word`` or ``word??`` gives access to the full information without | |
454 | snipping long strings. Long strings are sent to the screen through the |
|
452 | snipping long strings. Long strings are sent to the screen through the | |
455 | less pager if longer than the screen and printed otherwise. On systems |
|
453 | less pager if longer than the screen and printed otherwise. On systems | |
456 | lacking the less command, IPython uses a very basic internal pager. |
|
454 | lacking the less command, IPython uses a very basic internal pager. | |
457 |
|
455 | |||
458 | The following magic functions are particularly useful for gathering |
|
456 | The following magic functions are particularly useful for gathering | |
459 | information about your working environment. You can get more details by |
|
457 | information about your working environment. You can get more details by | |
460 | typing %magic or querying them individually (use %function_name? with or |
|
458 | typing ``%magic`` or querying them individually (use %function_name? with or | |
461 | without the %), this is just a summary: |
|
459 | without the %), this is just a summary: | |
462 |
|
460 | |||
463 | * **%pdoc <object>**: Print (or run through a pager if too long) the |
|
461 | * **%pdoc <object>**: Print (or run through a pager if too long) the | |
@@ -476,21 +474,19 b' without the %), this is just a summary:' | |||||
476 | identifiers and %whos prints a table with some basic details about |
|
474 | identifiers and %whos prints a table with some basic details about | |
477 | each identifier. |
|
475 | each identifier. | |
478 |
|
476 | |||
479 |
Note that the dynamic object information functions (?/??, |
|
477 | Note that the dynamic object information functions (?/??, ``%pdoc``, | |
480 |
%pdef, %psource) give you access to documentation even on |
|
478 | ``%pfile``, ``%pdef``, ``%psource``) give you access to documentation even on | |
481 |
are not really defined as separate identifiers. Try for example |
|
479 | things which are not really defined as separate identifiers. Try for example | |
482 | {}.get? or after doing import os, type os.path.abspath??. |
|
480 | typing {}.get? or after doing import os, type ``os.path.abspath??``. | |
483 |
|
||||
484 |
|
481 | |||
485 | .. _readline: |
|
482 | .. _readline: | |
486 |
|
483 | |||
487 | Readline-based features |
|
484 | Readline-based features | |
488 | ----------------------- |
|
485 | ----------------------- | |
489 |
|
486 | |||
490 | These features require the GNU readline library, so they won't work if |
|
487 | These features require the GNU readline library, so they won't work if your | |
491 |
|
|
488 | Python installation lacks readline support. We will first describe the default | |
492 |
|
|
489 | behavior IPython uses, and then how to change it to suit your preferences. | |
493 | your preferences. |
|
|||
494 |
|
490 | |||
495 |
|
491 | |||
496 | Command line completion |
|
492 | Command line completion | |
@@ -534,10 +530,10 b' Autoindent' | |||||
534 | IPython can recognize lines ending in ':' and indent the next line, |
|
530 | IPython can recognize lines ending in ':' and indent the next line, | |
535 | while also un-indenting automatically after 'raise' or 'return'. |
|
531 | while also un-indenting automatically after 'raise' or 'return'. | |
536 |
|
532 | |||
537 |
This feature uses the readline library, so it will honor your |
|
533 | This feature uses the readline library, so it will honor your | |
538 |
configuration (or whatever file your INPUTRC variable points |
|
534 | :file:`~/.inputrc` configuration (or whatever file your INPUTRC variable points | |
539 |
the following lines to your .inputrc file can make |
|
535 | to). Adding the following lines to your :file:`.inputrc` file can make | |
540 | more convenient (M-i indents, M-u unindents):: |
|
536 | indenting/unindenting more convenient (M-i indents, M-u unindents):: | |
541 |
|
537 | |||
542 | $if Python |
|
538 | $if Python | |
543 | "\M-i": " " |
|
539 | "\M-i": " " | |
@@ -548,17 +544,19 b' Note that there are 4 spaces between the quote marks after "M-i" above.' | |||||
548 |
|
544 | |||
549 | .. warning:: |
|
545 | .. warning:: | |
550 |
|
546 | |||
551 |
Setting the above indents will cause problems with unicode text entry in |
|
547 | Setting the above indents will cause problems with unicode text entry in | |
|
548 | the terminal. | |||
552 |
|
549 | |||
553 | .. warning:: |
|
550 | .. warning:: | |
554 |
|
551 | |||
555 | Autoindent is ON by default, but it can cause problems with |
|
552 | Autoindent is ON by default, but it can cause problems with the pasting of | |
556 |
|
|
553 | multi-line indented code (the pasted code gets re-indented on each line). A | |
557 | re-indented on each line). A magic function %autoindent allows you to |
|
554 | magic function %autoindent allows you to toggle it on/off at runtime. You | |
558 | toggle it on/off at runtime. You can also disable it permanently on in |
|
555 | can also disable it permanently on in your :file:`ipython_config.py` file | |
559 |
|
|
556 | (set TerminalInteractiveShell.autoindent=False). | |
560 |
|
557 | |||
561 |
If you want to paste multiple lines, it is recommended that you use |
|
558 | If you want to paste multiple lines, it is recommended that you use | |
|
559 | ``%paste``. | |||
562 |
|
560 | |||
563 |
|
561 | |||
564 | Customizing readline behavior |
|
562 | Customizing readline behavior | |
@@ -617,10 +615,10 b' any code you wrote while experimenting. Log files are regular text files' | |||||
617 | which you can later open in your favorite text editor to extract code or |
|
615 | which you can later open in your favorite text editor to extract code or | |
618 | to 'clean them up' before using them to replay a session. |
|
616 | to 'clean them up' before using them to replay a session. | |
619 |
|
617 | |||
620 | The %logstart function for activating logging in mid-session is used as |
|
618 | The `%logstart` function for activating logging in mid-session is used as | |
621 | follows: |
|
619 | follows:: | |
622 |
|
620 | |||
623 | %logstart [log_name [log_mode]] |
|
621 | %logstart [log_name [log_mode]] | |
624 |
|
622 | |||
625 | If no name is given, it defaults to a file named 'ipython_log.py' in your |
|
623 | If no name is given, it defaults to a file named 'ipython_log.py' in your | |
626 | current working directory, in 'rotate' mode (see below). |
|
624 | current working directory, in 'rotate' mode (see below). | |
@@ -1274,7 +1272,6 b' sections for execution as a demo:' | |||||
1274 | .. literalinclude:: ../../examples/lib/example-demo.py |
|
1272 | .. literalinclude:: ../../examples/lib/example-demo.py | |
1275 | :language: python |
|
1273 | :language: python | |
1276 |
|
1274 | |||
1277 |
|
||||
1278 | In order to run a file as a demo, you must first make a Demo object out |
|
1275 | In order to run a file as a demo, you must first make a Demo object out | |
1279 | of it. If the file is named myscript.py, the following code will make a |
|
1276 | of it. If the file is named myscript.py, the following code will make a | |
1280 | demo:: |
|
1277 | demo:: |
@@ -63,14 +63,6 b' A quick summary of the major changes (see below for details):' | |||||
63 | This requires some changes if you want to execute GUI-using scripts inside |
|
63 | This requires some changes if you want to execute GUI-using scripts inside | |
64 | IPython, see :ref:`the GUI support section <gui_support>` for more details. |
|
64 | IPython, see :ref:`the GUI support section <gui_support>` for more details. | |
65 |
|
65 | |||
66 | * **Integration into Microsoft Visual Studio**. Thanks to the work of the |
|
|||
67 | Microsoft `Python Tools for Visual Studio`__ team, this version of IPython |
|
|||
68 | has been integrated into Microsoft Visual Studio's Python tools open source |
|
|||
69 | plug-in. `Details below`_ |
|
|||
70 |
|
||||
71 | .. __: http://pytools.codeplex.com |
|
|||
72 | .. _details below: ms_visual_studio_011_ |
|
|||
73 |
|
||||
74 | * **A two-process architecture.** The Qt console is the first example of using |
|
66 | * **A two-process architecture.** The Qt console is the first example of using | |
75 | a new model that splits IPython between a kernel process where code is |
|
67 | a new model that splits IPython between a kernel process where code is | |
76 | executed and a client that handles user interaction. We plan on also |
|
68 | executed and a client that handles user interaction. We plan on also | |
@@ -85,6 +77,21 b' A quick summary of the major changes (see below for details):' | |||||
85 | hope this (ongoing) restructuring will make it easier for new developers to |
|
77 | hope this (ongoing) restructuring will make it easier for new developers to | |
86 | join us. |
|
78 | join us. | |
87 |
|
79 | |||
|
80 | * **Vim integration**. Vim can be configured to seamlessly control an IPython | |||
|
81 | kernel, see the files in :file:`docs/examples/vim` for the full details. | |||
|
82 | This work was done by Paul Ivanov, who prepared a nice `video | |||
|
83 | demonstration`__ of the features it provides. | |||
|
84 | ||||
|
85 | .. __: http://pirsquared.org/blog/2011/07/28/vim-ipython/ | |||
|
86 | ||||
|
87 | * **Integration into Microsoft Visual Studio**. Thanks to the work of the | |||
|
88 | Microsoft `Python Tools for Visual Studio`__ team, this version of IPython | |||
|
89 | has been integrated into Microsoft Visual Studio's Python tools open source | |||
|
90 | plug-in. `Details below`_ | |||
|
91 | ||||
|
92 | .. __: http://pytools.codeplex.com | |||
|
93 | .. _details below: ms_visual_studio_011_ | |||
|
94 | ||||
88 | * **Improved unicode support**. We closed many bugs related to unicode input. |
|
95 | * **Improved unicode support**. We closed many bugs related to unicode input. | |
89 |
|
96 | |||
90 | * **Python 3**. IPython now runs on Python 3.x. See :ref:`python3_011` for |
|
97 | * **Python 3**. IPython now runs on Python 3.x. See :ref:`python3_011` for | |
@@ -103,12 +110,6 b' A quick summary of the major changes (see below for details):' | |||||
103 | can have its attributes set either via files that now use real Python syntax |
|
110 | can have its attributes set either via files that now use real Python syntax | |
104 | or from the command-line. |
|
111 | or from the command-line. | |
105 |
|
112 | |||
106 | * **Vim integration**. Vim can be configured to seamlessly control an IPython |
|
|||
107 | kernel, see the files in :file:`docs/examples/vim` for the full details. |
|
|||
108 | This work was done by Paul Ivanov, who prepared a nice `video |
|
|||
109 | demonstration`__ of the features it provides. |
|
|||
110 |
|
||||
111 | .. __: http://pirsquared.org/blog/2011/07/28/vim-ipython/ |
|
|||
112 |
|
113 | |||
113 | Authors and support |
|
114 | Authors and support | |
114 | ------------------- |
|
115 | ------------------- | |
@@ -191,11 +192,14 b" list). Github's pull requests are a fantastic mechanism for reviewing code and" | |||||
191 | building a shared ownership of the project, and we are making enthusiastic use |
|
192 | building a shared ownership of the project, and we are making enthusiastic use | |
192 | of it. |
|
193 | of it. | |
193 |
|
194 | |||
194 | Note: this undercounts the number of issues closed in this development cycle, |
|
195 | .. Note:: | |
195 | since we only moved to github for issue tracking in May 2010, but we have no |
|
|||
196 | way of collecting statistics on the number of issues closed in the old |
|
|||
197 | Launchpad bug tracker prior to that. |
|
|||
198 |
|
196 | |||
|
197 | This undercounts the number of issues closed in this development cycle, | |||
|
198 | since we only moved to github for issue tracking in May 2010, but we have no | |||
|
199 | way of collecting statistics on the number of issues closed in the old | |||
|
200 | Launchpad bug tracker prior to that. | |||
|
201 | ||||
|
202 | ||||
199 | .. _qtconsole_011: |
|
203 | .. _qtconsole_011: | |
200 |
|
204 | |||
201 | Qt Console |
|
205 | Qt Console | |
@@ -250,9 +254,9 b' reference docs.' | |||||
250 | Refactoring |
|
254 | Refactoring | |
251 | ----------- |
|
255 | ----------- | |
252 |
|
256 | |||
253 |
As of th |
|
257 | As of this release, a signifiant portion of IPython has been refactored. This | |
254 |
|
|
258 | refactoring is founded on a number of new abstractions. The main new classes | |
255 |
|
|
259 | that implement these abstractions are: | |
256 |
|
260 | |||
257 | * :class:`IPython.utils.traitlets.HasTraits`. |
|
261 | * :class:`IPython.utils.traitlets.HasTraits`. | |
258 | * :class:`IPython.config.configurable.Configurable`. |
|
262 | * :class:`IPython.config.configurable.Configurable`. | |
@@ -274,8 +278,8 b" a leading '-', nor a space separating key from value. Flags exist, to set" | |||||
274 | multiple values or boolean flags, and these are always prefixed with '--', and |
|
278 | multiple values or boolean flags, and these are always prefixed with '--', and | |
275 | never take arguments. |
|
279 | never take arguments. | |
276 |
|
280 | |||
277 | ZMQ architecture |
|
281 | ZeroMQ architecture | |
278 | ---------------- |
|
282 | ------------------- | |
279 |
|
283 | |||
280 | There is a new GUI framework for IPython, based on a client-server model in |
|
284 | There is a new GUI framework for IPython, based on a client-server model in | |
281 | which multiple clients can communicate with one IPython kernel, using the |
|
285 | which multiple clients can communicate with one IPython kernel, using the | |
@@ -331,10 +335,10 b' Microsoft Visual Studio`__, as seen here:' | |||||
331 |
|
335 | |||
332 | The Microsoft team developing this currently has a release candidate out using |
|
336 | The Microsoft team developing this currently has a release candidate out using | |
333 | IPython 0.11. We will continue to collaborate with them to ensure that as they |
|
337 | IPython 0.11. We will continue to collaborate with them to ensure that as they | |
334 |
approach |
|
338 | approach their final release date, the integration with IPython remains smooth. | |
335 |
|
|
339 | We'd like to thank Dino Viehland and Shahrokh Mortazavi for the work they have | |
336 |
|
|
340 | done towards this feature, as well as Wenming Ye for his support of our WinHPC | |
337 | our WinHPC features. |
|
341 | capabilities. | |
338 |
|
342 | |||
339 | .. __: http://pytools.codeplex.com |
|
343 | .. __: http://pytools.codeplex.com | |
340 |
|
344 |
General Comments 0
You need to be logged in to leave comments.
Login now