Show More
@@ -1,9 +1,11 b'' | |||||
|
1 | .. _install_index: | |||
|
2 | ||||
1 | ================== |
|
3 | ================== | |
2 | Installation |
|
4 | Installation | |
3 | ================== |
|
5 | ================== | |
4 |
|
6 | |||
5 | .. toctree:: |
|
7 | .. toctree:: | |
6 | :maxdepth: 2 |
|
8 | :maxdepth: 2 | |
7 |
|
9 | |||
8 | basic.txt |
|
10 | basic.txt | |
9 | advanced.txt |
|
11 | advanced.txt |
@@ -1,189 +1,174 b'' | |||||
1 | .. _overview: |
|
1 | .. _overview: | |
2 |
|
2 | |||
3 | ============ |
|
3 | ============ | |
4 | Introduction |
|
4 | Introduction | |
5 | ============ |
|
5 | ============ | |
6 |
|
6 | |||
7 | This is the official documentation for IPython 0.x series (i.e. what |
|
|||
8 | we are used to refer to just as "IPython"). The original text of the |
|
|||
9 | manual (most of which is still in place) has been authored by Fernando |
|
|||
10 | Perez, but as recommended usage patterns and new features have |
|
|||
11 | emerged, this manual has been updated to reflect that fact. Most of |
|
|||
12 | the additions have been authored by Ville M. Vainio. |
|
|||
13 |
|
||||
14 | The manual has been generated from reStructuredText source markup with |
|
|||
15 | Sphinx, which should make it much easier to keep it up-to-date in the |
|
|||
16 | future. Some reST artifacts and bugs may still be apparent in the |
|
|||
17 | documentation, but this should improve as the toolchain matures. |
|
|||
18 |
|
||||
19 | Overview |
|
7 | Overview | |
20 | ======== |
|
8 | ======== | |
21 |
|
9 | |||
22 | One of Python's most useful features is its interactive interpreter. |
|
10 | One of Python's most useful features is its interactive interpreter. | |
23 | This system allows very fast testing of ideas without the overhead of |
|
11 | This system allows very fast testing of ideas without the overhead of | |
24 | creating test files as is typical in most programming languages. |
|
12 | creating test files as is typical in most programming languages. | |
25 | However, the interpreter supplied with the standard Python distribution |
|
13 | However, the interpreter supplied with the standard Python distribution | |
26 | is somewhat limited for extended interactive use. |
|
14 | is somewhat limited for extended interactive use. | |
27 |
|
15 | |||
28 | IPython is a free software project (released under the BSD license) |
|
16 | The goal of IPython is to create a comprehensive environment for | |
29 | which tries to: |
|
17 | interactive and exploratory computing. To support, this goal, IPython | |
|
18 | has two main components: | |||
|
19 | ||||
|
20 | * An enhanced interactive Python shell. | |||
|
21 | * An architecture for interactive parallel computing. | |||
|
22 | ||||
|
23 | All of IPython is open source (released under the revised BSD license). | |||
|
24 | ||||
|
25 | Enhanced interactive Python shell | |||
|
26 | ================================= | |||
|
27 | ||||
|
28 | IPython's interactive shell (`ipython`), has the following goals: | |||
30 |
|
29 | |||
31 | 1. Provide an interactive shell superior to Python's default. IPython |
|
30 | 1. Provide an interactive shell superior to Python's default. IPython | |
32 | has many features for object introspection, system shell access, |
|
31 | has many features for object introspection, system shell access, | |
33 | and its own special command system for adding functionality when |
|
32 | and its own special command system for adding functionality when | |
34 | working interactively. It tries to be a very efficient environment |
|
33 | working interactively. It tries to be a very efficient environment | |
35 | both for Python code development and for exploration of problems |
|
34 | both for Python code development and for exploration of problems | |
36 | using Python objects (in situations like data analysis). |
|
35 | using Python objects (in situations like data analysis). | |
37 | 2. Serve as an embeddable, ready to use interpreter for your own |
|
36 | 2. Serve as an embeddable, ready to use interpreter for your own | |
38 | programs. IPython can be started with a single call from inside |
|
37 | programs. IPython can be started with a single call from inside | |
39 | another program, providing access to the current namespace. This |
|
38 | another program, providing access to the current namespace. This | |
40 | can be very useful both for debugging purposes and for situations |
|
39 | can be very useful both for debugging purposes and for situations | |
41 | where a blend of batch-processing and interactive exploration are |
|
40 | where a blend of batch-processing and interactive exploration are | |
42 | needed. |
|
41 | needed. | |
43 | 3. Offer a flexible framework which can be used as the base |
|
42 | 3. Offer a flexible framework which can be used as the base | |
44 | environment for other systems with Python as the underlying |
|
43 | environment for other systems with Python as the underlying | |
45 | language. Specifically scientific environments like Mathematica, |
|
44 | language. Specifically scientific environments like Mathematica, | |
46 | IDL and Matlab inspired its design, but similar ideas can be |
|
45 | IDL and Matlab inspired its design, but similar ideas can be | |
47 | useful in many fields. |
|
46 | useful in many fields. | |
48 | 4. Allow interactive testing of threaded graphical toolkits. IPython |
|
47 | 4. Allow interactive testing of threaded graphical toolkits. IPython | |
49 | has support for interactive, non-blocking control of GTK, Qt and |
|
48 | has support for interactive, non-blocking control of GTK, Qt and | |
50 | WX applications via special threading flags. The normal Python |
|
49 | WX applications via special threading flags. The normal Python | |
51 | shell can only do this for Tkinter applications. |
|
50 | shell can only do this for Tkinter applications. | |
52 |
|
51 | |||
53 |
|
52 | Main features of the interactive shell | ||
54 | Main features |
|
53 | -------------------------------------- | |
55 | ------------- |
|
54 | ||
56 |
|
55 | * Dynamic object introspection. One can access docstrings, function | ||
57 | * Dynamic object introspection. One can access docstrings, function |
|
56 | definition prototypes, source code, source files and other details | |
58 | definition prototypes, source code, source files and other details |
|
57 | of any object accessible to the interpreter with a single | |
59 | of any object accessible to the interpreter with a single |
|
58 | keystroke (:samp:`?`, and using :samp:`??` provides additional detail). | |
60 | keystroke ('?', and using '??' provides additional detail). |
|
59 | * Searching through modules and namespaces with :samp:`*` wildcards, both | |
61 | * Searching through modules and namespaces with '*' wildcards, both |
|
60 | when using the :samp:`?` system and via the :samp:`%psearch` command. | |
62 | when using the '?' system and via the %psearch command. |
|
61 | * Completion in the local namespace, by typing :kbd:`TAB` at the prompt. | |
63 | * Completion in the local namespace, by typing TAB at the prompt. |
|
62 | This works for keywords, modules, methods, variables and files in the | |
64 | This works for keywords, modules, methods, variables and files in the |
|
63 | current directory. This is supported via the readline library, and | |
65 | current directory. This is supported via the readline library, and |
|
64 | full access to configuring readline's behavior is provided. | |
66 | full access to configuring readline's behavior is provided. |
|
65 | Custom completers can be implemented easily for different purposes | |
67 | Custom completers can be implemented easily for different purposes |
|
66 | (system commands, magic arguments etc.) | |
68 | (system commands, magic arguments etc.) |
|
67 | * Numbered input/output prompts with command history (persistent | |
69 | * Numbered input/output prompts with command history (persistent |
|
68 | across sessions and tied to each profile), full searching in this | |
70 | across sessions and tied to each profile), full searching in this |
|
69 | history and caching of all input and output. | |
71 | history and caching of all input and output. |
|
70 | * User-extensible 'magic' commands. A set of commands prefixed with | |
72 | * User-extensible 'magic' commands. A set of commands prefixed with |
|
71 | :samp:`%` is available for controlling IPython itself and provides | |
73 | % is available for controlling IPython itself and provides |
|
72 | directory control, namespace information and many aliases to | |
74 | directory control, namespace information and many aliases to |
|
73 | common system shell commands. | |
75 | common system shell commands. |
|
74 | * Alias facility for defining your own system aliases. | |
76 | * Alias facility for defining your own system aliases. |
|
75 | * Complete system shell access. Lines starting with :samp:`!` are passed | |
77 | * Complete system shell access. Lines starting with ! are passed |
|
76 | directly to the system shell, and using :samp:`!!` or :samp:`var = !cmd` | |
78 | directly to the system shell, and using !! or var = !cmd |
|
77 | captures shell output into python variables for further use. | |
79 | captures shell output into python variables for further use. |
|
78 | * Background execution of Python commands in a separate thread. | |
80 | * Background execution of Python commands in a separate thread. |
|
79 | IPython has an internal job manager called jobs, and a | |
81 | IPython has an internal job manager called jobs, and a |
|
80 | conveninence backgrounding magic function called :samp:`%bg`. | |
82 | conveninence backgrounding magic function called %bg. |
|
81 | * The ability to expand python variables when calling the system | |
83 | * The ability to expand python variables when calling the system |
|
82 | shell. In a shell command, any python variable prefixed with :samp:`$` is | |
84 | shell. In a shell command, any python variable prefixed with $ is |
|
83 | expanded. A double :samp:`$$` allows passing a literal :samp:`$` to the shell (for | |
85 | expanded. A double $$ allows passing a literal $ to the shell (for |
|
84 | access to shell and environment variables like :envvar:`PATH`). | |
86 | access to shell and environment variables like $PATH). |
|
85 | * Filesystem navigation, via a magic :samp:`%cd` command, along with a | |
87 | * Filesystem navigation, via a magic %cd command, along with a |
|
86 | persistent bookmark system (using :samp:`%bookmark`) for fast access to | |
88 | persistent bookmark system (using %bookmark) for fast access to |
|
87 | frequently visited directories. | |
89 | frequently visited directories. |
|
88 | * A lightweight persistence framework via the :samp:`%store` command, which | |
90 | * A lightweight persistence framework via the %store command, which |
|
89 | allows you to save arbitrary Python variables. These get restored | |
91 | allows you to save arbitrary Python variables. These get restored |
|
90 | automatically when your session restarts. | |
92 | automatically when your session restarts. |
|
91 | * Automatic indentation (optional) of code as you type (through the | |
93 | * Automatic indentation (optional) of code as you type (through the |
|
92 | readline library). | |
94 | readline library). |
|
93 | * Macro system for quickly re-executing multiple lines of previous | |
95 | * Macro system for quickly re-executing multiple lines of previous |
|
94 | input with a single name. Macros can be stored persistently via | |
96 | input with a single name. Macros can be stored persistently via |
|
95 | :samp:`%store` and edited via :samp:`%edit`. | |
97 | %store and edited via %edit. |
|
96 | * Session logging (you can then later use these logs as code in your | |
98 | * Session logging (you can then later use these logs as code in your |
|
97 | programs). Logs can optionally timestamp all input, and also store | |
99 | programs). Logs can optionally timestamp all input, and also store |
|
98 | session output (marked as comments, so the log remains valid | |
100 | session output (marked as comments, so the log remains valid |
|
99 | Python source code). | |
101 | Python source code). |
|
100 | * Session restoring: logs can be replayed to restore a previous | |
102 | * Session restoring: logs can be replayed to restore a previous |
|
101 | session to the state where you left it. | |
103 | session to the state where you left it. |
|
102 | * Verbose and colored exception traceback printouts. Easier to parse | |
104 | * Verbose and colored exception traceback printouts. Easier to parse |
|
103 | visually, and in verbose mode they produce a lot of useful | |
105 | visually, and in verbose mode they produce a lot of useful |
|
104 | debugging information (basically a terminal version of the cgitb | |
106 | debugging information (basically a terminal version of the cgitb |
|
105 | module). | |
107 | module). |
|
106 | * Auto-parentheses: callable objects can be executed without | |
108 | * Auto-parentheses: callable objects can be executed without |
|
107 | parentheses: :samp:`sin 3` is automatically converted to :samp:`sin(3)`. | |
109 | parentheses: 'sin 3' is automatically converted to 'sin(3)'. |
|
108 | * Auto-quoting: using :samp:`,`, or :samp:`;` as the first character forces | |
110 | * Auto-quoting: using ',' or ';' as the first character forces |
|
109 | auto-quoting of the rest of the line: :samp:`,my_function a b` becomes | |
111 | auto-quoting of the rest of the line: ',my_function a b' becomes |
|
110 | automatically :samp:`my_function("a","b")`, while :samp:`;my_function a b` | |
112 | automatically 'my_function("a","b")', while ';my_function a b' |
|
111 | becomes :samp:`my_function("a b")`. | |
113 | becomes 'my_function("a b")'. |
|
112 | * Extensible input syntax. You can define filters that pre-process | |
114 | * Extensible input syntax. You can define filters that pre-process |
|
113 | user input to simplify input in special situations. This allows | |
115 | user input to simplify input in special situations. This allows |
|
114 | for example pasting multi-line code fragments which start with | |
116 | for example pasting multi-line code fragments which start with |
|
115 | :samp:`>>>` or :samp:`...` such as those from other python sessions or the | |
117 | '>>>' or '...' such as those from other python sessions or the |
|
116 | standard Python documentation. | |
118 | standard Python documentation. |
|
117 | * Flexible configuration system. It uses a configuration file which | |
119 | * Flexible configuration system. It uses a configuration file which |
|
118 | allows permanent setting of all command-line options, module | |
120 | allows permanent setting of all command-line options, module |
|
119 | loading, code and file execution. The system allows recursive file | |
121 | loading, code and file execution. The system allows recursive file |
|
120 | inclusion, so you can have a base file with defaults and layers | |
122 | inclusion, so you can have a base file with defaults and layers |
|
121 | which load other customizations for particular projects. | |
123 | which load other customizations for particular projects. |
|
122 | * Embeddable. You can call IPython as a python shell inside your own | |
124 | * Embeddable. You can call IPython as a python shell inside your own |
|
123 | python programs. This can be used both for debugging code or for | |
125 | python programs. This can be used both for debugging code or for |
|
124 | providing interactive abilities to your programs with knowledge | |
126 | providing interactive abilities to your programs with knowledge |
|
125 | about the local namespaces (very useful in debugging and data | |
127 | about the local namespaces (very useful in debugging and data |
|
126 | analysis situations). | |
128 | analysis situations). |
|
127 | * Easy debugger access. You can set IPython to call up an enhanced | |
129 | * Easy debugger access. You can set IPython to call up an enhanced |
|
128 | version of the Python debugger (pdb) every time there is an | |
130 | version of the Python debugger (pdb) every time there is an |
|
129 | uncaught exception. This drops you inside the code which triggered | |
131 | uncaught exception. This drops you inside the code which triggered |
|
130 | the exception with all the data live and it is possible to | |
132 | the exception with all the data live and it is possible to |
|
131 | navigate the stack to rapidly isolate the source of a bug. The | |
133 | navigate the stack to rapidly isolate the source of a bug. The |
|
132 | :samp:`%run` magic command (with the :samp:`-d` option) can run any script under | |
134 | %run magic command -with the -d option- can run any script under |
|
133 | pdb's control, automatically setting initial breakpoints for you. | |
135 | pdb's control, automatically setting initial breakpoints for you. |
|
134 | This version of pdb has IPython-specific improvements, including | |
136 | This version of pdb has IPython-specific improvements, including |
|
135 | tab-completion and traceback coloring support. For even easier | |
137 | tab-completion and traceback coloring support. For even easier |
|
136 | debugger access, try :samp:`%debug` after seeing an exception. winpdb is | |
138 | debugger access, try %debug after seeing an exception. winpdb is |
|
137 | also supported, see ipy_winpdb extension. | |
139 | also supported, see ipy_winpdb extension. |
|
138 | * Profiler support. You can run single statements (similar to | |
140 | * Profiler support. You can run single statements (similar to |
|
139 | :samp:`profile.run()`) or complete programs under the profiler's control. | |
141 | profile.run()) or complete programs under the profiler's control. |
|
140 | While this is possible with standard cProfile or profile modules, | |
142 | While this is possible with standard cProfile or profile modules, |
|
141 | IPython wraps this functionality with magic commands (see :samp:`%prun` | |
143 | IPython wraps this functionality with magic commands (see '%prun' |
|
142 | and :samp:`%run -p`) convenient for rapid interactive work. | |
144 | and '%run -p') convenient for rapid interactive work. |
|
143 | * Doctest support. The special :samp:`%doctest_mode` command toggles a mode | |
145 | * Doctest support. The special %doctest_mode command toggles a mode |
|
144 | that allows you to paste existing doctests (with leading :samp:`>>>` | |
146 | that allows you to paste existing doctests (with leading '>>>' |
|
145 | prompts and whitespace) and uses doctest-compatible prompts and | |
147 | prompts and whitespace) and uses doctest-compatible prompts and |
|
146 | output, so you can use IPython sessions as doctest code. | |
148 | output, so you can use IPython sessions as doctest code. |
|
147 | ||
149 |
|
148 | Interactive parallel computing | ||
|
149 | ============================== | |||
|
150 | ||||
|
151 | Increasingly, parallel computer hardware, such as multicore CPUs, clusters and supercomputers, is becoming ubiquitous. Over the last 3 years, we have developed an | |||
|
152 | architecture within IPython that allows such hardware to be used quickly and easily | |||
|
153 | from Python. Moreover, this architecture is designed to support interactive and | |||
|
154 | collaborative parallel computing. | |||
|
155 | ||||
|
156 | For more information, see our :ref:`overview <parallel_index>` of using IPython for | |||
|
157 | parallel computing. | |||
150 |
|
158 | |||
151 | Portability and Python requirements |
|
159 | Portability and Python requirements | |
152 | ----------------------------------- |
|
160 | ----------------------------------- | |
153 |
|
161 | |||
154 | Python requirements: IPython requires with Python version 2.3 or newer. |
|
162 | As of the 0.9 release, IPython requires Python 2.4 or greater. We have | |
155 | If you are still using Python 2.2 and can not upgrade, the last version |
|
163 | not begun to test IPython on Python 2.6 or 3.0, but we expect it will | |
156 | of IPython which worked with Python 2.2 was 0.6.15, so you will have to |
|
164 | work with some minor changes. | |
157 | use that. |
|
165 | ||
158 |
|
166 | IPython is known to work on the following operating systems: | ||
159 | IPython is developed under Linux, but it should work in any reasonable |
|
167 | ||
160 | Unix-type system (tested OK under Solaris and the BSD family, for which |
|
168 | * Linux | |
161 | a port exists thanks to Dryice Liu). |
|
169 | * AIX | |
162 |
|
170 | * Most other Unix-like OSs (Solaris, BSD, etc.) | ||
163 | Mac OS X: it works, apparently without any problems (thanks to Jim Boyle |
|
171 | * Mac OS X | |
164 | at Lawrence Livermore for the information). Thanks to Andrea Riciputi, |
|
172 | * Windows (CygWin, XP, Vista, etc.) | |
165 | Fink support is available. |
|
173 | ||
166 |
|
174 | See :ref:`here <install_index>` for instructions on how to install IPython. No newline at end of file | ||
167 | CygWin: it works mostly OK, though some users have reported problems |
|
|||
168 | with prompt coloring. No satisfactory solution to this has been found so |
|
|||
169 | far, you may want to disable colors permanently in the ipythonrc |
|
|||
170 | configuration file if you experience problems. If you have proper color |
|
|||
171 | support under cygwin, please post to the IPython mailing list so this |
|
|||
172 | issue can be resolved for all users. |
|
|||
173 |
|
||||
174 | Windows: it works well under Windows Vista/XP/2k, and I suspect NT should |
|
|||
175 | behave similarly. Section "Installation under windows" describes |
|
|||
176 | installation details for Windows, including some additional tools needed |
|
|||
177 | on this platform. |
|
|||
178 |
|
||||
179 | Windows 9x support is present, and has been reported to work fine (at |
|
|||
180 | least on WinME). |
|
|||
181 |
|
||||
182 | Location |
|
|||
183 | -------- |
|
|||
184 |
|
||||
185 | IPython is generously hosted at http://ipython.scipy.org by the |
|
|||
186 | Enthought, Inc and the SciPy project. This site offers downloads, |
|
|||
187 | subversion access, mailing lists and a bug tracking system. I am very |
|
|||
188 | grateful to Enthought (http://www.enthought.com) and all of the SciPy |
|
|||
189 | team for their contribution. No newline at end of file |
|
@@ -1,15 +1,17 b'' | |||||
|
1 | .. _parallel_index: | |||
|
2 | ||||
1 | ==================================== |
|
3 | ==================================== | |
2 | Using IPython for Parallel computing |
|
4 | Using IPython for Parallel computing | |
3 | ==================================== |
|
5 | ==================================== | |
4 |
|
6 | |||
5 | User Documentation |
|
7 | User Documentation | |
6 | ================== |
|
8 | ================== | |
7 |
|
9 | |||
8 | .. toctree:: |
|
10 | .. toctree:: | |
9 | :maxdepth: 2 |
|
11 | :maxdepth: 2 | |
10 |
|
12 | |||
11 | parallel_intro.txt |
|
13 | parallel_intro.txt | |
12 | parallel_multiengine.txt |
|
14 | parallel_multiengine.txt | |
13 | parallel_task.txt |
|
15 | parallel_task.txt | |
14 | parallel_mpi.txt |
|
16 | parallel_mpi.txt | |
15 |
|
17 |
General Comments 0
You need to be logged in to leave comments.
Login now