This repository was archived by the owner on Apr 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathoverview.html
More file actions
321 lines (312 loc) · 18.5 KB
/
overview.html
File metadata and controls
321 lines (312 loc) · 18.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Introduction — IPython v0.10.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.10.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="IPython v0.10.1 documentation" href="index.html" />
<link rel="next" title="Installation" href="install/index.html" />
<link rel="prev" title="IPython Documentation" href="index.html" />
<link rel="canonical" href="http://ipython.readthedocs.io/en/stable/overview.html"/>
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="install/index.html" title="Installation"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="IPython Documentation"
accesskey="P">previous</a> |</li>
<li><a href="index.html">IPython v0.10.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="introduction">
<span id="overview"></span><h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<h2>Overview<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<p>One of Python’s most useful features is its interactive interpreter.
This system allows very fast testing of ideas without the overhead of
creating test files as is typical in most programming languages.
However, the interpreter supplied with the standard Python distribution
is somewhat limited for extended interactive use.</p>
<p>The goal of IPython is to create a comprehensive environment for
interactive and exploratory computing. To support this goal, IPython
has two main components:</p>
<ul class="simple">
<li>An enhanced interactive Python shell.</li>
<li>An architecture for interactive parallel computing.</li>
</ul>
<p>All of IPython is open source (released under the revised BSD license).</p>
</div>
<div class="section" id="enhanced-interactive-python-shell">
<h2>Enhanced interactive Python shell<a class="headerlink" href="#enhanced-interactive-python-shell" title="Permalink to this headline">¶</a></h2>
<p>IPython’s interactive shell (<strong class="command">ipython</strong>), has the following goals,
amongst others:</p>
<ol class="arabic simple">
<li>Provide an interactive shell superior to Python’s default. IPython
has many features for object introspection, system shell access,
and its own special command system for adding functionality when
working interactively. It tries to be a very efficient environment
both for Python code development and for exploration of problems
using Python objects (in situations like data analysis).</li>
<li>Serve as an embeddable, ready to use interpreter for your own
programs. IPython can be started with a single call from inside
another program, providing access to the current namespace. This
can be very useful both for debugging purposes and for situations
where a blend of batch-processing and interactive exploration are
needed. New in the 0.9 version of IPython is a reusable wxPython
based IPython widget.</li>
<li>Offer a flexible framework which can be used as the base
environment for other systems with Python as the underlying
language. Specifically scientific environments like Mathematica,
IDL and Matlab inspired its design, but similar ideas can be
useful in many fields.</li>
<li>Allow interactive testing of threaded graphical toolkits. IPython
has support for interactive, non-blocking control of GTK, Qt and
WX applications via special threading flags. The normal Python
shell can only do this for Tkinter applications.</li>
</ol>
<div class="section" id="main-features-of-the-interactive-shell">
<h3>Main features of the interactive shell<a class="headerlink" href="#main-features-of-the-interactive-shell" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Dynamic object introspection. One can access docstrings, function
definition prototypes, source code, source files and other details
of any object accessible to the interpreter with a single
keystroke (<tt class="samp docutils literal"><span class="pre">?</span></tt>, and using <tt class="samp docutils literal"><span class="pre">??</span></tt> provides additional detail).</li>
<li>Searching through modules and namespaces with <tt class="samp docutils literal"><span class="pre">*</span></tt> wildcards, both
when using the <tt class="samp docutils literal"><span class="pre">?</span></tt> system and via the <tt class="samp docutils literal"><span class="pre">%psearch</span></tt> command.</li>
<li>Completion in the local namespace, by typing <tt class="kbd docutils literal"><span class="pre">TAB</span></tt> at the prompt.
This works for keywords, modules, methods, variables and files in the
current directory. This is supported via the readline library, and
full access to configuring readline’s behavior is provided.
Custom completers can be implemented easily for different purposes
(system commands, magic arguments etc.)</li>
<li>Numbered input/output prompts with command history (persistent
across sessions and tied to each profile), full searching in this
history and caching of all input and output.</li>
<li>User-extensible ‘magic’ commands. A set of commands prefixed with
<tt class="samp docutils literal"><span class="pre">%</span></tt> is available for controlling IPython itself and provides
directory control, namespace information and many aliases to
common system shell commands.</li>
<li>Alias facility for defining your own system aliases.</li>
<li>Complete system shell access. Lines starting with <tt class="samp docutils literal"><span class="pre">!</span></tt> are passed
directly to the system shell, and using <tt class="samp docutils literal"><span class="pre">!!</span></tt> or <tt class="samp docutils literal"><span class="pre">var</span> <span class="pre">=</span> <span class="pre">!cmd</span></tt>
captures shell output into python variables for further use.</li>
<li>Background execution of Python commands in a separate thread.
IPython has an internal job manager called jobs, and a
convenience backgrounding magic function called <tt class="samp docutils literal"><span class="pre">%bg</span></tt>.</li>
<li>The ability to expand python variables when calling the system shell. In a
shell command, any python variable prefixed with <tt class="samp docutils literal"><span class="pre">$</span></tt> is expanded. A
double <tt class="samp docutils literal"><span class="pre">$$</span></tt> allows passing a literal <tt class="samp docutils literal"><span class="pre">$</span></tt> to the shell (for access
to shell and environment variables like <span class="target" id="index-0"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt>).</li>
<li>Filesystem navigation, via a magic <tt class="samp docutils literal"><span class="pre">%cd</span></tt> command, along with a
persistent bookmark system (using <tt class="samp docutils literal"><span class="pre">%bookmark</span></tt>) for fast access to
frequently visited directories.</li>
<li>A lightweight persistence framework via the <tt class="samp docutils literal"><span class="pre">%store</span></tt> command, which
allows you to save arbitrary Python variables. These get restored
automatically when your session restarts.</li>
<li>Automatic indentation (optional) of code as you type (through the
readline library).</li>
<li>Macro system for quickly re-executing multiple lines of previous
input with a single name. Macros can be stored persistently via
<tt class="samp docutils literal"><span class="pre">%store</span></tt> and edited via <tt class="samp docutils literal"><span class="pre">%edit</span></tt>.</li>
<li>Session logging (you can then later use these logs as code in your
programs). Logs can optionally timestamp all input, and also store
session output (marked as comments, so the log remains valid
Python source code).</li>
<li>Session restoring: logs can be replayed to restore a previous
session to the state where you left it.</li>
<li>Verbose and colored exception traceback printouts. Easier to parse
visually, and in verbose mode they produce a lot of useful
debugging information (basically a terminal version of the cgitb
module).</li>
<li>Auto-parentheses: callable objects can be executed without
parentheses: <tt class="samp docutils literal"><span class="pre">sin</span> <span class="pre">3</span></tt> is automatically converted to <tt class="samp docutils literal"><span class="pre">sin(3)</span></tt>.</li>
<li>Auto-quoting: using <tt class="samp docutils literal"><span class="pre">,</span></tt>, or <tt class="samp docutils literal"><span class="pre">;</span></tt> as the first character forces
auto-quoting of the rest of the line: <tt class="samp docutils literal"><span class="pre">,my_function</span> <span class="pre">a</span> <span class="pre">b</span></tt> becomes
automatically <tt class="samp docutils literal"><span class="pre">my_function("a","b")</span></tt>, while <tt class="samp docutils literal"><span class="pre">;my_function</span> <span class="pre">a</span> <span class="pre">b</span></tt>
becomes <tt class="samp docutils literal"><span class="pre">my_function("a</span> <span class="pre">b")</span></tt>.</li>
<li>Extensible input syntax. You can define filters that pre-process
user input to simplify input in special situations. This allows
for example pasting multi-line code fragments which start with
<tt class="samp docutils literal"><span class="pre">>>></span></tt> or <tt class="samp docutils literal"><span class="pre">...</span></tt> such as those from other python sessions or the
standard Python documentation.</li>
<li>Flexible configuration system. It uses a configuration file which
allows permanent setting of all command-line options, module
loading, code and file execution. The system allows recursive file
inclusion, so you can have a base file with defaults and layers
which load other customizations for particular projects.</li>
<li>Embeddable. You can call IPython as a python shell inside your own
python programs. This can be used both for debugging code or for
providing interactive abilities to your programs with knowledge
about the local namespaces (very useful in debugging and data
analysis situations).</li>
<li>Easy debugger access. You can set IPython to call up an enhanced version of
the Python debugger (pdb) every time there is an uncaught exception. This
drops you inside the code which triggered the exception with all the data
live and it is possible to navigate the stack to rapidly isolate the source
of a bug. The <tt class="samp docutils literal"><span class="pre">%run</span></tt> magic command (with the <tt class="samp docutils literal"><span class="pre">-d</span></tt> option) can run
any script under pdb’s control, automatically setting initial breakpoints for
you. This version of pdb has IPython-specific improvements, including
tab-completion and traceback coloring support. For even easier debugger
access, try <tt class="samp docutils literal"><span class="pre">%debug</span></tt> after seeing an exception. winpdb is also
supported, see ipy_winpdb extension.</li>
<li>Profiler support. You can run single statements (similar to
<tt class="samp docutils literal"><span class="pre">profile.run()</span></tt>) or complete programs under the profiler’s control.
While this is possible with standard cProfile or profile modules,
IPython wraps this functionality with magic commands (see <tt class="samp docutils literal"><span class="pre">%prun</span></tt>
and <tt class="samp docutils literal"><span class="pre">%run</span> <span class="pre">-p</span></tt>) convenient for rapid interactive work.</li>
<li>Doctest support. The special <tt class="samp docutils literal"><span class="pre">%doctest_mode</span></tt> command toggles a mode
that allows you to paste existing doctests (with leading <tt class="samp docutils literal"><span class="pre">>>></span></tt>
prompts and whitespace) and uses doctest-compatible prompts and
output, so you can use IPython sessions as doctest code.</li>
</ul>
</div>
</div>
<div class="section" id="interactive-parallel-computing">
<h2>Interactive parallel computing<a class="headerlink" href="#interactive-parallel-computing" title="Permalink to this headline">¶</a></h2>
<p>Increasingly, parallel computer hardware, such as multicore CPUs, clusters and
supercomputers, is becoming ubiquitous. Over the last 3 years, we have
developed an architecture within IPython that allows such hardware to be used
quickly and easily from Python. Moreover, this architecture is designed to
support interactive and collaborative parallel computing.</p>
<p>The main features of this system are:</p>
<ul class="simple">
<li>Quickly parallelize Python code from an interactive Python/IPython session.</li>
<li>A flexible and dynamic process model that be deployed on anything from
multicore workstations to supercomputers.</li>
<li>An architecture that supports many different styles of parallelism, from
message passing to task farming. And all of these styles can be handled
interactively.</li>
<li>Both blocking and fully asynchronous interfaces.</li>
<li>High level APIs that enable many things to be parallelized in a few lines
of code.</li>
<li>Write parallel code that will run unchanged on everything from multicore
workstations to supercomputers.</li>
<li>Full integration with Message Passing libraries (MPI).</li>
<li>Capabilities based security model with full encryption of network connections.</li>
<li>Share live parallel jobs with other users securely. We call this
collaborative parallel computing.</li>
<li>Dynamically load balanced task farming system.</li>
<li>Robust error handling. Python exceptions raised in parallel execution are
gathered and presented to the top-level code.</li>
</ul>
<p>For more information, see our <a class="reference internal" href="parallel/index.html#parallel-index"><em>overview</em></a> of using IPython
for parallel computing.</p>
<div class="section" id="portability-and-python-requirements">
<h3>Portability and Python requirements<a class="headerlink" href="#portability-and-python-requirements" title="Permalink to this headline">¶</a></h3>
<p>As of the 0.9 release, IPython requires Python 2.4 or greater. We have
not begun to test IPython on Python 2.6 or 3.0, but we expect it will
work with some minor changes.</p>
<p>IPython is known to work on the following operating systems:</p>
<blockquote>
<ul class="simple">
<li>Linux</li>
<li>Most other Unix-like OSs (AIX, Solaris, BSD, etc.)</li>
<li>Mac OS X</li>
<li>Windows (CygWin, XP, Vista, etc.)</li>
</ul>
</blockquote>
<p>See <a class="reference internal" href="install/index.html#install-index"><em>here</em></a> for instructions on how to install IPython.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Introduction</a><ul>
<li><a class="reference internal" href="#id1">Overview</a></li>
<li><a class="reference internal" href="#enhanced-interactive-python-shell">Enhanced interactive Python shell</a><ul>
<li><a class="reference internal" href="#main-features-of-the-interactive-shell">Main features of the interactive shell</a></li>
</ul>
</li>
<li><a class="reference internal" href="#interactive-parallel-computing">Interactive parallel computing</a><ul>
<li><a class="reference internal" href="#portability-and-python-requirements">Portability and Python requirements</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">IPython Documentation</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="install/index.html"
title="next chapter">Installation</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/overview.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="install/index.html" title="Installation"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="IPython Documentation"
>previous</a> |</li>
<li><a href="index.html">IPython v0.10.1 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2008, The IPython Development Team.
Last updated on Oct 11, 2010.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.1.
</div>
</body>
</html>