Show More
|
1 | NO CONTENT: file renamed from docs/source/parallel/parallel_task_old.txt to docs/source/attic/parallel_task_old.txt |
@@ -1,7 +1,6 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | # |
|
3 |
# IPython documentation build configuration file |
|
|
4 | # sphinx-quickstart on Thu May 8 16:45:02 2008. | |
|
3 | # IPython documentation build configuration file. | |
|
5 | 4 | |
|
6 | 5 | # NOTE: This file has been edited manually from the auto-generated one from |
|
7 | 6 | # sphinx. Do NOT delete and re-generate. If any changes from sphinx are |
@@ -21,7 +20,11 b' import sys, os' | |||
|
21 | 20 | # If your extensions are in another directory, add it here. If the directory |
|
22 | 21 | # is relative to the documentation root, use os.path.abspath to make it |
|
23 | 22 | # absolute, like shown here. |
|
24 |
|
|
|
23 | sys.path.append(os.path.abspath('../sphinxext')) | |
|
24 | ||
|
25 | # Import support for ipython console session syntax highlighting (lives | |
|
26 | # in the sphinxext directory defined above) | |
|
27 | import ipython_console_highlighting | |
|
25 | 28 | |
|
26 | 29 | # We load the ipython release info into a dict by explicit execution |
|
27 | 30 | iprelease = {} |
@@ -32,7 +35,10 b" execfile('../../IPython/Release.py',iprelease)" | |||
|
32 | 35 | |
|
33 | 36 | # Add any Sphinx extension module names here, as strings. They can be extensions |
|
34 | 37 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
|
35 | #extensions = [] | |
|
38 | extensions = ['sphinx.ext.autodoc', | |
|
39 | 'inheritance_diagram', 'only_directives', 'plot_directive', | |
|
40 | 'ipython_console_highlighting', | |
|
41 | ] | |
|
36 | 42 | |
|
37 | 43 | # Add any paths that contain templates here, relative to this directory. |
|
38 | 44 | templates_path = ['_templates'] |
@@ -67,7 +73,7 b" today_fmt = '%B %d, %Y'" | |||
|
67 | 73 | |
|
68 | 74 | # List of directories, relative to source directories, that shouldn't be searched |
|
69 | 75 | # for source files. |
|
70 |
|
|
|
76 | exclude_dirs = ['attic'] | |
|
71 | 77 | |
|
72 | 78 | # If true, '()' will be appended to :func: etc. cross-reference text. |
|
73 | 79 | #add_function_parentheses = True |
@@ -135,7 +141,7 b" html_last_updated_fmt = '%b %d, %Y'" | |||
|
135 | 141 | #html_file_suffix = '' |
|
136 | 142 | |
|
137 | 143 | # Output file base name for HTML help builder. |
|
138 |
htmlhelp_basename = ' |
|
|
144 | htmlhelp_basename = 'ipythondoc' | |
|
139 | 145 | |
|
140 | 146 | |
|
141 | 147 | # Options for LaTeX output |
@@ -173,5 +179,8 b" latex_documents = [ ('index', 'ipython.tex', 'IPython Documentation'," | |||
|
173 | 179 | #latex_use_modindex = True |
|
174 | 180 | |
|
175 | 181 | |
|
176 | # Cleanup: delete release info to avoid pickling errors from sphinx | |
|
182 | # Cleanup | |
|
183 | # ------- | |
|
184 | # delete release info to avoid pickling errors from sphinx | |
|
185 | ||
|
177 | 186 | del iprelease |
@@ -18,6 +18,8 b' time. A hybrid approach of specifying a few options in ipythonrc and' | |||
|
18 | 18 | doing the more advanced configuration in ipy_user_conf.py is also |
|
19 | 19 | possible. |
|
20 | 20 | |
|
21 | .. _ipythonrc: | |
|
22 | ||
|
21 | 23 | The ipythonrc approach |
|
22 | 24 | ====================== |
|
23 | 25 | |
@@ -36,11 +38,11 b' fairly primitive). Note that these are not python files, and this is' | |||
|
36 | 38 | deliberate, because it allows us to do some things which would be quite |
|
37 | 39 | tricky to implement if they were normal python files. |
|
38 | 40 | |
|
39 | First, an rcfile can contain permanent default values for almost all | |
|
40 |
|
|
|
41 |
|
|
|
42 | options. However, values you explicitly specify at the command line | |
|
43 |
|
|
|
41 | First, an rcfile can contain permanent default values for almost all command | |
|
42 | line options (except things like -help or -Version). :ref:`This section | |
|
43 | <command_line_options>` contains a description of all command-line | |
|
44 | options. However, values you explicitly specify at the command line override | |
|
45 | the values defined in the rcfile. | |
|
44 | 46 | |
|
45 | 47 | Besides command line option values, the rcfile can specify values for |
|
46 | 48 | certain extra special options which are not available at the command |
@@ -266,13 +268,13 b' which look like this::' | |||
|
266 | 268 | IPython profiles |
|
267 | 269 | ================ |
|
268 | 270 | |
|
269 | As we already mentioned, IPython supports the -profile command-line | |
|
270 |
|
|
|
271 |
|
|
|
272 |
|
|
|
273 |
|
|
|
274 | IPYTHONDIR there is a file called ipythonrc-<name> or | |
|
275 | ipy_profile_<name>.py, and loads it instead of the normal ipythonrc. | |
|
271 | As we already mentioned, IPython supports the -profile command-line option (see | |
|
272 | :ref:`here <command_line_options>`). A profile is nothing more than a | |
|
273 | particular configuration file like your basic ipythonrc one, but with | |
|
274 | particular customizations for a specific purpose. When you start IPython with | |
|
275 | 'ipython -profile <name>', it assumes that in your IPYTHONDIR there is a file | |
|
276 | called ipythonrc-<name> or ipy_profile_<name>.py, and loads it instead of the | |
|
277 | normal ipythonrc. | |
|
276 | 278 | |
|
277 | 279 | This system allows you to maintain multiple configurations which load |
|
278 | 280 | modules, set options, define functions, etc. suitable for different |
@@ -11,28 +11,27 b' in a directory named by default $HOME/.ipython. You can change this by' | |||
|
11 | 11 | defining the environment variable IPYTHONDIR, or at runtime with the |
|
12 | 12 | command line option -ipythondir. |
|
13 | 13 | |
|
14 | If all goes well, the first time you run IPython it should | |
|
15 |
|
|
|
16 | based on its builtin defaults. You can look at the files it creates to | |
|
17 | learn more about configuring the system. The main file you will modify | |
|
18 | to configure IPython's behavior is called ipythonrc (with a .ini | |
|
19 | extension under Windows), included for reference in `ipythonrc`_ | |
|
20 | section. This file is very commented and has many variables you can | |
|
21 | change to suit your taste, you can find more details in | |
|
22 | Sec. customization_. Here we discuss the basic things you will want to | |
|
23 | make sure things are working properly from the beginning. | |
|
14 | If all goes well, the first time you run IPython it should automatically create | |
|
15 | a user copy of the config directory for you, based on its builtin defaults. You | |
|
16 | can look at the files it creates to learn more about configuring the | |
|
17 | system. The main file you will modify to configure IPython's behavior is called | |
|
18 | ipythonrc (with a .ini extension under Windows), included for reference | |
|
19 | :ref:`here <ipythonrc>`. This file is very commented and has many variables you | |
|
20 | can change to suit your taste, you can find more details :ref:`here | |
|
21 | <customization>`. Here we discuss the basic things you will want to make sure | |
|
22 | things are working properly from the beginning. | |
|
24 | 23 | |
|
25 | 24 | |
|
26 |
.. _ |
|
|
25 | .. _accessing_help: | |
|
27 | 26 | |
|
28 | 27 | Access to the Python help system |
|
29 | 28 | ================================ |
|
30 | 29 | |
|
31 | This is true for Python in general (not just for IPython): you should | |
|
32 |
|
|
|
33 |
|
|
|
34 |
/usr/share/doc/python-doc |
|
|
35 |
|
|
|
30 | This is true for Python in general (not just for IPython): you should have an | |
|
31 | environment variable called PYTHONDOCS pointing to the directory where your | |
|
32 | HTML Python documentation lives. In my system it's | |
|
33 | :file:`/usr/share/doc/python-doc/html`, check your local details or ask your | |
|
34 | systems administrator. | |
|
36 | 35 | |
|
37 | 36 | This is the directory which holds the HTML version of the Python |
|
38 | 37 | manuals. Unfortunately it seems that different Linux distributions |
@@ -40,8 +39,9 b' package these files differently, so you may have to look around a bit.' | |||
|
40 | 39 | Below I show the contents of this directory on my system for reference:: |
|
41 | 40 | |
|
42 | 41 | [html]> ls |
|
43 | about.dat acks.html dist/ ext/ index.html lib/ modindex.html | |
|
44 | stdabout.dat tut/ about.html api/ doc/ icons/ inst/ mac/ ref/ style.css | |
|
42 | about.html dist/ icons/ lib/ python2.5.devhelp.gz whatsnew/ | |
|
43 | acks.html doc/ index.html mac/ ref/ | |
|
44 | api/ ext/ inst/ modindex.html tut/ | |
|
45 | 45 | |
|
46 | 46 | You should really make sure this variable is correctly set so that |
|
47 | 47 | Python's pydoc-based help system works. It is a powerful and convenient |
@@ -108,6 +108,8 b' The following terminals seem to handle the color sequences fine:' | |||
|
108 | 108 | support under cygwin, please post to the IPython mailing list so |
|
109 | 109 | this issue can be resolved for all users. |
|
110 | 110 | |
|
111 | .. _pyreadline: https://code.launchpad.net/pyreadline | |
|
112 | ||
|
111 | 113 | These have shown problems: |
|
112 | 114 | |
|
113 | 115 | * Windows command prompt in WinXP/2k logged into a Linux machine via |
@@ -157,13 +159,12 b' $HOME/.ipython/ipythonrc and set the colors option to the desired value.' | |||
|
157 | 159 | Object details (types, docstrings, source code, etc.) |
|
158 | 160 | ===================================================== |
|
159 | 161 | |
|
160 | IPython has a set of special functions for studying the objects you | |
|
161 | are working with, discussed in detail in Sec. `dynamic object | |
|
162 | information`_. But this system relies on passing information which is | |
|
163 | longer than your screen through a data pager, such as the common Unix | |
|
164 | less and more programs. In order to be able to see this information in | |
|
165 | color, your pager needs to be properly configured. I strongly | |
|
166 | recommend using less instead of more, as it seems that more simply can | |
|
162 | IPython has a set of special functions for studying the objects you are working | |
|
163 | with, discussed in detail :ref:`here <dynamic_object_info>`. But this system | |
|
164 | relies on passing information which is longer than your screen through a data | |
|
165 | pager, such as the common Unix less and more programs. In order to be able to | |
|
166 | see this information in color, your pager needs to be properly configured. I | |
|
167 | strongly recommend using less instead of more, as it seems that more simply can | |
|
167 | 168 | not understand colored text correctly. |
|
168 | 169 | |
|
169 | 170 | In order to configure less as your default pager, do the following: |
@@ -357,16 +357,20 b' This section outlines the various scenarios that we need to test before we relea' | |||
|
357 | 357 | Installation scenarios under Linux and OS X |
|
358 | 358 | ------------------------------------------- |
|
359 | 359 | |
|
360 | 1. Install from tarball using `python setup.py install`. | |
|
360 | 1. Install from tarball using ``python setup.py install``. | |
|
361 | 361 | a. With only readline+nose dependencies installed. |
|
362 | b. With all dependencies installed (readline, zope.interface, | |
|
363 |
|
|
|
362 | b. With all dependencies installed (readline, zope.interface, Twisted, | |
|
363 | foolscap, Sphinx, nose, pyOpenSSL). | |
|
364 | ||
|
364 | 365 | 2. Install using easy_install. |
|
366 | ||
|
365 | 367 | a. With only readline+nose dependencies installed. |
|
366 | i. Default dependencies: `easy_install ipython-0.9.beta3-py2.5.egg` | |
|
367 | ii. Optional dependency sets: `easy_install -f ipython-0.9.beta3-py2.5.egg IPython[kernel,doc,test,security]` | |
|
368 | i. Default dependencies: ``easy_install ipython-0.9.beta3-py2.5.egg`` | |
|
369 | ii. Optional dependency sets: ``easy_install -f ipython-0.9.beta3-py2.5.egg IPython[kernel,doc,test,security]`` | |
|
370 | ||
|
368 | 371 | b. With all dependencies already installed. |
|
369 | 372 | |
|
373 | ||
|
370 | 374 | Installation scenarios under Win32 |
|
371 | 375 | ---------------------------------- |
|
372 | 376 | |
@@ -381,6 +385,7 b' Tests to run for these scenarios' | |||
|
381 | 385 | 2. Start a controller and engines and try a few things by hand. |
|
382 | 386 | a. Using ipcluster. |
|
383 | 387 | b. Using ipcontroller/ipengine by hand. |
|
388 | ||
|
384 | 389 | 3. Run a few of the parallel examples. |
|
385 | 390 | 4. Try the kernel with and without security with and without PyOpenSSL |
|
386 | 391 | installed. |
@@ -8,7 +8,7 b' IPython reference' | |||
|
8 | 8 | |
|
9 | 9 | .. contents:: |
|
10 | 10 | |
|
11 |
.. _ |
|
|
11 | .. _command_line_options: | |
|
12 | 12 | |
|
13 | 13 | Command-line usage |
|
14 | 14 | ================== |
@@ -288,12 +288,13 b' All options with a [no] prepended can be specified in negated form' | |||
|
288 | 288 | recursive inclusions. |
|
289 | 289 | |
|
290 | 290 | -prompt_in1, pi1 <string> |
|
291 | Specify the string used for input prompts. Note that if you | |
|
292 | are using numbered prompts, the number is represented with a | |
|
293 | '\#' in the string. Don't forget to quote strings with spaces | |
|
294 | embedded in them. Default: 'In [\#]:'. Sec. Prompts_ | |
|
295 | discusses in detail all the available escapes to customize | |
|
296 | your prompts. | |
|
291 | ||
|
292 | Specify the string used for input prompts. Note that if you are using | |
|
293 | numbered prompts, the number is represented with a '\#' in the | |
|
294 | string. Don't forget to quote strings with spaces embedded in | |
|
295 | them. Default: 'In [\#]:'. The :ref:`prompts section <prompts>` | |
|
296 | discusses in detail all the available escapes to customize your | |
|
297 | prompts. | |
|
297 | 298 | |
|
298 | 299 | -prompt_in2, pi2 <string> |
|
299 | 300 | Similar to the previous option, but used for the continuation |
@@ -2077,13 +2078,14 b' customizations.' | |||
|
2077 | 2078 | Access to the standard Python help |
|
2078 | 2079 | ---------------------------------- |
|
2079 | 2080 | |
|
2080 | As of Python 2.1, a help system is available with access to object | |
|
2081 |
|
|
|
2082 |
|
|
|
2083 |
|
|
|
2084 |
|
|
|
2085 |
|
|
|
2081 | As of Python 2.1, a help system is available with access to object docstrings | |
|
2082 | and the Python manuals. Simply type 'help' (no quotes) to access it. You can | |
|
2083 | also type help(object) to obtain information about a given object, and | |
|
2084 | help('keyword') for information on a keyword. As noted :ref:`here | |
|
2085 | <accessing_help>`, you need to properly configure your environment variable | |
|
2086 | PYTHONDOCS for this feature to work correctly. | |
|
2086 | 2087 | |
|
2088 | .. _dynamic_object_info: | |
|
2087 | 2089 | |
|
2088 | 2090 | Dynamic object information |
|
2089 | 2091 | -------------------------- |
@@ -2126,7 +2128,7 b' are not really defined as separate identifiers. Try for example typing' | |||
|
2126 | 2128 | {}.get? or after doing import os, type os.path.abspath??. |
|
2127 | 2129 | |
|
2128 | 2130 | |
|
2129 |
.. _ |
|
|
2131 | .. _readline: | |
|
2130 | 2132 | |
|
2131 | 2133 | Readline-based features |
|
2132 | 2134 | ----------------------- |
@@ -2240,10 +2242,9 b' explanation in your ipythonrc file.' | |||
|
2240 | 2242 | Session logging and restoring |
|
2241 | 2243 | ----------------------------- |
|
2242 | 2244 | |
|
2243 | You can log all input from a session either by starting IPython with | |
|
2244 |
|
|
|
2245 |
|
|
|
2246 | function %logstart. | |
|
2245 | You can log all input from a session either by starting IPython with the | |
|
2246 | command line switches -log or -logfile (see :ref:`here <command_line_options>`) | |
|
2247 | or by activating the logging at any moment with the magic function %logstart. | |
|
2247 | 2248 | |
|
2248 | 2249 | Log files can later be reloaded with the -logplay option and IPython |
|
2249 | 2250 | will attempt to 'replay' the log by executing all the lines in it, thus |
@@ -2279,6 +2280,8 b' resume logging to a file which had previously been started with' | |||
|
2279 | 2280 | %logstart. They will fail (with an explanation) if you try to use them |
|
2280 | 2281 | before logging has been started. |
|
2281 | 2282 | |
|
2283 | .. _system_shell_access: | |
|
2284 | ||
|
2282 | 2285 | System shell access |
|
2283 | 2286 | ------------------- |
|
2284 | 2287 | |
@@ -2389,7 +2392,7 b" These features are basically a terminal version of Ka-Ping Yee's cgitb" | |||
|
2389 | 2392 | module, now part of the standard Python library. |
|
2390 | 2393 | |
|
2391 | 2394 | |
|
2392 |
.. _ |
|
|
2395 | .. _input_caching: | |
|
2393 | 2396 | |
|
2394 | 2397 | Input caching system |
|
2395 | 2398 | -------------------- |
@@ -2429,7 +2432,7 b' sec. 6.2 <#sec:magic> for more details on the macro system.' | |||
|
2429 | 2432 | A history function %hist allows you to see any part of your input |
|
2430 | 2433 | history by printing a range of the _i variables. |
|
2431 | 2434 | |
|
2432 |
.. _ |
|
|
2435 | .. _output_caching: | |
|
2433 | 2436 | |
|
2434 | 2437 | Output caching system |
|
2435 | 2438 | --------------------- |
@@ -3034,7 +3037,7 b' which is being shared by the interactive IPython loop and your GUI' | |||
|
3034 | 3037 | thread, you should really handle it with thread locking and |
|
3035 | 3038 | syncrhonization properties. The Python documentation discusses these. |
|
3036 | 3039 | |
|
3037 |
.. _ |
|
|
3040 | .. _interactive_demos: | |
|
3038 | 3041 | |
|
3039 | 3042 | Interactive demos with IPython |
|
3040 | 3043 | ============================== |
@@ -3143,21 +3146,17 b' toolkits, including Tk, GTK and WXPython. It also provides a number of' | |||
|
3143 | 3146 | commands useful for scientific computing, all with a syntax compatible |
|
3144 | 3147 | with that of the popular Matlab program. |
|
3145 | 3148 | |
|
3146 |
IPython accepts the special option -pylab ( |
|
|
3147 |
options` |
|
|
3148 | settings in the .matplotlibrc file. IPython will detect the user's | |
|
3149 |
|
|
|
3150 |
|
|
|
3151 | interactive mode and modifies %run slightly, so that any | |
|
3152 | matplotlib-based script can be executed using %run and the final | |
|
3153 | show() command does not block the interactive shell. | |
|
3154 | ||
|
3155 | The -pylab option must be given first in order for IPython to | |
|
3156 | configure its threading mode. However, you can still issue other | |
|
3157 | options afterwards. This allows you to have a matplotlib-based | |
|
3158 | environment customized with additional modules using the standard | |
|
3159 | IPython profile mechanism (Sec. Profiles_): ''ipython -pylab -p | |
|
3160 | myprofile'' will load the profile defined in ipythonrc-myprofile after | |
|
3161 | configuring matplotlib. | |
|
3162 | ||
|
3163 | ||
|
3149 | IPython accepts the special option -pylab (see :ref:`here | |
|
3150 | <command_line_options>`). This configures it to support matplotlib, honoring | |
|
3151 | the settings in the .matplotlibrc file. IPython will detect the user's choice | |
|
3152 | of matplotlib GUI backend, and automatically select the proper threading model | |
|
3153 | to prevent blocking. It also sets matplotlib in interactive mode and modifies | |
|
3154 | %run slightly, so that any matplotlib-based script can be executed using %run | |
|
3155 | and the final show() command does not block the interactive shell. | |
|
3156 | ||
|
3157 | The -pylab option must be given first in order for IPython to configure its | |
|
3158 | threading mode. However, you can still issue other options afterwards. This | |
|
3159 | allows you to have a matplotlib-based environment customized with additional | |
|
3160 | modules using the standard IPython profile mechanism (see :ref:`here | |
|
3161 | <profiles>`): ``ipython -pylab -p myprofile`` will load the profile defined in | |
|
3162 | ipythonrc-myprofile after configuring matplotlib. |
@@ -24,11 +24,11 b' Tab completion' | |||
|
24 | 24 | -------------- |
|
25 | 25 | |
|
26 | 26 | TAB-completion, especially for attributes, is a convenient way to explore the |
|
27 | structure of any object you're dealing with. Simply type object_name.<TAB> | |
|
28 |
|
|
|
29 |
more). Tab completion also works on file and directory |
|
|
30 |
with IPython's alias system allows you to do from within |
|
|
31 | things you normally would need the system shell for. | |
|
27 | structure of any object you're dealing with. Simply type object_name.<TAB> and | |
|
28 | a list of the object's attributes will be printed (see :ref:`the readline | |
|
29 | section <readline>` for more). Tab completion also works on file and directory | |
|
30 | names, which combined with IPython's alias system allows you to do from within | |
|
31 | IPython many of the things you normally would need the system shell for. | |
|
32 | 32 | |
|
33 | 33 | Explore your objects |
|
34 | 34 | -------------------- |
@@ -39,18 +39,18 b' constructor details for classes. The magic commands %pdoc, %pdef, %psource' | |||
|
39 | 39 | and %pfile will respectively print the docstring, function definition line, |
|
40 | 40 | full source code and the complete file for any object (when they can be |
|
41 | 41 | found). If automagic is on (it is by default), you don't need to type the '%' |
|
42 |
explicitly. See |
|
|
42 | explicitly. See :ref:`this section <dynamic_object_info>` for more. | |
|
43 | 43 | |
|
44 | 44 | The `%run` magic command |
|
45 | 45 | ------------------------ |
|
46 | 46 | |
|
47 | The %run magic command allows you to run any python script and load all of | |
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
|
47 | The %run magic command allows you to run any python script and load all of its | |
|
48 | data directly into the interactive namespace. Since the file is re-read from | |
|
49 | disk each time, changes you make to it are reflected immediately (in contrast | |
|
50 | to the behavior of import). I rarely use import for code I am testing, relying | |
|
51 | on %run instead. See :ref:`this section <magic>` for more on this and other | |
|
52 | magic commands, or type the name of any magic command and ? to get details on | |
|
53 | it. See also :ref:`this section <dreload>` for a recursive reload command. %run | |
|
54 | 54 | also has special flags for timing the execution of your scripts (-t) and for |
|
55 | 55 | executing them under the control of either Python's pdb debugger (-d) or |
|
56 | 56 | profiler (-p). With all of these, %run can be used as the main tool for |
@@ -60,21 +60,21 b' choice.' | |||
|
60 | 60 | Debug a Python script |
|
61 | 61 | --------------------- |
|
62 | 62 | |
|
63 | Use the Python debugger, pdb. The %pdb command allows you to toggle on and | |
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
|
74 |
|
|
|
75 | the 1/0. Note also that '%run -d' activates pdb and automatically sets | |
|
76 | initial breakpoints for you to step through your code, watch variables, etc. | |
|
77 |
|
|
|
63 | Use the Python debugger, pdb. The %pdb command allows you to toggle on and off | |
|
64 | the automatic invocation of an IPython-enhanced pdb debugger (with coloring, | |
|
65 | tab completion and more) at any uncaught exception. The advantage of this is | |
|
66 | that pdb starts inside the function where the exception occurred, with all data | |
|
67 | still available. You can print variables, see code, execute statements and even | |
|
68 | walk up and down the call stack to track down the true source of the problem | |
|
69 | (which often is many layers in the stack above where the exception gets | |
|
70 | triggered). Running programs with %run and pdb active can be an efficient to | |
|
71 | develop and debug code, in many cases eliminating the need for print statements | |
|
72 | or external debugging tools. I often simply put a 1/0 in a place where I want | |
|
73 | to take a look so that pdb gets called, quickly view whatever variables I need | |
|
74 | to or test various pieces of code and then remove the 1/0. Note also that '%run | |
|
75 | -d' activates pdb and automatically sets initial breakpoints for you to step | |
|
76 | through your code, watch variables, etc. The :ref:`output caching section | |
|
77 | <output_caching>` has more details. | |
|
78 | 78 | |
|
79 | 79 | Use the output cache |
|
80 | 80 | -------------------- |
@@ -84,7 +84,8 b' and variables named _1, _2, etc. alias them. For example, the result of input' | |||
|
84 | 84 | line 4 is available either as Out[4] or as _4. Additionally, three variables |
|
85 | 85 | named _, __ and ___ are always kept updated with the for the last three |
|
86 | 86 | results. This allows you to recall any previous result and further use it for |
|
87 |
new calculations. See |
|
|
87 | new calculations. See :ref:`the output caching section <output_caching>` for | |
|
88 | more. | |
|
88 | 89 | |
|
89 | 90 | Suppress output |
|
90 | 91 | --------------- |
@@ -102,7 +103,7 b' A similar system exists for caching input. All input is stored in a global' | |||
|
102 | 103 | list called In , so you can re-execute lines 22 through 28 plus line 34 by |
|
103 | 104 | typing 'exec In[22:29]+In[34]' (using Python slicing notation). If you need |
|
104 | 105 | to execute the same set of lines often, you can assign them to a macro with |
|
105 |
the %macro function. See |
|
|
106 | the %macro function. See :ref:`here <input_caching>` for more. | |
|
106 | 107 | |
|
107 | 108 | Use your input history |
|
108 | 109 | ---------------------- |
@@ -134,17 +135,18 b' into Python variables.' | |||
|
134 | 135 | Use Python variables when calling the shell |
|
135 | 136 | ------------------------------------------- |
|
136 | 137 | |
|
137 | Expand python variables when calling the shell (either via '!' and '!!' or | |
|
138 |
|
|
|
139 |
python expressions. See |
|
|
138 | Expand python variables when calling the shell (either via '!' and '!!' or via | |
|
139 | aliases) by prepending a $ in front of them. You can also expand complete | |
|
140 | python expressions. See :ref:`our shell section <system_shell_access>` for | |
|
141 | more details. | |
|
140 | 142 | |
|
141 | 143 | Use profiles |
|
142 | 144 | ------------ |
|
143 | 145 | |
|
144 | 146 | Use profiles to maintain different configurations (modules to load, function |
|
145 | 147 | definitions, option settings) for particular tasks. You can then have |
|
146 |
customized versions of IPython for specific purposes. |
|
|
147 | more. | |
|
148 | customized versions of IPython for specific purposes. :ref:`This section | |
|
149 | <profiles>` has more details. | |
|
148 | 150 | |
|
149 | 151 | |
|
150 | 152 | Embed IPython in your programs |
@@ -152,7 +154,7 b' Embed IPython in your programs' | |||
|
152 | 154 | |
|
153 | 155 | A few lines of code are enough to load a complete IPython inside your own |
|
154 | 156 | programs, giving you the ability to work with your data interactively after |
|
155 |
automatic processing has been completed. See |
|
|
157 | automatic processing has been completed. See :ref:`here <embedding>` for more. | |
|
156 | 158 | |
|
157 | 159 | Use the Python profiler |
|
158 | 160 | ----------------------- |
@@ -166,8 +168,8 b' Use IPython to present interactive demos' | |||
|
166 | 168 | ---------------------------------------- |
|
167 | 169 | |
|
168 | 170 | Use the IPython.demo.Demo class to load any Python script as an interactive |
|
169 | demo. With a minimal amount of simple markup, you can control the execution | |
|
170 |
|
|
|
171 | demo. With a minimal amount of simple markup, you can control the execution of | |
|
172 | the script, stopping as needed. See :ref:`here <interactive_demos>` for more. | |
|
171 | 173 | |
|
172 | 174 | Run doctests |
|
173 | 175 | ------------ |
General Comments 0
You need to be logged in to leave comments.
Login now