##// END OF EJS Templates
Fix incorrect link in OSX instructions.
fperez -
Show More
@@ -1,8818 +1,8819 b''
1 #LyX 1.3 created this file. For more info see http://www.lyx.org/
1 #LyX 1.3 created this file. For more info see http://www.lyx.org/
2 \lyxformat 221
2 \lyxformat 221
3 \textclass article
3 \textclass article
4 \begin_preamble
4 \begin_preamble
5 \usepackage{ae,aecompl}
5 \usepackage{ae,aecompl}
6 \usepackage{hyperref}
6 \usepackage{hyperref}
7 \usepackage{html}
7 \usepackage{html}
8 \end_preamble
8 \end_preamble
9 \language english
9 \language english
10 \inputencoding latin1
10 \inputencoding latin1
11 \fontscheme default
11 \fontscheme default
12 \graphics default
12 \graphics default
13 \paperfontsize default
13 \paperfontsize default
14 \spacing single
14 \spacing single
15 \papersize Default
15 \papersize Default
16 \paperpackage a4
16 \paperpackage a4
17 \use_geometry 1
17 \use_geometry 1
18 \use_amsmath 0
18 \use_amsmath 0
19 \use_natbib 0
19 \use_natbib 0
20 \use_numerical_citations 0
20 \use_numerical_citations 0
21 \paperorientation portrait
21 \paperorientation portrait
22 \leftmargin 1.25in
22 \leftmargin 1.25in
23 \topmargin 1in
23 \topmargin 1in
24 \rightmargin 1.25in
24 \rightmargin 1.25in
25 \bottommargin 1in
25 \bottommargin 1in
26 \secnumdepth 3
26 \secnumdepth 3
27 \tocdepth 3
27 \tocdepth 3
28 \paragraph_separation skip
28 \paragraph_separation skip
29 \defskip medskip
29 \defskip medskip
30 \quotes_language english
30 \quotes_language english
31 \quotes_times 2
31 \quotes_times 2
32 \papercolumns 1
32 \papercolumns 1
33 \papersides 1
33 \papersides 1
34 \paperpagestyle fancy
34 \paperpagestyle fancy
35
35
36 \layout Title
36 \layout Title
37
37
38 IPython
38 IPython
39 \newline
39 \newline
40
40
41 \size larger
41 \size larger
42 An enhanced Interactive Python
42 An enhanced Interactive Python
43 \size large
43 \size large
44
44
45 \newline
45 \newline
46 User Manual, v.
46 User Manual, v.
47 __version__
47 __version__
48 \layout Author
48 \layout Author
49
49
50 Fernando PοΏ½rez
50 Fernando PοΏ½rez
51 \layout Standard
51 \layout Standard
52
52
53
53
54 \begin_inset ERT
54 \begin_inset ERT
55 status Collapsed
55 status Collapsed
56
56
57 \layout Standard
57 \layout Standard
58
58
59 \backslash
59 \backslash
60 latex{
60 latex{
61 \end_inset
61 \end_inset
62
62
63
63
64 \begin_inset LatexCommand \tableofcontents{}
64 \begin_inset LatexCommand \tableofcontents{}
65
65
66 \end_inset
66 \end_inset
67
67
68
68
69 \begin_inset ERT
69 \begin_inset ERT
70 status Collapsed
70 status Collapsed
71
71
72 \layout Standard
72 \layout Standard
73 }
73 }
74 \end_inset
74 \end_inset
75
75
76
76
77 \layout Standard
77 \layout Standard
78
78
79
79
80 \begin_inset ERT
80 \begin_inset ERT
81 status Open
81 status Open
82
82
83 \layout Standard
83 \layout Standard
84
84
85 \backslash
85 \backslash
86 html{
86 html{
87 \backslash
87 \backslash
88 bodytext{bgcolor=#ffffff}}
88 bodytext{bgcolor=#ffffff}}
89 \end_inset
89 \end_inset
90
90
91
91
92 \layout Section
92 \layout Section
93 \pagebreak_top
93 \pagebreak_top
94 Overview
94 Overview
95 \layout Standard
95 \layout Standard
96
96
97 One of Python's most useful features is its interactive interpreter.
97 One of Python's most useful features is its interactive interpreter.
98 This system allows very fast testing of ideas without the overhead of creating
98 This system allows very fast testing of ideas without the overhead of creating
99 test files as is typical in most programming languages.
99 test files as is typical in most programming languages.
100 However, the interpreter supplied with the standard Python distribution
100 However, the interpreter supplied with the standard Python distribution
101 is somewhat limited for extended interactive use.
101 is somewhat limited for extended interactive use.
102 \layout Standard
102 \layout Standard
103
103
104 IPython is a free software project (released under the BSD license) which
104 IPython is a free software project (released under the BSD license) which
105 tries to:
105 tries to:
106 \layout Enumerate
106 \layout Enumerate
107
107
108 Provide an interactive shell superior to Python's default.
108 Provide an interactive shell superior to Python's default.
109 IPython has many features for object introspection, system shell access,
109 IPython has many features for object introspection, system shell access,
110 and its own special command system for adding functionality when working
110 and its own special command system for adding functionality when working
111 interactively.
111 interactively.
112 It tries to be a very efficient environment both for Python code development
112 It tries to be a very efficient environment both for Python code development
113 and for exploration of problems using Python objects (in situations like
113 and for exploration of problems using Python objects (in situations like
114 data analysis).
114 data analysis).
115 \layout Enumerate
115 \layout Enumerate
116
116
117 Serve as an embeddable, ready to use interpreter for your own programs.
117 Serve as an embeddable, ready to use interpreter for your own programs.
118 IPython can be started with a single call from inside another program,
118 IPython can be started with a single call from inside another program,
119 providing access to the current namespace.
119 providing access to the current namespace.
120 This can be very useful both for debugging purposes and for situations
120 This can be very useful both for debugging purposes and for situations
121 where a blend of batch-processing and interactive exploration are needed.
121 where a blend of batch-processing and interactive exploration are needed.
122 \layout Enumerate
122 \layout Enumerate
123
123
124 Offer a flexible framework which can be used as the base environment for
124 Offer a flexible framework which can be used as the base environment for
125 other systems with Python as the underlying language.
125 other systems with Python as the underlying language.
126 Specifically scientific environments like Mathematica, IDL and Matlab inspired
126 Specifically scientific environments like Mathematica, IDL and Matlab inspired
127 its design, but similar ideas can be useful in many fields.
127 its design, but similar ideas can be useful in many fields.
128 \layout Subsection
128 \layout Subsection
129
129
130 Main features
130 Main features
131 \layout Itemize
131 \layout Itemize
132
132
133 Dynamic object introspection.
133 Dynamic object introspection.
134 One can access docstrings, function definition prototypes, source code,
134 One can access docstrings, function definition prototypes, source code,
135 source files and other details of any object accessible to the interpreter
135 source files and other details of any object accessible to the interpreter
136 with a single keystroke (`
136 with a single keystroke (`
137 \family typewriter
137 \family typewriter
138 ?
138 ?
139 \family default
139 \family default
140 ').
140 ').
141 \layout Itemize
141 \layout Itemize
142
142
143 Completion in the local namespace, by typing TAB at the prompt.
143 Completion in the local namespace, by typing TAB at the prompt.
144 This works for keywords, methods, variables and files in the current directory.
144 This works for keywords, methods, variables and files in the current directory.
145 This is supported via the readline library, and full access to configuring
145 This is supported via the readline library, and full access to configuring
146 readline's behavior is provided.
146 readline's behavior is provided.
147 \layout Itemize
147 \layout Itemize
148
148
149 Numbered input/output prompts with command history (persistent across sessions
149 Numbered input/output prompts with command history (persistent across sessions
150 and tied to each profile), full searching in this history and caching of
150 and tied to each profile), full searching in this history and caching of
151 all input and output.
151 all input and output.
152 \layout Itemize
152 \layout Itemize
153
153
154 User-extensible `magic' commands.
154 User-extensible `magic' commands.
155 A set of commands prefixed with
155 A set of commands prefixed with
156 \family typewriter
156 \family typewriter
157 %
157 %
158 \family default
158 \family default
159 is available for controlling IPython itself and provides directory control,
159 is available for controlling IPython itself and provides directory control,
160 namespace information and many aliases to common system shell commands.
160 namespace information and many aliases to common system shell commands.
161 \layout Itemize
161 \layout Itemize
162
162
163 Alias facility for defining your own system aliases.
163 Alias facility for defining your own system aliases.
164 \layout Itemize
164 \layout Itemize
165
165
166 Complete system shell access.
166 Complete system shell access.
167 Lines starting with ! are passed directly to the system shell, and using
167 Lines starting with ! are passed directly to the system shell, and using
168 !! captures shell output into python variables for further use.
168 !! captures shell output into python variables for further use.
169 \layout Itemize
169 \layout Itemize
170
170
171 All calls to the system (via aliases or via !) have their standard output/error
171 All calls to the system (via aliases or via !) have their standard output/error
172 automatically stored as strings, and also available as lists.
172 automatically stored as strings, and also available as lists.
173 \layout Itemize
173 \layout Itemize
174
174
175 Background execution of Python commands in a separate thread.
175 Background execution of Python commands in a separate thread.
176 IPython has an internal job manager called
176 IPython has an internal job manager called
177 \family typewriter
177 \family typewriter
178 jobs
178 jobs
179 \family default
179 \family default
180 , and a conveninence backgrounding magic function called
180 , and a conveninence backgrounding magic function called
181 \family typewriter
181 \family typewriter
182 %bg
182 %bg
183 \family default
183 \family default
184 .
184 .
185 \layout Itemize
185 \layout Itemize
186
186
187 The ability to expand python variables when calling the system shell.
187 The ability to expand python variables when calling the system shell.
188 In a shell command, any python variable prefixed with
188 In a shell command, any python variable prefixed with
189 \family typewriter
189 \family typewriter
190 $
190 $
191 \family default
191 \family default
192 is expanded.
192 is expanded.
193 A double
193 A double
194 \family typewriter
194 \family typewriter
195 $$
195 $$
196 \family default
196 \family default
197 allows passing a literal
197 allows passing a literal
198 \family typewriter
198 \family typewriter
199 $
199 $
200 \family default
200 \family default
201 to the shell (for access to shell and environment variables like
201 to the shell (for access to shell and environment variables like
202 \family typewriter
202 \family typewriter
203 $PATH
203 $PATH
204 \family default
204 \family default
205 ).
205 ).
206 \layout Itemize
206 \layout Itemize
207
207
208 Filesystem navigation, via a magic
208 Filesystem navigation, via a magic
209 \family typewriter
209 \family typewriter
210 %cd
210 %cd
211 \family default
211 \family default
212 command, along with a persistent bookmark system (using
212 command, along with a persistent bookmark system (using
213 \family typewriter
213 \family typewriter
214 %bookmark
214 %bookmark
215 \family default
215 \family default
216 ) for fast access to frequently visited directories.
216 ) for fast access to frequently visited directories.
217 \layout Itemize
217 \layout Itemize
218
218
219 Automatic indentation (optional) of code as you type (through the readline
219 Automatic indentation (optional) of code as you type (through the readline
220 library).
220 library).
221 \layout Itemize
221 \layout Itemize
222
222
223 Macro system for quickly re-executing multiple lines of previous input with
223 Macro system for quickly re-executing multiple lines of previous input with
224 a single name.
224 a single name.
225 \layout Itemize
225 \layout Itemize
226
226
227 Session logging (you can then later use these logs as code in your programs).
227 Session logging (you can then later use these logs as code in your programs).
228 \layout Itemize
228 \layout Itemize
229
229
230 Session restoring: logs can be replayed to restore a previous session to
230 Session restoring: logs can be replayed to restore a previous session to
231 the state where you left it.
231 the state where you left it.
232 \layout Itemize
232 \layout Itemize
233
233
234 Verbose and colored exception traceback printouts.
234 Verbose and colored exception traceback printouts.
235 Easier to parse visually, and in verbose mode they produce a lot of useful
235 Easier to parse visually, and in verbose mode they produce a lot of useful
236 debugging information (basically a terminal version of the cgitb module).
236 debugging information (basically a terminal version of the cgitb module).
237 \layout Itemize
237 \layout Itemize
238
238
239 Auto-parentheses: callable objects can be executed without parentheses:
239 Auto-parentheses: callable objects can be executed without parentheses:
240
240
241 \family typewriter
241 \family typewriter
242 `sin 3'
242 `sin 3'
243 \family default
243 \family default
244 is automatically converted to
244 is automatically converted to
245 \family typewriter
245 \family typewriter
246 `sin(3)
246 `sin(3)
247 \family default
247 \family default
248 '.
248 '.
249 \layout Itemize
249 \layout Itemize
250
250
251 Auto-quoting: using `
251 Auto-quoting: using `
252 \family typewriter
252 \family typewriter
253 ,
253 ,
254 \family default
254 \family default
255 ' or `
255 ' or `
256 \family typewriter
256 \family typewriter
257 ;
257 ;
258 \family default
258 \family default
259 ' as the first character forces auto-quoting of the rest of the line:
259 ' as the first character forces auto-quoting of the rest of the line:
260 \family typewriter
260 \family typewriter
261 `,my_function a\SpecialChar ~
261 `,my_function a\SpecialChar ~
262 b'
262 b'
263 \family default
263 \family default
264 becomes automatically
264 becomes automatically
265 \family typewriter
265 \family typewriter
266 `my_function("a","b")'
266 `my_function("a","b")'
267 \family default
267 \family default
268 , while
268 , while
269 \family typewriter
269 \family typewriter
270 `;my_function a\SpecialChar ~
270 `;my_function a\SpecialChar ~
271 b'
271 b'
272 \family default
272 \family default
273 becomes
273 becomes
274 \family typewriter
274 \family typewriter
275 `my_function("a b")'
275 `my_function("a b")'
276 \family default
276 \family default
277 .
277 .
278 \layout Itemize
278 \layout Itemize
279
279
280 Extensible input syntax.
280 Extensible input syntax.
281 You can define filters that pre-process user input to simplify input in
281 You can define filters that pre-process user input to simplify input in
282 special situations.
282 special situations.
283 This allows for example pasting multi-line code fragments which start with
283 This allows for example pasting multi-line code fragments which start with
284
284
285 \family typewriter
285 \family typewriter
286 `>>>'
286 `>>>'
287 \family default
287 \family default
288 or
288 or
289 \family typewriter
289 \family typewriter
290 `...'
290 `...'
291 \family default
291 \family default
292 such as those from other python sessions or the standard Python documentation.
292 such as those from other python sessions or the standard Python documentation.
293 \layout Itemize
293 \layout Itemize
294
294
295 Flexible configuration system.
295 Flexible configuration system.
296 It uses a configuration file which allows permanent setting of all command-line
296 It uses a configuration file which allows permanent setting of all command-line
297 options, module loading, code and file execution.
297 options, module loading, code and file execution.
298 The system allows recursive file inclusion, so you can have a base file
298 The system allows recursive file inclusion, so you can have a base file
299 with defaults and layers which load other customizations for particular
299 with defaults and layers which load other customizations for particular
300 projects.
300 projects.
301 \layout Itemize
301 \layout Itemize
302
302
303 Embeddable.
303 Embeddable.
304 You can call IPython as a python shell inside your own python programs.
304 You can call IPython as a python shell inside your own python programs.
305 This can be used both for debugging code or for providing interactive abilities
305 This can be used both for debugging code or for providing interactive abilities
306 to your programs with knowledge about the local namespaces (very useful
306 to your programs with knowledge about the local namespaces (very useful
307 in debugging and data analysis situations).
307 in debugging and data analysis situations).
308 \layout Itemize
308 \layout Itemize
309
309
310 Easy debugger access.
310 Easy debugger access.
311 You can set IPython to call up the Python debugger (pdb) every time there
311 You can set IPython to call up the Python debugger (pdb) every time there
312 is an uncaught exception.
312 is an uncaught exception.
313 This drops you inside the code which triggered the exception with all the
313 This drops you inside the code which triggered the exception with all the
314 data live and it is possible to navigate the stack to rapidly isolate the
314 data live and it is possible to navigate the stack to rapidly isolate the
315 source of a bug.
315 source of a bug.
316 The
316 The
317 \family typewriter
317 \family typewriter
318 %run
318 %run
319 \family default
319 \family default
320 magic command --with the
320 magic command --with the
321 \family typewriter
321 \family typewriter
322 -d
322 -d
323 \family default
323 \family default
324 option-- can run any script under
324 option-- can run any script under
325 \family typewriter
325 \family typewriter
326 pdb
326 pdb
327 \family default
327 \family default
328 's control, automatically setting initial breakpoints for you.
328 's control, automatically setting initial breakpoints for you.
329 \layout Itemize
329 \layout Itemize
330
330
331 Profiler support.
331 Profiler support.
332 You can run single statements (similar to
332 You can run single statements (similar to
333 \family typewriter
333 \family typewriter
334 profile.run()
334 profile.run()
335 \family default
335 \family default
336 ) or complete programs under the profiler's control.
336 ) or complete programs under the profiler's control.
337 While this is possible with the standard
337 While this is possible with the standard
338 \family typewriter
338 \family typewriter
339 profile
339 profile
340 \family default
340 \family default
341 module, IPython wraps this functionality with magic commands (see
341 module, IPython wraps this functionality with magic commands (see
342 \family typewriter
342 \family typewriter
343 `%prun'
343 `%prun'
344 \family default
344 \family default
345 and
345 and
346 \family typewriter
346 \family typewriter
347 `%run -p
347 `%run -p
348 \family default
348 \family default
349 ') convenient for rapid interactive work.
349 ') convenient for rapid interactive work.
350 \layout Subsection
350 \layout Subsection
351
351
352 Portability and Python requirements
352 Portability and Python requirements
353 \layout Standard
353 \layout Standard
354
354
355
355
356 \series bold
356 \series bold
357 Python requirements:
357 Python requirements:
358 \series default
358 \series default
359 IPython works with Python version 2.2 or newer.
359 IPython works with Python version 2.2 or newer.
360 It has been tested with Python 2.4 and no problems have been reported.
360 It has been tested with Python 2.4 and no problems have been reported.
361 Support for Python 2.1 hasn't been recently tested, since I don't have access
361 Support for Python 2.1 hasn't been recently tested, since I don't have access
362 to it on any of my systems.
362 to it on any of my systems.
363 But I suspect there may be some problems with Python 2.1, because some of
363 But I suspect there may be some problems with Python 2.1, because some of
364 the newer code may use 2.2 features.
364 the newer code may use 2.2 features.
365 \layout Standard
365 \layout Standard
366
366
367 IPython is developed under
367 IPython is developed under
368 \series bold
368 \series bold
369 Linux
369 Linux
370 \series default
370 \series default
371 , but it should work in any reasonable Unix-type system (tested OK under
371 , but it should work in any reasonable Unix-type system (tested OK under
372 Solaris and the *BSD family, for which a port exists thanks to Dryice Liu).
372 Solaris and the *BSD family, for which a port exists thanks to Dryice Liu).
373 \layout Standard
373 \layout Standard
374
374
375
375
376 \series bold
376 \series bold
377 Mac OS X
377 Mac OS X
378 \series default
378 \series default
379 : it works, apparently without any problems (thanks to Jim Boyle at Lawrence
379 : it works, apparently without any problems (thanks to Jim Boyle at Lawrence
380 Livermore for the information).
380 Livermore for the information).
381 Thanks to Andrea Riciputi, Fink support is available.
381 Thanks to Andrea Riciputi, Fink support is available.
382 \layout Standard
382 \layout Standard
383
383
384
384
385 \series bold
385 \series bold
386 CygWin
386 CygWin
387 \series default
387 \series default
388 : it works mostly OK, though some users have reported problems with prompt
388 : it works mostly OK, though some users have reported problems with prompt
389 coloring.
389 coloring.
390 No satisfactory solution to this has been found so far, you may want to
390 No satisfactory solution to this has been found so far, you may want to
391 disable colors permanently in the
391 disable colors permanently in the
392 \family typewriter
392 \family typewriter
393 ipythonrc
393 ipythonrc
394 \family default
394 \family default
395 configuration file if you experience problems.
395 configuration file if you experience problems.
396 If you have proper color support under cygwin, please post to the IPython
396 If you have proper color support under cygwin, please post to the IPython
397 mailing list so this issue can be resolved for all users.
397 mailing list so this issue can be resolved for all users.
398 \layout Standard
398 \layout Standard
399
399
400
400
401 \series bold
401 \series bold
402 Windows
402 Windows
403 \series default
403 \series default
404 : it works well under Windows XP/2k, and I suspect NT should behave similarly.
404 : it works well under Windows XP/2k, and I suspect NT should behave similarly.
405 Section\SpecialChar ~
405 Section\SpecialChar ~
406
406
407 \begin_inset LatexCommand \ref{sub:Under-Windows}
407 \begin_inset LatexCommand \ref{sub:Under-Windows}
408
408
409 \end_inset
409 \end_inset
410
410
411 describes installation details for Windows, including some additional tools
411 describes installation details for Windows, including some additional tools
412 needed on this platform.
412 needed on this platform.
413 \layout Standard
413 \layout Standard
414
414
415 Windows 9x support is present, and has been reported to work fine (at least
415 Windows 9x support is present, and has been reported to work fine (at least
416 on WinME).
416 on WinME).
417 \layout Standard
417 \layout Standard
418
418
419 Please note, however, that I have very little access to and experience with
419 Please note, however, that I have very little access to and experience with
420 Windows development.
420 Windows development.
421 For this reason, Windows-specific bugs tend to linger far longer than I
421 For this reason, Windows-specific bugs tend to linger far longer than I
422 would like, and often I just can't find a satisfactory solution.
422 would like, and often I just can't find a satisfactory solution.
423 If any Windows user wants to join in with development help, all hands are
423 If any Windows user wants to join in with development help, all hands are
424 always welcome.
424 always welcome.
425 \layout Subsection
425 \layout Subsection
426
426
427 Location
427 Location
428 \layout Standard
428 \layout Standard
429
429
430 IPython is generously hosted at
430 IPython is generously hosted at
431 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
431 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
432
432
433 \end_inset
433 \end_inset
434
434
435 by the SciPy project.
435 by the SciPy project.
436 This site offers downloads, CVS access, mailing lists and a bug tracking
436 This site offers downloads, CVS access, mailing lists and a bug tracking
437 system.
437 system.
438 I am very grateful to Enthought (
438 I am very grateful to Enthought (
439 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
439 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
440
440
441 \end_inset
441 \end_inset
442
442
443 ) and all of the SciPy team for their contribution.
443 ) and all of the SciPy team for their contribution.
444 \layout Section
444 \layout Section
445
445
446
446
447 \begin_inset LatexCommand \label{sec:install}
447 \begin_inset LatexCommand \label{sec:install}
448
448
449 \end_inset
449 \end_inset
450
450
451 Installation
451 Installation
452 \layout Subsection
452 \layout Subsection
453
453
454 Instant instructions
454 Instant instructions
455 \layout Standard
455 \layout Standard
456
456
457 If you are of the impatient kind, under Linux/Unix simply untar/unzip the
457 If you are of the impatient kind, under Linux/Unix simply untar/unzip the
458 download, then install with
458 download, then install with
459 \family typewriter
459 \family typewriter
460 `python setup.py install'
460 `python setup.py install'
461 \family default
461 \family default
462 .
462 .
463 Under Windows, double-click on the provided
463 Under Windows, double-click on the provided
464 \family typewriter
464 \family typewriter
465 .exe
465 .exe
466 \family default
466 \family default
467 binary installer.
467 binary installer.
468 \layout Standard
468 \layout Standard
469
469
470 Then, take a look at Sections
470 Then, take a look at Sections
471 \begin_inset LatexCommand \ref{sec:good_config}
471 \begin_inset LatexCommand \ref{sec:good_config}
472
472
473 \end_inset
473 \end_inset
474
474
475 for configuring things optimally and
475 for configuring things optimally and
476 \begin_inset LatexCommand \ref{sec:quick_tips}
476 \begin_inset LatexCommand \ref{sec:quick_tips}
477
477
478 \end_inset
478 \end_inset
479
479
480 for quick tips on efficient use of IPython.
480 for quick tips on efficient use of IPython.
481 You can later refer to the rest of the manual for all the gory details.
481 You can later refer to the rest of the manual for all the gory details.
482 \layout Standard
482 \layout Standard
483
483
484 See the notes in sec.
484 See the notes in sec.
485
485
486 \begin_inset LatexCommand \ref{sec:upgrade}
486 \begin_inset LatexCommand \ref{sec:upgrade}
487
487
488 \end_inset
488 \end_inset
489
489
490 for upgrading IPython versions.
490 for upgrading IPython versions.
491 \layout Subsection
491 \layout Subsection
492
492
493 Detailed Unix instructions (Linux, Mac OS X, etc.)
493 Detailed Unix instructions (Linux, Mac OS X, etc.)
494 \layout Standard
494 \layout Standard
495
495
496
496
497 \begin_inset ERT
497 \begin_inset ERT
498 status Open
498 status Open
499
499
500 \layout Standard
500 \layout Standard
501
501
502 \backslash
502 \backslash
503 html{
503 html{
504 \backslash
504 \backslash
505 textbf{A warning to readers of the HTML version of this manual}: all options below are preceded with with TWO dashes and no intervening space between the dashes (e.g. Dash-Dash-home). The default HTML conversion tools mangle these into a single dash.}
505 textbf{A warning to readers of the HTML version of this manual}: all options below are preceded with with TWO dashes and no intervening space between the dashes (e.g. Dash-Dash-home). The default HTML conversion tools mangle these into a single dash.}
506 \end_inset
506 \end_inset
507
507
508
508
509 \layout Standard
509 \layout Standard
510
510
511 For RPM based systems, simply install the supplied package in the usual
511 For RPM based systems, simply install the supplied package in the usual
512 manner.
512 manner.
513 If you download the tar archive, the process is:
513 If you download the tar archive, the process is:
514 \layout Enumerate
514 \layout Enumerate
515
515
516 Unzip/untar the
516 Unzip/untar the
517 \family typewriter
517 \family typewriter
518 ipython-XXX.tar.gz
518 ipython-XXX.tar.gz
519 \family default
519 \family default
520 file wherever you want (
520 file wherever you want (
521 \family typewriter
521 \family typewriter
522 XXX
522 XXX
523 \family default
523 \family default
524 is the version number).
524 is the version number).
525 It will make a directory called
525 It will make a directory called
526 \family typewriter
526 \family typewriter
527 ipython-XXX.
527 ipython-XXX.
528
528
529 \family default
529 \family default
530 Change into that directory where you will find the files
530 Change into that directory where you will find the files
531 \family typewriter
531 \family typewriter
532 README
532 README
533 \family default
533 \family default
534 and
534 and
535 \family typewriter
535 \family typewriter
536 setup.py
536 setup.py
537 \family default
537 \family default
538 .
538 .
539
539
540 \family typewriter
540 \family typewriter
541 O
541 O
542 \family default
542 \family default
543 nce you've completed the installation, you can safely remove this directory.
543 nce you've completed the installation, you can safely remove this directory.
544
544
545 \layout Enumerate
545 \layout Enumerate
546
546
547 If you are installing over a previous installation of version 0.2.0 or earlier,
547 If you are installing over a previous installation of version 0.2.0 or earlier,
548 first remove your
548 first remove your
549 \family typewriter
549 \family typewriter
550 $HOME/.ipython
550 $HOME/.ipython
551 \family default
551 \family default
552 directory, since the configuration file format has changed somewhat (the
552 directory, since the configuration file format has changed somewhat (the
553 '=' were removed from all option specifications).
553 '=' were removed from all option specifications).
554 Or you can call ipython with the
554 Or you can call ipython with the
555 \family typewriter
555 \family typewriter
556 -upgrade
556 -upgrade
557 \family default
557 \family default
558 option and it will do this automatically for you.
558 option and it will do this automatically for you.
559 \layout Enumerate
559 \layout Enumerate
560
560
561 IPython uses distutils, so you can install it by simply typing at the system
561 IPython uses distutils, so you can install it by simply typing at the system
562 prompt (don't type the
562 prompt (don't type the
563 \family typewriter
563 \family typewriter
564 $
564 $
565 \family default
565 \family default
566 )
566 )
567 \newline
567 \newline
568
568
569 \family typewriter
569 \family typewriter
570 $ python setup.py install
570 $ python setup.py install
571 \family default
571 \family default
572
572
573 \newline
573 \newline
574 Note that this assumes you have root access to your machine.
574 Note that this assumes you have root access to your machine.
575 If you don't have root access or don't want IPython to go in the default
575 If you don't have root access or don't want IPython to go in the default
576 python directories, you'll need to use the
576 python directories, you'll need to use the
577 \family typewriter
577 \family typewriter
578 --home
578 --home
579 \family default
579 \family default
580 option (or
580 option (or
581 \family typewriter
581 \family typewriter
582 --prefix
582 --prefix
583 \family default
583 \family default
584 ).
584 ).
585 For example:
585 For example:
586 \newline
586 \newline
587
587
588 \family typewriter
588 \family typewriter
589 $ python setup.py install --home $HOME/local
589 $ python setup.py install --home $HOME/local
590 \family default
590 \family default
591
591
592 \newline
592 \newline
593 will install
593 will install
594 \begin_inset Foot
594 \begin_inset Foot
595 collapsed true
595 collapsed true
596
596
597 \layout Standard
597 \layout Standard
598
598
599 If you are reading these instructions in HTML format, please note that the
599 If you are reading these instructions in HTML format, please note that the
600 option is --home, with
600 option is --home, with
601 \emph on
601 \emph on
602 two
602 two
603 \emph default
603 \emph default
604 dashes.
604 dashes.
605 The automatic HTML conversion program seems to eat up one of the dashes,
605 The automatic HTML conversion program seems to eat up one of the dashes,
606 unfortunately (it's ok in the PDF version).
606 unfortunately (it's ok in the PDF version).
607 \end_inset
607 \end_inset
608
608
609 IPython into
609 IPython into
610 \family typewriter
610 \family typewriter
611 $HOME/local
611 $HOME/local
612 \family default
612 \family default
613 and its subdirectories (creating them if necessary).
613 and its subdirectories (creating them if necessary).
614 \newline
614 \newline
615 You can type
615 You can type
616 \newline
616 \newline
617
617
618 \family typewriter
618 \family typewriter
619 $ python setup.py --help
619 $ python setup.py --help
620 \family default
620 \family default
621
621
622 \newline
622 \newline
623 for more details.
623 for more details.
624 \newline
624 \newline
625 Note that if you change the default location for
625 Note that if you change the default location for
626 \family typewriter
626 \family typewriter
627 --home
627 --home
628 \family default
628 \family default
629 at installation, IPython may end up installed at a location which is not
629 at installation, IPython may end up installed at a location which is not
630 part of your
630 part of your
631 \family typewriter
631 \family typewriter
632 $PYTHONPATH
632 $PYTHONPATH
633 \family default
633 \family default
634 environment variable.
634 environment variable.
635 In this case, you'll need to configure this variable to include the actual
635 In this case, you'll need to configure this variable to include the actual
636 directory where the
636 directory where the
637 \family typewriter
637 \family typewriter
638 IPython/
638 IPython/
639 \family default
639 \family default
640 directory ended (typically the value you give to
640 directory ended (typically the value you give to
641 \family typewriter
641 \family typewriter
642 --home
642 --home
643 \family default
643 \family default
644 plus
644 plus
645 \family typewriter
645 \family typewriter
646 /lib/python
646 /lib/python
647 \family default
647 \family default
648 ).
648 ).
649 \layout Subsubsection
649 \layout Subsubsection
650
650
651 Mac OSX information
651 Mac OSX information
652 \layout Standard
652 \layout Standard
653
653
654 Under OSX, there is a choice you need to make.
654 Under OSX, there is a choice you need to make.
655 Apple ships its own build of Python, which lives in the core OSX filesystem
655 Apple ships its own build of Python, which lives in the core OSX filesystem
656 hierarchy.
656 hierarchy.
657 You can also manually install a separate Python, either purely by hand
657 You can also manually install a separate Python, either purely by hand
658 (typically in
658 (typically in
659 \family typewriter
659 \family typewriter
660 /usr/local
660 /usr/local
661 \family default
661 \family default
662 ) or by using Fink, which puts everything under
662 ) or by using Fink, which puts everything under
663 \family typewriter
663 \family typewriter
664 /sw
664 /sw
665 \family default
665 \family default
666 .
666 .
667 Which route to follow is a matter of personal preference, as I've seen
667 Which route to follow is a matter of personal preference, as I've seen
668 users who favor each of the approaches.
668 users who favor each of the approaches.
669 Here I will simply list the known installation issues under OSX, along
669 Here I will simply list the known installation issues under OSX, along
670 with their solutions.
670 with their solutions.
671 \layout Subsubsection*
671 \layout Subsubsection*
672
672
673 GUI problems
673 GUI problems
674 \layout Standard
674 \layout Standard
675
675
676 The following instructions apply to an install of IPython under OSX from
676 The following instructions apply to an install of IPython under OSX from
677 unpacking the
677 unpacking the
678 \family typewriter
678 \family typewriter
679 .tar.gz
679 .tar.gz
680 \family default
680 \family default
681 distribution and installing it for the default Python interpreter shipped
681 distribution and installing it for the default Python interpreter shipped
682 by Apple.
682 by Apple.
683 If you are using a fink install, fink will take care of these details for
683 If you are using a fink install, fink will take care of these details for
684 you, by installing IPython against fink's Python.
684 you, by installing IPython against fink's Python.
685 \layout Standard
685 \layout Standard
686
686
687 IPython offers various forms of support for interacting with graphical applicati
687 IPython offers various forms of support for interacting with graphical applicati
688 ons from the command line, from simple Tk apps (which are in principle always
688 ons from the command line, from simple Tk apps (which are in principle always
689 supported by Python) to interactive control of WX, QT and GTK apps.
689 supported by Python) to interactive control of WX, QT and GTK apps.
690 Under OSX, however, this requires that ipython is installed by calling
690 Under OSX, however, this requires that ipython is installed by calling
691 the special
691 the special
692 \family typewriter
692 \family typewriter
693 pythonw
693 pythonw
694 \family default
694 \family default
695 script at installation time, which takes care of coordinating things with
695 script at installation time, which takes care of coordinating things with
696 Apple's graphical environment.
696 Apple's graphical environment.
697 \layout Standard
697 \layout Standard
698
698
699 So when installing under OSX, it is best to use the following command
699 So when installing under OSX, it is best to use the following command
700 \begin_inset ERT
700 \begin_inset ERT
701 status Collapsed
701 status Collapsed
702
702
703 \layout Standard
703 \layout Standard
704
704
705 \backslash
705 \backslash
706 html{
706 html{
707 \backslash
707 \backslash
708 emph{[Again, in the HTML manual, the option is called -~-install=scripts, with TWO dashes and no intervening space between the dashes]}}
708 emph{[Again, in the HTML manual, the option is called -~-install=scripts, with TWO dashes and no intervening space between the dashes]}}
709 \end_inset
709 \end_inset
710
710
711 :
711 :
712 \family typewriter
712 \family typewriter
713
713
714 \newline
714 \newline
715 \SpecialChar ~
715 \SpecialChar ~
716 \SpecialChar ~
716 \SpecialChar ~
717 $ sudo pythonw setup.py install --install-scripts=/usr/local/bin
717 $ sudo pythonw setup.py install --install-scripts=/usr/local/bin
718 \family default
718 \family default
719
719
720 \newline
720 \newline
721 or
721 or
722 \family typewriter
722 \family typewriter
723
723
724 \newline
724 \newline
725 \SpecialChar ~
725 \SpecialChar ~
726 \SpecialChar ~
726 \SpecialChar ~
727 $ sudo pythonw setup.py install --install-scripts=/usr/bin
727 $ sudo pythonw setup.py install --install-scripts=/usr/bin
728 \newline
728 \newline
729
729
730 \family default
730 \family default
731 depending on where you like to keep hand-installed executables.
731 depending on where you like to keep hand-installed executables.
732 \layout Standard
732 \layout Standard
733
733
734 The resulting script will have an appropriate shebang line (the first line
734 The resulting script will have an appropriate shebang line (the first line
735 in the script whic begins with
735 in the script whic begins with
736 \family typewriter
736 \family typewriter
737 #!...
737 #!...
738 \family default
738 \family default
739 ) such that the ipython interpreter can interact with the OS X GUI.
739 ) such that the ipython interpreter can interact with the OS X GUI.
740 If the installed version does not work and has a shebang line that points
740 If the installed version does not work and has a shebang line that points
741 to, for example, just
741 to, for example, just
742 \family typewriter
742 \family typewriter
743 /usr/bin/python
743 /usr/bin/python
744 \family default
744 \family default
745 , then you might have a stale, cached version in your
745 , then you might have a stale, cached version in your
746 \family typewriter
746 \family typewriter
747 build/scripts-<python-version>
747 build/scripts-<python-version>
748 \family default
748 \family default
749 directory.
749 directory.
750 Delete that directory and rerun the
750 Delete that directory and rerun the
751 \family typewriter
751 \family typewriter
752 setup.py
752 setup.py
753 \family default
753 \family default
754 .
754 .
755
755
756 \layout Standard
756 \layout Standard
757
757
758 It is also a good idea to use the special flag
758 It is also a good idea to use the special flag
759 \family typewriter
759 \family typewriter
760 --install-scripts
760 --install-scripts
761 \family default
761 \family default
762 as indicated above, to ensure that the ipython scripts end up in a location
762 as indicated above, to ensure that the ipython scripts end up in a location
763 which is part of your
763 which is part of your
764 \family typewriter
764 \family typewriter
765 $PATH
765 $PATH
766 \family default
766 \family default
767 .
767 .
768 Otherwise Apple's Python will put the scripts in an internal directory
768 Otherwise Apple's Python will put the scripts in an internal directory
769 not available by default at the command line (if you use
769 not available by default at the command line (if you use
770 \family typewriter
770 \family typewriter
771 /usr/local/bin
771 /usr/local/bin
772 \family default
772 \family default
773 , you need to make sure this is in your
773 , you need to make sure this is in your
774 \family typewriter
774 \family typewriter
775 $PATH
775 $PATH
776 \family default
776 \family default
777 , which may not be true by default).
777 , which may not be true by default).
778 \layout Subsubsection*
778 \layout Subsubsection*
779
779
780 Readline problems
780 Readline problems
781 \layout Standard
781 \layout Standard
782
782
783 By default, the Python version shipped by Apple does
783 By default, the Python version shipped by Apple does
784 \emph on
784 \emph on
785 not
785 not
786 \emph default
786 \emph default
787 include the readline library, so central to IPython's behavior.
787 include the readline library, so central to IPython's behavior.
788 If you install IPython against Apple's Python, you will not have arrow
788 If you install IPython against Apple's Python, you will not have arrow
789 keys, tab completion, etc.
789 keys, tab completion, etc.
790 For Mac OSX 10.3 (Panther), you can find a prebuilt readline library here:
790 For Mac OSX 10.3 (Panther), you can find a prebuilt readline library here:
791 \newline
791 \newline
792
792
793 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip}
793 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip}
794
794
795 \end_inset
795 \end_inset
796
796
797
797
798 \layout Standard
798 \layout Standard
799
799
800 Install this package, then you need to either:
800 If you are using OSX 10.4 (Tiger), after installing this package you need
801 to either:
801 \layout Enumerate
802 \layout Enumerate
802
803
803 Move
804 move
804 \family typewriter
805 \family typewriter
805 readline.so
806 readline.so
806 \family default
807 \family default
807 from
808 from
808 \family typewriter
809 \family typewriter
809 /Library/Python/2.3
810 /Library/Python/2.3
810 \family default
811 \family default
811 to
812 to
812 \family typewriter
813 \family typewriter
813 /Library/Python/2.3/site-packages
814 /Library/Python/2.3/site-packages
814 \family default
815 \family default
815 .
816 , or
816 \layout Enumerate
817 \layout Enumerate
817
818
818 Install
819 install
819 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org/tmp/scipy_cvs_2005-07-29.tgz}
820 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/TigerPython23Compat.pkg.zip}
820
821
821 \end_inset
822 \end_inset
822
823
823
824
824 \layout Standard
825 \layout Standard
825
826
826 Users installing against Fink's Python or a properly hand-built one should
827 Users installing against Fink's Python or a properly hand-built one should
827 not have this problem.
828 not have this problem.
828 \layout Subsection
829 \layout Subsection
829
830
830
831
831 \begin_inset LatexCommand \label{sub:Under-Windows}
832 \begin_inset LatexCommand \label{sub:Under-Windows}
832
833
833 \end_inset
834 \end_inset
834
835
835 Windows instructions
836 Windows instructions
836 \layout Standard
837 \layout Standard
837
838
838 While you can use IPython under Windows with only a stock Python installation,
839 While you can use IPython under Windows with only a stock Python installation,
839 there is one extension,
840 there is one extension,
840 \family typewriter
841 \family typewriter
841 readline
842 readline
842 \family default
843 \family default
843 , which will make the whole experience a lot more pleasant.
844 , which will make the whole experience a lot more pleasant.
844 It is almost a requirement, since IPython will complain in its absence
845 It is almost a requirement, since IPython will complain in its absence
845 (though it will function).
846 (though it will function).
846
847
847 \layout Standard
848 \layout Standard
848
849
849 The
850 The
850 \family typewriter
851 \family typewriter
851 readline
852 readline
852 \family default
853 \family default
853 extension needs two other libraries to work, so in all you need:
854 extension needs two other libraries to work, so in all you need:
854 \layout Enumerate
855 \layout Enumerate
855
856
856
857
857 \family typewriter
858 \family typewriter
858 PyWin32
859 PyWin32
859 \family default
860 \family default
860 from
861 from
861 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/mhammond}
862 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/mhammond}
862
863
863 \end_inset
864 \end_inset
864
865
865 .
866 .
866 \layout Enumerate
867 \layout Enumerate
867
868
868
869
869 \family typewriter
870 \family typewriter
870 CTypes
871 CTypes
871 \family default
872 \family default
872 from
873 from
873 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/theller/ctypes}
874 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/theller/ctypes}
874
875
875 \end_inset
876 \end_inset
876
877
877 (you
878 (you
878 \emph on
879 \emph on
879 must
880 must
880 \emph default
881 \emph default
881 use version 0.9.1 or newer).
882 use version 0.9.1 or newer).
882 \layout Enumerate
883 \layout Enumerate
883
884
884
885
885 \family typewriter
886 \family typewriter
886 Readline
887 Readline
887 \family default
888 \family default
888 for Windows from
889 for Windows from
889 \begin_inset LatexCommand \htmlurl{http://sourceforge.net/projects/uncpythontools}
890 \begin_inset LatexCommand \htmlurl{http://sourceforge.net/projects/uncpythontools}
890
891
891 \end_inset
892 \end_inset
892
893
893 .
894 .
894 \layout Standard
895 \layout Standard
895
896
896
897
897 \series bold
898 \series bold
898 Warning about a broken readline-like library:
899 Warning about a broken readline-like library:
899 \series default
900 \series default
900 several users have reported problems stemming from using the pseudo-readline
901 several users have reported problems stemming from using the pseudo-readline
901 library at
902 library at
902 \begin_inset LatexCommand \htmlurl{http://newcenturycomputers.net/projects/readline.html}
903 \begin_inset LatexCommand \htmlurl{http://newcenturycomputers.net/projects/readline.html}
903
904
904 \end_inset
905 \end_inset
905
906
906 .
907 .
907 This is a broken library which, while called readline, only implements
908 This is a broken library which, while called readline, only implements
908 an incomplete subset of the readline API.
909 an incomplete subset of the readline API.
909 Since it is still called readline, it fools IPython's detection mechanisms
910 Since it is still called readline, it fools IPython's detection mechanisms
910 and causes unpredictable crashes later.
911 and causes unpredictable crashes later.
911 If you wish to use IPython under Windows, you must NOT use this library,
912 If you wish to use IPython under Windows, you must NOT use this library,
912 which for all purposes is (at least as of version 1.6) terminally broken.
913 which for all purposes is (at least as of version 1.6) terminally broken.
913 \layout Subsubsection
914 \layout Subsubsection
914
915
915 Gary Bishop's readline and color support for Windows
916 Gary Bishop's readline and color support for Windows
916 \layout Standard
917 \layout Standard
917
918
918 Some of IPython's very useful features are:
919 Some of IPython's very useful features are:
919 \layout Itemize
920 \layout Itemize
920
921
921 Integrated readline support (Tab-based file, object and attribute completion,
922 Integrated readline support (Tab-based file, object and attribute completion,
922 input history across sessions, editable command line, etc.)
923 input history across sessions, editable command line, etc.)
923 \layout Itemize
924 \layout Itemize
924
925
925 Coloring of prompts, code and tracebacks.
926 Coloring of prompts, code and tracebacks.
926 \layout Standard
927 \layout Standard
927
928
928 These, by default, are only available under Unix-like operating systems.
929 These, by default, are only available under Unix-like operating systems.
929 However, thanks to Gary Bishop's work, Windows XP/2k users can also benefit
930 However, thanks to Gary Bishop's work, Windows XP/2k users can also benefit
930 from them.
931 from them.
931 His readline library implements both GNU readline functionality and color
932 His readline library implements both GNU readline functionality and color
932 support, so that IPython under Windows XP/2k can be as friendly and powerful
933 support, so that IPython under Windows XP/2k can be as friendly and powerful
933 as under Unix-like environments.
934 as under Unix-like environments.
934 \layout Standard
935 \layout Standard
935
936
936 You can find Gary's tools at
937 You can find Gary's tools at
937 \begin_inset LatexCommand \htmlurl{http://sourceforge.net/projects/uncpythontools}
938 \begin_inset LatexCommand \htmlurl{http://sourceforge.net/projects/uncpythontools}
938
939
939 \end_inset
940 \end_inset
940
941
941 ; Gary's
942 ; Gary's
942 \family typewriter
943 \family typewriter
943 readline
944 readline
944 \family default
945 \family default
945 requires in turn the
946 requires in turn the
946 \family typewriter
947 \family typewriter
947 ctypes
948 ctypes
948 \family default
949 \family default
949 library by Thomas Heller, available at
950 library by Thomas Heller, available at
950 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/theller/ctypes}
951 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/theller/ctypes}
951
952
952 \end_inset
953 \end_inset
953
954
954 , and Mark Hammond's
955 , and Mark Hammond's
955 \family typewriter
956 \family typewriter
956 PyWin32
957 PyWin32
957 \family default
958 \family default
958 from
959 from
959 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/mhammond}
960 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/mhammond}
960
961
961 \end_inset
962 \end_inset
962
963
963 (
964 (
964 \family typewriter
965 \family typewriter
965 PyWin32
966 PyWin32
966 \family default
967 \family default
967 is great for anything Windows-related anyway, so you might as well get
968 is great for anything Windows-related anyway, so you might as well get
968 it).
969 it).
969 \layout Standard
970 \layout Standard
970
971
971 Under MS\SpecialChar ~
972 Under MS\SpecialChar ~
972 Windows, IPython will complain if it can not find this
973 Windows, IPython will complain if it can not find this
973 \family typewriter
974 \family typewriter
974 readline
975 readline
975 \family default
976 \family default
976 library at startup and any time the
977 library at startup and any time the
977 \family typewriter
978 \family typewriter
978 %colors
979 %colors
979 \family default
980 \family default
980 command is issued, so you can consider it to be a quasi-requirement.
981 command is issued, so you can consider it to be a quasi-requirement.
981 \layout Subsubsection
982 \layout Subsubsection
982
983
983 Installation procedure
984 Installation procedure
984 \layout Standard
985 \layout Standard
985
986
986 Once you have the above installed, from the IPython download directory grab
987 Once you have the above installed, from the IPython download directory grab
987 the
988 the
988 \family typewriter
989 \family typewriter
989 ipython-XXX.win32.exe
990 ipython-XXX.win32.exe
990 \family default
991 \family default
991 file, where
992 file, where
992 \family typewriter
993 \family typewriter
993 XXX
994 XXX
994 \family default
995 \family default
995 represents the version number.
996 represents the version number.
996 This is a regular windows executable installer, which you can simply double-cli
997 This is a regular windows executable installer, which you can simply double-cli
997 ck to install.
998 ck to install.
998 It will add an entry for IPython to your Start Menu, as well as registering
999 It will add an entry for IPython to your Start Menu, as well as registering
999 IPython in the Windows list of applications, so you can later uninstall
1000 IPython in the Windows list of applications, so you can later uninstall
1000 it from the Control Panel.
1001 it from the Control Panel.
1001
1002
1002 \layout Standard
1003 \layout Standard
1003
1004
1004 IPython tries to install the configuration information in a directory named
1005 IPython tries to install the configuration information in a directory named
1005
1006
1006 \family typewriter
1007 \family typewriter
1007 .ipython
1008 .ipython
1008 \family default
1009 \family default
1009 (
1010 (
1010 \family typewriter
1011 \family typewriter
1011 _ipython
1012 _ipython
1012 \family default
1013 \family default
1013 under Windows) located in your `home' directory.
1014 under Windows) located in your `home' directory.
1014 IPython sets this directory by looking for a
1015 IPython sets this directory by looking for a
1015 \family typewriter
1016 \family typewriter
1016 HOME
1017 HOME
1017 \family default
1018 \family default
1018 environment variable; if such a variable does not exist, it uses
1019 environment variable; if such a variable does not exist, it uses
1019 \family typewriter
1020 \family typewriter
1020 HOMEDRIVE
1021 HOMEDRIVE
1021 \backslash
1022 \backslash
1022 HOMEPATH
1023 HOMEPATH
1023 \family default
1024 \family default
1024 (these are always defined by Windows).
1025 (these are always defined by Windows).
1025 This typically gives something like
1026 This typically gives something like
1026 \family typewriter
1027 \family typewriter
1027 C:
1028 C:
1028 \backslash
1029 \backslash
1029 Documents and Settings
1030 Documents and Settings
1030 \backslash
1031 \backslash
1031 YourUserName
1032 YourUserName
1032 \family default
1033 \family default
1033 , but your local details may vary.
1034 , but your local details may vary.
1034 In this directory you will find all the files that configure IPython's
1035 In this directory you will find all the files that configure IPython's
1035 defaults, and you can put there your profiles and extensions.
1036 defaults, and you can put there your profiles and extensions.
1036 This directory is automatically added by IPython to
1037 This directory is automatically added by IPython to
1037 \family typewriter
1038 \family typewriter
1038 sys.path
1039 sys.path
1039 \family default
1040 \family default
1040 , so anything you place there can be found by
1041 , so anything you place there can be found by
1041 \family typewriter
1042 \family typewriter
1042 import
1043 import
1043 \family default
1044 \family default
1044 statements.
1045 statements.
1045 \layout Paragraph
1046 \layout Paragraph
1046
1047
1047 Upgrading
1048 Upgrading
1048 \layout Standard
1049 \layout Standard
1049
1050
1050 For an IPython upgrade, you should first uninstall the previous version.
1051 For an IPython upgrade, you should first uninstall the previous version.
1051 This will ensure that all files and directories (such as the documentation)
1052 This will ensure that all files and directories (such as the documentation)
1052 which carry embedded version strings in their names are properly removed.
1053 which carry embedded version strings in their names are properly removed.
1053 \layout Paragraph
1054 \layout Paragraph
1054
1055
1055 Manual installation under Win32
1056 Manual installation under Win32
1056 \layout Standard
1057 \layout Standard
1057
1058
1058 In case the automatic installer does not work for some reason, you can download
1059 In case the automatic installer does not work for some reason, you can download
1059 the
1060 the
1060 \family typewriter
1061 \family typewriter
1061 ipython-XXX.tar.gz
1062 ipython-XXX.tar.gz
1062 \family default
1063 \family default
1063 file, which contains the full IPython source distribution (the popular
1064 file, which contains the full IPython source distribution (the popular
1064 WinZip can read
1065 WinZip can read
1065 \family typewriter
1066 \family typewriter
1066 .tar.gz
1067 .tar.gz
1067 \family default
1068 \family default
1068 files).
1069 files).
1069 After uncompressing the archive, you can install it at a command terminal
1070 After uncompressing the archive, you can install it at a command terminal
1070 just like any other Python module, by using
1071 just like any other Python module, by using
1071 \family typewriter
1072 \family typewriter
1072 `python setup.py install'
1073 `python setup.py install'
1073 \family default
1074 \family default
1074 .
1075 .
1075
1076
1076 \layout Standard
1077 \layout Standard
1077
1078
1078 After the installation, run the supplied
1079 After the installation, run the supplied
1079 \family typewriter
1080 \family typewriter
1080 win32_manual_post_install.py
1081 win32_manual_post_install.py
1081 \family default
1082 \family default
1082 script, which creates the necessary Start Menu shortcuts for you.
1083 script, which creates the necessary Start Menu shortcuts for you.
1083 \layout Subsection
1084 \layout Subsection
1084
1085
1085
1086
1086 \begin_inset LatexCommand \label{sec:upgrade}
1087 \begin_inset LatexCommand \label{sec:upgrade}
1087
1088
1088 \end_inset
1089 \end_inset
1089
1090
1090 Upgrading from a previous version
1091 Upgrading from a previous version
1091 \layout Standard
1092 \layout Standard
1092
1093
1093 If you are upgrading from a previous version of IPython, after doing the
1094 If you are upgrading from a previous version of IPython, after doing the
1094 routine installation described above, you should call IPython with the
1095 routine installation described above, you should call IPython with the
1095
1096
1096 \family typewriter
1097 \family typewriter
1097 -upgrade
1098 -upgrade
1098 \family default
1099 \family default
1099 option the first time you run your new copy.
1100 option the first time you run your new copy.
1100 This will automatically update your configuration directory while preserving
1101 This will automatically update your configuration directory while preserving
1101 copies of your old files.
1102 copies of your old files.
1102 You can then later merge back any personal customizations you may have
1103 You can then later merge back any personal customizations you may have
1103 made into the new files.
1104 made into the new files.
1104 It is a good idea to do this as there may be new options available in the
1105 It is a good idea to do this as there may be new options available in the
1105 new configuration files which you will not have.
1106 new configuration files which you will not have.
1106 \layout Standard
1107 \layout Standard
1107
1108
1108 Under Windows, if you don't know how to call python scripts with arguments
1109 Under Windows, if you don't know how to call python scripts with arguments
1109 from a command line, simply delete the old config directory and IPython
1110 from a command line, simply delete the old config directory and IPython
1110 will make a new one.
1111 will make a new one.
1111 Win2k and WinXP users will find it in
1112 Win2k and WinXP users will find it in
1112 \family typewriter
1113 \family typewriter
1113 C:
1114 C:
1114 \backslash
1115 \backslash
1115 Documents and Settings
1116 Documents and Settings
1116 \backslash
1117 \backslash
1117 YourUserName
1118 YourUserName
1118 \backslash
1119 \backslash
1119 .ipython
1120 .ipython
1120 \family default
1121 \family default
1121 , and Win 9x users under
1122 , and Win 9x users under
1122 \family typewriter
1123 \family typewriter
1123 C:
1124 C:
1124 \backslash
1125 \backslash
1125 Program Files
1126 Program Files
1126 \backslash
1127 \backslash
1127 IPython
1128 IPython
1128 \backslash
1129 \backslash
1129 .ipython.
1130 .ipython.
1130 \layout Section
1131 \layout Section
1131
1132
1132
1133
1133 \begin_inset LatexCommand \label{sec:good_config}
1134 \begin_inset LatexCommand \label{sec:good_config}
1134
1135
1135 \end_inset
1136 \end_inset
1136
1137
1137
1138
1138 \begin_inset OptArg
1139 \begin_inset OptArg
1139 collapsed true
1140 collapsed true
1140
1141
1141 \layout Standard
1142 \layout Standard
1142
1143
1143 Initial configuration
1144 Initial configuration
1144 \begin_inset ERT
1145 \begin_inset ERT
1145 status Collapsed
1146 status Collapsed
1146
1147
1147 \layout Standard
1148 \layout Standard
1148
1149
1149 \backslash
1150 \backslash
1150 ldots
1151 ldots
1151 \end_inset
1152 \end_inset
1152
1153
1153
1154
1154 \end_inset
1155 \end_inset
1155
1156
1156 Initial configuration of your environment
1157 Initial configuration of your environment
1157 \layout Standard
1158 \layout Standard
1158
1159
1159 This section will help you set various things in your environment for your
1160 This section will help you set various things in your environment for your
1160 IPython sessions to be as efficient as possible.
1161 IPython sessions to be as efficient as possible.
1161 All of IPython's configuration information, along with several example
1162 All of IPython's configuration information, along with several example
1162 files, is stored in a directory named by default
1163 files, is stored in a directory named by default
1163 \family typewriter
1164 \family typewriter
1164 $HOME/.ipython
1165 $HOME/.ipython
1165 \family default
1166 \family default
1166 .
1167 .
1167 You can change this by defining the environment variable
1168 You can change this by defining the environment variable
1168 \family typewriter
1169 \family typewriter
1169 IPYTHONDIR
1170 IPYTHONDIR
1170 \family default
1171 \family default
1171 , or at runtime with the command line option
1172 , or at runtime with the command line option
1172 \family typewriter
1173 \family typewriter
1173 -ipythondir
1174 -ipythondir
1174 \family default
1175 \family default
1175 .
1176 .
1176 \layout Standard
1177 \layout Standard
1177
1178
1178 If all goes well, the first time you run IPython it should automatically
1179 If all goes well, the first time you run IPython it should automatically
1179 create a user copy of the config directory for you, based on its builtin
1180 create a user copy of the config directory for you, based on its builtin
1180 defaults.
1181 defaults.
1181 You can look at the files it creates to learn more about configuring the
1182 You can look at the files it creates to learn more about configuring the
1182 system.
1183 system.
1183 The main file you will modify to configure IPython's behavior is called
1184 The main file you will modify to configure IPython's behavior is called
1184
1185
1185 \family typewriter
1186 \family typewriter
1186 ipythonrc
1187 ipythonrc
1187 \family default
1188 \family default
1188 (with a
1189 (with a
1189 \family typewriter
1190 \family typewriter
1190 .ini
1191 .ini
1191 \family default
1192 \family default
1192 extension under Windows), included for reference in Sec.
1193 extension under Windows), included for reference in Sec.
1193
1194
1194 \begin_inset LatexCommand \ref{sec:ipytonrc-sample}
1195 \begin_inset LatexCommand \ref{sec:ipytonrc-sample}
1195
1196
1196 \end_inset
1197 \end_inset
1197
1198
1198 .
1199 .
1199 This file is very commented and has many variables you can change to suit
1200 This file is very commented and has many variables you can change to suit
1200 your taste, you can find more details in Sec.
1201 your taste, you can find more details in Sec.
1201
1202
1202 \begin_inset LatexCommand \ref{sec:customization}
1203 \begin_inset LatexCommand \ref{sec:customization}
1203
1204
1204 \end_inset
1205 \end_inset
1205
1206
1206 .
1207 .
1207 Here we discuss the basic things you will want to make sure things are
1208 Here we discuss the basic things you will want to make sure things are
1208 working properly from the beginning.
1209 working properly from the beginning.
1209 \layout Subsection
1210 \layout Subsection
1210
1211
1211
1212
1212 \begin_inset LatexCommand \label{sec:help-access}
1213 \begin_inset LatexCommand \label{sec:help-access}
1213
1214
1214 \end_inset
1215 \end_inset
1215
1216
1216 Access to the Python help system
1217 Access to the Python help system
1217 \layout Standard
1218 \layout Standard
1218
1219
1219 This is true for Python in general (not just for IPython): you should have
1220 This is true for Python in general (not just for IPython): you should have
1220 an environment variable called
1221 an environment variable called
1221 \family typewriter
1222 \family typewriter
1222 PYTHONDOCS
1223 PYTHONDOCS
1223 \family default
1224 \family default
1224 pointing to the directory where your HTML Python documentation lives.
1225 pointing to the directory where your HTML Python documentation lives.
1225 In my system it's
1226 In my system it's
1226 \family typewriter
1227 \family typewriter
1227 /usr/share/doc/python-docs-2.3.4/html
1228 /usr/share/doc/python-docs-2.3.4/html
1228 \family default
1229 \family default
1229 , check your local details or ask your systems administrator.
1230 , check your local details or ask your systems administrator.
1230
1231
1231 \layout Standard
1232 \layout Standard
1232
1233
1233 This is the directory which holds the HTML version of the Python manuals.
1234 This is the directory which holds the HTML version of the Python manuals.
1234 Unfortunately it seems that different Linux distributions package these
1235 Unfortunately it seems that different Linux distributions package these
1235 files differently, so you may have to look around a bit.
1236 files differently, so you may have to look around a bit.
1236 Below I show the contents of this directory on my system for reference:
1237 Below I show the contents of this directory on my system for reference:
1237 \layout Standard
1238 \layout Standard
1238
1239
1239
1240
1240 \family typewriter
1241 \family typewriter
1241 [html]> ls
1242 [html]> ls
1242 \newline
1243 \newline
1243 about.dat acks.html dist/ ext/ index.html lib/ modindex.html stdabout.dat tut/
1244 about.dat acks.html dist/ ext/ index.html lib/ modindex.html stdabout.dat tut/
1244 about.html api/ doc/ icons/ inst/ mac/ ref/ style.css
1245 about.html api/ doc/ icons/ inst/ mac/ ref/ style.css
1245 \layout Standard
1246 \layout Standard
1246
1247
1247 You should really make sure this variable is correctly set so that Python's
1248 You should really make sure this variable is correctly set so that Python's
1248 pydoc-based help system works.
1249 pydoc-based help system works.
1249 It is a powerful and convenient system with full access to the Python manuals
1250 It is a powerful and convenient system with full access to the Python manuals
1250 and all modules accessible to you.
1251 and all modules accessible to you.
1251 \layout Standard
1252 \layout Standard
1252
1253
1253 Under Windows it seems that pydoc finds the documentation automatically,
1254 Under Windows it seems that pydoc finds the documentation automatically,
1254 so no extra setup appears necessary.
1255 so no extra setup appears necessary.
1255 \layout Subsection
1256 \layout Subsection
1256
1257
1257 Editor
1258 Editor
1258 \layout Standard
1259 \layout Standard
1259
1260
1260 The
1261 The
1261 \family typewriter
1262 \family typewriter
1262 %edit
1263 %edit
1263 \family default
1264 \family default
1264 command (and its alias
1265 command (and its alias
1265 \family typewriter
1266 \family typewriter
1266 %ed
1267 %ed
1267 \family default
1268 \family default
1268 ) will invoke the editor set in your environment as
1269 ) will invoke the editor set in your environment as
1269 \family typewriter
1270 \family typewriter
1270 EDITOR
1271 EDITOR
1271 \family default
1272 \family default
1272 .
1273 .
1273 If this variable is not set, it will default to
1274 If this variable is not set, it will default to
1274 \family typewriter
1275 \family typewriter
1275 vi
1276 vi
1276 \family default
1277 \family default
1277 under Linux/Unix and to
1278 under Linux/Unix and to
1278 \family typewriter
1279 \family typewriter
1279 notepad
1280 notepad
1280 \family default
1281 \family default
1281 under Windows.
1282 under Windows.
1282 You may want to set this variable properly and to a lightweight editor
1283 You may want to set this variable properly and to a lightweight editor
1283 which doesn't take too long to start (that is, something other than a new
1284 which doesn't take too long to start (that is, something other than a new
1284 instance of
1285 instance of
1285 \family typewriter
1286 \family typewriter
1286 Emacs
1287 Emacs
1287 \family default
1288 \family default
1288 ).
1289 ).
1289 This way you can edit multi-line code quickly and with the power of a real
1290 This way you can edit multi-line code quickly and with the power of a real
1290 editor right inside IPython.
1291 editor right inside IPython.
1291
1292
1292 \layout Standard
1293 \layout Standard
1293
1294
1294 If you are a dedicated
1295 If you are a dedicated
1295 \family typewriter
1296 \family typewriter
1296 Emacs
1297 Emacs
1297 \family default
1298 \family default
1298 user, you should set up the
1299 user, you should set up the
1299 \family typewriter
1300 \family typewriter
1300 Emacs
1301 Emacs
1301 \family default
1302 \family default
1302 server so that new requests are handled by the original process.
1303 server so that new requests are handled by the original process.
1303 This means that almost no time is spent in handling the request (assuming
1304 This means that almost no time is spent in handling the request (assuming
1304 an
1305 an
1305 \family typewriter
1306 \family typewriter
1306 Emacs
1307 Emacs
1307 \family default
1308 \family default
1308 process is already running).
1309 process is already running).
1309 For this to work, you need to set your
1310 For this to work, you need to set your
1310 \family typewriter
1311 \family typewriter
1311 EDITOR
1312 EDITOR
1312 \family default
1313 \family default
1313 environment variable to
1314 environment variable to
1314 \family typewriter
1315 \family typewriter
1315 'emacsclient'
1316 'emacsclient'
1316 \family default
1317 \family default
1317 .
1318 .
1318
1319
1319 \family typewriter
1320 \family typewriter
1320
1321
1321 \family default
1322 \family default
1322 The code below, supplied by Francois Pinard, can then be used in your
1323 The code below, supplied by Francois Pinard, can then be used in your
1323 \family typewriter
1324 \family typewriter
1324 .emacs
1325 .emacs
1325 \family default
1326 \family default
1326 file to enable the server:
1327 file to enable the server:
1327 \layout Standard
1328 \layout Standard
1328
1329
1329
1330
1330 \family typewriter
1331 \family typewriter
1331 (defvar server-buffer-clients)
1332 (defvar server-buffer-clients)
1332 \newline
1333 \newline
1333 (when (and (fboundp 'server-start) (string-equal (getenv "TERM") 'xterm))
1334 (when (and (fboundp 'server-start) (string-equal (getenv "TERM") 'xterm))
1334 \newline
1335 \newline
1335
1336
1336 \begin_inset ERT
1337 \begin_inset ERT
1337 status Collapsed
1338 status Collapsed
1338
1339
1339 \layout Standard
1340 \layout Standard
1340
1341
1341 \backslash
1342 \backslash
1342 hspace*{0mm}
1343 hspace*{0mm}
1343 \end_inset
1344 \end_inset
1344
1345
1345 \SpecialChar ~
1346 \SpecialChar ~
1346 \SpecialChar ~
1347 \SpecialChar ~
1347 (server-start)
1348 (server-start)
1348 \newline
1349 \newline
1349
1350
1350 \begin_inset ERT
1351 \begin_inset ERT
1351 status Collapsed
1352 status Collapsed
1352
1353
1353 \layout Standard
1354 \layout Standard
1354
1355
1355 \backslash
1356 \backslash
1356 hspace*{0mm}
1357 hspace*{0mm}
1357 \end_inset
1358 \end_inset
1358
1359
1359 \SpecialChar ~
1360 \SpecialChar ~
1360 \SpecialChar ~
1361 \SpecialChar ~
1361 (defun fp-kill-server-with-buffer-routine ()
1362 (defun fp-kill-server-with-buffer-routine ()
1362 \newline
1363 \newline
1363
1364
1364 \begin_inset ERT
1365 \begin_inset ERT
1365 status Collapsed
1366 status Collapsed
1366
1367
1367 \layout Standard
1368 \layout Standard
1368
1369
1369 \backslash
1370 \backslash
1370 hspace*{0mm}
1371 hspace*{0mm}
1371 \end_inset
1372 \end_inset
1372
1373
1373 \SpecialChar ~
1374 \SpecialChar ~
1374 \SpecialChar ~
1375 \SpecialChar ~
1375 \SpecialChar ~
1376 \SpecialChar ~
1376 \SpecialChar ~
1377 \SpecialChar ~
1377 (and server-buffer-clients (server-done)))
1378 (and server-buffer-clients (server-done)))
1378 \newline
1379 \newline
1379
1380
1380 \begin_inset ERT
1381 \begin_inset ERT
1381 status Collapsed
1382 status Collapsed
1382
1383
1383 \layout Standard
1384 \layout Standard
1384
1385
1385 \backslash
1386 \backslash
1386 hspace*{0mm}
1387 hspace*{0mm}
1387 \end_inset
1388 \end_inset
1388
1389
1389 \SpecialChar ~
1390 \SpecialChar ~
1390 \SpecialChar ~
1391 \SpecialChar ~
1391 (add-hook 'kill-buffer-hook 'fp-kill-server-with-buffer-routine))
1392 (add-hook 'kill-buffer-hook 'fp-kill-server-with-buffer-routine))
1392 \layout Standard
1393 \layout Standard
1393
1394
1394 You can also set the value of this editor via the commmand-line option '-
1395 You can also set the value of this editor via the commmand-line option '-
1395 \family typewriter
1396 \family typewriter
1396 editor'
1397 editor'
1397 \family default
1398 \family default
1398 or in your
1399 or in your
1399 \family typewriter
1400 \family typewriter
1400 ipythonrc
1401 ipythonrc
1401 \family default
1402 \family default
1402 file.
1403 file.
1403 This is useful if you wish to use specifically for IPython an editor different
1404 This is useful if you wish to use specifically for IPython an editor different
1404 from your typical default (and for Windows users who tend to use fewer
1405 from your typical default (and for Windows users who tend to use fewer
1405 environment variables).
1406 environment variables).
1406 \layout Subsection
1407 \layout Subsection
1407
1408
1408 Color
1409 Color
1409 \layout Standard
1410 \layout Standard
1410
1411
1411 The default IPython configuration has most bells and whistles turned on
1412 The default IPython configuration has most bells and whistles turned on
1412 (they're pretty safe).
1413 (they're pretty safe).
1413 But there's one that
1414 But there's one that
1414 \emph on
1415 \emph on
1415 may
1416 may
1416 \emph default
1417 \emph default
1417 cause problems on some systems: the use of color on screen for displaying
1418 cause problems on some systems: the use of color on screen for displaying
1418 information.
1419 information.
1419 This is very useful, since IPython can show prompts and exception tracebacks
1420 This is very useful, since IPython can show prompts and exception tracebacks
1420 with various colors, display syntax-highlighted source code, and in general
1421 with various colors, display syntax-highlighted source code, and in general
1421 make it easier to visually parse information.
1422 make it easier to visually parse information.
1422 \layout Standard
1423 \layout Standard
1423
1424
1424 The following terminals seem to handle the color sequences fine:
1425 The following terminals seem to handle the color sequences fine:
1425 \layout Itemize
1426 \layout Itemize
1426
1427
1427 Linux main text console, KDE Konsole, Gnome Terminal, E-term, rxvt, xterm.
1428 Linux main text console, KDE Konsole, Gnome Terminal, E-term, rxvt, xterm.
1428 \layout Itemize
1429 \layout Itemize
1429
1430
1430 CDE terminal (tested under Solaris).
1431 CDE terminal (tested under Solaris).
1431 This one boldfaces light colors.
1432 This one boldfaces light colors.
1432 \layout Itemize
1433 \layout Itemize
1433
1434
1434 (X)Emacs buffers.
1435 (X)Emacs buffers.
1435 See sec.
1436 See sec.
1436 \begin_inset LatexCommand \ref{sec:emacs}
1437 \begin_inset LatexCommand \ref{sec:emacs}
1437
1438
1438 \end_inset
1439 \end_inset
1439
1440
1440 for more details on using IPython with (X)Emacs.
1441 for more details on using IPython with (X)Emacs.
1441 \layout Itemize
1442 \layout Itemize
1442
1443
1443 A Windows (XP/2k) command prompt
1444 A Windows (XP/2k) command prompt
1444 \emph on
1445 \emph on
1445 with Gary Bishop's support extensions
1446 with Gary Bishop's support extensions
1446 \emph default
1447 \emph default
1447 .
1448 .
1448 Gary's extensions are discussed in Sec.\SpecialChar ~
1449 Gary's extensions are discussed in Sec.\SpecialChar ~
1449
1450
1450 \begin_inset LatexCommand \ref{sub:Under-Windows}
1451 \begin_inset LatexCommand \ref{sub:Under-Windows}
1451
1452
1452 \end_inset
1453 \end_inset
1453
1454
1454 .
1455 .
1455 \layout Itemize
1456 \layout Itemize
1456
1457
1457 A Windows (XP/2k) CygWin shell.
1458 A Windows (XP/2k) CygWin shell.
1458 Although some users have reported problems; it is not clear whether there
1459 Although some users have reported problems; it is not clear whether there
1459 is an issue for everyone or only under specific configurations.
1460 is an issue for everyone or only under specific configurations.
1460 If you have full color support under cygwin, please post to the IPython
1461 If you have full color support under cygwin, please post to the IPython
1461 mailing list so this issue can be resolved for all users.
1462 mailing list so this issue can be resolved for all users.
1462 \layout Standard
1463 \layout Standard
1463
1464
1464 These have shown problems:
1465 These have shown problems:
1465 \layout Itemize
1466 \layout Itemize
1466
1467
1467 Windows command prompt in WinXP/2k logged into a Linux machine via telnet
1468 Windows command prompt in WinXP/2k logged into a Linux machine via telnet
1468 or ssh.
1469 or ssh.
1469 \layout Itemize
1470 \layout Itemize
1470
1471
1471 Windows native command prompt in WinXP/2k,
1472 Windows native command prompt in WinXP/2k,
1472 \emph on
1473 \emph on
1473 without
1474 without
1474 \emph default
1475 \emph default
1475 Gary Bishop's extensions.
1476 Gary Bishop's extensions.
1476 Once Gary's readline library is installed, the normal WinXP/2k command
1477 Once Gary's readline library is installed, the normal WinXP/2k command
1477 prompt works perfectly.
1478 prompt works perfectly.
1478 \layout Standard
1479 \layout Standard
1479
1480
1480 Currently the following color schemes are available:
1481 Currently the following color schemes are available:
1481 \layout Itemize
1482 \layout Itemize
1482
1483
1483
1484
1484 \family typewriter
1485 \family typewriter
1485 NoColor
1486 NoColor
1486 \family default
1487 \family default
1487 : uses no color escapes at all (all escapes are empty
1488 : uses no color escapes at all (all escapes are empty
1488 \begin_inset Quotes eld
1489 \begin_inset Quotes eld
1489 \end_inset
1490 \end_inset
1490
1491
1491
1492
1492 \begin_inset Quotes eld
1493 \begin_inset Quotes eld
1493 \end_inset
1494 \end_inset
1494
1495
1495 strings).
1496 strings).
1496 This 'scheme' is thus fully safe to use in any terminal.
1497 This 'scheme' is thus fully safe to use in any terminal.
1497 \layout Itemize
1498 \layout Itemize
1498
1499
1499
1500
1500 \family typewriter
1501 \family typewriter
1501 Linux
1502 Linux
1502 \family default
1503 \family default
1503 : works well in Linux console type environments: dark background with light
1504 : works well in Linux console type environments: dark background with light
1504 fonts.
1505 fonts.
1505 It uses bright colors for information, so it is difficult to read if you
1506 It uses bright colors for information, so it is difficult to read if you
1506 have a light colored background.
1507 have a light colored background.
1507 \layout Itemize
1508 \layout Itemize
1508
1509
1509
1510
1510 \family typewriter
1511 \family typewriter
1511 LightBG
1512 LightBG
1512 \family default
1513 \family default
1513 : the basic colors are similar to those in the
1514 : the basic colors are similar to those in the
1514 \family typewriter
1515 \family typewriter
1515 Linux
1516 Linux
1516 \family default
1517 \family default
1517 scheme but darker.
1518 scheme but darker.
1518 It is easy to read in terminals with light backgrounds.
1519 It is easy to read in terminals with light backgrounds.
1519 \layout Standard
1520 \layout Standard
1520
1521
1521 IPython uses colors for two main groups of things: prompts and tracebacks
1522 IPython uses colors for two main groups of things: prompts and tracebacks
1522 which are directly printed to the terminal, and the object introspection
1523 which are directly printed to the terminal, and the object introspection
1523 system which passes large sets of data through a pager.
1524 system which passes large sets of data through a pager.
1524 \layout Subsubsection
1525 \layout Subsubsection
1525
1526
1526 Input/Output prompts and exception tracebacks
1527 Input/Output prompts and exception tracebacks
1527 \layout Standard
1528 \layout Standard
1528
1529
1529 You can test whether the colored prompts and tracebacks work on your system
1530 You can test whether the colored prompts and tracebacks work on your system
1530 interactively by typing
1531 interactively by typing
1531 \family typewriter
1532 \family typewriter
1532 '%colors Linux'
1533 '%colors Linux'
1533 \family default
1534 \family default
1534 at the prompt (use '
1535 at the prompt (use '
1535 \family typewriter
1536 \family typewriter
1536 %colors LightBG'
1537 %colors LightBG'
1537 \family default
1538 \family default
1538 if your terminal has a light background).
1539 if your terminal has a light background).
1539 If the input prompt shows garbage like:
1540 If the input prompt shows garbage like:
1540 \newline
1541 \newline
1541
1542
1542 \family typewriter
1543 \family typewriter
1543 [0;32mIn [[1;32m1[0;32m]: [0;00m
1544 [0;32mIn [[1;32m1[0;32m]: [0;00m
1544 \family default
1545 \family default
1545
1546
1546 \newline
1547 \newline
1547 instead of (in color) something like:
1548 instead of (in color) something like:
1548 \newline
1549 \newline
1549
1550
1550 \family typewriter
1551 \family typewriter
1551 In [1]:
1552 In [1]:
1552 \family default
1553 \family default
1553
1554
1554 \newline
1555 \newline
1555 this means that your terminal doesn't properly handle color escape sequences.
1556 this means that your terminal doesn't properly handle color escape sequences.
1556 You can go to a 'no color' mode by typing '
1557 You can go to a 'no color' mode by typing '
1557 \family typewriter
1558 \family typewriter
1558 %colors NoColor
1559 %colors NoColor
1559 \family default
1560 \family default
1560 '.
1561 '.
1561
1562
1562 \layout Standard
1563 \layout Standard
1563
1564
1564 You can try using a different terminal emulator program.
1565 You can try using a different terminal emulator program.
1565 To permanently set your color preferences, edit the file
1566 To permanently set your color preferences, edit the file
1566 \family typewriter
1567 \family typewriter
1567 $HOME/.ipython/ipythonrc
1568 $HOME/.ipython/ipythonrc
1568 \family default
1569 \family default
1569 and set the
1570 and set the
1570 \family typewriter
1571 \family typewriter
1571 colors
1572 colors
1572 \family default
1573 \family default
1573 option to the desired value.
1574 option to the desired value.
1574 \layout Subsubsection
1575 \layout Subsubsection
1575
1576
1576 Object details (types, docstrings, source code, etc.)
1577 Object details (types, docstrings, source code, etc.)
1577 \layout Standard
1578 \layout Standard
1578
1579
1579 IPython has a set of special functions for studying the objects you are
1580 IPython has a set of special functions for studying the objects you are
1580 working with, discussed in detail in Sec.
1581 working with, discussed in detail in Sec.
1581
1582
1582 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1583 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1583
1584
1584 \end_inset
1585 \end_inset
1585
1586
1586 .
1587 .
1587 But this system relies on passing information which is longer than your
1588 But this system relies on passing information which is longer than your
1588 screen through a data pager, such as the common Unix
1589 screen through a data pager, such as the common Unix
1589 \family typewriter
1590 \family typewriter
1590 less
1591 less
1591 \family default
1592 \family default
1592 and
1593 and
1593 \family typewriter
1594 \family typewriter
1594 more
1595 more
1595 \family default
1596 \family default
1596 programs.
1597 programs.
1597 In order to be able to see this information in color, your pager needs
1598 In order to be able to see this information in color, your pager needs
1598 to be properly configured.
1599 to be properly configured.
1599 I strongly recommend using
1600 I strongly recommend using
1600 \family typewriter
1601 \family typewriter
1601 less
1602 less
1602 \family default
1603 \family default
1603 instead of
1604 instead of
1604 \family typewriter
1605 \family typewriter
1605 more
1606 more
1606 \family default
1607 \family default
1607 , as it seems that
1608 , as it seems that
1608 \family typewriter
1609 \family typewriter
1609 more
1610 more
1610 \family default
1611 \family default
1611 simply can not understand colored text correctly.
1612 simply can not understand colored text correctly.
1612 \layout Standard
1613 \layout Standard
1613
1614
1614 In order to configure
1615 In order to configure
1615 \family typewriter
1616 \family typewriter
1616 less
1617 less
1617 \family default
1618 \family default
1618 as your default pager, do the following:
1619 as your default pager, do the following:
1619 \layout Enumerate
1620 \layout Enumerate
1620
1621
1621 Set the environment
1622 Set the environment
1622 \family typewriter
1623 \family typewriter
1623 PAGER
1624 PAGER
1624 \family default
1625 \family default
1625 variable to
1626 variable to
1626 \family typewriter
1627 \family typewriter
1627 less
1628 less
1628 \family default
1629 \family default
1629 .
1630 .
1630 \layout Enumerate
1631 \layout Enumerate
1631
1632
1632 Set the environment
1633 Set the environment
1633 \family typewriter
1634 \family typewriter
1634 LESS
1635 LESS
1635 \family default
1636 \family default
1636 variable to
1637 variable to
1637 \family typewriter
1638 \family typewriter
1638 -r
1639 -r
1639 \family default
1640 \family default
1640 (plus any other options you always want to pass to
1641 (plus any other options you always want to pass to
1641 \family typewriter
1642 \family typewriter
1642 less
1643 less
1643 \family default
1644 \family default
1644 by default).
1645 by default).
1645 This tells
1646 This tells
1646 \family typewriter
1647 \family typewriter
1647 less
1648 less
1648 \family default
1649 \family default
1649 to properly interpret control sequences, which is how color information
1650 to properly interpret control sequences, which is how color information
1650 is given to your terminal.
1651 is given to your terminal.
1651 \layout Standard
1652 \layout Standard
1652
1653
1653 For the
1654 For the
1654 \family typewriter
1655 \family typewriter
1655 csh
1656 csh
1656 \family default
1657 \family default
1657 or
1658 or
1658 \family typewriter
1659 \family typewriter
1659 tcsh
1660 tcsh
1660 \family default
1661 \family default
1661 shells, add to your
1662 shells, add to your
1662 \family typewriter
1663 \family typewriter
1663 ~/.cshrc
1664 ~/.cshrc
1664 \family default
1665 \family default
1665 file the lines:
1666 file the lines:
1666 \layout Standard
1667 \layout Standard
1667
1668
1668
1669
1669 \family typewriter
1670 \family typewriter
1670 setenv PAGER less
1671 setenv PAGER less
1671 \newline
1672 \newline
1672 setenv LESS -r
1673 setenv LESS -r
1673 \layout Standard
1674 \layout Standard
1674
1675
1675 There is similar syntax for other Unix shells, look at your system documentation
1676 There is similar syntax for other Unix shells, look at your system documentation
1676 for details.
1677 for details.
1677 \layout Standard
1678 \layout Standard
1678
1679
1679 If you are on a system which lacks proper data pagers (such as Windows),
1680 If you are on a system which lacks proper data pagers (such as Windows),
1680 IPython will use a very limited builtin pager.
1681 IPython will use a very limited builtin pager.
1681 \layout Subsection
1682 \layout Subsection
1682
1683
1683
1684
1684 \begin_inset LatexCommand \label{sec:emacs}
1685 \begin_inset LatexCommand \label{sec:emacs}
1685
1686
1686 \end_inset
1687 \end_inset
1687
1688
1688 (X)Emacs configuration
1689 (X)Emacs configuration
1689 \layout Standard
1690 \layout Standard
1690
1691
1691 Thanks to the work of Alexander Schmolck and Prabhu Ramachandran, currently
1692 Thanks to the work of Alexander Schmolck and Prabhu Ramachandran, currently
1692 (X)Emacs and IPython get along very well.
1693 (X)Emacs and IPython get along very well.
1693
1694
1694 \layout Standard
1695 \layout Standard
1695
1696
1696
1697
1697 \series bold
1698 \series bold
1698 Important note:
1699 Important note:
1699 \series default
1700 \series default
1700 You will need to use a recent enough version of
1701 You will need to use a recent enough version of
1701 \family typewriter
1702 \family typewriter
1702 python-mode.el
1703 python-mode.el
1703 \family default
1704 \family default
1704 , along with the file
1705 , along with the file
1705 \family typewriter
1706 \family typewriter
1706 ipython.el
1707 ipython.el
1707 \family default
1708 \family default
1708 .
1709 .
1709 You can check that the version you have of
1710 You can check that the version you have of
1710 \family typewriter
1711 \family typewriter
1711 python-mode.el
1712 python-mode.el
1712 \family default
1713 \family default
1713 is new enough by either looking at the revision number in the file itself,
1714 is new enough by either looking at the revision number in the file itself,
1714 or asking for it in (X)Emacs via
1715 or asking for it in (X)Emacs via
1715 \family typewriter
1716 \family typewriter
1716 M-x py-version
1717 M-x py-version
1717 \family default
1718 \family default
1718 .
1719 .
1719 Versions 4.68 and newer contain the necessary fixes for proper IPython support.
1720 Versions 4.68 and newer contain the necessary fixes for proper IPython support.
1720 \layout Standard
1721 \layout Standard
1721
1722
1722 The file
1723 The file
1723 \family typewriter
1724 \family typewriter
1724 ipython.el
1725 ipython.el
1725 \family default
1726 \family default
1726 is included with the IPython distribution, in the documentation directory
1727 is included with the IPython distribution, in the documentation directory
1727 (where this manual resides in PDF and HTML formats).
1728 (where this manual resides in PDF and HTML formats).
1728 \layout Standard
1729 \layout Standard
1729
1730
1730 Once you put these files in your Emacs path, all you need in your
1731 Once you put these files in your Emacs path, all you need in your
1731 \family typewriter
1732 \family typewriter
1732 .emacs
1733 .emacs
1733 \family default
1734 \family default
1734 file is:
1735 file is:
1735 \layout Standard
1736 \layout Standard
1736
1737
1737
1738
1738 \family typewriter
1739 \family typewriter
1739 (require 'ipython)
1740 (require 'ipython)
1740 \layout Standard
1741 \layout Standard
1741
1742
1742 This should give you full support for executing code snippets via IPython,
1743 This should give you full support for executing code snippets via IPython,
1743 opening IPython as your Python shell via
1744 opening IPython as your Python shell via
1744 \family typewriter
1745 \family typewriter
1745 C-c\SpecialChar ~
1746 C-c\SpecialChar ~
1746 !
1747 !
1747 \family default
1748 \family default
1748 , etc.
1749 , etc.
1749
1750
1750 \layout Subsubsection*
1751 \layout Subsubsection*
1751
1752
1752 Notes
1753 Notes
1753 \layout Itemize
1754 \layout Itemize
1754
1755
1755 There is one caveat you should be aware of: you must start the IPython shell
1756 There is one caveat you should be aware of: you must start the IPython shell
1756
1757
1757 \emph on
1758 \emph on
1758 before
1759 before
1759 \emph default
1760 \emph default
1760 attempting to execute any code regions via
1761 attempting to execute any code regions via
1761 \family typewriter
1762 \family typewriter
1762 C-c\SpecialChar ~
1763 C-c\SpecialChar ~
1763 |
1764 |
1764 \family default
1765 \family default
1765 .
1766 .
1766 Simply type
1767 Simply type
1767 \family typewriter
1768 \family typewriter
1768 C-c\SpecialChar ~
1769 C-c\SpecialChar ~
1769 !
1770 !
1770 \family default
1771 \family default
1771 to start IPython before passing any code regions to the interpreter, and
1772 to start IPython before passing any code regions to the interpreter, and
1772 you shouldn't experience any problems.
1773 you shouldn't experience any problems.
1773 \newline
1774 \newline
1774 This is due to a bug in Python itself, which has been fixed for Python 2.3,
1775 This is due to a bug in Python itself, which has been fixed for Python 2.3,
1775 but exists as of Python 2.2.2 (reported as SF bug [ 737947 ]).
1776 but exists as of Python 2.2.2 (reported as SF bug [ 737947 ]).
1776 \layout Itemize
1777 \layout Itemize
1777
1778
1778 The (X)Emacs support is maintained by Alexander Schmolck, so all comments/reques
1779 The (X)Emacs support is maintained by Alexander Schmolck, so all comments/reques
1779 ts should be directed to him through the IPython mailing lists.
1780 ts should be directed to him through the IPython mailing lists.
1780
1781
1781 \layout Itemize
1782 \layout Itemize
1782
1783
1783 This code is still somewhat experimental so it's a bit rough around the
1784 This code is still somewhat experimental so it's a bit rough around the
1784 edges (although in practice, it works quite well).
1785 edges (although in practice, it works quite well).
1785 \layout Itemize
1786 \layout Itemize
1786
1787
1787 Be aware that if you customize
1788 Be aware that if you customize
1788 \family typewriter
1789 \family typewriter
1789 py-python-command
1790 py-python-command
1790 \family default
1791 \family default
1791 previously, this value will override what
1792 previously, this value will override what
1792 \family typewriter
1793 \family typewriter
1793 ipython.el
1794 ipython.el
1794 \family default
1795 \family default
1795 does (because loading the customization variables comes later).
1796 does (because loading the customization variables comes later).
1796 \layout Section
1797 \layout Section
1797
1798
1798
1799
1799 \begin_inset LatexCommand \label{sec:quick_tips}
1800 \begin_inset LatexCommand \label{sec:quick_tips}
1800
1801
1801 \end_inset
1802 \end_inset
1802
1803
1803 Quick tips
1804 Quick tips
1804 \layout Standard
1805 \layout Standard
1805
1806
1806 IPython can be used as an improved replacement for the Python prompt, and
1807 IPython can be used as an improved replacement for the Python prompt, and
1807 for that you don't really need to read any more of this manual.
1808 for that you don't really need to read any more of this manual.
1808 But in this section we'll try to summarize a few tips on how to make the
1809 But in this section we'll try to summarize a few tips on how to make the
1809 most effective use of it for everyday Python development, highlighting
1810 most effective use of it for everyday Python development, highlighting
1810 things you might miss in the rest of the manual (which is getting long).
1811 things you might miss in the rest of the manual (which is getting long).
1811 We'll give references to parts in the manual which provide more detail
1812 We'll give references to parts in the manual which provide more detail
1812 when appropriate.
1813 when appropriate.
1813 \layout Standard
1814 \layout Standard
1814
1815
1815 The following article by Jeremy Jones provides an introductory tutorial
1816 The following article by Jeremy Jones provides an introductory tutorial
1816 about IPython:
1817 about IPython:
1817 \newline
1818 \newline
1818
1819
1819 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html}
1820 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html}
1820
1821
1821 \end_inset
1822 \end_inset
1822
1823
1823
1824
1824 \layout Itemize
1825 \layout Itemize
1825
1826
1826 The TAB key.
1827 The TAB key.
1827 TAB-completion, especially for attributes, is a convenient way to explore
1828 TAB-completion, especially for attributes, is a convenient way to explore
1828 the structure of any object you're dealing with.
1829 the structure of any object you're dealing with.
1829 Simply type
1830 Simply type
1830 \family typewriter
1831 \family typewriter
1831 object_name.<TAB>
1832 object_name.<TAB>
1832 \family default
1833 \family default
1833 and a list of the object's attributes will be printed (see sec.
1834 and a list of the object's attributes will be printed (see sec.
1834
1835
1835 \begin_inset LatexCommand \ref{sec:readline}
1836 \begin_inset LatexCommand \ref{sec:readline}
1836
1837
1837 \end_inset
1838 \end_inset
1838
1839
1839 for more).
1840 for more).
1840 Tab completion also works on file and directory names, which combined with
1841 Tab completion also works on file and directory names, which combined with
1841 IPython's alias system allows you to do from within IPython many of the
1842 IPython's alias system allows you to do from within IPython many of the
1842 things you normally would need the system shell for.
1843 things you normally would need the system shell for.
1843
1844
1844 \layout Itemize
1845 \layout Itemize
1845
1846
1846 Explore your objects.
1847 Explore your objects.
1847 Typing
1848 Typing
1848 \family typewriter
1849 \family typewriter
1849 object_name?
1850 object_name?
1850 \family default
1851 \family default
1851 will print all sorts of details about any object, including docstrings,
1852 will print all sorts of details about any object, including docstrings,
1852 function definition lines (for call arguments) and constructor details
1853 function definition lines (for call arguments) and constructor details
1853 for classes.
1854 for classes.
1854 The magic commands
1855 The magic commands
1855 \family typewriter
1856 \family typewriter
1856 %pdoc
1857 %pdoc
1857 \family default
1858 \family default
1858 ,
1859 ,
1859 \family typewriter
1860 \family typewriter
1860 %pdef
1861 %pdef
1861 \family default
1862 \family default
1862 ,
1863 ,
1863 \family typewriter
1864 \family typewriter
1864 %psource
1865 %psource
1865 \family default
1866 \family default
1866 and
1867 and
1867 \family typewriter
1868 \family typewriter
1868 %pfile
1869 %pfile
1869 \family default
1870 \family default
1870 will respectively print the docstring, function definition line, full source
1871 will respectively print the docstring, function definition line, full source
1871 code and the complete file for any object (when they can be found).
1872 code and the complete file for any object (when they can be found).
1872 If automagic is on (it is by default), you don't need to type the '
1873 If automagic is on (it is by default), you don't need to type the '
1873 \family typewriter
1874 \family typewriter
1874 %
1875 %
1875 \family default
1876 \family default
1876 ' explicitly.
1877 ' explicitly.
1877 See sec.
1878 See sec.
1878
1879
1879 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1880 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1880
1881
1881 \end_inset
1882 \end_inset
1882
1883
1883 for more.
1884 for more.
1884 \layout Itemize
1885 \layout Itemize
1885
1886
1886 The
1887 The
1887 \family typewriter
1888 \family typewriter
1888 %run
1889 %run
1889 \family default
1890 \family default
1890 magic command allows you to run any python script and load all of its data
1891 magic command allows you to run any python script and load all of its data
1891 directly into the interactive namespace.
1892 directly into the interactive namespace.
1892 Since the file is re-read from disk each time, changes you make to it are
1893 Since the file is re-read from disk each time, changes you make to it are
1893 reflected immediately (in contrast to the behavior of
1894 reflected immediately (in contrast to the behavior of
1894 \family typewriter
1895 \family typewriter
1895 import
1896 import
1896 \family default
1897 \family default
1897 ).
1898 ).
1898 I rarely use
1899 I rarely use
1899 \family typewriter
1900 \family typewriter
1900 import
1901 import
1901 \family default
1902 \family default
1902 for code I am testing, relying on
1903 for code I am testing, relying on
1903 \family typewriter
1904 \family typewriter
1904 %run
1905 %run
1905 \family default
1906 \family default
1906 instead.
1907 instead.
1907 See sec.
1908 See sec.
1908
1909
1909 \begin_inset LatexCommand \ref{sec:magic}
1910 \begin_inset LatexCommand \ref{sec:magic}
1910
1911
1911 \end_inset
1912 \end_inset
1912
1913
1913 for more on this and other magic commands, or type the name of any magic
1914 for more on this and other magic commands, or type the name of any magic
1914 command and ? to get details on it.
1915 command and ? to get details on it.
1915 See also sec.
1916 See also sec.
1916
1917
1917 \begin_inset LatexCommand \ref{sec:dreload}
1918 \begin_inset LatexCommand \ref{sec:dreload}
1918
1919
1919 \end_inset
1920 \end_inset
1920
1921
1921 for a recursive reload command.
1922 for a recursive reload command.
1922 \newline
1923 \newline
1923
1924
1924 \family typewriter
1925 \family typewriter
1925 %run
1926 %run
1926 \family default
1927 \family default
1927 also has special flags for timing the execution of your scripts (
1928 also has special flags for timing the execution of your scripts (
1928 \family typewriter
1929 \family typewriter
1929 -t
1930 -t
1930 \family default
1931 \family default
1931 ) and for executing them under the control of either Python's
1932 ) and for executing them under the control of either Python's
1932 \family typewriter
1933 \family typewriter
1933 pdb
1934 pdb
1934 \family default
1935 \family default
1935 debugger (
1936 debugger (
1936 \family typewriter
1937 \family typewriter
1937 -d
1938 -d
1938 \family default
1939 \family default
1939 ) or profiler (
1940 ) or profiler (
1940 \family typewriter
1941 \family typewriter
1941 -p
1942 -p
1942 \family default
1943 \family default
1943 ).
1944 ).
1944 With all of these,
1945 With all of these,
1945 \family typewriter
1946 \family typewriter
1946 %run
1947 %run
1947 \family default
1948 \family default
1948 can be used as the main tool for efficient interactive development of code
1949 can be used as the main tool for efficient interactive development of code
1949 which you write in your editor of choice.
1950 which you write in your editor of choice.
1950 \layout Itemize
1951 \layout Itemize
1951
1952
1952 Use the Python debugger,
1953 Use the Python debugger,
1953 \family typewriter
1954 \family typewriter
1954 pdb
1955 pdb
1955 \family default
1956 \family default
1956
1957
1957 \begin_inset Foot
1958 \begin_inset Foot
1958 collapsed true
1959 collapsed true
1959
1960
1960 \layout Standard
1961 \layout Standard
1961
1962
1962 Thanks to Christian Hart and Matthew Arnison for the suggestions leading
1963 Thanks to Christian Hart and Matthew Arnison for the suggestions leading
1963 to IPython's improved debugger and profiler support.
1964 to IPython's improved debugger and profiler support.
1964 \end_inset
1965 \end_inset
1965
1966
1966 .
1967 .
1967 The
1968 The
1968 \family typewriter
1969 \family typewriter
1969 %pdb
1970 %pdb
1970 \family default
1971 \family default
1971 command allows you to toggle on and off the automatic invocation of the
1972 command allows you to toggle on and off the automatic invocation of the
1972 pdb debugger at any uncaught exception.
1973 pdb debugger at any uncaught exception.
1973 The advantage of this is that pdb starts
1974 The advantage of this is that pdb starts
1974 \emph on
1975 \emph on
1975 inside
1976 inside
1976 \emph default
1977 \emph default
1977 the function where the exception occurred, with all data still available.
1978 the function where the exception occurred, with all data still available.
1978 You can print variables, see code, execute statements and even walk up
1979 You can print variables, see code, execute statements and even walk up
1979 and down the call stack to track down the true source of the problem (which
1980 and down the call stack to track down the true source of the problem (which
1980 often is many layers in the stack above where the exception gets triggered).
1981 often is many layers in the stack above where the exception gets triggered).
1981 \newline
1982 \newline
1982 Running programs with
1983 Running programs with
1983 \family typewriter
1984 \family typewriter
1984 %run
1985 %run
1985 \family default
1986 \family default
1986 and pdb active can be an efficient to develop and debug code, in many cases
1987 and pdb active can be an efficient to develop and debug code, in many cases
1987 eliminating the need for
1988 eliminating the need for
1988 \family typewriter
1989 \family typewriter
1989 print
1990 print
1990 \family default
1991 \family default
1991 statements or external debugging tools.
1992 statements or external debugging tools.
1992 I often simply put a
1993 I often simply put a
1993 \family typewriter
1994 \family typewriter
1994 1/0
1995 1/0
1995 \family default
1996 \family default
1996 in a place where I want to take a look so that pdb gets called, quickly
1997 in a place where I want to take a look so that pdb gets called, quickly
1997 view whatever variables I need to or test various pieces of code and then
1998 view whatever variables I need to or test various pieces of code and then
1998 remove the
1999 remove the
1999 \family typewriter
2000 \family typewriter
2000 1/0
2001 1/0
2001 \family default
2002 \family default
2002 .
2003 .
2003 \newline
2004 \newline
2004 Note also that `
2005 Note also that `
2005 \family typewriter
2006 \family typewriter
2006 %run -d
2007 %run -d
2007 \family default
2008 \family default
2008 ' activates
2009 ' activates
2009 \family typewriter
2010 \family typewriter
2010 pdb
2011 pdb
2011 \family default
2012 \family default
2012 and automatically sets initial breakpoints for you to step through your
2013 and automatically sets initial breakpoints for you to step through your
2013 code, watch variables, etc.
2014 code, watch variables, etc.
2014 See Sec.\SpecialChar ~
2015 See Sec.\SpecialChar ~
2015
2016
2016 \begin_inset LatexCommand \ref{sec:cache_output}
2017 \begin_inset LatexCommand \ref{sec:cache_output}
2017
2018
2018 \end_inset
2019 \end_inset
2019
2020
2020 for details.
2021 for details.
2021 \layout Itemize
2022 \layout Itemize
2022
2023
2023 Use the output cache.
2024 Use the output cache.
2024 All output results are automatically stored in a global dictionary named
2025 All output results are automatically stored in a global dictionary named
2025
2026
2026 \family typewriter
2027 \family typewriter
2027 Out
2028 Out
2028 \family default
2029 \family default
2029 and variables named
2030 and variables named
2030 \family typewriter
2031 \family typewriter
2031 _1
2032 _1
2032 \family default
2033 \family default
2033 ,
2034 ,
2034 \family typewriter
2035 \family typewriter
2035 _2
2036 _2
2036 \family default
2037 \family default
2037 , etc.
2038 , etc.
2038 alias them.
2039 alias them.
2039 For example, the result of input line 4 is available either as
2040 For example, the result of input line 4 is available either as
2040 \family typewriter
2041 \family typewriter
2041 Out[4]
2042 Out[4]
2042 \family default
2043 \family default
2043 or as
2044 or as
2044 \family typewriter
2045 \family typewriter
2045 _4
2046 _4
2046 \family default
2047 \family default
2047 .
2048 .
2048 Additionally, three variables named
2049 Additionally, three variables named
2049 \family typewriter
2050 \family typewriter
2050 _
2051 _
2051 \family default
2052 \family default
2052 ,
2053 ,
2053 \family typewriter
2054 \family typewriter
2054 __
2055 __
2055 \family default
2056 \family default
2056 and
2057 and
2057 \family typewriter
2058 \family typewriter
2058 ___
2059 ___
2059 \family default
2060 \family default
2060 are always kept updated with the for the last three results.
2061 are always kept updated with the for the last three results.
2061 This allows you to recall any previous result and further use it for new
2062 This allows you to recall any previous result and further use it for new
2062 calculations.
2063 calculations.
2063 See Sec.\SpecialChar ~
2064 See Sec.\SpecialChar ~
2064
2065
2065 \begin_inset LatexCommand \ref{sec:cache_output}
2066 \begin_inset LatexCommand \ref{sec:cache_output}
2066
2067
2067 \end_inset
2068 \end_inset
2068
2069
2069 for more.
2070 for more.
2070 \layout Itemize
2071 \layout Itemize
2071
2072
2072 Put a '
2073 Put a '
2073 \family typewriter
2074 \family typewriter
2074 ;
2075 ;
2075 \family default
2076 \family default
2076 ' at the end of a line to supress the printing of output.
2077 ' at the end of a line to supress the printing of output.
2077 This is useful when doing calculations which generate long output you are
2078 This is useful when doing calculations which generate long output you are
2078 not interested in seeing.
2079 not interested in seeing.
2079 The
2080 The
2080 \family typewriter
2081 \family typewriter
2081 _*
2082 _*
2082 \family default
2083 \family default
2083 variables and the
2084 variables and the
2084 \family typewriter
2085 \family typewriter
2085 Out[]
2086 Out[]
2086 \family default
2087 \family default
2087 list do get updated with the contents of the output, even if it is not
2088 list do get updated with the contents of the output, even if it is not
2088 printed.
2089 printed.
2089 You can thus still access the generated results this way for further processing.
2090 You can thus still access the generated results this way for further processing.
2090 \layout Itemize
2091 \layout Itemize
2091
2092
2092 A similar system exists for caching input.
2093 A similar system exists for caching input.
2093 All input is stored in a global list called
2094 All input is stored in a global list called
2094 \family typewriter
2095 \family typewriter
2095 In
2096 In
2096 \family default
2097 \family default
2097 , so you can re-execute lines 22 through 28 plus line 34 by typing
2098 , so you can re-execute lines 22 through 28 plus line 34 by typing
2098 \family typewriter
2099 \family typewriter
2099 'exec In[22:29]+In[34]'
2100 'exec In[22:29]+In[34]'
2100 \family default
2101 \family default
2101 (using Python slicing notation).
2102 (using Python slicing notation).
2102 If you need to execute the same set of lines often, you can assign them
2103 If you need to execute the same set of lines often, you can assign them
2103 to a macro with the
2104 to a macro with the
2104 \family typewriter
2105 \family typewriter
2105 %macro
2106 %macro
2106 \family default
2107 \family default
2107
2108
2108 \family typewriter
2109 \family typewriter
2109 function.
2110 function.
2110
2111
2111 \family default
2112 \family default
2112 See sec.
2113 See sec.
2113
2114
2114 \begin_inset LatexCommand \ref{sec:cache_input}
2115 \begin_inset LatexCommand \ref{sec:cache_input}
2115
2116
2116 \end_inset
2117 \end_inset
2117
2118
2118 for more.
2119 for more.
2119 \layout Itemize
2120 \layout Itemize
2120
2121
2121 Use your input history.
2122 Use your input history.
2122 The
2123 The
2123 \family typewriter
2124 \family typewriter
2124 %hist
2125 %hist
2125 \family default
2126 \family default
2126 command can show you all previous input, without line numbers if desired
2127 command can show you all previous input, without line numbers if desired
2127 (option
2128 (option
2128 \family typewriter
2129 \family typewriter
2129 -n
2130 -n
2130 \family default
2131 \family default
2131 ) so you can directly copy and paste code either back in IPython or in a
2132 ) so you can directly copy and paste code either back in IPython or in a
2132 text editor.
2133 text editor.
2133 You can also save all your history by turning on logging via
2134 You can also save all your history by turning on logging via
2134 \family typewriter
2135 \family typewriter
2135 %logstart
2136 %logstart
2136 \family default
2137 \family default
2137 ; these logs can later be either reloaded as IPython sessions or used as
2138 ; these logs can later be either reloaded as IPython sessions or used as
2138 code for your programs.
2139 code for your programs.
2139 \layout Itemize
2140 \layout Itemize
2140
2141
2141 Define your own macros with
2142 Define your own macros with
2142 \family typewriter
2143 \family typewriter
2143 %macro
2144 %macro
2144 \family default
2145 \family default
2145 .
2146 .
2146 This can be useful for automating sequences of expressions when working
2147 This can be useful for automating sequences of expressions when working
2147 interactively.
2148 interactively.
2148 \layout Itemize
2149 \layout Itemize
2149
2150
2150 Define your own system aliases.
2151 Define your own system aliases.
2151 Even though IPython gives you access to your system shell via the
2152 Even though IPython gives you access to your system shell via the
2152 \family typewriter
2153 \family typewriter
2153 !
2154 !
2154 \family default
2155 \family default
2155 prefix, it is convenient to have aliases to the system commands you use
2156 prefix, it is convenient to have aliases to the system commands you use
2156 most often.
2157 most often.
2157 This allows you to work seamlessly from inside IPython with the same commands
2158 This allows you to work seamlessly from inside IPython with the same commands
2158 you are used to in your system shell.
2159 you are used to in your system shell.
2159 \newline
2160 \newline
2160 IPython comes with some pre-defined aliases and a complete system for changing
2161 IPython comes with some pre-defined aliases and a complete system for changing
2161 directories, both via a stack (see
2162 directories, both via a stack (see
2162 \family typewriter
2163 \family typewriter
2163 %pushd
2164 %pushd
2164 \family default
2165 \family default
2165 ,
2166 ,
2166 \family typewriter
2167 \family typewriter
2167 %popd
2168 %popd
2168 \family default
2169 \family default
2169 and
2170 and
2170 \family typewriter
2171 \family typewriter
2171 %ds
2172 %ds
2172 \family default
2173 \family default
2173 ) and via direct
2174 ) and via direct
2174 \family typewriter
2175 \family typewriter
2175 %cd
2176 %cd
2176 \family default
2177 \family default
2177 .
2178 .
2178 The latter keeps a history of visited directories and allows you to go
2179 The latter keeps a history of visited directories and allows you to go
2179 to any previously visited one.
2180 to any previously visited one.
2180 \layout Itemize
2181 \layout Itemize
2181
2182
2182 Use Python to manipulate the results of system commands.
2183 Use Python to manipulate the results of system commands.
2183 The `
2184 The `
2184 \family typewriter
2185 \family typewriter
2185 !!
2186 !!
2186 \family default
2187 \family default
2187 ' special syntax, and the
2188 ' special syntax, and the
2188 \family typewriter
2189 \family typewriter
2189 %sc
2190 %sc
2190 \family default
2191 \family default
2191 and
2192 and
2192 \family typewriter
2193 \family typewriter
2193 %sx
2194 %sx
2194 \family default
2195 \family default
2195 magic commands allow you to capture system output into Python variables.
2196 magic commands allow you to capture system output into Python variables.
2196 \layout Itemize
2197 \layout Itemize
2197
2198
2198 Expand python variables when calling the shell (either via
2199 Expand python variables when calling the shell (either via
2199 \family typewriter
2200 \family typewriter
2200 `!'
2201 `!'
2201 \family default
2202 \family default
2202 and
2203 and
2203 \family typewriter
2204 \family typewriter
2204 `!!'
2205 `!!'
2205 \family default
2206 \family default
2206 or via aliases) by prepending a
2207 or via aliases) by prepending a
2207 \family typewriter
2208 \family typewriter
2208 $
2209 $
2209 \family default
2210 \family default
2210 in front of them.
2211 in front of them.
2211 You can also expand complete python expressions.
2212 You can also expand complete python expressions.
2212 See sec.\SpecialChar ~
2213 See sec.\SpecialChar ~
2213
2214
2214 \begin_inset LatexCommand \ref{sub:System-shell-access}
2215 \begin_inset LatexCommand \ref{sub:System-shell-access}
2215
2216
2216 \end_inset
2217 \end_inset
2217
2218
2218 for more.
2219 for more.
2219 \layout Itemize
2220 \layout Itemize
2220
2221
2221 Use profiles to maintain different configurations (modules to load, function
2222 Use profiles to maintain different configurations (modules to load, function
2222 definitions, option settings) for particular tasks.
2223 definitions, option settings) for particular tasks.
2223 You can then have customized versions of IPython for specific purposes.
2224 You can then have customized versions of IPython for specific purposes.
2224 See sec.\SpecialChar ~
2225 See sec.\SpecialChar ~
2225
2226
2226 \begin_inset LatexCommand \ref{sec:profiles}
2227 \begin_inset LatexCommand \ref{sec:profiles}
2227
2228
2228 \end_inset
2229 \end_inset
2229
2230
2230 for more.
2231 for more.
2231 \layout Itemize
2232 \layout Itemize
2232
2233
2233 Embed IPython in your programs.
2234 Embed IPython in your programs.
2234 A few lines of code are enough to load a complete IPython inside your own
2235 A few lines of code are enough to load a complete IPython inside your own
2235 programs, giving you the ability to work with your data interactively after
2236 programs, giving you the ability to work with your data interactively after
2236 automatic processing has been completed.
2237 automatic processing has been completed.
2237 See sec.\SpecialChar ~
2238 See sec.\SpecialChar ~
2238
2239
2239 \begin_inset LatexCommand \ref{sec:embed}
2240 \begin_inset LatexCommand \ref{sec:embed}
2240
2241
2241 \end_inset
2242 \end_inset
2242
2243
2243 for more.
2244 for more.
2244 \layout Itemize
2245 \layout Itemize
2245
2246
2246 Use the Python profiler.
2247 Use the Python profiler.
2247 When dealing with performance issues, the
2248 When dealing with performance issues, the
2248 \family typewriter
2249 \family typewriter
2249 %run
2250 %run
2250 \family default
2251 \family default
2251 command with a
2252 command with a
2252 \family typewriter
2253 \family typewriter
2253 -p
2254 -p
2254 \family default
2255 \family default
2255 option allows you to run complete programs under the control of the Python
2256 option allows you to run complete programs under the control of the Python
2256 profiler.
2257 profiler.
2257 The
2258 The
2258 \family typewriter
2259 \family typewriter
2259 %prun
2260 %prun
2260 \family default
2261 \family default
2261 command does a similar job for single Python expressions (like function
2262 command does a similar job for single Python expressions (like function
2262 calls).
2263 calls).
2263 \layout Itemize
2264 \layout Itemize
2264
2265
2265 Use
2266 Use
2266 \family typewriter
2267 \family typewriter
2267 %edit
2268 %edit
2268 \family default
2269 \family default
2269 to have almost multiline editing.
2270 to have almost multiline editing.
2270 While IPython doesn't support true multiline editing, this command allows
2271 While IPython doesn't support true multiline editing, this command allows
2271 you to call an editor on the spot, and IPython will execute the code you
2272 you to call an editor on the spot, and IPython will execute the code you
2272 type in there as if it were typed interactively.
2273 type in there as if it were typed interactively.
2273 \layout Standard
2274 \layout Standard
2274
2275
2275 If you have your own favorite tip on using IPython efficiently for a certain
2276 If you have your own favorite tip on using IPython efficiently for a certain
2276 task (especially things which can't be done in the normal Python interpreter),
2277 task (especially things which can't be done in the normal Python interpreter),
2277 don't hesitate to send it!
2278 don't hesitate to send it!
2278 \layout Section
2279 \layout Section
2279
2280
2280 Command-line use
2281 Command-line use
2281 \layout Standard
2282 \layout Standard
2282
2283
2283 You start IPython with the command:
2284 You start IPython with the command:
2284 \layout Standard
2285 \layout Standard
2285
2286
2286
2287
2287 \family typewriter
2288 \family typewriter
2288 $ ipython [options] files
2289 $ ipython [options] files
2289 \layout Standard
2290 \layout Standard
2290
2291
2291 If invoked with no options, it executes all the files listed in sequence
2292 If invoked with no options, it executes all the files listed in sequence
2292 and drops you into the interpreter while still acknowledging any options
2293 and drops you into the interpreter while still acknowledging any options
2293 you may have set in your ipythonrc file.
2294 you may have set in your ipythonrc file.
2294 This behavior is different from standard Python, which when called as
2295 This behavior is different from standard Python, which when called as
2295 \family typewriter
2296 \family typewriter
2296 python -i
2297 python -i
2297 \family default
2298 \family default
2298 will only execute one file and ignore your configuration setup.
2299 will only execute one file and ignore your configuration setup.
2299 \layout Standard
2300 \layout Standard
2300
2301
2301 Please note that some of the configuration options are not available at
2302 Please note that some of the configuration options are not available at
2302 the command line, simply because they are not practical here.
2303 the command line, simply because they are not practical here.
2303 Look into your ipythonrc configuration file for details on those.
2304 Look into your ipythonrc configuration file for details on those.
2304 This file typically installed in the
2305 This file typically installed in the
2305 \family typewriter
2306 \family typewriter
2306 $HOME/.ipython
2307 $HOME/.ipython
2307 \family default
2308 \family default
2308 directory.
2309 directory.
2309 For Windows users,
2310 For Windows users,
2310 \family typewriter
2311 \family typewriter
2311 $HOME
2312 $HOME
2312 \family default
2313 \family default
2313 resolves to
2314 resolves to
2314 \family typewriter
2315 \family typewriter
2315 C:
2316 C:
2316 \backslash
2317 \backslash
2317
2318
2318 \backslash
2319 \backslash
2319 Documents and Settings
2320 Documents and Settings
2320 \backslash
2321 \backslash
2321
2322
2322 \backslash
2323 \backslash
2323 YourUserName
2324 YourUserName
2324 \family default
2325 \family default
2325 in most instances.
2326 in most instances.
2326 In the rest of this text, we will refer to this directory as
2327 In the rest of this text, we will refer to this directory as
2327 \family typewriter
2328 \family typewriter
2328 IPYTHONDIR
2329 IPYTHONDIR
2329 \family default
2330 \family default
2330 .
2331 .
2331 \layout Subsection
2332 \layout Subsection
2332
2333
2333
2334
2334 \begin_inset LatexCommand \label{sec:threading-opts}
2335 \begin_inset LatexCommand \label{sec:threading-opts}
2335
2336
2336 \end_inset
2337 \end_inset
2337
2338
2338 Special Threading Options
2339 Special Threading Options
2339 \layout Standard
2340 \layout Standard
2340
2341
2341 The following special options are ONLY valid at the beginning of the command
2342 The following special options are ONLY valid at the beginning of the command
2342 line, and not later.
2343 line, and not later.
2343 This is because they control the initial- ization of ipython itself, before
2344 This is because they control the initial- ization of ipython itself, before
2344 the normal option-handling mechanism is active.
2345 the normal option-handling mechanism is active.
2345 \layout List
2346 \layout List
2346 \labelwidthstring 00.00.0000
2347 \labelwidthstring 00.00.0000
2347
2348
2348
2349
2349 \family typewriter
2350 \family typewriter
2350 \series bold
2351 \series bold
2351 -gthread,\SpecialChar ~
2352 -gthread,\SpecialChar ~
2352 -wthread,\SpecialChar ~
2353 -wthread,\SpecialChar ~
2353 -pylab:
2354 -pylab:
2354 \family default
2355 \family default
2355 \series default
2356 \series default
2356 Only
2357 Only
2357 \emph on
2358 \emph on
2358 one
2359 one
2359 \emph default
2360 \emph default
2360 of these can be given, and it can only be given as the first option passed
2361 of these can be given, and it can only be given as the first option passed
2361 to IPython (it will have no effect in any other position).
2362 to IPython (it will have no effect in any other position).
2362 They provide threading support for the GTK and WXPython toolkits, and for
2363 They provide threading support for the GTK and WXPython toolkits, and for
2363 the matplotlib library.
2364 the matplotlib library.
2364 \layout List
2365 \layout List
2365 \labelwidthstring 00.00.0000
2366 \labelwidthstring 00.00.0000
2366
2367
2367 \SpecialChar ~
2368 \SpecialChar ~
2368 If
2369 If
2369 \family typewriter
2370 \family typewriter
2370 -gthread
2371 -gthread
2371 \family default
2372 \family default
2372 is given, IPython starts running a separate thread for GTK operation, so
2373 is given, IPython starts running a separate thread for GTK operation, so
2373 that pyGTK-based programs can open and control GUIs without blocking IPython.
2374 that pyGTK-based programs can open and control GUIs without blocking IPython.
2374
2375
2375 \layout List
2376 \layout List
2376 \labelwidthstring 00.00.0000
2377 \labelwidthstring 00.00.0000
2377
2378
2378 \SpecialChar ~
2379 \SpecialChar ~
2379 Similarly,
2380 Similarly,
2380 \family typewriter
2381 \family typewriter
2381 -wthread
2382 -wthread
2382 \family default
2383 \family default
2383 instantiates IPython with threading support for the WXPython toolkit.
2384 instantiates IPython with threading support for the WXPython toolkit.
2384 You can control WX application windows from within IPython.
2385 You can control WX application windows from within IPython.
2385 \layout List
2386 \layout List
2386 \labelwidthstring 00.00.0000
2387 \labelwidthstring 00.00.0000
2387
2388
2388 \SpecialChar ~
2389 \SpecialChar ~
2389 If
2390 If
2390 \family typewriter
2391 \family typewriter
2391 -pylab
2392 -pylab
2392 \family default
2393 \family default
2393 is given, IPython loads special support for the mat- plotlib library (
2394 is given, IPython loads special support for the mat- plotlib library (
2394 \begin_inset LatexCommand \htmlurl{http://matplotlib.sourceforge.net}
2395 \begin_inset LatexCommand \htmlurl{http://matplotlib.sourceforge.net}
2395
2396
2396 \end_inset
2397 \end_inset
2397
2398
2398 ), allowing interactive usage of any of its backends as defined in the user's
2399 ), allowing interactive usage of any of its backends as defined in the user's
2399 .matplotlibrc file.
2400 .matplotlibrc file.
2400 It automatically activates GTK or WX threading for IPyhton if the choice
2401 It automatically activates GTK or WX threading for IPyhton if the choice
2401 of matplotlib backend requires it.
2402 of matplotlib backend requires it.
2402 It also modifies the
2403 It also modifies the
2403 \family typewriter
2404 \family typewriter
2404 %run
2405 %run
2405 \family default
2406 \family default
2406 command to correctly execute (without blocking) any matplotlib-based script
2407 command to correctly execute (without blocking) any matplotlib-based script
2407 which calls
2408 which calls
2408 \family typewriter
2409 \family typewriter
2409 show()
2410 show()
2410 \family default
2411 \family default
2411 at the end.
2412 at the end.
2412
2413
2413 \layout List
2414 \layout List
2414 \labelwidthstring 00.00.0000
2415 \labelwidthstring 00.00.0000
2415
2416
2416
2417
2417 \family typewriter
2418 \family typewriter
2418 \series bold
2419 \series bold
2419 -tk
2420 -tk
2420 \family default
2421 \family default
2421 \series default
2422 \series default
2422 The
2423 The
2423 \family typewriter
2424 \family typewriter
2424 -g/wthread
2425 -g/wthread
2425 \family default
2426 \family default
2426 options, and
2427 options, and
2427 \family typewriter
2428 \family typewriter
2428 -pylab
2429 -pylab
2429 \family default
2430 \family default
2430 (if matplotlib is configured to use WX or GTK), will normally block Tk
2431 (if matplotlib is configured to use WX or GTK), will normally block Tk
2431 graphical interfaces.
2432 graphical interfaces.
2432 This means that when either GTK or WX threading is active, any attempt
2433 This means that when either GTK or WX threading is active, any attempt
2433 to open a Tk GUI will result in a dead window, and pos- sibly cause the
2434 to open a Tk GUI will result in a dead window, and pos- sibly cause the
2434 Python interpreter to crash.
2435 Python interpreter to crash.
2435 An extra option,
2436 An extra option,
2436 \family typewriter
2437 \family typewriter
2437 -tk
2438 -tk
2438 \family default
2439 \family default
2439 , is available to address this issue.
2440 , is available to address this issue.
2440 It can
2441 It can
2441 \emph on
2442 \emph on
2442 only
2443 only
2443 \emph default
2444 \emph default
2444 be given as a
2445 be given as a
2445 \emph on
2446 \emph on
2446 second
2447 second
2447 \emph default
2448 \emph default
2448 option after any of the above (
2449 option after any of the above (
2449 \family typewriter
2450 \family typewriter
2450 -gthread
2451 -gthread
2451 \family default
2452 \family default
2452 ,
2453 ,
2453 \family typewriter
2454 \family typewriter
2454 -wthread
2455 -wthread
2455 \family default
2456 \family default
2456 or
2457 or
2457 \family typewriter
2458 \family typewriter
2458 -pylab
2459 -pylab
2459 \family default
2460 \family default
2460 ).
2461 ).
2461 \layout List
2462 \layout List
2462 \labelwidthstring 00.00.0000
2463 \labelwidthstring 00.00.0000
2463
2464
2464 \SpecialChar ~
2465 \SpecialChar ~
2465 If
2466 If
2466 \family typewriter
2467 \family typewriter
2467 -tk
2468 -tk
2468 \family default
2469 \family default
2469 is given, IPython will try to coordinate Tk threading with WX or GTK.
2470 is given, IPython will try to coordinate Tk threading with WX or GTK.
2470 This is however potentially unreliable, and you will have to test on your
2471 This is however potentially unreliable, and you will have to test on your
2471 platform and Python configuration to determine whether it works for you.
2472 platform and Python configuration to determine whether it works for you.
2472 Debian users have reported success, apparently due to the fact that Debian
2473 Debian users have reported success, apparently due to the fact that Debian
2473 builds all of Tcl, Tk, Tkinter and Python with pthreads support.
2474 builds all of Tcl, Tk, Tkinter and Python with pthreads support.
2474 Under other Linux environments (such as Fedora Core 2), this option has
2475 Under other Linux environments (such as Fedora Core 2), this option has
2475 caused random crashes and lockups of the Python interpreter.
2476 caused random crashes and lockups of the Python interpreter.
2476 Under other operating systems (Mac OSX and Windows), you'll need to try
2477 Under other operating systems (Mac OSX and Windows), you'll need to try
2477 it to find out, since currently no user reports are available.
2478 it to find out, since currently no user reports are available.
2478 \layout List
2479 \layout List
2479 \labelwidthstring 00.00.0000
2480 \labelwidthstring 00.00.0000
2480
2481
2481 \SpecialChar ~
2482 \SpecialChar ~
2482 There is unfortunately no way for IPython to determine at run time whether
2483 There is unfortunately no way for IPython to determine at run time whether
2483
2484
2484 \family typewriter
2485 \family typewriter
2485 -tk
2486 -tk
2486 \family default
2487 \family default
2487 will work reliably or not, so you will need to do some experiments before
2488 will work reliably or not, so you will need to do some experiments before
2488 relying on it for regular work.
2489 relying on it for regular work.
2489
2490
2490 \layout Subsection
2491 \layout Subsection
2491
2492
2492
2493
2493 \begin_inset LatexCommand \label{sec:cmd-line-opts}
2494 \begin_inset LatexCommand \label{sec:cmd-line-opts}
2494
2495
2495 \end_inset
2496 \end_inset
2496
2497
2497 Regular Options
2498 Regular Options
2498 \layout Standard
2499 \layout Standard
2499
2500
2500 After the above threading options have been given, regular options can follow
2501 After the above threading options have been given, regular options can follow
2501 in any order.
2502 in any order.
2502 All options can be abbreviated to their shortest non-ambiguous form and
2503 All options can be abbreviated to their shortest non-ambiguous form and
2503 are case-sensitive.
2504 are case-sensitive.
2504 One or two dashes can be used.
2505 One or two dashes can be used.
2505 Some options have an alternate short form, indicated after a
2506 Some options have an alternate short form, indicated after a
2506 \family typewriter
2507 \family typewriter
2507 |
2508 |
2508 \family default
2509 \family default
2509 .
2510 .
2510 \layout Standard
2511 \layout Standard
2511
2512
2512 Most options can also be set from your ipythonrc configuration file.
2513 Most options can also be set from your ipythonrc configuration file.
2513 See the provided example for more details on what the options do.
2514 See the provided example for more details on what the options do.
2514 Options given at the command line override the values set in the ipythonrc
2515 Options given at the command line override the values set in the ipythonrc
2515 file.
2516 file.
2516 \layout Standard
2517 \layout Standard
2517
2518
2518 All options with a
2519 All options with a
2519 \family typewriter
2520 \family typewriter
2520 no|
2521 no|
2521 \family default
2522 \family default
2522 prepended can be specified in 'no' form (
2523 prepended can be specified in 'no' form (
2523 \family typewriter
2524 \family typewriter
2524 -nooption
2525 -nooption
2525 \family default
2526 \family default
2526 instead of
2527 instead of
2527 \family typewriter
2528 \family typewriter
2528 -option
2529 -option
2529 \family default
2530 \family default
2530 ) to turn the feature off.
2531 ) to turn the feature off.
2531 \layout List
2532 \layout List
2532 \labelwidthstring 00.00.0000
2533 \labelwidthstring 00.00.0000
2533
2534
2534
2535
2535 \family typewriter
2536 \family typewriter
2536 \series bold
2537 \series bold
2537 -help
2538 -help
2538 \family default
2539 \family default
2539 \series default
2540 \series default
2540 : print a help message and exit.
2541 : print a help message and exit.
2541 \layout List
2542 \layout List
2542 \labelwidthstring 00.00.0000
2543 \labelwidthstring 00.00.0000
2543
2544
2544
2545
2545 \family typewriter
2546 \family typewriter
2546 \series bold
2547 \series bold
2547 -pylab:
2548 -pylab:
2548 \family default
2549 \family default
2549 \series default
2550 \series default
2550 this can
2551 this can
2551 \emph on
2552 \emph on
2552 only
2553 only
2553 \emph default
2554 \emph default
2554 be given as the
2555 be given as the
2555 \emph on
2556 \emph on
2556 first
2557 first
2557 \emph default
2558 \emph default
2558 option passed to IPython (it will have no effect in any other position).
2559 option passed to IPython (it will have no effect in any other position).
2559 It adds special support for the matplotlib library (
2560 It adds special support for the matplotlib library (
2560 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
2561 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
2561
2562
2562 \end_inset
2563 \end_inset
2563
2564
2564 ), allowing interactive usage of any of its backends as defined in the user's
2565 ), allowing interactive usage of any of its backends as defined in the user's
2565
2566
2566 \family typewriter
2567 \family typewriter
2567 .matplotlibrc
2568 .matplotlibrc
2568 \family default
2569 \family default
2569 file.
2570 file.
2570 It automatically activates GTK or WX threading for IPyhton if the choice
2571 It automatically activates GTK or WX threading for IPyhton if the choice
2571 of matplotlib backend requires it.
2572 of matplotlib backend requires it.
2572 It also modifies the
2573 It also modifies the
2573 \family typewriter
2574 \family typewriter
2574 %run
2575 %run
2575 \family default
2576 \family default
2576 command to correctly execute (without blocking) any matplotlib-based script
2577 command to correctly execute (without blocking) any matplotlib-based script
2577 which calls
2578 which calls
2578 \family typewriter
2579 \family typewriter
2579 show()
2580 show()
2580 \family default
2581 \family default
2581 at the end.
2582 at the end.
2582 See Sec.\SpecialChar ~
2583 See Sec.\SpecialChar ~
2583
2584
2584 \begin_inset LatexCommand \ref{sec:matplotlib-support}
2585 \begin_inset LatexCommand \ref{sec:matplotlib-support}
2585
2586
2586 \end_inset
2587 \end_inset
2587
2588
2588 for more details.
2589 for more details.
2589 \layout List
2590 \layout List
2590 \labelwidthstring 00.00.0000
2591 \labelwidthstring 00.00.0000
2591
2592
2592
2593
2593 \family typewriter
2594 \family typewriter
2594 \series bold
2595 \series bold
2595 -no|automagic
2596 -no|automagic
2596 \series default
2597 \series default
2597 :
2598 :
2598 \family default
2599 \family default
2599 make magic commands automatic (without needing their first character to
2600 make magic commands automatic (without needing their first character to
2600 be
2601 be
2601 \family typewriter
2602 \family typewriter
2602 %
2603 %
2603 \family default
2604 \family default
2604 ).
2605 ).
2605 Type
2606 Type
2606 \family typewriter
2607 \family typewriter
2607 %magic
2608 %magic
2608 \family default
2609 \family default
2609 at the IPython prompt for more information.
2610 at the IPython prompt for more information.
2610 \layout List
2611 \layout List
2611 \labelwidthstring 00.00.0000
2612 \labelwidthstring 00.00.0000
2612
2613
2613
2614
2614 \family typewriter
2615 \family typewriter
2615 \series bold
2616 \series bold
2616 -no|banner
2617 -no|banner
2617 \series default
2618 \series default
2618 :
2619 :
2619 \family default
2620 \family default
2620 Print the initial information banner (default on).
2621 Print the initial information banner (default on).
2621 \layout List
2622 \layout List
2622 \labelwidthstring 00.00.0000
2623 \labelwidthstring 00.00.0000
2623
2624
2624
2625
2625 \family typewriter
2626 \family typewriter
2626 \series bold
2627 \series bold
2627 -c\SpecialChar ~
2628 -c\SpecialChar ~
2628 <command>:
2629 <command>:
2629 \family default
2630 \family default
2630 \series default
2631 \series default
2631 execute the given command string, and set sys.argv to
2632 execute the given command string, and set sys.argv to
2632 \family typewriter
2633 \family typewriter
2633 ['c']
2634 ['c']
2634 \family default
2635 \family default
2635 .
2636 .
2636 This is similar to the
2637 This is similar to the
2637 \family typewriter
2638 \family typewriter
2638 -c
2639 -c
2639 \family default
2640 \family default
2640 option in the normal Python interpreter.
2641 option in the normal Python interpreter.
2641
2642
2642 \layout List
2643 \layout List
2643 \labelwidthstring 00.00.0000
2644 \labelwidthstring 00.00.0000
2644
2645
2645
2646
2646 \family typewriter
2647 \family typewriter
2647 \series bold
2648 \series bold
2648 -cache_size|cs\SpecialChar ~
2649 -cache_size|cs\SpecialChar ~
2649 <n>
2650 <n>
2650 \series default
2651 \series default
2651 :
2652 :
2652 \family default
2653 \family default
2653 size of the output cache (maximum number of entries to hold in memory).
2654 size of the output cache (maximum number of entries to hold in memory).
2654 The default is 1000, you can change it permanently in your config file.
2655 The default is 1000, you can change it permanently in your config file.
2655 Setting it to 0 completely disables the caching system, and the minimum
2656 Setting it to 0 completely disables the caching system, and the minimum
2656 value accepted is 20 (if you provide a value less than 20, it is reset
2657 value accepted is 20 (if you provide a value less than 20, it is reset
2657 to 0 and a warning is issued) This limit is defined because otherwise you'll
2658 to 0 and a warning is issued) This limit is defined because otherwise you'll
2658 spend more time re-flushing a too small cache than working.
2659 spend more time re-flushing a too small cache than working.
2659 \layout List
2660 \layout List
2660 \labelwidthstring 00.00.0000
2661 \labelwidthstring 00.00.0000
2661
2662
2662
2663
2663 \family typewriter
2664 \family typewriter
2664 \series bold
2665 \series bold
2665 -classic|cl
2666 -classic|cl
2666 \series default
2667 \series default
2667 :
2668 :
2668 \family default
2669 \family default
2669 Gives IPython a similar feel to the classic Python prompt.
2670 Gives IPython a similar feel to the classic Python prompt.
2670 \layout List
2671 \layout List
2671 \labelwidthstring 00.00.0000
2672 \labelwidthstring 00.00.0000
2672
2673
2673
2674
2674 \family typewriter
2675 \family typewriter
2675 \series bold
2676 \series bold
2676 -colors\SpecialChar ~
2677 -colors\SpecialChar ~
2677 <scheme>:
2678 <scheme>:
2678 \family default
2679 \family default
2679 \series default
2680 \series default
2680 Color scheme for prompts and exception reporting.
2681 Color scheme for prompts and exception reporting.
2681 Currently implemented: NoColor, Linux and LightBG.
2682 Currently implemented: NoColor, Linux and LightBG.
2682 \layout List
2683 \layout List
2683 \labelwidthstring 00.00.0000
2684 \labelwidthstring 00.00.0000
2684
2685
2685
2686
2686 \family typewriter
2687 \family typewriter
2687 \series bold
2688 \series bold
2688 -no|color_info:
2689 -no|color_info:
2689 \family default
2690 \family default
2690 \series default
2691 \series default
2691 IPython can display information about objects via a set of functions, and
2692 IPython can display information about objects via a set of functions, and
2692 optionally can use colors for this, syntax highlighting source code and
2693 optionally can use colors for this, syntax highlighting source code and
2693 various other elements.
2694 various other elements.
2694 However, because this information is passed through a pager (like 'less')
2695 However, because this information is passed through a pager (like 'less')
2695 and many pagers get confused with color codes, this option is off by default.
2696 and many pagers get confused with color codes, this option is off by default.
2696 You can test it and turn it on permanently in your ipythonrc file if it
2697 You can test it and turn it on permanently in your ipythonrc file if it
2697 works for you.
2698 works for you.
2698 As a reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
2699 As a reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
2699 that in RedHat 7.2 doesn't.
2700 that in RedHat 7.2 doesn't.
2700 \layout List
2701 \layout List
2701 \labelwidthstring 00.00.0000
2702 \labelwidthstring 00.00.0000
2702
2703
2703 \SpecialChar ~
2704 \SpecialChar ~
2704 Test it and turn it on permanently if it works with your system.
2705 Test it and turn it on permanently if it works with your system.
2705 The magic function
2706 The magic function
2706 \family typewriter
2707 \family typewriter
2707 %color_info
2708 %color_info
2708 \family default
2709 \family default
2709 allows you to toggle this interactively for testing.
2710 allows you to toggle this interactively for testing.
2710 \layout List
2711 \layout List
2711 \labelwidthstring 00.00.0000
2712 \labelwidthstring 00.00.0000
2712
2713
2713
2714
2714 \family typewriter
2715 \family typewriter
2715 \series bold
2716 \series bold
2716 -no|debug
2717 -no|debug
2717 \family default
2718 \family default
2718 \series default
2719 \series default
2719 : Show information about the loading process.
2720 : Show information about the loading process.
2720 Very useful to pin down problems with your configuration files or to get
2721 Very useful to pin down problems with your configuration files or to get
2721 details about session restores.
2722 details about session restores.
2722 \layout List
2723 \layout List
2723 \labelwidthstring 00.00.0000
2724 \labelwidthstring 00.00.0000
2724
2725
2725
2726
2726 \family typewriter
2727 \family typewriter
2727 \series bold
2728 \series bold
2728 -no|deep_reload
2729 -no|deep_reload
2729 \series default
2730 \series default
2730 :
2731 :
2731 \family default
2732 \family default
2732 IPython can use the
2733 IPython can use the
2733 \family typewriter
2734 \family typewriter
2734 deep_reload
2735 deep_reload
2735 \family default
2736 \family default
2736 module which reloads changes in modules recursively (it replaces the
2737 module which reloads changes in modules recursively (it replaces the
2737 \family typewriter
2738 \family typewriter
2738 reload()
2739 reload()
2739 \family default
2740 \family default
2740 function, so you don't need to change anything to use it).
2741 function, so you don't need to change anything to use it).
2741
2742
2742 \family typewriter
2743 \family typewriter
2743 deep_reload()
2744 deep_reload()
2744 \family default
2745 \family default
2745 forces a full reload of modules whose code may have changed, which the
2746 forces a full reload of modules whose code may have changed, which the
2746 default
2747 default
2747 \family typewriter
2748 \family typewriter
2748 reload()
2749 reload()
2749 \family default
2750 \family default
2750 function does not.
2751 function does not.
2751 \layout List
2752 \layout List
2752 \labelwidthstring 00.00.0000
2753 \labelwidthstring 00.00.0000
2753
2754
2754 \SpecialChar ~
2755 \SpecialChar ~
2755 When deep_reload is off, IPython will use the normal
2756 When deep_reload is off, IPython will use the normal
2756 \family typewriter
2757 \family typewriter
2757 reload()
2758 reload()
2758 \family default
2759 \family default
2759 , but deep_reload will still be available as
2760 , but deep_reload will still be available as
2760 \family typewriter
2761 \family typewriter
2761 dreload()
2762 dreload()
2762 \family default
2763 \family default
2763 .
2764 .
2764 This feature is off by default [which means that you have both normal
2765 This feature is off by default [which means that you have both normal
2765 \family typewriter
2766 \family typewriter
2766 reload()
2767 reload()
2767 \family default
2768 \family default
2768 and
2769 and
2769 \family typewriter
2770 \family typewriter
2770 dreload()
2771 dreload()
2771 \family default
2772 \family default
2772 ].
2773 ].
2773 \layout List
2774 \layout List
2774 \labelwidthstring 00.00.0000
2775 \labelwidthstring 00.00.0000
2775
2776
2776
2777
2777 \family typewriter
2778 \family typewriter
2778 \series bold
2779 \series bold
2779 -editor\SpecialChar ~
2780 -editor\SpecialChar ~
2780 <name>
2781 <name>
2781 \family default
2782 \family default
2782 \series default
2783 \series default
2783 : Which editor to use with the
2784 : Which editor to use with the
2784 \family typewriter
2785 \family typewriter
2785 %edit
2786 %edit
2786 \family default
2787 \family default
2787 command.
2788 command.
2788 By default, IPython will honor your
2789 By default, IPython will honor your
2789 \family typewriter
2790 \family typewriter
2790 EDITOR
2791 EDITOR
2791 \family default
2792 \family default
2792 environment variable (if not set, vi is the Unix default and notepad the
2793 environment variable (if not set, vi is the Unix default and notepad the
2793 Windows one).
2794 Windows one).
2794 Since this editor is invoked on the fly by IPython and is meant for editing
2795 Since this editor is invoked on the fly by IPython and is meant for editing
2795 small code snippets, you may want to use a small, lightweight editor here
2796 small code snippets, you may want to use a small, lightweight editor here
2796 (in case your default
2797 (in case your default
2797 \family typewriter
2798 \family typewriter
2798 EDITOR
2799 EDITOR
2799 \family default
2800 \family default
2800 is something like Emacs).
2801 is something like Emacs).
2801 \layout List
2802 \layout List
2802 \labelwidthstring 00.00.0000
2803 \labelwidthstring 00.00.0000
2803
2804
2804
2805
2805 \family typewriter
2806 \family typewriter
2806 \series bold
2807 \series bold
2807 -ipythondir\SpecialChar ~
2808 -ipythondir\SpecialChar ~
2808 <name>
2809 <name>
2809 \series default
2810 \series default
2810 :
2811 :
2811 \family default
2812 \family default
2812 name of your IPython configuration directory
2813 name of your IPython configuration directory
2813 \family typewriter
2814 \family typewriter
2814 IPYTHONDIR
2815 IPYTHONDIR
2815 \family default
2816 \family default
2816 .
2817 .
2817 This can also be specified through the environment variable
2818 This can also be specified through the environment variable
2818 \family typewriter
2819 \family typewriter
2819 IPYTHONDIR
2820 IPYTHONDIR
2820 \family default
2821 \family default
2821 .
2822 .
2822 \layout List
2823 \layout List
2823 \labelwidthstring 00.00.0000
2824 \labelwidthstring 00.00.0000
2824
2825
2825
2826
2826 \family typewriter
2827 \family typewriter
2827 \series bold
2828 \series bold
2828 -log|l
2829 -log|l
2829 \family default
2830 \family default
2830 \series default
2831 \series default
2831 : generate a log file of all input.
2832 : generate a log file of all input.
2832 Defaults to
2833 Defaults to
2833 \family typewriter
2834 \family typewriter
2834 $IPYTHONDIR/log
2835 $IPYTHONDIR/log
2835 \family default
2836 \family default
2836 .
2837 .
2837 You can use this to later restore a session by loading your logfile as
2838 You can use this to later restore a session by loading your logfile as
2838 a file to be executed with option
2839 a file to be executed with option
2839 \family typewriter
2840 \family typewriter
2840 -logplay
2841 -logplay
2841 \family default
2842 \family default
2842 (see below).
2843 (see below).
2843 \layout List
2844 \layout List
2844 \labelwidthstring 00.00.0000
2845 \labelwidthstring 00.00.0000
2845
2846
2846
2847
2847 \family typewriter
2848 \family typewriter
2848 \series bold
2849 \series bold
2849 -logfile|lf\SpecialChar ~
2850 -logfile|lf\SpecialChar ~
2850 <name>
2851 <name>
2851 \series default
2852 \series default
2852 :
2853 :
2853 \family default
2854 \family default
2854 specify the name of your logfile.
2855 specify the name of your logfile.
2855 \layout List
2856 \layout List
2856 \labelwidthstring 00.00.0000
2857 \labelwidthstring 00.00.0000
2857
2858
2858
2859
2859 \family typewriter
2860 \family typewriter
2860 \series bold
2861 \series bold
2861 -logplay|lp\SpecialChar ~
2862 -logplay|lp\SpecialChar ~
2862 <name>
2863 <name>
2863 \series default
2864 \series default
2864 :
2865 :
2865 \family default
2866 \family default
2866 you can replay a previous log.
2867 you can replay a previous log.
2867 For restoring a session as close as possible to the state you left it in,
2868 For restoring a session as close as possible to the state you left it in,
2868 use this option (don't just run the logfile).
2869 use this option (don't just run the logfile).
2869 With
2870 With
2870 \family typewriter
2871 \family typewriter
2871 -logplay
2872 -logplay
2872 \family default
2873 \family default
2873 , IPython will try to reconstruct the previous working environment in full,
2874 , IPython will try to reconstruct the previous working environment in full,
2874 not just execute the commands in the logfile.
2875 not just execute the commands in the logfile.
2875 \layout List
2876 \layout List
2876 \labelwidthstring 00.00.0000
2877 \labelwidthstring 00.00.0000
2877
2878
2878 \SpecialChar ~
2879 \SpecialChar ~
2879 When a session is restored, logging is automatically turned on again with
2880 When a session is restored, logging is automatically turned on again with
2880 the name of the logfile it was invoked with (it is read from the log header).
2881 the name of the logfile it was invoked with (it is read from the log header).
2881 So once you've turned logging on for a session, you can quit IPython and
2882 So once you've turned logging on for a session, you can quit IPython and
2882 reload it as many times as you want and it will continue to log its history
2883 reload it as many times as you want and it will continue to log its history
2883 and restore from the beginning every time.
2884 and restore from the beginning every time.
2884 \layout List
2885 \layout List
2885 \labelwidthstring 00.00.0000
2886 \labelwidthstring 00.00.0000
2886
2887
2887 \SpecialChar ~
2888 \SpecialChar ~
2888 Caveats: there are limitations in this option.
2889 Caveats: there are limitations in this option.
2889 The history variables
2890 The history variables
2890 \family typewriter
2891 \family typewriter
2891 _i*
2892 _i*
2892 \family default
2893 \family default
2893 ,
2894 ,
2894 \family typewriter
2895 \family typewriter
2895 _*
2896 _*
2896 \family default
2897 \family default
2897 and
2898 and
2898 \family typewriter
2899 \family typewriter
2899 _dh
2900 _dh
2900 \family default
2901 \family default
2901 don't get restored properly.
2902 don't get restored properly.
2902 In the future we will try to implement full session saving by writing and
2903 In the future we will try to implement full session saving by writing and
2903 retrieving a 'snapshot' of the memory state of IPython.
2904 retrieving a 'snapshot' of the memory state of IPython.
2904 But our first attempts failed because of inherent limitations of Python's
2905 But our first attempts failed because of inherent limitations of Python's
2905 Pickle module, so this may have to wait.
2906 Pickle module, so this may have to wait.
2906 \layout List
2907 \layout List
2907 \labelwidthstring 00.00.0000
2908 \labelwidthstring 00.00.0000
2908
2909
2909
2910
2910 \family typewriter
2911 \family typewriter
2911 \series bold
2912 \series bold
2912 -no|messages
2913 -no|messages
2913 \series default
2914 \series default
2914 :
2915 :
2915 \family default
2916 \family default
2916 Print messages which IPython collects about its startup process (default
2917 Print messages which IPython collects about its startup process (default
2917 on).
2918 on).
2918 \layout List
2919 \layout List
2919 \labelwidthstring 00.00.0000
2920 \labelwidthstring 00.00.0000
2920
2921
2921
2922
2922 \family typewriter
2923 \family typewriter
2923 \series bold
2924 \series bold
2924 -no|pdb
2925 -no|pdb
2925 \family default
2926 \family default
2926 \series default
2927 \series default
2927 : Automatically call the pdb debugger after every uncaught exception.
2928 : Automatically call the pdb debugger after every uncaught exception.
2928 If you are used to debugging using pdb, this puts you automatically inside
2929 If you are used to debugging using pdb, this puts you automatically inside
2929 of it after any call (either in IPython or in code called by it) which
2930 of it after any call (either in IPython or in code called by it) which
2930 triggers an exception which goes uncaught.
2931 triggers an exception which goes uncaught.
2931 \layout List
2932 \layout List
2932 \labelwidthstring 00.00.0000
2933 \labelwidthstring 00.00.0000
2933
2934
2934
2935
2935 \family typewriter
2936 \family typewriter
2936 \series bold
2937 \series bold
2937 -no|pprint
2938 -no|pprint
2938 \series default
2939 \series default
2939 :
2940 :
2940 \family default
2941 \family default
2941 ipython can optionally use the pprint (pretty printer) module for displaying
2942 ipython can optionally use the pprint (pretty printer) module for displaying
2942 results.
2943 results.
2943 pprint tends to give a nicer display of nested data structures.
2944 pprint tends to give a nicer display of nested data structures.
2944 If you like it, you can turn it on permanently in your config file (default
2945 If you like it, you can turn it on permanently in your config file (default
2945 off).
2946 off).
2946 \layout List
2947 \layout List
2947 \labelwidthstring 00.00.0000
2948 \labelwidthstring 00.00.0000
2948
2949
2949
2950
2950 \family typewriter
2951 \family typewriter
2951 \series bold
2952 \series bold
2952 -profile|p <name>
2953 -profile|p <name>
2953 \series default
2954 \series default
2954 :
2955 :
2955 \family default
2956 \family default
2956 assume that your config file is
2957 assume that your config file is
2957 \family typewriter
2958 \family typewriter
2958 ipythonrc-<name>
2959 ipythonrc-<name>
2959 \family default
2960 \family default
2960 (looks in current dir first, then in
2961 (looks in current dir first, then in
2961 \family typewriter
2962 \family typewriter
2962 IPYTHONDIR
2963 IPYTHONDIR
2963 \family default
2964 \family default
2964 ).
2965 ).
2965 This is a quick way to keep and load multiple config files for different
2966 This is a quick way to keep and load multiple config files for different
2966 tasks, especially if you use the include option of config files.
2967 tasks, especially if you use the include option of config files.
2967 You can keep a basic
2968 You can keep a basic
2968 \family typewriter
2969 \family typewriter
2969 IPYTHONDIR/ipythonrc
2970 IPYTHONDIR/ipythonrc
2970 \family default
2971 \family default
2971 file and then have other 'profiles' which include this one and load extra
2972 file and then have other 'profiles' which include this one and load extra
2972 things for particular tasks.
2973 things for particular tasks.
2973 For example:
2974 For example:
2974 \layout List
2975 \layout List
2975 \labelwidthstring 00.00.0000
2976 \labelwidthstring 00.00.0000
2976
2977
2977
2978
2978 \family typewriter
2979 \family typewriter
2979 \SpecialChar ~
2980 \SpecialChar ~
2980
2981
2981 \family default
2982 \family default
2982 1.
2983 1.
2983
2984
2984 \family typewriter
2985 \family typewriter
2985 $HOME/.ipython/ipythonrc
2986 $HOME/.ipython/ipythonrc
2986 \family default
2987 \family default
2987 : load basic things you always want.
2988 : load basic things you always want.
2988 \layout List
2989 \layout List
2989 \labelwidthstring 00.00.0000
2990 \labelwidthstring 00.00.0000
2990
2991
2991
2992
2992 \family typewriter
2993 \family typewriter
2993 \SpecialChar ~
2994 \SpecialChar ~
2994
2995
2995 \family default
2996 \family default
2996 2.
2997 2.
2997
2998
2998 \family typewriter
2999 \family typewriter
2999 $HOME/.ipython/ipythonrc-math
3000 $HOME/.ipython/ipythonrc-math
3000 \family default
3001 \family default
3001 : load (1) and basic math-related modules.
3002 : load (1) and basic math-related modules.
3002
3003
3003 \layout List
3004 \layout List
3004 \labelwidthstring 00.00.0000
3005 \labelwidthstring 00.00.0000
3005
3006
3006
3007
3007 \family typewriter
3008 \family typewriter
3008 \SpecialChar ~
3009 \SpecialChar ~
3009
3010
3010 \family default
3011 \family default
3011 3.
3012 3.
3012
3013
3013 \family typewriter
3014 \family typewriter
3014 $HOME/.ipython/ipythonrc-numeric
3015 $HOME/.ipython/ipythonrc-numeric
3015 \family default
3016 \family default
3016 : load (1) and Numeric and plotting modules.
3017 : load (1) and Numeric and plotting modules.
3017 \layout List
3018 \layout List
3018 \labelwidthstring 00.00.0000
3019 \labelwidthstring 00.00.0000
3019
3020
3020 \SpecialChar ~
3021 \SpecialChar ~
3021 Since it is possible to create an endless loop by having circular file
3022 Since it is possible to create an endless loop by having circular file
3022 inclusions, IPython will stop if it reaches 15 recursive inclusions.
3023 inclusions, IPython will stop if it reaches 15 recursive inclusions.
3023 \layout List
3024 \layout List
3024 \labelwidthstring 00.00.0000
3025 \labelwidthstring 00.00.0000
3025
3026
3026
3027
3027 \family typewriter
3028 \family typewriter
3028 \series bold
3029 \series bold
3029 -prompt_in1|pi1\SpecialChar ~
3030 -prompt_in1|pi1\SpecialChar ~
3030 <string>:
3031 <string>:
3031 \family default
3032 \family default
3032 \series default
3033 \series default
3033 Specify the string used for input prompts.
3034 Specify the string used for input prompts.
3034 Note that if you are using numbered prompts, the number is represented
3035 Note that if you are using numbered prompts, the number is represented
3035 with a '
3036 with a '
3036 \backslash
3037 \backslash
3037 #' in the string.
3038 #' in the string.
3038 Don't forget to quote strings with spaces embedded in them.
3039 Don't forget to quote strings with spaces embedded in them.
3039 Default: '
3040 Default: '
3040 \family typewriter
3041 \family typewriter
3041 In\SpecialChar ~
3042 In\SpecialChar ~
3042 [
3043 [
3043 \backslash
3044 \backslash
3044 #]:
3045 #]:
3045 \family default
3046 \family default
3046 '.
3047 '.
3047 Sec.\SpecialChar ~
3048 Sec.\SpecialChar ~
3048
3049
3049 \begin_inset LatexCommand \ref{sec:prompts}
3050 \begin_inset LatexCommand \ref{sec:prompts}
3050
3051
3051 \end_inset
3052 \end_inset
3052
3053
3053 discusses in detail all the available escapes to customize your prompts.
3054 discusses in detail all the available escapes to customize your prompts.
3054 \layout List
3055 \layout List
3055 \labelwidthstring 00.00.0000
3056 \labelwidthstring 00.00.0000
3056
3057
3057
3058
3058 \family typewriter
3059 \family typewriter
3059 \series bold
3060 \series bold
3060 -prompt_in2|pi2\SpecialChar ~
3061 -prompt_in2|pi2\SpecialChar ~
3061 <string>:
3062 <string>:
3062 \family default
3063 \family default
3063 \series default
3064 \series default
3064 Similar to the previous option, but used for the continuation prompts.
3065 Similar to the previous option, but used for the continuation prompts.
3065 The special sequence '
3066 The special sequence '
3066 \family typewriter
3067 \family typewriter
3067
3068
3068 \backslash
3069 \backslash
3069 D
3070 D
3070 \family default
3071 \family default
3071 ' is similar to '
3072 ' is similar to '
3072 \family typewriter
3073 \family typewriter
3073
3074
3074 \backslash
3075 \backslash
3075 #
3076 #
3076 \family default
3077 \family default
3077 ', but with all digits replaced dots (so you can have your continuation
3078 ', but with all digits replaced dots (so you can have your continuation
3078 prompt aligned with your input prompt).
3079 prompt aligned with your input prompt).
3079 Default: '
3080 Default: '
3080 \family typewriter
3081 \family typewriter
3081 \SpecialChar ~
3082 \SpecialChar ~
3082 \SpecialChar ~
3083 \SpecialChar ~
3083 \SpecialChar ~
3084 \SpecialChar ~
3084 .
3085 .
3085 \backslash
3086 \backslash
3086 D.:
3087 D.:
3087 \family default
3088 \family default
3088 ' (note three spaces at the start for alignment with '
3089 ' (note three spaces at the start for alignment with '
3089 \family typewriter
3090 \family typewriter
3090 In\SpecialChar ~
3091 In\SpecialChar ~
3091 [
3092 [
3092 \backslash
3093 \backslash
3093 #]
3094 #]
3094 \family default
3095 \family default
3095 ').
3096 ').
3096 \layout List
3097 \layout List
3097 \labelwidthstring 00.00.0000
3098 \labelwidthstring 00.00.0000
3098
3099
3099
3100
3100 \family typewriter
3101 \family typewriter
3101 \series bold
3102 \series bold
3102 -prompt_out|po\SpecialChar ~
3103 -prompt_out|po\SpecialChar ~
3103 <string>:
3104 <string>:
3104 \family default
3105 \family default
3105 \series default
3106 \series default
3106 String used for output prompts, also uses numbers like
3107 String used for output prompts, also uses numbers like
3107 \family typewriter
3108 \family typewriter
3108 prompt_in1
3109 prompt_in1
3109 \family default
3110 \family default
3110 .
3111 .
3111 Default: '
3112 Default: '
3112 \family typewriter
3113 \family typewriter
3113 Out[
3114 Out[
3114 \backslash
3115 \backslash
3115 #]:
3116 #]:
3116 \family default
3117 \family default
3117 '
3118 '
3118 \layout List
3119 \layout List
3119 \labelwidthstring 00.00.0000
3120 \labelwidthstring 00.00.0000
3120
3121
3121
3122
3122 \family typewriter
3123 \family typewriter
3123 \series bold
3124 \series bold
3124 -quick
3125 -quick
3125 \family default
3126 \family default
3126 \series default
3127 \series default
3127 : start in bare bones mode (no config file loaded).
3128 : start in bare bones mode (no config file loaded).
3128 \layout List
3129 \layout List
3129 \labelwidthstring 00.00.0000
3130 \labelwidthstring 00.00.0000
3130
3131
3131
3132
3132 \family typewriter
3133 \family typewriter
3133 \series bold
3134 \series bold
3134 -rcfile\SpecialChar ~
3135 -rcfile\SpecialChar ~
3135 <name>
3136 <name>
3136 \series default
3137 \series default
3137 :
3138 :
3138 \family default
3139 \family default
3139 name of your IPython resource configuration file.
3140 name of your IPython resource configuration file.
3140 Normally IPython loads ipythonrc (from current directory) or
3141 Normally IPython loads ipythonrc (from current directory) or
3141 \family typewriter
3142 \family typewriter
3142 IPYTHONDIR/ipythonrc
3143 IPYTHONDIR/ipythonrc
3143 \family default
3144 \family default
3144 .
3145 .
3145 \layout List
3146 \layout List
3146 \labelwidthstring 00.00.0000
3147 \labelwidthstring 00.00.0000
3147
3148
3148 \SpecialChar ~
3149 \SpecialChar ~
3149 If the loading of your config file fails, IPython starts with a bare bones
3150 If the loading of your config file fails, IPython starts with a bare bones
3150 configuration (no modules loaded at all).
3151 configuration (no modules loaded at all).
3151 \layout List
3152 \layout List
3152 \labelwidthstring 00.00.0000
3153 \labelwidthstring 00.00.0000
3153
3154
3154
3155
3155 \family typewriter
3156 \family typewriter
3156 \series bold
3157 \series bold
3157 -no|readline
3158 -no|readline
3158 \family default
3159 \family default
3159 \series default
3160 \series default
3160 : use the readline library, which is needed to support name completion and
3161 : use the readline library, which is needed to support name completion and
3161 command history, among other things.
3162 command history, among other things.
3162 It is enabled by default, but may cause problems for users of X/Emacs in
3163 It is enabled by default, but may cause problems for users of X/Emacs in
3163 Python comint or shell buffers.
3164 Python comint or shell buffers.
3164 \layout List
3165 \layout List
3165 \labelwidthstring 00.00.0000
3166 \labelwidthstring 00.00.0000
3166
3167
3167 \SpecialChar ~
3168 \SpecialChar ~
3168 Note that X/Emacs 'eterm' buffers (opened with
3169 Note that X/Emacs 'eterm' buffers (opened with
3169 \family typewriter
3170 \family typewriter
3170 M-x\SpecialChar ~
3171 M-x\SpecialChar ~
3171 term
3172 term
3172 \family default
3173 \family default
3173 ) support IPython's readline and syntax coloring fine, only 'emacs' (
3174 ) support IPython's readline and syntax coloring fine, only 'emacs' (
3174 \family typewriter
3175 \family typewriter
3175 M-x\SpecialChar ~
3176 M-x\SpecialChar ~
3176 shell
3177 shell
3177 \family default
3178 \family default
3178 and
3179 and
3179 \family typewriter
3180 \family typewriter
3180 C-c\SpecialChar ~
3181 C-c\SpecialChar ~
3181 !
3182 !
3182 \family default
3183 \family default
3183 ) buffers do not.
3184 ) buffers do not.
3184 \layout List
3185 \layout List
3185 \labelwidthstring 00.00.0000
3186 \labelwidthstring 00.00.0000
3186
3187
3187
3188
3188 \family typewriter
3189 \family typewriter
3189 \series bold
3190 \series bold
3190 -screen_length|sl\SpecialChar ~
3191 -screen_length|sl\SpecialChar ~
3191 <n>
3192 <n>
3192 \series default
3193 \series default
3193 :
3194 :
3194 \family default
3195 \family default
3195 number of lines of your screen.
3196 number of lines of your screen.
3196 This is used to control printing of very long strings.
3197 This is used to control printing of very long strings.
3197 Strings longer than this number of lines will be sent through a pager instead
3198 Strings longer than this number of lines will be sent through a pager instead
3198 of directly printed.
3199 of directly printed.
3199 \layout List
3200 \layout List
3200 \labelwidthstring 00.00.0000
3201 \labelwidthstring 00.00.0000
3201
3202
3202 \SpecialChar ~
3203 \SpecialChar ~
3203 The default value for this is 0, which means IPython will auto-detect your
3204 The default value for this is 0, which means IPython will auto-detect your
3204 screen size every time it needs to print certain potentially long strings
3205 screen size every time it needs to print certain potentially long strings
3205 (this doesn't change the behavior of the 'print' keyword, it's only triggered
3206 (this doesn't change the behavior of the 'print' keyword, it's only triggered
3206 internally).
3207 internally).
3207 If for some reason this isn't working well (it needs curses support), specify
3208 If for some reason this isn't working well (it needs curses support), specify
3208 it yourself.
3209 it yourself.
3209 Otherwise don't change the default.
3210 Otherwise don't change the default.
3210 \layout List
3211 \layout List
3211 \labelwidthstring 00.00.0000
3212 \labelwidthstring 00.00.0000
3212
3213
3213
3214
3214 \family typewriter
3215 \family typewriter
3215 \series bold
3216 \series bold
3216 -separate_in|si\SpecialChar ~
3217 -separate_in|si\SpecialChar ~
3217 <string>
3218 <string>
3218 \series default
3219 \series default
3219 :
3220 :
3220 \family default
3221 \family default
3221 separator before input prompts.
3222 separator before input prompts.
3222 Default: '
3223 Default: '
3223 \family typewriter
3224 \family typewriter
3224
3225
3225 \backslash
3226 \backslash
3226 n
3227 n
3227 \family default
3228 \family default
3228 '
3229 '
3229 \layout List
3230 \layout List
3230 \labelwidthstring 00.00.0000
3231 \labelwidthstring 00.00.0000
3231
3232
3232
3233
3233 \family typewriter
3234 \family typewriter
3234 \series bold
3235 \series bold
3235 -separate_out|so\SpecialChar ~
3236 -separate_out|so\SpecialChar ~
3236 <string>
3237 <string>
3237 \family default
3238 \family default
3238 \series default
3239 \series default
3239 : separator before output prompts.
3240 : separator before output prompts.
3240 Default: nothing.
3241 Default: nothing.
3241 \layout List
3242 \layout List
3242 \labelwidthstring 00.00.0000
3243 \labelwidthstring 00.00.0000
3243
3244
3244
3245
3245 \family typewriter
3246 \family typewriter
3246 \series bold
3247 \series bold
3247 -separate_out2|so2\SpecialChar ~
3248 -separate_out2|so2\SpecialChar ~
3248 <string>
3249 <string>
3249 \series default
3250 \series default
3250 :
3251 :
3251 \family default
3252 \family default
3252 separator after output prompts.
3253 separator after output prompts.
3253 Default: nothing.
3254 Default: nothing.
3254 \layout List
3255 \layout List
3255 \labelwidthstring 00.00.0000
3256 \labelwidthstring 00.00.0000
3256
3257
3257 \SpecialChar ~
3258 \SpecialChar ~
3258 For these three options, use the value 0 to specify no separator.
3259 For these three options, use the value 0 to specify no separator.
3259 \layout List
3260 \layout List
3260 \labelwidthstring 00.00.0000
3261 \labelwidthstring 00.00.0000
3261
3262
3262
3263
3263 \family typewriter
3264 \family typewriter
3264 \series bold
3265 \series bold
3265 -nosep
3266 -nosep
3266 \series default
3267 \series default
3267 :
3268 :
3268 \family default
3269 \family default
3269 shorthand for
3270 shorthand for
3270 \family typewriter
3271 \family typewriter
3271 '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'
3272 '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'
3272 \family default
3273 \family default
3273 .
3274 .
3274 Simply removes all input/output separators.
3275 Simply removes all input/output separators.
3275 \layout List
3276 \layout List
3276 \labelwidthstring 00.00.0000
3277 \labelwidthstring 00.00.0000
3277
3278
3278
3279
3279 \family typewriter
3280 \family typewriter
3280 \series bold
3281 \series bold
3281 -upgrade
3282 -upgrade
3282 \family default
3283 \family default
3283 \series default
3284 \series default
3284 : allows you to upgrade your
3285 : allows you to upgrade your
3285 \family typewriter
3286 \family typewriter
3286 IPYTHONDIR
3287 IPYTHONDIR
3287 \family default
3288 \family default
3288 configuration when you install a new version of IPython.
3289 configuration when you install a new version of IPython.
3289 Since new versions may include new command line options or example files,
3290 Since new versions may include new command line options or example files,
3290 this copies updated ipythonrc-type files.
3291 this copies updated ipythonrc-type files.
3291 However, it backs up (with a
3292 However, it backs up (with a
3292 \family typewriter
3293 \family typewriter
3293 .old
3294 .old
3294 \family default
3295 \family default
3295 extension) all files which it overwrites so that you can merge back any
3296 extension) all files which it overwrites so that you can merge back any
3296 customizations you might have in your personal files.
3297 customizations you might have in your personal files.
3297 \layout List
3298 \layout List
3298 \labelwidthstring 00.00.0000
3299 \labelwidthstring 00.00.0000
3299
3300
3300
3301
3301 \family typewriter
3302 \family typewriter
3302 \series bold
3303 \series bold
3303 -Version
3304 -Version
3304 \series default
3305 \series default
3305 :
3306 :
3306 \family default
3307 \family default
3307 print version information and exit.
3308 print version information and exit.
3308 \layout List
3309 \layout List
3309 \labelwidthstring 00.00.0000
3310 \labelwidthstring 00.00.0000
3310
3311
3311
3312
3312 \family typewriter
3313 \family typewriter
3313 \series bold
3314 \series bold
3314 -xmode <modename>
3315 -xmode <modename>
3315 \series default
3316 \series default
3316 :
3317 :
3317 \family default
3318 \family default
3318 Mode for exception reporting.
3319 Mode for exception reporting.
3319 \layout List
3320 \layout List
3320 \labelwidthstring 00.00.0000
3321 \labelwidthstring 00.00.0000
3321
3322
3322 \SpecialChar ~
3323 \SpecialChar ~
3323 Valid modes: Plain, Context and Verbose.
3324 Valid modes: Plain, Context and Verbose.
3324 \layout List
3325 \layout List
3325 \labelwidthstring 00.00.0000
3326 \labelwidthstring 00.00.0000
3326
3327
3327 \SpecialChar ~
3328 \SpecialChar ~
3328 Plain: similar to python's normal traceback printing.
3329 Plain: similar to python's normal traceback printing.
3329 \layout List
3330 \layout List
3330 \labelwidthstring 00.00.0000
3331 \labelwidthstring 00.00.0000
3331
3332
3332 \SpecialChar ~
3333 \SpecialChar ~
3333 Context: prints 5 lines of context source code around each line in the
3334 Context: prints 5 lines of context source code around each line in the
3334 traceback.
3335 traceback.
3335 \layout List
3336 \layout List
3336 \labelwidthstring 00.00.0000
3337 \labelwidthstring 00.00.0000
3337
3338
3338 \SpecialChar ~
3339 \SpecialChar ~
3339 Verbose: similar to Context, but additionally prints the variables currently
3340 Verbose: similar to Context, but additionally prints the variables currently
3340 visible where the exception happened (shortening their strings if too long).
3341 visible where the exception happened (shortening their strings if too long).
3341 This can potentially be very slow, if you happen to have a huge data structure
3342 This can potentially be very slow, if you happen to have a huge data structure
3342 whose string representation is complex to compute.
3343 whose string representation is complex to compute.
3343 Your computer may appear to freeze for a while with cpu usage at 100%.
3344 Your computer may appear to freeze for a while with cpu usage at 100%.
3344 If this occurs, you can cancel the traceback with Ctrl-C (maybe hitting
3345 If this occurs, you can cancel the traceback with Ctrl-C (maybe hitting
3345 it more than once).
3346 it more than once).
3346 \layout Section
3347 \layout Section
3347
3348
3348 Interactive use
3349 Interactive use
3349 \layout Standard
3350 \layout Standard
3350
3351
3351
3352
3352 \series bold
3353 \series bold
3353 Warning
3354 Warning
3354 \series default
3355 \series default
3355 : IPython relies on the existence of a global variable called
3356 : IPython relies on the existence of a global variable called
3356 \family typewriter
3357 \family typewriter
3357 __IP
3358 __IP
3358 \family default
3359 \family default
3359 which controls the shell itself.
3360 which controls the shell itself.
3360 If you redefine
3361 If you redefine
3361 \family typewriter
3362 \family typewriter
3362 __IP
3363 __IP
3363 \family default
3364 \family default
3364 to anything, bizarre behavior will quickly occur.
3365 to anything, bizarre behavior will quickly occur.
3365 \layout Standard
3366 \layout Standard
3366
3367
3367 Other than the above warning, IPython is meant to work as a drop-in replacement
3368 Other than the above warning, IPython is meant to work as a drop-in replacement
3368 for the standard interactive interpreter.
3369 for the standard interactive interpreter.
3369 As such, any code which is valid python should execute normally under IPython
3370 As such, any code which is valid python should execute normally under IPython
3370 (cases where this is not true should be reported as bugs).
3371 (cases where this is not true should be reported as bugs).
3371 It does, however, offer many features which are not available at a standard
3372 It does, however, offer many features which are not available at a standard
3372 python prompt.
3373 python prompt.
3373 What follows is a list of these.
3374 What follows is a list of these.
3374 \layout Subsection
3375 \layout Subsection
3375
3376
3376 Caution for Windows users
3377 Caution for Windows users
3377 \layout Standard
3378 \layout Standard
3378
3379
3379 Windows, unfortunately, uses the `
3380 Windows, unfortunately, uses the `
3380 \family typewriter
3381 \family typewriter
3381
3382
3382 \backslash
3383 \backslash
3383
3384
3384 \family default
3385 \family default
3385 ' character as a path separator.
3386 ' character as a path separator.
3386 This is a terrible choice, because `
3387 This is a terrible choice, because `
3387 \family typewriter
3388 \family typewriter
3388
3389
3389 \backslash
3390 \backslash
3390
3391
3391 \family default
3392 \family default
3392 ' also represents the escape character in most modern programming languages,
3393 ' also represents the escape character in most modern programming languages,
3393 including Python.
3394 including Python.
3394 For this reason, issuing many of the commands discussed below (especially
3395 For this reason, issuing many of the commands discussed below (especially
3395 magics which affect the filesystem) with `
3396 magics which affect the filesystem) with `
3396 \family typewriter
3397 \family typewriter
3397
3398
3398 \backslash
3399 \backslash
3399
3400
3400 \family default
3401 \family default
3401 ' in them will cause strange errors.
3402 ' in them will cause strange errors.
3402 \layout Standard
3403 \layout Standard
3403
3404
3404 A partial solution is to use instead the `
3405 A partial solution is to use instead the `
3405 \family typewriter
3406 \family typewriter
3406 /
3407 /
3407 \family default
3408 \family default
3408 ' character as a path separator, which Windows recognizes in
3409 ' character as a path separator, which Windows recognizes in
3409 \emph on
3410 \emph on
3410 most
3411 most
3411 \emph default
3412 \emph default
3412 situations.
3413 situations.
3413 However, in Windows commands `
3414 However, in Windows commands `
3414 \family typewriter
3415 \family typewriter
3415 /
3416 /
3416 \family default
3417 \family default
3417 ' flags options, so you can not use it for the root directory.
3418 ' flags options, so you can not use it for the root directory.
3418 This means that paths beginning at the root must be typed in a contrived
3419 This means that paths beginning at the root must be typed in a contrived
3419 manner like:
3420 manner like:
3420 \newline
3421 \newline
3421
3422
3422 \family typewriter
3423 \family typewriter
3423 %copy
3424 %copy
3424 \backslash
3425 \backslash
3425 opt/foo/bar.txt
3426 opt/foo/bar.txt
3426 \backslash
3427 \backslash
3427 tmp
3428 tmp
3428 \layout Standard
3429 \layout Standard
3429
3430
3430 There is no sensible thing IPython can do to truly work around this flaw
3431 There is no sensible thing IPython can do to truly work around this flaw
3431 in Windows
3432 in Windows
3432 \begin_inset Foot
3433 \begin_inset Foot
3433 collapsed true
3434 collapsed true
3434
3435
3435 \layout Standard
3436 \layout Standard
3436
3437
3437 If anyone comes up with a
3438 If anyone comes up with a
3438 \emph on
3439 \emph on
3439 clean
3440 clean
3440 \emph default
3441 \emph default
3441 solution which works consistently and does not negatively impact other
3442 solution which works consistently and does not negatively impact other
3442 platforms at all, I'll gladly accept a patch.
3443 platforms at all, I'll gladly accept a patch.
3443 \end_inset
3444 \end_inset
3444
3445
3445 .
3446 .
3446 \layout Subsection
3447 \layout Subsection
3447
3448
3448
3449
3449 \begin_inset LatexCommand \label{sec:magic}
3450 \begin_inset LatexCommand \label{sec:magic}
3450
3451
3451 \end_inset
3452 \end_inset
3452
3453
3453 Magic command system
3454 Magic command system
3454 \layout Standard
3455 \layout Standard
3455
3456
3456 IPython will treat any line whose first character is a
3457 IPython will treat any line whose first character is a
3457 \family typewriter
3458 \family typewriter
3458 %
3459 %
3459 \family default
3460 \family default
3460 as a special call to a 'magic' function.
3461 as a special call to a 'magic' function.
3461 These allow you to control the behavior of IPython itself, plus a lot of
3462 These allow you to control the behavior of IPython itself, plus a lot of
3462 system-type features.
3463 system-type features.
3463 They are all prefixed with a
3464 They are all prefixed with a
3464 \family typewriter
3465 \family typewriter
3465 %
3466 %
3466 \family default
3467 \family default
3467 character, but parameters are given without parentheses or quotes.
3468 character, but parameters are given without parentheses or quotes.
3468 \layout Standard
3469 \layout Standard
3469
3470
3470 Example: typing
3471 Example: typing
3471 \family typewriter
3472 \family typewriter
3472 '%cd mydir'
3473 '%cd mydir'
3473 \family default
3474 \family default
3474 (without the quotes) changes you working directory to
3475 (without the quotes) changes you working directory to
3475 \family typewriter
3476 \family typewriter
3476 'mydir'
3477 'mydir'
3477 \family default
3478 \family default
3478 , if it exists.
3479 , if it exists.
3479 \layout Standard
3480 \layout Standard
3480
3481
3481 If you have 'automagic' enabled (in your
3482 If you have 'automagic' enabled (in your
3482 \family typewriter
3483 \family typewriter
3483 ipythonrc
3484 ipythonrc
3484 \family default
3485 \family default
3485 file, via the command line option
3486 file, via the command line option
3486 \family typewriter
3487 \family typewriter
3487 -automagic
3488 -automagic
3488 \family default
3489 \family default
3489 or with the
3490 or with the
3490 \family typewriter
3491 \family typewriter
3491 %automagic
3492 %automagic
3492 \family default
3493 \family default
3493 function), you don't need to type in the
3494 function), you don't need to type in the
3494 \family typewriter
3495 \family typewriter
3495 %
3496 %
3496 \family default
3497 \family default
3497 explicitly.
3498 explicitly.
3498 IPython will scan its internal list of magic functions and call one if
3499 IPython will scan its internal list of magic functions and call one if
3499 it exists.
3500 it exists.
3500 With automagic on you can then just type '
3501 With automagic on you can then just type '
3501 \family typewriter
3502 \family typewriter
3502 cd mydir
3503 cd mydir
3503 \family default
3504 \family default
3504 ' to go to directory '
3505 ' to go to directory '
3505 \family typewriter
3506 \family typewriter
3506 mydir
3507 mydir
3507 \family default
3508 \family default
3508 '.
3509 '.
3509 The automagic system has the lowest possible precedence in name searches,
3510 The automagic system has the lowest possible precedence in name searches,
3510 so defining an identifier with the same name as an existing magic function
3511 so defining an identifier with the same name as an existing magic function
3511 will shadow it for automagic use.
3512 will shadow it for automagic use.
3512 You can still access the shadowed magic function by explicitly using the
3513 You can still access the shadowed magic function by explicitly using the
3513
3514
3514 \family typewriter
3515 \family typewriter
3515 %
3516 %
3516 \family default
3517 \family default
3517 character at the beginning of the line.
3518 character at the beginning of the line.
3518 \layout Standard
3519 \layout Standard
3519
3520
3520 An example (with automagic on) should clarify all this:
3521 An example (with automagic on) should clarify all this:
3521 \layout LyX-Code
3522 \layout LyX-Code
3522
3523
3523 In [1]: cd ipython # %cd is called by automagic
3524 In [1]: cd ipython # %cd is called by automagic
3524 \layout LyX-Code
3525 \layout LyX-Code
3525
3526
3526 /home/fperez/ipython
3527 /home/fperez/ipython
3527 \layout LyX-Code
3528 \layout LyX-Code
3528
3529
3529 In [2]: cd=1 # now cd is just a variable
3530 In [2]: cd=1 # now cd is just a variable
3530 \layout LyX-Code
3531 \layout LyX-Code
3531
3532
3532 In [3]: cd ..
3533 In [3]: cd ..
3533 # and doesn't work as a function anymore
3534 # and doesn't work as a function anymore
3534 \layout LyX-Code
3535 \layout LyX-Code
3535
3536
3536 ------------------------------------------------------------
3537 ------------------------------------------------------------
3537 \layout LyX-Code
3538 \layout LyX-Code
3538
3539
3539 File "<console>", line 1
3540 File "<console>", line 1
3540 \layout LyX-Code
3541 \layout LyX-Code
3541
3542
3542 cd ..
3543 cd ..
3543 \layout LyX-Code
3544 \layout LyX-Code
3544
3545
3545 ^
3546 ^
3546 \layout LyX-Code
3547 \layout LyX-Code
3547
3548
3548 SyntaxError: invalid syntax
3549 SyntaxError: invalid syntax
3549 \layout LyX-Code
3550 \layout LyX-Code
3550
3551
3551 \layout LyX-Code
3552 \layout LyX-Code
3552
3553
3553 In [4]: %cd ..
3554 In [4]: %cd ..
3554 # but %cd always works
3555 # but %cd always works
3555 \layout LyX-Code
3556 \layout LyX-Code
3556
3557
3557 /home/fperez
3558 /home/fperez
3558 \layout LyX-Code
3559 \layout LyX-Code
3559
3560
3560 In [5]: del cd # if you remove the cd variable
3561 In [5]: del cd # if you remove the cd variable
3561 \layout LyX-Code
3562 \layout LyX-Code
3562
3563
3563 In [6]: cd ipython # automagic can work again
3564 In [6]: cd ipython # automagic can work again
3564 \layout LyX-Code
3565 \layout LyX-Code
3565
3566
3566 /home/fperez/ipython
3567 /home/fperez/ipython
3567 \layout Standard
3568 \layout Standard
3568
3569
3569 You can define your own magic functions to extend the system.
3570 You can define your own magic functions to extend the system.
3570 The following is a snippet of code which shows how to do it.
3571 The following is a snippet of code which shows how to do it.
3571 It is provided as file
3572 It is provided as file
3572 \family typewriter
3573 \family typewriter
3573 example-magic.py
3574 example-magic.py
3574 \family default
3575 \family default
3575 in the examples directory:
3576 in the examples directory:
3576 \layout Standard
3577 \layout Standard
3577
3578
3578
3579
3579 \begin_inset Include \verbatiminput{examples/example-magic.py}
3580 \begin_inset Include \verbatiminput{examples/example-magic.py}
3580 preview false
3581 preview false
3581
3582
3582 \end_inset
3583 \end_inset
3583
3584
3584
3585
3585 \layout Standard
3586 \layout Standard
3586
3587
3587 You can also define your own aliased names for magic functions.
3588 You can also define your own aliased names for magic functions.
3588 In your
3589 In your
3589 \family typewriter
3590 \family typewriter
3590 ipythonrc
3591 ipythonrc
3591 \family default
3592 \family default
3592 file, placing a line like:
3593 file, placing a line like:
3593 \layout Standard
3594 \layout Standard
3594
3595
3595
3596
3596 \family typewriter
3597 \family typewriter
3597 execute __IP.magic_cl = __IP.magic_clear
3598 execute __IP.magic_cl = __IP.magic_clear
3598 \layout Standard
3599 \layout Standard
3599
3600
3600 will define
3601 will define
3601 \family typewriter
3602 \family typewriter
3602 %cl
3603 %cl
3603 \family default
3604 \family default
3604 as a new name for
3605 as a new name for
3605 \family typewriter
3606 \family typewriter
3606 %clear
3607 %clear
3607 \family default
3608 \family default
3608 .
3609 .
3609 \layout Standard
3610 \layout Standard
3610
3611
3611 Type
3612 Type
3612 \family typewriter
3613 \family typewriter
3613 %magic
3614 %magic
3614 \family default
3615 \family default
3615 for more information, including a list of all available magic functions
3616 for more information, including a list of all available magic functions
3616 at any time and their docstrings.
3617 at any time and their docstrings.
3617 You can also type
3618 You can also type
3618 \family typewriter
3619 \family typewriter
3619 %magic_function_name?
3620 %magic_function_name?
3620 \family default
3621 \family default
3621 (see sec.
3622 (see sec.
3622
3623
3623 \begin_inset LatexCommand \ref{sec:dyn-object-info}
3624 \begin_inset LatexCommand \ref{sec:dyn-object-info}
3624
3625
3625 \end_inset
3626 \end_inset
3626
3627
3627 for information on the
3628 for information on the
3628 \family typewriter
3629 \family typewriter
3629 '?'
3630 '?'
3630 \family default
3631 \family default
3631 system) to get information about any particular magic function you are
3632 system) to get information about any particular magic function you are
3632 interested in.
3633 interested in.
3633 \layout Subsubsection
3634 \layout Subsubsection
3634
3635
3635 Magic commands
3636 Magic commands
3636 \layout Standard
3637 \layout Standard
3637
3638
3638 The rest of this section is automatically generated for each release from
3639 The rest of this section is automatically generated for each release from
3639 the docstrings in the IPython code.
3640 the docstrings in the IPython code.
3640 Therefore the formatting is somewhat minimal, but this method has the advantage
3641 Therefore the formatting is somewhat minimal, but this method has the advantage
3641 of having information always in sync with the code.
3642 of having information always in sync with the code.
3642 \layout Standard
3643 \layout Standard
3643
3644
3644 A list of all the magic commands available in IPython's
3645 A list of all the magic commands available in IPython's
3645 \emph on
3646 \emph on
3646 default
3647 default
3647 \emph default
3648 \emph default
3648 installation follows.
3649 installation follows.
3649 This is similar to what you'll see by simply typing
3650 This is similar to what you'll see by simply typing
3650 \family typewriter
3651 \family typewriter
3651 %magic
3652 %magic
3652 \family default
3653 \family default
3653 at the prompt, but that will also give you information about magic commands
3654 at the prompt, but that will also give you information about magic commands
3654 you may have added as part of your personal customizations.
3655 you may have added as part of your personal customizations.
3655 \layout Standard
3656 \layout Standard
3656
3657
3657
3658
3658 \begin_inset Include \input{magic.tex}
3659 \begin_inset Include \input{magic.tex}
3659 preview false
3660 preview false
3660
3661
3661 \end_inset
3662 \end_inset
3662
3663
3663
3664
3664 \layout Subsection
3665 \layout Subsection
3665
3666
3666 Access to the standard Python help
3667 Access to the standard Python help
3667 \layout Standard
3668 \layout Standard
3668
3669
3669 As of Python 2.1, a help system is available with access to object docstrings
3670 As of Python 2.1, a help system is available with access to object docstrings
3670 and the Python manuals.
3671 and the Python manuals.
3671 Simply type
3672 Simply type
3672 \family typewriter
3673 \family typewriter
3673 'help'
3674 'help'
3674 \family default
3675 \family default
3675 (no quotes) to access it.
3676 (no quotes) to access it.
3676 You can also type
3677 You can also type
3677 \family typewriter
3678 \family typewriter
3678 help(object)
3679 help(object)
3679 \family default
3680 \family default
3680 to obtain information about a given object, and
3681 to obtain information about a given object, and
3681 \family typewriter
3682 \family typewriter
3682 help('keyword')
3683 help('keyword')
3683 \family default
3684 \family default
3684 for information on a keyword.
3685 for information on a keyword.
3685 As noted in sec.
3686 As noted in sec.
3686
3687
3687 \begin_inset LatexCommand \ref{sec:help-access}
3688 \begin_inset LatexCommand \ref{sec:help-access}
3688
3689
3689 \end_inset
3690 \end_inset
3690
3691
3691 , you need to properly configure your environment variable
3692 , you need to properly configure your environment variable
3692 \family typewriter
3693 \family typewriter
3693 PYTHONDOCS
3694 PYTHONDOCS
3694 \family default
3695 \family default
3695 for this feature to work correctly.
3696 for this feature to work correctly.
3696 \layout Subsection
3697 \layout Subsection
3697
3698
3698
3699
3699 \begin_inset LatexCommand \label{sec:dyn-object-info}
3700 \begin_inset LatexCommand \label{sec:dyn-object-info}
3700
3701
3701 \end_inset
3702 \end_inset
3702
3703
3703 Dynamic object information
3704 Dynamic object information
3704 \layout Standard
3705 \layout Standard
3705
3706
3706 Typing
3707 Typing
3707 \family typewriter
3708 \family typewriter
3708 ?word
3709 ?word
3709 \family default
3710 \family default
3710 or
3711 or
3711 \family typewriter
3712 \family typewriter
3712 word?
3713 word?
3713 \family default
3714 \family default
3714 prints detailed information about an object.
3715 prints detailed information about an object.
3715 If certain strings in the object are too long (docstrings, code, etc.) they
3716 If certain strings in the object are too long (docstrings, code, etc.) they
3716 get snipped in the center for brevity.
3717 get snipped in the center for brevity.
3717 This system gives access variable types and values, full source code for
3718 This system gives access variable types and values, full source code for
3718 any object (if available), function prototypes and other useful information.
3719 any object (if available), function prototypes and other useful information.
3719 \layout Standard
3720 \layout Standard
3720
3721
3721 Typing
3722 Typing
3722 \family typewriter
3723 \family typewriter
3723 ??word
3724 ??word
3724 \family default
3725 \family default
3725 or
3726 or
3726 \family typewriter
3727 \family typewriter
3727 word??
3728 word??
3728 \family default
3729 \family default
3729 gives access to the full information without snipping long strings.
3730 gives access to the full information without snipping long strings.
3730 Long strings are sent to the screen through the
3731 Long strings are sent to the screen through the
3731 \family typewriter
3732 \family typewriter
3732 less
3733 less
3733 \family default
3734 \family default
3734 pager if longer than the screen and printed otherwise.
3735 pager if longer than the screen and printed otherwise.
3735 On systems lacking the
3736 On systems lacking the
3736 \family typewriter
3737 \family typewriter
3737 less
3738 less
3738 \family default
3739 \family default
3739 command, IPython uses a very basic internal pager.
3740 command, IPython uses a very basic internal pager.
3740 \layout Standard
3741 \layout Standard
3741
3742
3742 The following magic functions are particularly useful for gathering information
3743 The following magic functions are particularly useful for gathering information
3743 about your working environment.
3744 about your working environment.
3744 You can get more details by typing
3745 You can get more details by typing
3745 \family typewriter
3746 \family typewriter
3746 %magic
3747 %magic
3747 \family default
3748 \family default
3748 or querying them individually (use
3749 or querying them individually (use
3749 \family typewriter
3750 \family typewriter
3750 %function_name?
3751 %function_name?
3751 \family default
3752 \family default
3752 with or without the
3753 with or without the
3753 \family typewriter
3754 \family typewriter
3754 %
3755 %
3755 \family default
3756 \family default
3756 ), this is just a summary:
3757 ), this is just a summary:
3757 \layout List
3758 \layout List
3758 \labelwidthstring 00.00.0000
3759 \labelwidthstring 00.00.0000
3759
3760
3760
3761
3761 \family typewriter
3762 \family typewriter
3762 \series bold
3763 \series bold
3763 %pdoc\SpecialChar ~
3764 %pdoc\SpecialChar ~
3764 <object>
3765 <object>
3765 \family default
3766 \family default
3766 \series default
3767 \series default
3767 : Print (or run through a pager if too long) the docstring for an object.
3768 : Print (or run through a pager if too long) the docstring for an object.
3768 If the given object is a class, it will print both the class and the constructo
3769 If the given object is a class, it will print both the class and the constructo
3769 r docstrings.
3770 r docstrings.
3770 \layout List
3771 \layout List
3771 \labelwidthstring 00.00.0000
3772 \labelwidthstring 00.00.0000
3772
3773
3773
3774
3774 \family typewriter
3775 \family typewriter
3775 \series bold
3776 \series bold
3776 %pdef\SpecialChar ~
3777 %pdef\SpecialChar ~
3777 <object>
3778 <object>
3778 \family default
3779 \family default
3779 \series default
3780 \series default
3780 : Print the definition header for any callable object.
3781 : Print the definition header for any callable object.
3781 If the object is a class, print the constructor information.
3782 If the object is a class, print the constructor information.
3782 \layout List
3783 \layout List
3783 \labelwidthstring 00.00.0000
3784 \labelwidthstring 00.00.0000
3784
3785
3785
3786
3786 \family typewriter
3787 \family typewriter
3787 \series bold
3788 \series bold
3788 %psource\SpecialChar ~
3789 %psource\SpecialChar ~
3789 <object>
3790 <object>
3790 \family default
3791 \family default
3791 \series default
3792 \series default
3792 : Print (or run through a pager if too long) the source code for an object.
3793 : Print (or run through a pager if too long) the source code for an object.
3793 \layout List
3794 \layout List
3794 \labelwidthstring 00.00.0000
3795 \labelwidthstring 00.00.0000
3795
3796
3796
3797
3797 \family typewriter
3798 \family typewriter
3798 \series bold
3799 \series bold
3799 %pfile\SpecialChar ~
3800 %pfile\SpecialChar ~
3800 <object>
3801 <object>
3801 \family default
3802 \family default
3802 \series default
3803 \series default
3803 : Show the entire source file where an object was defined via a pager, opening
3804 : Show the entire source file where an object was defined via a pager, opening
3804 it at the line where the object definition begins.
3805 it at the line where the object definition begins.
3805 \layout List
3806 \layout List
3806 \labelwidthstring 00.00.0000
3807 \labelwidthstring 00.00.0000
3807
3808
3808
3809
3809 \family typewriter
3810 \family typewriter
3810 \series bold
3811 \series bold
3811 %who/%whos
3812 %who/%whos
3812 \family default
3813 \family default
3813 \series default
3814 \series default
3814 : These functions give information about identifiers you have defined interactiv
3815 : These functions give information about identifiers you have defined interactiv
3815 ely (not things you loaded or defined in your configuration files).
3816 ely (not things you loaded or defined in your configuration files).
3816
3817
3817 \family typewriter
3818 \family typewriter
3818 %who
3819 %who
3819 \family default
3820 \family default
3820 just prints a list of identifiers and
3821 just prints a list of identifiers and
3821 \family typewriter
3822 \family typewriter
3822 %whos
3823 %whos
3823 \family default
3824 \family default
3824 prints a table with some basic details about each identifier.
3825 prints a table with some basic details about each identifier.
3825 \layout Standard
3826 \layout Standard
3826
3827
3827 Note that the dynamic object information functions (
3828 Note that the dynamic object information functions (
3828 \family typewriter
3829 \family typewriter
3829 ?/??, %pdoc, %pfile, %pdef, %psource
3830 ?/??, %pdoc, %pfile, %pdef, %psource
3830 \family default
3831 \family default
3831 ) give you access to documentation even on things which are not really defined
3832 ) give you access to documentation even on things which are not really defined
3832 as separate identifiers.
3833 as separate identifiers.
3833 Try for example typing
3834 Try for example typing
3834 \family typewriter
3835 \family typewriter
3835 {}.get?
3836 {}.get?
3836 \family default
3837 \family default
3837 or after doing
3838 or after doing
3838 \family typewriter
3839 \family typewriter
3839 import os
3840 import os
3840 \family default
3841 \family default
3841 , type
3842 , type
3842 \family typewriter
3843 \family typewriter
3843 os.path.abspath??
3844 os.path.abspath??
3844 \family default
3845 \family default
3845 .
3846 .
3846 \layout Subsection
3847 \layout Subsection
3847
3848
3848
3849
3849 \begin_inset LatexCommand \label{sec:readline}
3850 \begin_inset LatexCommand \label{sec:readline}
3850
3851
3851 \end_inset
3852 \end_inset
3852
3853
3853 Readline-based features
3854 Readline-based features
3854 \layout Standard
3855 \layout Standard
3855
3856
3856 These features require the GNU readline library, so they won't work if your
3857 These features require the GNU readline library, so they won't work if your
3857 Python installation lacks readline support.
3858 Python installation lacks readline support.
3858 We will first describe the default behavior IPython uses, and then how
3859 We will first describe the default behavior IPython uses, and then how
3859 to change it to suit your preferences.
3860 to change it to suit your preferences.
3860 \layout Subsubsection
3861 \layout Subsubsection
3861
3862
3862 Command line completion
3863 Command line completion
3863 \layout Standard
3864 \layout Standard
3864
3865
3865 At any time, hitting TAB will complete any available python commands or
3866 At any time, hitting TAB will complete any available python commands or
3866 variable names, and show you a list of the possible completions if there's
3867 variable names, and show you a list of the possible completions if there's
3867 no unambiguous one.
3868 no unambiguous one.
3868 It will also complete filenames in the current directory if no python names
3869 It will also complete filenames in the current directory if no python names
3869 match what you've typed so far.
3870 match what you've typed so far.
3870 \layout Subsubsection
3871 \layout Subsubsection
3871
3872
3872 Search command history
3873 Search command history
3873 \layout Standard
3874 \layout Standard
3874
3875
3875 IPython provides two ways for searching through previous input and thus
3876 IPython provides two ways for searching through previous input and thus
3876 reduce the need for repetitive typing:
3877 reduce the need for repetitive typing:
3877 \layout Enumerate
3878 \layout Enumerate
3878
3879
3879 Start typing, and then use
3880 Start typing, and then use
3880 \family typewriter
3881 \family typewriter
3881 Ctrl-p
3882 Ctrl-p
3882 \family default
3883 \family default
3883 (previous,up) and
3884 (previous,up) and
3884 \family typewriter
3885 \family typewriter
3885 Ctrl-n
3886 Ctrl-n
3886 \family default
3887 \family default
3887 (next,down) to search through only the history items that match what you've
3888 (next,down) to search through only the history items that match what you've
3888 typed so far.
3889 typed so far.
3889 If you use
3890 If you use
3890 \family typewriter
3891 \family typewriter
3891 Ctrl-p/Ctrl-n
3892 Ctrl-p/Ctrl-n
3892 \family default
3893 \family default
3893 at a blank prompt, they just behave like normal arrow keys.
3894 at a blank prompt, they just behave like normal arrow keys.
3894 \layout Enumerate
3895 \layout Enumerate
3895
3896
3896 Hit
3897 Hit
3897 \family typewriter
3898 \family typewriter
3898 Ctrl-r
3899 Ctrl-r
3899 \family default
3900 \family default
3900 : opens a search prompt.
3901 : opens a search prompt.
3901 Begin typing and the system searches your history for lines that contain
3902 Begin typing and the system searches your history for lines that contain
3902 what you've typed so far, completing as much as it can.
3903 what you've typed so far, completing as much as it can.
3903 \layout Subsubsection
3904 \layout Subsubsection
3904
3905
3905 Persistent command history across sessions
3906 Persistent command history across sessions
3906 \layout Standard
3907 \layout Standard
3907
3908
3908 IPython will save your input history when it leaves and reload it next time
3909 IPython will save your input history when it leaves and reload it next time
3909 you restart it.
3910 you restart it.
3910 By default, the history file is named
3911 By default, the history file is named
3911 \family typewriter
3912 \family typewriter
3912 $IPYTHONDIR/history
3913 $IPYTHONDIR/history
3913 \family default
3914 \family default
3914 , but if you've loaded a named profile, '
3915 , but if you've loaded a named profile, '
3915 \family typewriter
3916 \family typewriter
3916 -PROFILE_NAME
3917 -PROFILE_NAME
3917 \family default
3918 \family default
3918 ' is appended to the name.
3919 ' is appended to the name.
3919 This allows you to keep separate histories related to various tasks: commands
3920 This allows you to keep separate histories related to various tasks: commands
3920 related to numerical work will not be clobbered by a system shell history,
3921 related to numerical work will not be clobbered by a system shell history,
3921 for example.
3922 for example.
3922 \layout Subsubsection
3923 \layout Subsubsection
3923
3924
3924 Autoindent
3925 Autoindent
3925 \layout Standard
3926 \layout Standard
3926
3927
3927 IPython can recognize lines ending in ':' and indent the next line, while
3928 IPython can recognize lines ending in ':' and indent the next line, while
3928 also un-indenting automatically after 'raise' or 'return'.
3929 also un-indenting automatically after 'raise' or 'return'.
3929
3930
3930 \layout Standard
3931 \layout Standard
3931
3932
3932 This feature uses the readline library, so it will honor your
3933 This feature uses the readline library, so it will honor your
3933 \family typewriter
3934 \family typewriter
3934 ~/.inputrc
3935 ~/.inputrc
3935 \family default
3936 \family default
3936 configuration (or whatever file your
3937 configuration (or whatever file your
3937 \family typewriter
3938 \family typewriter
3938 INPUTRC
3939 INPUTRC
3939 \family default
3940 \family default
3940 variable points to).
3941 variable points to).
3941 Adding the following lines to your
3942 Adding the following lines to your
3942 \family typewriter
3943 \family typewriter
3943 .inputrc
3944 .inputrc
3944 \family default
3945 \family default
3945 file can make indenting/unindenting more convenient (
3946 file can make indenting/unindenting more convenient (
3946 \family typewriter
3947 \family typewriter
3947 M-i
3948 M-i
3948 \family default
3949 \family default
3949 indents,
3950 indents,
3950 \family typewriter
3951 \family typewriter
3951 M-u
3952 M-u
3952 \family default
3953 \family default
3953 unindents):
3954 unindents):
3954 \layout Standard
3955 \layout Standard
3955
3956
3956
3957
3957 \family typewriter
3958 \family typewriter
3958 $if Python
3959 $if Python
3959 \newline
3960 \newline
3960 "
3961 "
3961 \backslash
3962 \backslash
3962 M-i": "\SpecialChar ~
3963 M-i": "\SpecialChar ~
3963 \SpecialChar ~
3964 \SpecialChar ~
3964 \SpecialChar ~
3965 \SpecialChar ~
3965 \SpecialChar ~
3966 \SpecialChar ~
3966 "
3967 "
3967 \newline
3968 \newline
3968 "
3969 "
3969 \backslash
3970 \backslash
3970 M-u": "
3971 M-u": "
3971 \backslash
3972 \backslash
3972 d
3973 d
3973 \backslash
3974 \backslash
3974 d
3975 d
3975 \backslash
3976 \backslash
3976 d
3977 d
3977 \backslash
3978 \backslash
3978 d"
3979 d"
3979 \newline
3980 \newline
3980 $endif
3981 $endif
3981 \layout Standard
3982 \layout Standard
3982
3983
3983 Note that there are 4 spaces between the quote marks after
3984 Note that there are 4 spaces between the quote marks after
3984 \family typewriter
3985 \family typewriter
3985 "M-i"
3986 "M-i"
3986 \family default
3987 \family default
3987 above.
3988 above.
3988 \layout Standard
3989 \layout Standard
3989
3990
3990
3991
3991 \series bold
3992 \series bold
3992 Warning:
3993 Warning:
3993 \series default
3994 \series default
3994 this feature is ON by default, but it can cause problems with the pasting
3995 this feature is ON by default, but it can cause problems with the pasting
3995 of multi-line indented code (the pasted code gets re-indented on each line).
3996 of multi-line indented code (the pasted code gets re-indented on each line).
3996 A magic function
3997 A magic function
3997 \family typewriter
3998 \family typewriter
3998 %autoindent
3999 %autoindent
3999 \family default
4000 \family default
4000 allows you to toggle it on/off at runtime.
4001 allows you to toggle it on/off at runtime.
4001 You can also disable it permanently on in your
4002 You can also disable it permanently on in your
4002 \family typewriter
4003 \family typewriter
4003 ipythonrc
4004 ipythonrc
4004 \family default
4005 \family default
4005 file (set
4006 file (set
4006 \family typewriter
4007 \family typewriter
4007 autoindent 0
4008 autoindent 0
4008 \family default
4009 \family default
4009 ).
4010 ).
4010 \layout Subsubsection
4011 \layout Subsubsection
4011
4012
4012 Customizing readline behavior
4013 Customizing readline behavior
4013 \layout Standard
4014 \layout Standard
4014
4015
4015 All these features are based on the GNU readline library, which has an extremely
4016 All these features are based on the GNU readline library, which has an extremely
4016 customizable interface.
4017 customizable interface.
4017 Normally, readline is configured via a file which defines the behavior
4018 Normally, readline is configured via a file which defines the behavior
4018 of the library; the details of the syntax for this can be found in the
4019 of the library; the details of the syntax for this can be found in the
4019 readline documentation available with your system or on the Internet.
4020 readline documentation available with your system or on the Internet.
4020 IPython doesn't read this file (if it exists) directly, but it does support
4021 IPython doesn't read this file (if it exists) directly, but it does support
4021 passing to readline valid options via a simple interface.
4022 passing to readline valid options via a simple interface.
4022 In brief, you can customize readline by setting the following options in
4023 In brief, you can customize readline by setting the following options in
4023 your
4024 your
4024 \family typewriter
4025 \family typewriter
4025 ipythonrc
4026 ipythonrc
4026 \family default
4027 \family default
4027 configuration file (note that these options can
4028 configuration file (note that these options can
4028 \emph on
4029 \emph on
4029 not
4030 not
4030 \emph default
4031 \emph default
4031 be specified at the command line):
4032 be specified at the command line):
4032 \layout List
4033 \layout List
4033 \labelwidthstring 00.00.0000
4034 \labelwidthstring 00.00.0000
4034
4035
4035
4036
4036 \family typewriter
4037 \family typewriter
4037 \series bold
4038 \series bold
4038 readline_parse_and_bind:
4039 readline_parse_and_bind:
4039 \family default
4040 \family default
4040 \series default
4041 \series default
4041 this option can appear as many times as you want, each time defining a
4042 this option can appear as many times as you want, each time defining a
4042 string to be executed via a
4043 string to be executed via a
4043 \family typewriter
4044 \family typewriter
4044 readline.parse_and_bind()
4045 readline.parse_and_bind()
4045 \family default
4046 \family default
4046 command.
4047 command.
4047 The syntax for valid commands of this kind can be found by reading the
4048 The syntax for valid commands of this kind can be found by reading the
4048 documentation for the GNU readline library, as these commands are of the
4049 documentation for the GNU readline library, as these commands are of the
4049 kind which readline accepts in its configuration file.
4050 kind which readline accepts in its configuration file.
4050 \layout List
4051 \layout List
4051 \labelwidthstring 00.00.0000
4052 \labelwidthstring 00.00.0000
4052
4053
4053
4054
4054 \family typewriter
4055 \family typewriter
4055 \series bold
4056 \series bold
4056 readline_remove_delims:
4057 readline_remove_delims:
4057 \family default
4058 \family default
4058 \series default
4059 \series default
4059 a string of characters to be removed from the default word-delimiters list
4060 a string of characters to be removed from the default word-delimiters list
4060 used by readline, so that completions may be performed on strings which
4061 used by readline, so that completions may be performed on strings which
4061 contain them.
4062 contain them.
4062 Do not change the default value unless you know what you're doing.
4063 Do not change the default value unless you know what you're doing.
4063 \layout List
4064 \layout List
4064 \labelwidthstring 00.00.0000
4065 \labelwidthstring 00.00.0000
4065
4066
4066
4067
4067 \family typewriter
4068 \family typewriter
4068 \series bold
4069 \series bold
4069 readline_omit__names
4070 readline_omit__names
4070 \family default
4071 \family default
4071 \series default
4072 \series default
4072 : when tab-completion is enabled, hitting
4073 : when tab-completion is enabled, hitting
4073 \family typewriter
4074 \family typewriter
4074 <tab>
4075 <tab>
4075 \family default
4076 \family default
4076 after a '
4077 after a '
4077 \family typewriter
4078 \family typewriter
4078 .
4079 .
4079 \family default
4080 \family default
4080 ' in a name will complete all attributes of an object, including all the
4081 ' in a name will complete all attributes of an object, including all the
4081 special methods whose names include double underscores (like
4082 special methods whose names include double underscores (like
4082 \family typewriter
4083 \family typewriter
4083 __getitem__
4084 __getitem__
4084 \family default
4085 \family default
4085 or
4086 or
4086 \family typewriter
4087 \family typewriter
4087 __class__
4088 __class__
4088 \family default
4089 \family default
4089 ).
4090 ).
4090 If you'd rather not see these names by default, you can set this option
4091 If you'd rather not see these names by default, you can set this option
4091 to 1.
4092 to 1.
4092 Note that even when this option is set, you can still see those names by
4093 Note that even when this option is set, you can still see those names by
4093 explicitly typing a
4094 explicitly typing a
4094 \family typewriter
4095 \family typewriter
4095 _
4096 _
4096 \family default
4097 \family default
4097 after the period and hitting
4098 after the period and hitting
4098 \family typewriter
4099 \family typewriter
4099 <tab>
4100 <tab>
4100 \family default
4101 \family default
4101 : '
4102 : '
4102 \family typewriter
4103 \family typewriter
4103 name._<tab>
4104 name._<tab>
4104 \family default
4105 \family default
4105 ' will always complete attribute names starting with '
4106 ' will always complete attribute names starting with '
4106 \family typewriter
4107 \family typewriter
4107 _
4108 _
4108 \family default
4109 \family default
4109 '.
4110 '.
4110 \layout List
4111 \layout List
4111 \labelwidthstring 00.00.0000
4112 \labelwidthstring 00.00.0000
4112
4113
4113 \SpecialChar ~
4114 \SpecialChar ~
4114 This option is off by default so that new users see all attributes of any
4115 This option is off by default so that new users see all attributes of any
4115 objects they are dealing with.
4116 objects they are dealing with.
4116 \layout Standard
4117 \layout Standard
4117
4118
4118 You will find the default values along with a corresponding detailed explanation
4119 You will find the default values along with a corresponding detailed explanation
4119 in your
4120 in your
4120 \family typewriter
4121 \family typewriter
4121 ipythonrc
4122 ipythonrc
4122 \family default
4123 \family default
4123 file.
4124 file.
4124 \layout Subsection
4125 \layout Subsection
4125
4126
4126 Session logging and restoring
4127 Session logging and restoring
4127 \layout Standard
4128 \layout Standard
4128
4129
4129 You can log all input from a session either by starting IPython with the
4130 You can log all input from a session either by starting IPython with the
4130 command line switches
4131 command line switches
4131 \family typewriter
4132 \family typewriter
4132 -log
4133 -log
4133 \family default
4134 \family default
4134 or
4135 or
4135 \family typewriter
4136 \family typewriter
4136 -logfile
4137 -logfile
4137 \family default
4138 \family default
4138 (see sec.
4139 (see sec.
4139
4140
4140 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
4141 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
4141
4142
4142 \end_inset
4143 \end_inset
4143
4144
4144 )or by activating the logging at any moment with the magic function
4145 )or by activating the logging at any moment with the magic function
4145 \family typewriter
4146 \family typewriter
4146 %logstart
4147 %logstart
4147 \family default
4148 \family default
4148 .
4149 .
4149
4150
4150 \layout Standard
4151 \layout Standard
4151
4152
4152 Log files can later be reloaded with the
4153 Log files can later be reloaded with the
4153 \family typewriter
4154 \family typewriter
4154 -logplay
4155 -logplay
4155 \family default
4156 \family default
4156 option and IPython will attempt to 'replay' the log by executing all the
4157 option and IPython will attempt to 'replay' the log by executing all the
4157 lines in it, thus restoring the state of a previous session.
4158 lines in it, thus restoring the state of a previous session.
4158 This feature is not quite perfect, but can still be useful in many cases.
4159 This feature is not quite perfect, but can still be useful in many cases.
4159 \layout Standard
4160 \layout Standard
4160
4161
4161 The log files can also be used as a way to have a permanent record of any
4162 The log files can also be used as a way to have a permanent record of any
4162 code you wrote while experimenting.
4163 code you wrote while experimenting.
4163 Log files are regular text files which you can later open in your favorite
4164 Log files are regular text files which you can later open in your favorite
4164 text editor to extract code or to 'clean them up' before using them to
4165 text editor to extract code or to 'clean them up' before using them to
4165 replay a session.
4166 replay a session.
4166 \layout Standard
4167 \layout Standard
4167
4168
4168 The
4169 The
4169 \family typewriter
4170 \family typewriter
4170 %logstart
4171 %logstart
4171 \family default
4172 \family default
4172 function for activating logging in mid-session is used as follows:
4173 function for activating logging in mid-session is used as follows:
4173 \layout Standard
4174 \layout Standard
4174
4175
4175
4176
4176 \family typewriter
4177 \family typewriter
4177 %logstart [log_name [log_mode]]
4178 %logstart [log_name [log_mode]]
4178 \layout Standard
4179 \layout Standard
4179
4180
4180 If no name is given, it defaults to a file named
4181 If no name is given, it defaults to a file named
4181 \family typewriter
4182 \family typewriter
4182 'log'
4183 'log'
4183 \family default
4184 \family default
4184 in your IPYTHONDIR directory, in
4185 in your IPYTHONDIR directory, in
4185 \family typewriter
4186 \family typewriter
4186 'rotate'
4187 'rotate'
4187 \family default
4188 \family default
4188 mode (see below).
4189 mode (see below).
4189 \layout Standard
4190 \layout Standard
4190
4191
4191 '
4192 '
4192 \family typewriter
4193 \family typewriter
4193 %logstart name
4194 %logstart name
4194 \family default
4195 \family default
4195 ' saves to file
4196 ' saves to file
4196 \family typewriter
4197 \family typewriter
4197 'name'
4198 'name'
4198 \family default
4199 \family default
4199 in
4200 in
4200 \family typewriter
4201 \family typewriter
4201 'backup'
4202 'backup'
4202 \family default
4203 \family default
4203 mode.
4204 mode.
4204 It saves your history up to that point and then continues logging.
4205 It saves your history up to that point and then continues logging.
4205 \layout Standard
4206 \layout Standard
4206
4207
4207
4208
4208 \family typewriter
4209 \family typewriter
4209 %logstart
4210 %logstart
4210 \family default
4211 \family default
4211 takes a second optional parameter: logging mode.
4212 takes a second optional parameter: logging mode.
4212 This can be one of (note that the modes are given unquoted):
4213 This can be one of (note that the modes are given unquoted):
4213 \layout List
4214 \layout List
4214 \labelwidthstring 00.00.0000
4215 \labelwidthstring 00.00.0000
4215
4216
4216
4217
4217 \family typewriter
4218 \family typewriter
4218 over
4219 over
4219 \family default
4220 \family default
4220 : overwrite existing
4221 : overwrite existing
4221 \family typewriter
4222 \family typewriter
4222 log_name
4223 log_name
4223 \family default
4224 \family default
4224 .
4225 .
4225 \layout List
4226 \layout List
4226 \labelwidthstring 00.00.0000
4227 \labelwidthstring 00.00.0000
4227
4228
4228
4229
4229 \family typewriter
4230 \family typewriter
4230 backup
4231 backup
4231 \family default
4232 \family default
4232 : rename (if exists) to
4233 : rename (if exists) to
4233 \family typewriter
4234 \family typewriter
4234 log_name~
4235 log_name~
4235 \family default
4236 \family default
4236 and start
4237 and start
4237 \family typewriter
4238 \family typewriter
4238 log_name
4239 log_name
4239 \family default
4240 \family default
4240 .
4241 .
4241 \layout List
4242 \layout List
4242 \labelwidthstring 00.00.0000
4243 \labelwidthstring 00.00.0000
4243
4244
4244
4245
4245 \family typewriter
4246 \family typewriter
4246 append
4247 append
4247 \family default
4248 \family default
4248 : well, that says it.
4249 : well, that says it.
4249 \layout List
4250 \layout List
4250 \labelwidthstring 00.00.0000
4251 \labelwidthstring 00.00.0000
4251
4252
4252
4253
4253 \family typewriter
4254 \family typewriter
4254 rotate
4255 rotate
4255 \family default
4256 \family default
4256 : create rotating logs
4257 : create rotating logs
4257 \family typewriter
4258 \family typewriter
4258 log_name
4259 log_name
4259 \family default
4260 \family default
4260 .
4261 .
4261 \family typewriter
4262 \family typewriter
4262 1~
4263 1~
4263 \family default
4264 \family default
4264 ,
4265 ,
4265 \family typewriter
4266 \family typewriter
4266 log_name.2~
4267 log_name.2~
4267 \family default
4268 \family default
4268 , etc.
4269 , etc.
4269 \layout Standard
4270 \layout Standard
4270
4271
4271 The
4272 The
4272 \family typewriter
4273 \family typewriter
4273 %logoff
4274 %logoff
4274 \family default
4275 \family default
4275 and
4276 and
4276 \family typewriter
4277 \family typewriter
4277 %logon
4278 %logon
4278 \family default
4279 \family default
4279 functions allow you to temporarily stop and resume logging to a file which
4280 functions allow you to temporarily stop and resume logging to a file which
4280 had previously been started with
4281 had previously been started with
4281 \family typewriter
4282 \family typewriter
4282 %logstart
4283 %logstart
4283 \family default
4284 \family default
4284 .
4285 .
4285 They will fail (with an explanation) if you try to use them before logging
4286 They will fail (with an explanation) if you try to use them before logging
4286 has been started.
4287 has been started.
4287 \layout Subsection
4288 \layout Subsection
4288
4289
4289
4290
4290 \begin_inset LatexCommand \label{sub:System-shell-access}
4291 \begin_inset LatexCommand \label{sub:System-shell-access}
4291
4292
4292 \end_inset
4293 \end_inset
4293
4294
4294 System shell access
4295 System shell access
4295 \layout Standard
4296 \layout Standard
4296
4297
4297 Any input line beginning with a
4298 Any input line beginning with a
4298 \family typewriter
4299 \family typewriter
4299 !
4300 !
4300 \family default
4301 \family default
4301 character is passed verbatim (minus the
4302 character is passed verbatim (minus the
4302 \family typewriter
4303 \family typewriter
4303 !
4304 !
4304 \family default
4305 \family default
4305 , of course) to the underlying operating system.
4306 , of course) to the underlying operating system.
4306 For example, typing
4307 For example, typing
4307 \family typewriter
4308 \family typewriter
4308 !ls
4309 !ls
4309 \family default
4310 \family default
4310 will run
4311 will run
4311 \family typewriter
4312 \family typewriter
4312 'ls'
4313 'ls'
4313 \family default
4314 \family default
4314 in the current directory.
4315 in the current directory.
4315 \layout Subsubsection
4316 \layout Subsubsection
4316
4317
4317 Manual capture of command output
4318 Manual capture of command output
4318 \layout Standard
4319 \layout Standard
4319
4320
4320 If the input line begins with
4321 If the input line begins with
4321 \emph on
4322 \emph on
4322 two
4323 two
4323 \emph default
4324 \emph default
4324 exclamation marks,
4325 exclamation marks,
4325 \family typewriter
4326 \family typewriter
4326 !!
4327 !!
4327 \family default
4328 \family default
4328 , the command is executed but its output is captured and returned as a python
4329 , the command is executed but its output is captured and returned as a python
4329 list, split on newlines.
4330 list, split on newlines.
4330 Any output sent by the subprocess to standard error is printed separately,
4331 Any output sent by the subprocess to standard error is printed separately,
4331 so that the resulting list only captures standard output.
4332 so that the resulting list only captures standard output.
4332 The
4333 The
4333 \family typewriter
4334 \family typewriter
4334 !!
4335 !!
4335 \family default
4336 \family default
4336 syntax is a shorthand for the
4337 syntax is a shorthand for the
4337 \family typewriter
4338 \family typewriter
4338 %sx
4339 %sx
4339 \family default
4340 \family default
4340 magic command.
4341 magic command.
4341 \layout Standard
4342 \layout Standard
4342
4343
4343 Finally, the
4344 Finally, the
4344 \family typewriter
4345 \family typewriter
4345 %sc
4346 %sc
4346 \family default
4347 \family default
4347 magic (short for `shell capture') is similar to
4348 magic (short for `shell capture') is similar to
4348 \family typewriter
4349 \family typewriter
4349 %sx
4350 %sx
4350 \family default
4351 \family default
4351 , but allowing more fine-grained control of the capture details, and storing
4352 , but allowing more fine-grained control of the capture details, and storing
4352 the result directly into a named variable.
4353 the result directly into a named variable.
4353 \layout Standard
4354 \layout Standard
4354
4355
4355 See Sec.\SpecialChar ~
4356 See Sec.\SpecialChar ~
4356
4357
4357 \begin_inset LatexCommand \ref{sec:magic}
4358 \begin_inset LatexCommand \ref{sec:magic}
4358
4359
4359 \end_inset
4360 \end_inset
4360
4361
4361 for details on the magics
4362 for details on the magics
4362 \family typewriter
4363 \family typewriter
4363 %sc
4364 %sc
4364 \family default
4365 \family default
4365 and
4366 and
4366 \family typewriter
4367 \family typewriter
4367 %sx
4368 %sx
4368 \family default
4369 \family default
4369 , or use IPython's own help (
4370 , or use IPython's own help (
4370 \family typewriter
4371 \family typewriter
4371 sc?
4372 sc?
4372 \family default
4373 \family default
4373 and
4374 and
4374 \family typewriter
4375 \family typewriter
4375 sx?
4376 sx?
4376 \family default
4377 \family default
4377 ) for further details.
4378 ) for further details.
4378 \layout Standard
4379 \layout Standard
4379
4380
4380 IPython also allows you to expand the value of python variables when making
4381 IPython also allows you to expand the value of python variables when making
4381 system calls.
4382 system calls.
4382 Any python variable or expression which you prepend with
4383 Any python variable or expression which you prepend with
4383 \family typewriter
4384 \family typewriter
4384 $
4385 $
4385 \family default
4386 \family default
4386 will get expanded before the system call is made.
4387 will get expanded before the system call is made.
4387
4388
4388 \layout Standard
4389 \layout Standard
4389
4390
4390
4391
4391 \family typewriter
4392 \family typewriter
4392 In [1]: pyvar='Hello world'
4393 In [1]: pyvar='Hello world'
4393 \newline
4394 \newline
4394 In [2]: !echo "A python variable: $pyvar"
4395 In [2]: !echo "A python variable: $pyvar"
4395 \newline
4396 \newline
4396 A python variable: Hello world
4397 A python variable: Hello world
4397 \layout Standard
4398 \layout Standard
4398
4399
4399 If you want the shell to actually see a literal
4400 If you want the shell to actually see a literal
4400 \family typewriter
4401 \family typewriter
4401 $
4402 $
4402 \family default
4403 \family default
4403 , you need to type it twice:
4404 , you need to type it twice:
4404 \layout Standard
4405 \layout Standard
4405
4406
4406
4407
4407 \family typewriter
4408 \family typewriter
4408 In [3]: !echo "A system variable: $$HOME"
4409 In [3]: !echo "A system variable: $$HOME"
4409 \newline
4410 \newline
4410 A system variable: /home/fperez
4411 A system variable: /home/fperez
4411 \layout Standard
4412 \layout Standard
4412
4413
4413 You can pass arbitrary expressions, though you'll need to delimit them with
4414 You can pass arbitrary expressions, though you'll need to delimit them with
4414
4415
4415 \family typewriter
4416 \family typewriter
4416 {}
4417 {}
4417 \family default
4418 \family default
4418 if there is ambiguity as to the extent of the expression:
4419 if there is ambiguity as to the extent of the expression:
4419 \layout Standard
4420 \layout Standard
4420
4421
4421
4422
4422 \family typewriter
4423 \family typewriter
4423 In [5]: x=10
4424 In [5]: x=10
4424 \newline
4425 \newline
4425 In [6]: y=20
4426 In [6]: y=20
4426 \newline
4427 \newline
4427 In [13]: !echo $x+y
4428 In [13]: !echo $x+y
4428 \newline
4429 \newline
4429 10+y
4430 10+y
4430 \newline
4431 \newline
4431 In [7]: !echo ${x+y}
4432 In [7]: !echo ${x+y}
4432 \newline
4433 \newline
4433 30
4434 30
4434 \layout Standard
4435 \layout Standard
4435
4436
4436 Even object attributes can be expanded:
4437 Even object attributes can be expanded:
4437 \layout Standard
4438 \layout Standard
4438
4439
4439
4440
4440 \family typewriter
4441 \family typewriter
4441 In [12]: !echo $sys.argv
4442 In [12]: !echo $sys.argv
4442 \newline
4443 \newline
4443 [/home/fperez/usr/bin/ipython]
4444 [/home/fperez/usr/bin/ipython]
4444 \layout Subsection
4445 \layout Subsection
4445
4446
4446 System command aliases
4447 System command aliases
4447 \layout Standard
4448 \layout Standard
4448
4449
4449 The
4450 The
4450 \family typewriter
4451 \family typewriter
4451 %alias
4452 %alias
4452 \family default
4453 \family default
4453 magic function and the
4454 magic function and the
4454 \family typewriter
4455 \family typewriter
4455 alias
4456 alias
4456 \family default
4457 \family default
4457 option in the
4458 option in the
4458 \family typewriter
4459 \family typewriter
4459 ipythonrc
4460 ipythonrc
4460 \family default
4461 \family default
4461 configuration file allow you to define magic functions which are in fact
4462 configuration file allow you to define magic functions which are in fact
4462 system shell commands.
4463 system shell commands.
4463 These aliases can have parameters.
4464 These aliases can have parameters.
4464
4465
4465 \layout Standard
4466 \layout Standard
4466
4467
4467 '
4468 '
4468 \family typewriter
4469 \family typewriter
4469 %alias alias_name cmd
4470 %alias alias_name cmd
4470 \family default
4471 \family default
4471 ' defines '
4472 ' defines '
4472 \family typewriter
4473 \family typewriter
4473 alias_name
4474 alias_name
4474 \family default
4475 \family default
4475 ' as an alias for '
4476 ' as an alias for '
4476 \family typewriter
4477 \family typewriter
4477 cmd
4478 cmd
4478 \family default
4479 \family default
4479 '
4480 '
4480 \layout Standard
4481 \layout Standard
4481
4482
4482 Then, typing '
4483 Then, typing '
4483 \family typewriter
4484 \family typewriter
4484 %alias_name params
4485 %alias_name params
4485 \family default
4486 \family default
4486 ' will execute the system command '
4487 ' will execute the system command '
4487 \family typewriter
4488 \family typewriter
4488 cmd params
4489 cmd params
4489 \family default
4490 \family default
4490 ' (from your underlying operating system).
4491 ' (from your underlying operating system).
4491
4492
4492 \layout Standard
4493 \layout Standard
4493
4494
4494 You can also define aliases with parameters using
4495 You can also define aliases with parameters using
4495 \family typewriter
4496 \family typewriter
4496 %s
4497 %s
4497 \family default
4498 \family default
4498 specifiers (one per parameter).
4499 specifiers (one per parameter).
4499 The following example defines the
4500 The following example defines the
4500 \family typewriter
4501 \family typewriter
4501 %parts
4502 %parts
4502 \family default
4503 \family default
4503 function as an alias to the command '
4504 function as an alias to the command '
4504 \family typewriter
4505 \family typewriter
4505 echo first %s second %s
4506 echo first %s second %s
4506 \family default
4507 \family default
4507 ' where each
4508 ' where each
4508 \family typewriter
4509 \family typewriter
4509 %s
4510 %s
4510 \family default
4511 \family default
4511 will be replaced by a positional parameter to the call to
4512 will be replaced by a positional parameter to the call to
4512 \family typewriter
4513 \family typewriter
4513 %parts:
4514 %parts:
4514 \layout Standard
4515 \layout Standard
4515
4516
4516
4517
4517 \family typewriter
4518 \family typewriter
4518 In [1]: alias parts echo first %s second %s
4519 In [1]: alias parts echo first %s second %s
4519 \newline
4520 \newline
4520 In [2]: %parts A B
4521 In [2]: %parts A B
4521 \newline
4522 \newline
4522 first A second B
4523 first A second B
4523 \newline
4524 \newline
4524 In [3]: %parts A
4525 In [3]: %parts A
4525 \newline
4526 \newline
4526 Incorrect number of arguments: 2 expected.
4527 Incorrect number of arguments: 2 expected.
4527
4528
4528 \newline
4529 \newline
4529 parts is an alias to: 'echo first %s second %s'
4530 parts is an alias to: 'echo first %s second %s'
4530 \layout Standard
4531 \layout Standard
4531
4532
4532 If called with no parameters,
4533 If called with no parameters,
4533 \family typewriter
4534 \family typewriter
4534 %alias
4535 %alias
4535 \family default
4536 \family default
4536 prints the table of currently defined aliases.
4537 prints the table of currently defined aliases.
4537 \layout Standard
4538 \layout Standard
4538
4539
4539 The
4540 The
4540 \family typewriter
4541 \family typewriter
4541 %rehash/rehashx
4542 %rehash/rehashx
4542 \family default
4543 \family default
4543 magics allow you to load your entire
4544 magics allow you to load your entire
4544 \family typewriter
4545 \family typewriter
4545 $PATH
4546 $PATH
4546 \family default
4547 \family default
4547 as ipython aliases.
4548 as ipython aliases.
4548 See their respective docstrings (or sec.\SpecialChar ~
4549 See their respective docstrings (or sec.\SpecialChar ~
4549
4550
4550 \begin_inset LatexCommand \ref{sec:magic}
4551 \begin_inset LatexCommand \ref{sec:magic}
4551
4552
4552 \end_inset
4553 \end_inset
4553
4554
4554 for further details).
4555 for further details).
4555 \layout Subsection
4556 \layout Subsection
4556
4557
4557
4558
4558 \begin_inset LatexCommand \label{sec:dreload}
4559 \begin_inset LatexCommand \label{sec:dreload}
4559
4560
4560 \end_inset
4561 \end_inset
4561
4562
4562 Recursive reload
4563 Recursive reload
4563 \layout Standard
4564 \layout Standard
4564
4565
4565 The
4566 The
4566 \family typewriter
4567 \family typewriter
4567 %dreload
4568 %dreload
4568 \family default
4569 \family default
4569 command does a recursive reload of a module: changes made to the module
4570 command does a recursive reload of a module: changes made to the module
4570 since you imported will actually be available without having to exit.
4571 since you imported will actually be available without having to exit.
4571 \layout Subsection
4572 \layout Subsection
4572
4573
4573 Verbose and colored exception traceback printouts
4574 Verbose and colored exception traceback printouts
4574 \layout Standard
4575 \layout Standard
4575
4576
4576 IPython provides the option to see very detailed exception tracebacks, which
4577 IPython provides the option to see very detailed exception tracebacks, which
4577 can be especially useful when debugging large programs.
4578 can be especially useful when debugging large programs.
4578 You can run any Python file with the
4579 You can run any Python file with the
4579 \family typewriter
4580 \family typewriter
4580 %run
4581 %run
4581 \family default
4582 \family default
4582 function to benefit from these detailed tracebacks.
4583 function to benefit from these detailed tracebacks.
4583 Furthermore, both normal and verbose tracebacks can be colored (if your
4584 Furthermore, both normal and verbose tracebacks can be colored (if your
4584 terminal supports it) which makes them much easier to parse visually.
4585 terminal supports it) which makes them much easier to parse visually.
4585 \layout Standard
4586 \layout Standard
4586
4587
4587 See the magic
4588 See the magic
4588 \family typewriter
4589 \family typewriter
4589 xmode
4590 xmode
4590 \family default
4591 \family default
4591 and
4592 and
4592 \family typewriter
4593 \family typewriter
4593 colors
4594 colors
4594 \family default
4595 \family default
4595 functions for details (just type
4596 functions for details (just type
4596 \family typewriter
4597 \family typewriter
4597 %magic
4598 %magic
4598 \family default
4599 \family default
4599 ).
4600 ).
4600 \layout Standard
4601 \layout Standard
4601
4602
4602 These features are basically a terminal version of Ka-Ping Yee's
4603 These features are basically a terminal version of Ka-Ping Yee's
4603 \family typewriter
4604 \family typewriter
4604 cgitb
4605 cgitb
4605 \family default
4606 \family default
4606 module, now part of the standard Python library.
4607 module, now part of the standard Python library.
4607 \layout Subsection
4608 \layout Subsection
4608
4609
4609
4610
4610 \begin_inset LatexCommand \label{sec:cache_input}
4611 \begin_inset LatexCommand \label{sec:cache_input}
4611
4612
4612 \end_inset
4613 \end_inset
4613
4614
4614 Input caching system
4615 Input caching system
4615 \layout Standard
4616 \layout Standard
4616
4617
4617 IPython offers numbered prompts (In/Out) with input and output caching.
4618 IPython offers numbered prompts (In/Out) with input and output caching.
4618 All input is saved and can be retrieved as variables (besides the usual
4619 All input is saved and can be retrieved as variables (besides the usual
4619 arrow key recall).
4620 arrow key recall).
4620 \layout Standard
4621 \layout Standard
4621
4622
4622 The following GLOBAL variables always exist (so don't overwrite them!):
4623 The following GLOBAL variables always exist (so don't overwrite them!):
4623
4624
4624 \family typewriter
4625 \family typewriter
4625 _i
4626 _i
4626 \family default
4627 \family default
4627 : stores previous input.
4628 : stores previous input.
4628
4629
4629 \family typewriter
4630 \family typewriter
4630 _ii
4631 _ii
4631 \family default
4632 \family default
4632 : next previous.
4633 : next previous.
4633
4634
4634 \family typewriter
4635 \family typewriter
4635 _iii
4636 _iii
4636 \family default
4637 \family default
4637 : next-next previous.
4638 : next-next previous.
4638
4639
4639 \family typewriter
4640 \family typewriter
4640 _ih
4641 _ih
4641 \family default
4642 \family default
4642 : a list of all input
4643 : a list of all input
4643 \family typewriter
4644 \family typewriter
4644 _ih[n]
4645 _ih[n]
4645 \family default
4646 \family default
4646 is the input from line
4647 is the input from line
4647 \family typewriter
4648 \family typewriter
4648 n
4649 n
4649 \family default
4650 \family default
4650 and this list is aliased to the global variable
4651 and this list is aliased to the global variable
4651 \family typewriter
4652 \family typewriter
4652 In
4653 In
4653 \family default
4654 \family default
4654 .
4655 .
4655 If you overwrite
4656 If you overwrite
4656 \family typewriter
4657 \family typewriter
4657 In
4658 In
4658 \family default
4659 \family default
4659 with a variable of your own, you can remake the assignment to the internal
4660 with a variable of your own, you can remake the assignment to the internal
4660 list with a simple
4661 list with a simple
4661 \family typewriter
4662 \family typewriter
4662 'In=_ih'
4663 'In=_ih'
4663 \family default
4664 \family default
4664 .
4665 .
4665 \layout Standard
4666 \layout Standard
4666
4667
4667 Additionally, global variables named
4668 Additionally, global variables named
4668 \family typewriter
4669 \family typewriter
4669 _i<n>
4670 _i<n>
4670 \family default
4671 \family default
4671 are dynamically created (
4672 are dynamically created (
4672 \family typewriter
4673 \family typewriter
4673 <n>
4674 <n>
4674 \family default
4675 \family default
4675 being the prompt counter), such that
4676 being the prompt counter), such that
4676 \newline
4677 \newline
4677
4678
4678 \family typewriter
4679 \family typewriter
4679 _i<n> == _ih[<n>] == In[<n>].
4680 _i<n> == _ih[<n>] == In[<n>].
4680 \layout Standard
4681 \layout Standard
4681
4682
4682 For example, what you typed at prompt 14 is available as
4683 For example, what you typed at prompt 14 is available as
4683 \family typewriter
4684 \family typewriter
4684 _i14,
4685 _i14,
4685 \family default
4686 \family default
4686
4687
4687 \family typewriter
4688 \family typewriter
4688 _ih[14]
4689 _ih[14]
4689 \family default
4690 \family default
4690 and
4691 and
4691 \family typewriter
4692 \family typewriter
4692 In[14]
4693 In[14]
4693 \family default
4694 \family default
4694 .
4695 .
4695 \layout Standard
4696 \layout Standard
4696
4697
4697 This allows you to easily cut and paste multi line interactive prompts by
4698 This allows you to easily cut and paste multi line interactive prompts by
4698 printing them out: they print like a clean string, without prompt characters.
4699 printing them out: they print like a clean string, without prompt characters.
4699 You can also manipulate them like regular variables (they are strings),
4700 You can also manipulate them like regular variables (they are strings),
4700 modify or exec them (typing
4701 modify or exec them (typing
4701 \family typewriter
4702 \family typewriter
4702 'exec _i9'
4703 'exec _i9'
4703 \family default
4704 \family default
4704 will re-execute the contents of input prompt 9, '
4705 will re-execute the contents of input prompt 9, '
4705 \family typewriter
4706 \family typewriter
4706 exec In[9:14]+In[18]
4707 exec In[9:14]+In[18]
4707 \family default
4708 \family default
4708 ' will re-execute lines 9 through 13 and line 18).
4709 ' will re-execute lines 9 through 13 and line 18).
4709 \layout Standard
4710 \layout Standard
4710
4711
4711 You can also re-execute multiple lines of input easily by using the magic
4712 You can also re-execute multiple lines of input easily by using the magic
4712
4713
4713 \family typewriter
4714 \family typewriter
4714 %macro
4715 %macro
4715 \family default
4716 \family default
4716 function (which automates the process and allows re-execution without having
4717 function (which automates the process and allows re-execution without having
4717 to type '
4718 to type '
4718 \family typewriter
4719 \family typewriter
4719 exec
4720 exec
4720 \family default
4721 \family default
4721 ' every time).
4722 ' every time).
4722 The macro system also allows you to re-execute previous lines which include
4723 The macro system also allows you to re-execute previous lines which include
4723 magic function calls (which require special processing).
4724 magic function calls (which require special processing).
4724 Type
4725 Type
4725 \family typewriter
4726 \family typewriter
4726 %macro?
4727 %macro?
4727 \family default
4728 \family default
4728 or see sec.
4729 or see sec.
4729
4730
4730 \begin_inset LatexCommand \ref{sec:magic}
4731 \begin_inset LatexCommand \ref{sec:magic}
4731
4732
4732 \end_inset
4733 \end_inset
4733
4734
4734 for more details on the macro system.
4735 for more details on the macro system.
4735 \layout Standard
4736 \layout Standard
4736
4737
4737 A history function
4738 A history function
4738 \family typewriter
4739 \family typewriter
4739 %hist
4740 %hist
4740 \family default
4741 \family default
4741 allows you to see any part of your input history by printing a range of
4742 allows you to see any part of your input history by printing a range of
4742 the
4743 the
4743 \family typewriter
4744 \family typewriter
4744 _i
4745 _i
4745 \family default
4746 \family default
4746 variables.
4747 variables.
4747 \layout Subsection
4748 \layout Subsection
4748
4749
4749
4750
4750 \begin_inset LatexCommand \label{sec:cache_output}
4751 \begin_inset LatexCommand \label{sec:cache_output}
4751
4752
4752 \end_inset
4753 \end_inset
4753
4754
4754 Output caching system
4755 Output caching system
4755 \layout Standard
4756 \layout Standard
4756
4757
4757 For output that is returned from actions, a system similar to the input
4758 For output that is returned from actions, a system similar to the input
4758 cache exists but using
4759 cache exists but using
4759 \family typewriter
4760 \family typewriter
4760 _
4761 _
4761 \family default
4762 \family default
4762 instead of
4763 instead of
4763 \family typewriter
4764 \family typewriter
4764 _i
4765 _i
4765 \family default
4766 \family default
4766 .
4767 .
4767 Only actions that produce a result (NOT assignments, for example) are cached.
4768 Only actions that produce a result (NOT assignments, for example) are cached.
4768 If you are familiar with Mathematica, IPython's
4769 If you are familiar with Mathematica, IPython's
4769 \family typewriter
4770 \family typewriter
4770 _
4771 _
4771 \family default
4772 \family default
4772 variables behave exactly like Mathematica's
4773 variables behave exactly like Mathematica's
4773 \family typewriter
4774 \family typewriter
4774 %
4775 %
4775 \family default
4776 \family default
4776 variables.
4777 variables.
4777 \layout Standard
4778 \layout Standard
4778
4779
4779 The following GLOBAL variables always exist (so don't overwrite them!):
4780 The following GLOBAL variables always exist (so don't overwrite them!):
4780
4781
4781 \layout List
4782 \layout List
4782 \labelwidthstring 00.00.0000
4783 \labelwidthstring 00.00.0000
4783
4784
4784
4785
4785 \family typewriter
4786 \family typewriter
4786 \series bold
4787 \series bold
4787 _
4788 _
4788 \family default
4789 \family default
4789 \series default
4790 \series default
4790 (a
4791 (a
4791 \emph on
4792 \emph on
4792 single
4793 single
4793 \emph default
4794 \emph default
4794 underscore) : stores previous output, like Python's default interpreter.
4795 underscore) : stores previous output, like Python's default interpreter.
4795 \layout List
4796 \layout List
4796 \labelwidthstring 00.00.0000
4797 \labelwidthstring 00.00.0000
4797
4798
4798
4799
4799 \family typewriter
4800 \family typewriter
4800 \series bold
4801 \series bold
4801 __
4802 __
4802 \family default
4803 \family default
4803 \series default
4804 \series default
4804 (two underscores): next previous.
4805 (two underscores): next previous.
4805 \layout List
4806 \layout List
4806 \labelwidthstring 00.00.0000
4807 \labelwidthstring 00.00.0000
4807
4808
4808
4809
4809 \family typewriter
4810 \family typewriter
4810 \series bold
4811 \series bold
4811 ___
4812 ___
4812 \family default
4813 \family default
4813 \series default
4814 \series default
4814 (three underscores): next-next previous.
4815 (three underscores): next-next previous.
4815 \layout Standard
4816 \layout Standard
4816
4817
4817 Additionally, global variables named
4818 Additionally, global variables named
4818 \family typewriter
4819 \family typewriter
4819 _<n>
4820 _<n>
4820 \family default
4821 \family default
4821 are dynamically created (
4822 are dynamically created (
4822 \family typewriter
4823 \family typewriter
4823 <n>
4824 <n>
4824 \family default
4825 \family default
4825 being the prompt counter), such that the result of output
4826 being the prompt counter), such that the result of output
4826 \family typewriter
4827 \family typewriter
4827 <n>
4828 <n>
4828 \family default
4829 \family default
4829 is always available as
4830 is always available as
4830 \family typewriter
4831 \family typewriter
4831 _<n>
4832 _<n>
4832 \family default
4833 \family default
4833 (don't use the angle brackets, just the number, e.g.
4834 (don't use the angle brackets, just the number, e.g.
4834
4835
4835 \family typewriter
4836 \family typewriter
4836 _21
4837 _21
4837 \family default
4838 \family default
4838 ).
4839 ).
4839 \layout Standard
4840 \layout Standard
4840
4841
4841 These global variables are all stored in a global dictionary (not a list,
4842 These global variables are all stored in a global dictionary (not a list,
4842 since it only has entries for lines which returned a result) available
4843 since it only has entries for lines which returned a result) available
4843 under the names
4844 under the names
4844 \family typewriter
4845 \family typewriter
4845 _oh
4846 _oh
4846 \family default
4847 \family default
4847 and
4848 and
4848 \family typewriter
4849 \family typewriter
4849 Out
4850 Out
4850 \family default
4851 \family default
4851 (similar to
4852 (similar to
4852 \family typewriter
4853 \family typewriter
4853 _ih
4854 _ih
4854 \family default
4855 \family default
4855 and
4856 and
4856 \family typewriter
4857 \family typewriter
4857 In
4858 In
4858 \family default
4859 \family default
4859 ).
4860 ).
4860 So the output from line 12 can be obtained as
4861 So the output from line 12 can be obtained as
4861 \family typewriter
4862 \family typewriter
4862 _12
4863 _12
4863 \family default
4864 \family default
4864 ,
4865 ,
4865 \family typewriter
4866 \family typewriter
4866 Out[12]
4867 Out[12]
4867 \family default
4868 \family default
4868 or
4869 or
4869 \family typewriter
4870 \family typewriter
4870 _oh[12]
4871 _oh[12]
4871 \family default
4872 \family default
4872 .
4873 .
4873 If you accidentally overwrite the
4874 If you accidentally overwrite the
4874 \family typewriter
4875 \family typewriter
4875 Out
4876 Out
4876 \family default
4877 \family default
4877 variable you can recover it by typing
4878 variable you can recover it by typing
4878 \family typewriter
4879 \family typewriter
4879 'Out=_oh
4880 'Out=_oh
4880 \family default
4881 \family default
4881 ' at the prompt.
4882 ' at the prompt.
4882 \layout Standard
4883 \layout Standard
4883
4884
4884 This system obviously can potentially put heavy memory demands on your system,
4885 This system obviously can potentially put heavy memory demands on your system,
4885 since it prevents Python's garbage collector from removing any previously
4886 since it prevents Python's garbage collector from removing any previously
4886 computed results.
4887 computed results.
4887 You can control how many results are kept in memory with the option (at
4888 You can control how many results are kept in memory with the option (at
4888 the command line or in your
4889 the command line or in your
4889 \family typewriter
4890 \family typewriter
4890 ipythonrc
4891 ipythonrc
4891 \family default
4892 \family default
4892 file)
4893 file)
4893 \family typewriter
4894 \family typewriter
4894 cache_size
4895 cache_size
4895 \family default
4896 \family default
4896 .
4897 .
4897 If you set it to 0, the whole system is completely disabled and the prompts
4898 If you set it to 0, the whole system is completely disabled and the prompts
4898 revert to the classic
4899 revert to the classic
4899 \family typewriter
4900 \family typewriter
4900 '>>>'
4901 '>>>'
4901 \family default
4902 \family default
4902 of normal Python.
4903 of normal Python.
4903 \layout Subsection
4904 \layout Subsection
4904
4905
4905 Directory history
4906 Directory history
4906 \layout Standard
4907 \layout Standard
4907
4908
4908 Your history of visited directories is kept in the global list
4909 Your history of visited directories is kept in the global list
4909 \family typewriter
4910 \family typewriter
4910 _dh
4911 _dh
4911 \family default
4912 \family default
4912 , and the magic
4913 , and the magic
4913 \family typewriter
4914 \family typewriter
4914 %cd
4915 %cd
4915 \family default
4916 \family default
4916 command can be used to go to any entry in that list.
4917 command can be used to go to any entry in that list.
4917 The
4918 The
4918 \family typewriter
4919 \family typewriter
4919 %dhist
4920 %dhist
4920 \family default
4921 \family default
4921 command allows you to view this history.
4922 command allows you to view this history.
4922 \layout Subsection
4923 \layout Subsection
4923
4924
4924 Automatic parentheses and quotes
4925 Automatic parentheses and quotes
4925 \layout Standard
4926 \layout Standard
4926
4927
4927 These features were adapted from Nathan Gray's LazyPython.
4928 These features were adapted from Nathan Gray's LazyPython.
4928 They are meant to allow less typing for common situations.
4929 They are meant to allow less typing for common situations.
4929 \layout Subsubsection
4930 \layout Subsubsection
4930
4931
4931 Automatic parentheses
4932 Automatic parentheses
4932 \layout Standard
4933 \layout Standard
4933
4934
4934 Callable objects (i.e.
4935 Callable objects (i.e.
4935 functions, methods, etc) can be invoked like this (notice the commas between
4936 functions, methods, etc) can be invoked like this (notice the commas between
4936 the arguments):
4937 the arguments):
4937 \layout Standard
4938 \layout Standard
4938
4939
4939
4940
4940 \family typewriter
4941 \family typewriter
4941 >>> callable_ob arg1, arg2, arg3
4942 >>> callable_ob arg1, arg2, arg3
4942 \layout Standard
4943 \layout Standard
4943
4944
4944 and the input will be translated to this:
4945 and the input will be translated to this:
4945 \layout Standard
4946 \layout Standard
4946
4947
4947
4948
4948 \family typewriter
4949 \family typewriter
4949 --> callable_ob(arg1, arg2, arg3)
4950 --> callable_ob(arg1, arg2, arg3)
4950 \layout Standard
4951 \layout Standard
4951
4952
4952 You can force automatic parentheses by using '/' as the first character
4953 You can force automatic parentheses by using '/' as the first character
4953 of a line.
4954 of a line.
4954 For example:
4955 For example:
4955 \layout Standard
4956 \layout Standard
4956
4957
4957
4958
4958 \family typewriter
4959 \family typewriter
4959 >>> /globals # becomes 'globals()'
4960 >>> /globals # becomes 'globals()'
4960 \layout Standard
4961 \layout Standard
4961
4962
4962 Note that the '/' MUST be the first character on the line! This won't work:
4963 Note that the '/' MUST be the first character on the line! This won't work:
4963
4964
4964 \layout Standard
4965 \layout Standard
4965
4966
4966
4967
4967 \family typewriter
4968 \family typewriter
4968 >>> print /globals # syntax error
4969 >>> print /globals # syntax error
4969 \layout Standard
4970 \layout Standard
4970
4971
4971 In most cases the automatic algorithm should work, so you should rarely
4972 In most cases the automatic algorithm should work, so you should rarely
4972 need to explicitly invoke /.
4973 need to explicitly invoke /.
4973 One notable exception is if you are trying to call a function with a list
4974 One notable exception is if you are trying to call a function with a list
4974 of tuples as arguments (the parenthesis will confuse IPython):
4975 of tuples as arguments (the parenthesis will confuse IPython):
4975 \layout Standard
4976 \layout Standard
4976
4977
4977
4978
4978 \family typewriter
4979 \family typewriter
4979 In [1]: zip (1,2,3),(4,5,6) # won't work
4980 In [1]: zip (1,2,3),(4,5,6) # won't work
4980 \layout Standard
4981 \layout Standard
4981
4982
4982 but this will work:
4983 but this will work:
4983 \layout Standard
4984 \layout Standard
4984
4985
4985
4986
4986 \family typewriter
4987 \family typewriter
4987 In [2]: /zip (1,2,3),(4,5,6)
4988 In [2]: /zip (1,2,3),(4,5,6)
4988 \newline
4989 \newline
4989 ------> zip ((1,2,3),(4,5,6))
4990 ------> zip ((1,2,3),(4,5,6))
4990 \newline
4991 \newline
4991 Out[2]= [(1, 4), (2, 5), (3, 6)]
4992 Out[2]= [(1, 4), (2, 5), (3, 6)]
4992 \layout Standard
4993 \layout Standard
4993
4994
4994 IPython tells you that it has altered your command line by displaying the
4995 IPython tells you that it has altered your command line by displaying the
4995 new command line preceded by
4996 new command line preceded by
4996 \family typewriter
4997 \family typewriter
4997 -->
4998 -->
4998 \family default
4999 \family default
4999 .
5000 .
5000 e.g.:
5001 e.g.:
5001 \layout Standard
5002 \layout Standard
5002
5003
5003
5004
5004 \family typewriter
5005 \family typewriter
5005 In [18]: callable list
5006 In [18]: callable list
5006 \newline
5007 \newline
5007 -------> callable (list)
5008 -------> callable (list)
5008 \layout Subsubsection
5009 \layout Subsubsection
5009
5010
5010 Automatic quoting
5011 Automatic quoting
5011 \layout Standard
5012 \layout Standard
5012
5013
5013 You can force automatic quoting of a function's arguments by using
5014 You can force automatic quoting of a function's arguments by using
5014 \family typewriter
5015 \family typewriter
5015 `,'
5016 `,'
5016 \family default
5017 \family default
5017 or
5018 or
5018 \family typewriter
5019 \family typewriter
5019 `;'
5020 `;'
5020 \family default
5021 \family default
5021 as the first character of a line.
5022 as the first character of a line.
5022 For example:
5023 For example:
5023 \layout Standard
5024 \layout Standard
5024
5025
5025
5026
5026 \family typewriter
5027 \family typewriter
5027 >>> ,my_function /home/me # becomes my_function("/home/me")
5028 >>> ,my_function /home/me # becomes my_function("/home/me")
5028 \layout Standard
5029 \layout Standard
5029
5030
5030 If you use
5031 If you use
5031 \family typewriter
5032 \family typewriter
5032 `;'
5033 `;'
5033 \family default
5034 \family default
5034 instead, the whole argument is quoted as a single string (while
5035 instead, the whole argument is quoted as a single string (while
5035 \family typewriter
5036 \family typewriter
5036 `,'
5037 `,'
5037 \family default
5038 \family default
5038 splits on whitespace):
5039 splits on whitespace):
5039 \layout Standard
5040 \layout Standard
5040
5041
5041
5042
5042 \family typewriter
5043 \family typewriter
5043 >>> ,my_function a b c # becomes my_function("a","b","c")
5044 >>> ,my_function a b c # becomes my_function("a","b","c")
5044 \layout Standard
5045 \layout Standard
5045
5046
5046
5047
5047 \family typewriter
5048 \family typewriter
5048 >>> ;my_function a b c # becomes my_function("a b c")
5049 >>> ;my_function a b c # becomes my_function("a b c")
5049 \layout Standard
5050 \layout Standard
5050
5051
5051 Note that the `
5052 Note that the `
5052 \family typewriter
5053 \family typewriter
5053 ,
5054 ,
5054 \family default
5055 \family default
5055 ' or `
5056 ' or `
5056 \family typewriter
5057 \family typewriter
5057 ;
5058 ;
5058 \family default
5059 \family default
5059 ' MUST be the first character on the line! This won't work:
5060 ' MUST be the first character on the line! This won't work:
5060 \layout Standard
5061 \layout Standard
5061
5062
5062
5063
5063 \family typewriter
5064 \family typewriter
5064 >>> x = ,my_function /home/me # syntax error
5065 >>> x = ,my_function /home/me # syntax error
5065 \layout Section
5066 \layout Section
5066
5067
5067
5068
5068 \begin_inset LatexCommand \label{sec:customization}
5069 \begin_inset LatexCommand \label{sec:customization}
5069
5070
5070 \end_inset
5071 \end_inset
5071
5072
5072 Customization
5073 Customization
5073 \layout Standard
5074 \layout Standard
5074
5075
5075 As we've already mentioned, IPython reads a configuration file which can
5076 As we've already mentioned, IPython reads a configuration file which can
5076 be specified at the command line (
5077 be specified at the command line (
5077 \family typewriter
5078 \family typewriter
5078 -rcfile
5079 -rcfile
5079 \family default
5080 \family default
5080 ) or which by default is assumed to be called
5081 ) or which by default is assumed to be called
5081 \family typewriter
5082 \family typewriter
5082 ipythonrc
5083 ipythonrc
5083 \family default
5084 \family default
5084 .
5085 .
5085 Such a file is looked for in the current directory where IPython is started
5086 Such a file is looked for in the current directory where IPython is started
5086 and then in your
5087 and then in your
5087 \family typewriter
5088 \family typewriter
5088 IPYTHONDIR
5089 IPYTHONDIR
5089 \family default
5090 \family default
5090 , which allows you to have local configuration files for specific projects.
5091 , which allows you to have local configuration files for specific projects.
5091 In this section we will call these types of configuration files simply
5092 In this section we will call these types of configuration files simply
5092 rcfiles (short for resource configuration file).
5093 rcfiles (short for resource configuration file).
5093 \layout Standard
5094 \layout Standard
5094
5095
5095 The syntax of an rcfile is one of key-value pairs separated by whitespace,
5096 The syntax of an rcfile is one of key-value pairs separated by whitespace,
5096 one per line.
5097 one per line.
5097 Lines beginning with a
5098 Lines beginning with a
5098 \family typewriter
5099 \family typewriter
5099 #
5100 #
5100 \family default
5101 \family default
5101 are ignored as comments, but comments can
5102 are ignored as comments, but comments can
5102 \series bold
5103 \series bold
5103 not
5104 not
5104 \series default
5105 \series default
5105 be put on lines with data (the parser is fairly primitive).
5106 be put on lines with data (the parser is fairly primitive).
5106 Note that these are not python files, and this is deliberate, because it
5107 Note that these are not python files, and this is deliberate, because it
5107 allows us to do some things which would be quite tricky to implement if
5108 allows us to do some things which would be quite tricky to implement if
5108 they were normal python files.
5109 they were normal python files.
5109 \layout Standard
5110 \layout Standard
5110
5111
5111 First, an rcfile can contain permanent default values for almost all command
5112 First, an rcfile can contain permanent default values for almost all command
5112 line options (except things like
5113 line options (except things like
5113 \family typewriter
5114 \family typewriter
5114 -help
5115 -help
5115 \family default
5116 \family default
5116 or
5117 or
5117 \family typewriter
5118 \family typewriter
5118 -Version
5119 -Version
5119 \family default
5120 \family default
5120 ).
5121 ).
5121 Sec\SpecialChar ~
5122 Sec\SpecialChar ~
5122
5123
5123 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5124 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5124
5125
5125 \end_inset
5126 \end_inset
5126
5127
5127 contains a description of all command-line options.
5128 contains a description of all command-line options.
5128 However, values you explicitly specify at the command line override the
5129 However, values you explicitly specify at the command line override the
5129 values defined in the rcfile.
5130 values defined in the rcfile.
5130 \layout Standard
5131 \layout Standard
5131
5132
5132 Besides command line option values, the rcfile can specify values for certain
5133 Besides command line option values, the rcfile can specify values for certain
5133 extra special options which are not available at the command line.
5134 extra special options which are not available at the command line.
5134 These options are briefly described below.
5135 These options are briefly described below.
5135
5136
5136 \layout Standard
5137 \layout Standard
5137
5138
5138 Each of these options may appear as many times as you need it in the file.
5139 Each of these options may appear as many times as you need it in the file.
5139 \layout List
5140 \layout List
5140 \labelwidthstring 00.00.0000
5141 \labelwidthstring 00.00.0000
5141
5142
5142
5143
5143 \family typewriter
5144 \family typewriter
5144 \series bold
5145 \series bold
5145 include\SpecialChar ~
5146 include\SpecialChar ~
5146 <file1>\SpecialChar ~
5147 <file1>\SpecialChar ~
5147 <file2>\SpecialChar ~
5148 <file2>\SpecialChar ~
5148 ...
5149 ...
5149 \family default
5150 \family default
5150 \series default
5151 \series default
5151 : you can name
5152 : you can name
5152 \emph on
5153 \emph on
5153 other
5154 other
5154 \emph default
5155 \emph default
5155 rcfiles you want to recursively load up to 15 levels (don't use the
5156 rcfiles you want to recursively load up to 15 levels (don't use the
5156 \family typewriter
5157 \family typewriter
5157 <>
5158 <>
5158 \family default
5159 \family default
5159 brackets in your names!).
5160 brackets in your names!).
5160 This feature allows you to define a 'base' rcfile with general options
5161 This feature allows you to define a 'base' rcfile with general options
5161 and special-purpose files which can be loaded only when needed with particular
5162 and special-purpose files which can be loaded only when needed with particular
5162 configuration options.
5163 configuration options.
5163 To make this more convenient, IPython accepts the
5164 To make this more convenient, IPython accepts the
5164 \family typewriter
5165 \family typewriter
5165 -profile <name>
5166 -profile <name>
5166 \family default
5167 \family default
5167 option (abbreviates to
5168 option (abbreviates to
5168 \family typewriter
5169 \family typewriter
5169 -p <name
5170 -p <name
5170 \family default
5171 \family default
5171 >)
5172 >)
5172 \family typewriter
5173 \family typewriter
5173 which
5174 which
5174 \family default
5175 \family default
5175 tells it to look for an rcfile named
5176 tells it to look for an rcfile named
5176 \family typewriter
5177 \family typewriter
5177 ipythonrc-<name>
5178 ipythonrc-<name>
5178 \family default
5179 \family default
5179 .
5180 .
5180
5181
5181 \layout List
5182 \layout List
5182 \labelwidthstring 00.00.0000
5183 \labelwidthstring 00.00.0000
5183
5184
5184
5185
5185 \family typewriter
5186 \family typewriter
5186 \series bold
5187 \series bold
5187 import_mod\SpecialChar ~
5188 import_mod\SpecialChar ~
5188 <mod1>\SpecialChar ~
5189 <mod1>\SpecialChar ~
5189 <mod2>\SpecialChar ~
5190 <mod2>\SpecialChar ~
5190 ...
5191 ...
5191 \family default
5192 \family default
5192 \series default
5193 \series default
5193 : import modules with '
5194 : import modules with '
5194 \family typewriter
5195 \family typewriter
5195 import
5196 import
5196 \family default
5197 \family default
5197
5198
5198 \family typewriter
5199 \family typewriter
5199 <mod1>,<mod2>,...
5200 <mod1>,<mod2>,...
5200 \family default
5201 \family default
5201 '
5202 '
5202 \layout List
5203 \layout List
5203 \labelwidthstring 00.00.0000
5204 \labelwidthstring 00.00.0000
5204
5205
5205
5206
5206 \family typewriter
5207 \family typewriter
5207 \series bold
5208 \series bold
5208 import_some\SpecialChar ~
5209 import_some\SpecialChar ~
5209 <mod>\SpecialChar ~
5210 <mod>\SpecialChar ~
5210 <f1>\SpecialChar ~
5211 <f1>\SpecialChar ~
5211 <f2>\SpecialChar ~
5212 <f2>\SpecialChar ~
5212 ...
5213 ...
5213 \family default
5214 \family default
5214 \series default
5215 \series default
5215 : import functions with '
5216 : import functions with '
5216 \family typewriter
5217 \family typewriter
5217 from <mod> import
5218 from <mod> import
5218 \family default
5219 \family default
5219
5220
5220 \family typewriter
5221 \family typewriter
5221 <f1>,<f2>,...
5222 <f1>,<f2>,...
5222 \family default
5223 \family default
5223 '
5224 '
5224 \layout List
5225 \layout List
5225 \labelwidthstring 00.00.0000
5226 \labelwidthstring 00.00.0000
5226
5227
5227
5228
5228 \family typewriter
5229 \family typewriter
5229 \series bold
5230 \series bold
5230 import_all\SpecialChar ~
5231 import_all\SpecialChar ~
5231 <mod1>\SpecialChar ~
5232 <mod1>\SpecialChar ~
5232 <mod2>\SpecialChar ~
5233 <mod2>\SpecialChar ~
5233 ...
5234 ...
5234 \family default
5235 \family default
5235 \series default
5236 \series default
5236 : for each module listed import functions with '
5237 : for each module listed import functions with '
5237 \family typewriter
5238 \family typewriter
5238 from <mod> import *
5239 from <mod> import *
5239 \family default
5240 \family default
5240 '
5241 '
5241 \layout List
5242 \layout List
5242 \labelwidthstring 00.00.0000
5243 \labelwidthstring 00.00.0000
5243
5244
5244
5245
5245 \family typewriter
5246 \family typewriter
5246 \series bold
5247 \series bold
5247 execute\SpecialChar ~
5248 execute\SpecialChar ~
5248 <python\SpecialChar ~
5249 <python\SpecialChar ~
5249 code>
5250 code>
5250 \family default
5251 \family default
5251 \series default
5252 \series default
5252 : give any single-line python code to be executed.
5253 : give any single-line python code to be executed.
5253 \layout List
5254 \layout List
5254 \labelwidthstring 00.00.0000
5255 \labelwidthstring 00.00.0000
5255
5256
5256
5257
5257 \family typewriter
5258 \family typewriter
5258 \series bold
5259 \series bold
5259 execfile\SpecialChar ~
5260 execfile\SpecialChar ~
5260 <filename>
5261 <filename>
5261 \family default
5262 \family default
5262 \series default
5263 \series default
5263 : execute the python file given with an '
5264 : execute the python file given with an '
5264 \family typewriter
5265 \family typewriter
5265 execfile(filename)
5266 execfile(filename)
5266 \family default
5267 \family default
5267 ' command.
5268 ' command.
5268 Username expansion is performed on the given names.
5269 Username expansion is performed on the given names.
5269 So if you need any amount of extra fancy customization that won't fit in
5270 So if you need any amount of extra fancy customization that won't fit in
5270 any of the above 'canned' options, you can just put it in a separate python
5271 any of the above 'canned' options, you can just put it in a separate python
5271 file and execute it.
5272 file and execute it.
5272 \layout List
5273 \layout List
5273 \labelwidthstring 00.00.0000
5274 \labelwidthstring 00.00.0000
5274
5275
5275
5276
5276 \family typewriter
5277 \family typewriter
5277 \series bold
5278 \series bold
5278 alias\SpecialChar ~
5279 alias\SpecialChar ~
5279 <alias_def>
5280 <alias_def>
5280 \family default
5281 \family default
5281 \series default
5282 \series default
5282 : this is equivalent to calling '
5283 : this is equivalent to calling '
5283 \family typewriter
5284 \family typewriter
5284 %alias\SpecialChar ~
5285 %alias\SpecialChar ~
5285 <alias_def>
5286 <alias_def>
5286 \family default
5287 \family default
5287 ' at the IPython command line.
5288 ' at the IPython command line.
5288 This way, from within IPython you can do common system tasks without having
5289 This way, from within IPython you can do common system tasks without having
5289 to exit it or use the
5290 to exit it or use the
5290 \family typewriter
5291 \family typewriter
5291 !
5292 !
5292 \family default
5293 \family default
5293 escape.
5294 escape.
5294 IPython isn't meant to be a shell replacement, but it is often very useful
5295 IPython isn't meant to be a shell replacement, but it is often very useful
5295 to be able to do things with files while testing code.
5296 to be able to do things with files while testing code.
5296 This gives you the flexibility to have within IPython any aliases you may
5297 This gives you the flexibility to have within IPython any aliases you may
5297 be used to under your normal system shell.
5298 be used to under your normal system shell.
5298 \layout Subsection
5299 \layout Subsection
5299
5300
5300
5301
5301 \begin_inset LatexCommand \label{sec:ipytonrc-sample}
5302 \begin_inset LatexCommand \label{sec:ipytonrc-sample}
5302
5303
5303 \end_inset
5304 \end_inset
5304
5305
5305 Sample
5306 Sample
5306 \family typewriter
5307 \family typewriter
5307 ipythonrc
5308 ipythonrc
5308 \family default
5309 \family default
5309 file
5310 file
5310 \layout Standard
5311 \layout Standard
5311
5312
5312 The default rcfile, called
5313 The default rcfile, called
5313 \family typewriter
5314 \family typewriter
5314 ipythonrc
5315 ipythonrc
5315 \family default
5316 \family default
5316 and supplied in your
5317 and supplied in your
5317 \family typewriter
5318 \family typewriter
5318 IPYTHONDIR
5319 IPYTHONDIR
5319 \family default
5320 \family default
5320 directory contains lots of comments on all of these options.
5321 directory contains lots of comments on all of these options.
5321 We reproduce it here for reference:
5322 We reproduce it here for reference:
5322 \layout Standard
5323 \layout Standard
5323
5324
5324
5325
5325 \begin_inset Include \verbatiminput{../IPython/UserConfig/ipythonrc}
5326 \begin_inset Include \verbatiminput{../IPython/UserConfig/ipythonrc}
5326 preview false
5327 preview false
5327
5328
5328 \end_inset
5329 \end_inset
5329
5330
5330
5331
5331 \layout Subsection
5332 \layout Subsection
5332
5333
5333
5334
5334 \begin_inset LatexCommand \label{sec:prompts}
5335 \begin_inset LatexCommand \label{sec:prompts}
5335
5336
5336 \end_inset
5337 \end_inset
5337
5338
5338 Fine-tuning your prompt
5339 Fine-tuning your prompt
5339 \layout Standard
5340 \layout Standard
5340
5341
5341 IPython's prompts can be customized using a syntax similar to that of the
5342 IPython's prompts can be customized using a syntax similar to that of the
5342
5343
5343 \family typewriter
5344 \family typewriter
5344 bash
5345 bash
5345 \family default
5346 \family default
5346 shell.
5347 shell.
5347 Many of
5348 Many of
5348 \family typewriter
5349 \family typewriter
5349 bash
5350 bash
5350 \family default
5351 \family default
5351 's escapes are supported, as well as a few additional ones.
5352 's escapes are supported, as well as a few additional ones.
5352 We list them below:
5353 We list them below:
5353 \layout Description
5354 \layout Description
5354
5355
5355
5356
5356 \backslash
5357 \backslash
5357 # the prompt/history count number
5358 # the prompt/history count number
5358 \layout Description
5359 \layout Description
5359
5360
5360
5361
5361 \backslash
5362 \backslash
5362 D the prompt/history count, with the actual digits replaced by dots.
5363 D the prompt/history count, with the actual digits replaced by dots.
5363 Used mainly in continuation prompts (prompt_in2)
5364 Used mainly in continuation prompts (prompt_in2)
5364 \layout Description
5365 \layout Description
5365
5366
5366
5367
5367 \backslash
5368 \backslash
5368 w the current working directory
5369 w the current working directory
5369 \layout Description
5370 \layout Description
5370
5371
5371
5372
5372 \backslash
5373 \backslash
5373 W the basename of current working directory
5374 W the basename of current working directory
5374 \layout Description
5375 \layout Description
5375
5376
5376
5377
5377 \backslash
5378 \backslash
5378 X
5379 X
5379 \emph on
5380 \emph on
5380 n
5381 n
5381 \emph default
5382 \emph default
5382 where
5383 where
5383 \begin_inset Formula $n=0\ldots5.$
5384 \begin_inset Formula $n=0\ldots5.$
5384 \end_inset
5385 \end_inset
5385
5386
5386 The current working directory, with
5387 The current working directory, with
5387 \family typewriter
5388 \family typewriter
5388 $HOME
5389 $HOME
5389 \family default
5390 \family default
5390 replaced by
5391 replaced by
5391 \family typewriter
5392 \family typewriter
5392 ~
5393 ~
5393 \family default
5394 \family default
5394 , and filtered out to contain only
5395 , and filtered out to contain only
5395 \begin_inset Formula $n$
5396 \begin_inset Formula $n$
5396 \end_inset
5397 \end_inset
5397
5398
5398 path elements
5399 path elements
5399 \layout Description
5400 \layout Description
5400
5401
5401
5402
5402 \backslash
5403 \backslash
5403 Y
5404 Y
5404 \emph on
5405 \emph on
5405 n
5406 n
5406 \emph default
5407 \emph default
5407 Similar to
5408 Similar to
5408 \backslash
5409 \backslash
5409 X
5410 X
5410 \emph on
5411 \emph on
5411 n
5412 n
5412 \emph default
5413 \emph default
5413 , but with the
5414 , but with the
5414 \begin_inset Formula $n+1$
5415 \begin_inset Formula $n+1$
5415 \end_inset
5416 \end_inset
5416
5417
5417 element included if it is
5418 element included if it is
5418 \family typewriter
5419 \family typewriter
5419 ~
5420 ~
5420 \family default
5421 \family default
5421 (this is similar to the behavior of the %c
5422 (this is similar to the behavior of the %c
5422 \emph on
5423 \emph on
5423 n
5424 n
5424 \emph default
5425 \emph default
5425 escapes in
5426 escapes in
5426 \family typewriter
5427 \family typewriter
5427 tcsh
5428 tcsh
5428 \family default
5429 \family default
5429 )
5430 )
5430 \layout Description
5431 \layout Description
5431
5432
5432
5433
5433 \backslash
5434 \backslash
5434 u the username of the current user
5435 u the username of the current user
5435 \layout Description
5436 \layout Description
5436
5437
5437
5438
5438 \backslash
5439 \backslash
5439 $ if the effective UID is 0, a #, otherwise a $
5440 $ if the effective UID is 0, a #, otherwise a $
5440 \layout Description
5441 \layout Description
5441
5442
5442
5443
5443 \backslash
5444 \backslash
5444 h the hostname up to the first `.'
5445 h the hostname up to the first `.'
5445 \layout Description
5446 \layout Description
5446
5447
5447
5448
5448 \backslash
5449 \backslash
5449 H the hostname
5450 H the hostname
5450 \layout Description
5451 \layout Description
5451
5452
5452
5453
5453 \backslash
5454 \backslash
5454 n a newline
5455 n a newline
5455 \layout Description
5456 \layout Description
5456
5457
5457
5458
5458 \backslash
5459 \backslash
5459 r a carriage return
5460 r a carriage return
5460 \layout Description
5461 \layout Description
5461
5462
5462
5463
5463 \backslash
5464 \backslash
5464 v IPython version string
5465 v IPython version string
5465 \layout Standard
5466 \layout Standard
5466
5467
5467 In addition to these, ANSI color escapes can be insterted into the prompts,
5468 In addition to these, ANSI color escapes can be insterted into the prompts,
5468 as
5469 as
5469 \family typewriter
5470 \family typewriter
5470
5471
5471 \backslash
5472 \backslash
5472 C_
5473 C_
5473 \emph on
5474 \emph on
5474 ColorName
5475 ColorName
5475 \family default
5476 \family default
5476 \emph default
5477 \emph default
5477 .
5478 .
5478 The list of valid color names is: Black, Blue, Brown, Cyan, DarkGray, Green,
5479 The list of valid color names is: Black, Blue, Brown, Cyan, DarkGray, Green,
5479 LightBlue, LightCyan, LightGray, LightGreen, LightPurple, LightRed, NoColor,
5480 LightBlue, LightCyan, LightGray, LightGreen, LightPurple, LightRed, NoColor,
5480 Normal, Purple, Red, White, Yellow.
5481 Normal, Purple, Red, White, Yellow.
5481 \layout Standard
5482 \layout Standard
5482
5483
5483 Finally, IPython supports the evaluation of arbitrary expressions in your
5484 Finally, IPython supports the evaluation of arbitrary expressions in your
5484 prompt string.
5485 prompt string.
5485 The prompt strings are evaluated through the syntax of PEP 215, but basically
5486 The prompt strings are evaluated through the syntax of PEP 215, but basically
5486 you can use
5487 you can use
5487 \family typewriter
5488 \family typewriter
5488 $x.y
5489 $x.y
5489 \family default
5490 \family default
5490 to expand the value of
5491 to expand the value of
5491 \family typewriter
5492 \family typewriter
5492 x.y
5493 x.y
5493 \family default
5494 \family default
5494 , and for more complicated expressions you can use braces:
5495 , and for more complicated expressions you can use braces:
5495 \family typewriter
5496 \family typewriter
5496 ${foo()+x}
5497 ${foo()+x}
5497 \family default
5498 \family default
5498 will call function
5499 will call function
5499 \family typewriter
5500 \family typewriter
5500 foo
5501 foo
5501 \family default
5502 \family default
5502 and add to it the value of
5503 and add to it the value of
5503 \family typewriter
5504 \family typewriter
5504 x
5505 x
5505 \family default
5506 \family default
5506 , before putting the result into your prompt.
5507 , before putting the result into your prompt.
5507 For example, using
5508 For example, using
5508 \newline
5509 \newline
5509
5510
5510 \family typewriter
5511 \family typewriter
5511 prompt_in1 '${commands.getoutput("uptime")}
5512 prompt_in1 '${commands.getoutput("uptime")}
5512 \backslash
5513 \backslash
5513 nIn [
5514 nIn [
5514 \backslash
5515 \backslash
5515 #]: '
5516 #]: '
5516 \newline
5517 \newline
5517
5518
5518 \family default
5519 \family default
5519 will print the result of the uptime command on each prompt (assuming the
5520 will print the result of the uptime command on each prompt (assuming the
5520
5521
5521 \family typewriter
5522 \family typewriter
5522 commands
5523 commands
5523 \family default
5524 \family default
5524 module has been imported in your
5525 module has been imported in your
5525 \family typewriter
5526 \family typewriter
5526 ipythonrc
5527 ipythonrc
5527 \family default
5528 \family default
5528 file).
5529 file).
5529 \layout Subsubsection
5530 \layout Subsubsection
5530
5531
5531 Prompt examples
5532 Prompt examples
5532 \layout Standard
5533 \layout Standard
5533
5534
5534 The following options in an ipythonrc file will give you IPython's default
5535 The following options in an ipythonrc file will give you IPython's default
5535 prompts:
5536 prompts:
5536 \layout Standard
5537 \layout Standard
5537
5538
5538
5539
5539 \family typewriter
5540 \family typewriter
5540 prompt_in1 'In [
5541 prompt_in1 'In [
5541 \backslash
5542 \backslash
5542 #]:'
5543 #]:'
5543 \newline
5544 \newline
5544 prompt_in2 '\SpecialChar ~
5545 prompt_in2 '\SpecialChar ~
5545 \SpecialChar ~
5546 \SpecialChar ~
5546 \SpecialChar ~
5547 \SpecialChar ~
5547 .
5548 .
5548 \backslash
5549 \backslash
5549 D.:'
5550 D.:'
5550 \newline
5551 \newline
5551 prompt_out 'Out[
5552 prompt_out 'Out[
5552 \backslash
5553 \backslash
5553 #]:'
5554 #]:'
5554 \layout Standard
5555 \layout Standard
5555
5556
5556 which look like this:
5557 which look like this:
5557 \layout Standard
5558 \layout Standard
5558
5559
5559
5560
5560 \family typewriter
5561 \family typewriter
5561 In [1]: 1+2
5562 In [1]: 1+2
5562 \newline
5563 \newline
5563 Out[1]: 3
5564 Out[1]: 3
5564 \layout Standard
5565 \layout Standard
5565
5566
5566
5567
5567 \family typewriter
5568 \family typewriter
5568 In [2]: for i in (1,2,3):
5569 In [2]: for i in (1,2,3):
5569 \newline
5570 \newline
5570
5571
5571 \begin_inset ERT
5572 \begin_inset ERT
5572 status Collapsed
5573 status Collapsed
5573
5574
5574 \layout Standard
5575 \layout Standard
5575
5576
5576 \backslash
5577 \backslash
5577 hspace*{0mm}
5578 hspace*{0mm}
5578 \end_inset
5579 \end_inset
5579
5580
5580 \SpecialChar ~
5581 \SpecialChar ~
5581 \SpecialChar ~
5582 \SpecialChar ~
5582 \SpecialChar ~
5583 \SpecialChar ~
5583 ...: \SpecialChar ~
5584 ...: \SpecialChar ~
5584 \SpecialChar ~
5585 \SpecialChar ~
5585 \SpecialChar ~
5586 \SpecialChar ~
5586 \SpecialChar ~
5587 \SpecialChar ~
5587 print i,
5588 print i,
5588 \newline
5589 \newline
5589
5590
5590 \begin_inset ERT
5591 \begin_inset ERT
5591 status Collapsed
5592 status Collapsed
5592
5593
5593 \layout Standard
5594 \layout Standard
5594
5595
5595 \backslash
5596 \backslash
5596 hspace*{0mm}
5597 hspace*{0mm}
5597 \end_inset
5598 \end_inset
5598
5599
5599 \SpecialChar ~
5600 \SpecialChar ~
5600 \SpecialChar ~
5601 \SpecialChar ~
5601 \SpecialChar ~
5602 \SpecialChar ~
5602 ...:
5603 ...:
5603 \newline
5604 \newline
5604 1 2 3
5605 1 2 3
5605 \layout Standard
5606 \layout Standard
5606
5607
5607 These will give you a very colorful prompt with path information:
5608 These will give you a very colorful prompt with path information:
5608 \layout Standard
5609 \layout Standard
5609
5610
5610
5611
5611 \family typewriter
5612 \family typewriter
5612 #prompt_in1 '
5613 #prompt_in1 '
5613 \backslash
5614 \backslash
5614 C_Red
5615 C_Red
5615 \backslash
5616 \backslash
5616 u
5617 u
5617 \backslash
5618 \backslash
5618 C_Blue[
5619 C_Blue[
5619 \backslash
5620 \backslash
5620 C_Cyan
5621 C_Cyan
5621 \backslash
5622 \backslash
5622 Y1
5623 Y1
5623 \backslash
5624 \backslash
5624 C_Blue]
5625 C_Blue]
5625 \backslash
5626 \backslash
5626 C_LightGreen
5627 C_LightGreen
5627 \backslash
5628 \backslash
5628 #>'
5629 #>'
5629 \newline
5630 \newline
5630 prompt_in2 ' ..
5631 prompt_in2 ' ..
5631 \backslash
5632 \backslash
5632 D>'
5633 D>'
5633 \newline
5634 \newline
5634 prompt_out '<
5635 prompt_out '<
5635 \backslash
5636 \backslash
5636 #>'
5637 #>'
5637 \layout Standard
5638 \layout Standard
5638
5639
5639 which look like this:
5640 which look like this:
5640 \layout Standard
5641 \layout Standard
5641
5642
5642
5643
5643 \family typewriter
5644 \family typewriter
5644 \color red
5645 \color red
5645 fperez
5646 fperez
5646 \color blue
5647 \color blue
5647 [
5648 [
5648 \color cyan
5649 \color cyan
5649 ~/ipython
5650 ~/ipython
5650 \color blue
5651 \color blue
5651 ]
5652 ]
5652 \color green
5653 \color green
5653 1>
5654 1>
5654 \color default
5655 \color default
5655 1+2
5656 1+2
5656 \newline
5657 \newline
5657
5658
5658 \begin_inset ERT
5659 \begin_inset ERT
5659 status Collapsed
5660 status Collapsed
5660
5661
5661 \layout Standard
5662 \layout Standard
5662
5663
5663 \backslash
5664 \backslash
5664 hspace*{0mm}
5665 hspace*{0mm}
5665 \end_inset
5666 \end_inset
5666
5667
5667 \SpecialChar ~
5668 \SpecialChar ~
5668 \SpecialChar ~
5669 \SpecialChar ~
5669 \SpecialChar ~
5670 \SpecialChar ~
5670 \SpecialChar ~
5671 \SpecialChar ~
5671 \SpecialChar ~
5672 \SpecialChar ~
5672 \SpecialChar ~
5673 \SpecialChar ~
5673 \SpecialChar ~
5674 \SpecialChar ~
5674 \SpecialChar ~
5675 \SpecialChar ~
5675 \SpecialChar ~
5676 \SpecialChar ~
5676 \SpecialChar ~
5677 \SpecialChar ~
5677 \SpecialChar ~
5678 \SpecialChar ~
5678 \SpecialChar ~
5679 \SpecialChar ~
5679 \SpecialChar ~
5680 \SpecialChar ~
5680 \SpecialChar ~
5681 \SpecialChar ~
5681 \SpecialChar ~
5682 \SpecialChar ~
5682 \SpecialChar ~
5683 \SpecialChar ~
5683
5684
5684 \color red
5685 \color red
5685 <1>
5686 <1>
5686 \color default
5687 \color default
5687 3
5688 3
5688 \newline
5689 \newline
5689
5690
5690 \color red
5691 \color red
5691 fperez
5692 fperez
5692 \color blue
5693 \color blue
5693 [
5694 [
5694 \color cyan
5695 \color cyan
5695 ~/ipython
5696 ~/ipython
5696 \color blue
5697 \color blue
5697 ]
5698 ]
5698 \color green
5699 \color green
5699 2>
5700 2>
5700 \color default
5701 \color default
5701 for i in (1,2,3):
5702 for i in (1,2,3):
5702 \newline
5703 \newline
5703
5704
5704 \begin_inset ERT
5705 \begin_inset ERT
5705 status Collapsed
5706 status Collapsed
5706
5707
5707 \layout Standard
5708 \layout Standard
5708
5709
5709 \backslash
5710 \backslash
5710 hspace*{0mm}
5711 hspace*{0mm}
5711 \end_inset
5712 \end_inset
5712
5713
5713 \SpecialChar ~
5714 \SpecialChar ~
5714 \SpecialChar ~
5715 \SpecialChar ~
5715 \SpecialChar ~
5716 \SpecialChar ~
5716 \SpecialChar ~
5717 \SpecialChar ~
5717 \SpecialChar ~
5718 \SpecialChar ~
5718 \SpecialChar ~
5719 \SpecialChar ~
5719 \SpecialChar ~
5720 \SpecialChar ~
5720 \SpecialChar ~
5721 \SpecialChar ~
5721 \SpecialChar ~
5722 \SpecialChar ~
5722 \SpecialChar ~
5723 \SpecialChar ~
5723 \SpecialChar ~
5724 \SpecialChar ~
5724 \SpecialChar ~
5725 \SpecialChar ~
5725 \SpecialChar ~
5726 \SpecialChar ~
5726 \SpecialChar ~
5727 \SpecialChar ~
5727 \SpecialChar ~
5728 \SpecialChar ~
5728
5729
5729 \color green
5730 \color green
5730 ...>
5731 ...>
5731 \color default
5732 \color default
5732 \SpecialChar ~
5733 \SpecialChar ~
5733 \SpecialChar ~
5734 \SpecialChar ~
5734 \SpecialChar ~
5735 \SpecialChar ~
5735 \SpecialChar ~
5736 \SpecialChar ~
5736 print i,
5737 print i,
5737 \newline
5738 \newline
5738
5739
5739 \begin_inset ERT
5740 \begin_inset ERT
5740 status Collapsed
5741 status Collapsed
5741
5742
5742 \layout Standard
5743 \layout Standard
5743
5744
5744 \backslash
5745 \backslash
5745 hspace*{0mm}
5746 hspace*{0mm}
5746 \end_inset
5747 \end_inset
5747
5748
5748 \SpecialChar ~
5749 \SpecialChar ~
5749 \SpecialChar ~
5750 \SpecialChar ~
5750 \SpecialChar ~
5751 \SpecialChar ~
5751 \SpecialChar ~
5752 \SpecialChar ~
5752 \SpecialChar ~
5753 \SpecialChar ~
5753 \SpecialChar ~
5754 \SpecialChar ~
5754 \SpecialChar ~
5755 \SpecialChar ~
5755 \SpecialChar ~
5756 \SpecialChar ~
5756 \SpecialChar ~
5757 \SpecialChar ~
5757 \SpecialChar ~
5758 \SpecialChar ~
5758 \SpecialChar ~
5759 \SpecialChar ~
5759 \SpecialChar ~
5760 \SpecialChar ~
5760 \SpecialChar ~
5761 \SpecialChar ~
5761 \SpecialChar ~
5762 \SpecialChar ~
5762 \SpecialChar ~
5763 \SpecialChar ~
5763
5764
5764 \color green
5765 \color green
5765 ...>
5766 ...>
5766 \color default
5767 \color default
5767
5768
5768 \newline
5769 \newline
5769 1 2 3
5770 1 2 3
5770 \layout Standard
5771 \layout Standard
5771
5772
5772 The following shows the usage of dynamic expression evaluation:
5773 The following shows the usage of dynamic expression evaluation:
5773 \layout Subsection
5774 \layout Subsection
5774
5775
5775
5776
5776 \begin_inset LatexCommand \label{sec:profiles}
5777 \begin_inset LatexCommand \label{sec:profiles}
5777
5778
5778 \end_inset
5779 \end_inset
5779
5780
5780 IPython profiles
5781 IPython profiles
5781 \layout Standard
5782 \layout Standard
5782
5783
5783 As we already mentioned, IPython supports the
5784 As we already mentioned, IPython supports the
5784 \family typewriter
5785 \family typewriter
5785 -profile
5786 -profile
5786 \family default
5787 \family default
5787 command-line option (see sec.
5788 command-line option (see sec.
5788
5789
5789 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5790 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5790
5791
5791 \end_inset
5792 \end_inset
5792
5793
5793 ).
5794 ).
5794 A profile is nothing more than a particular configuration file like your
5795 A profile is nothing more than a particular configuration file like your
5795 basic
5796 basic
5796 \family typewriter
5797 \family typewriter
5797 ipythonrc
5798 ipythonrc
5798 \family default
5799 \family default
5799 one, but with particular customizations for a specific purpose.
5800 one, but with particular customizations for a specific purpose.
5800 When you start IPython with '
5801 When you start IPython with '
5801 \family typewriter
5802 \family typewriter
5802 ipython -profile <name>
5803 ipython -profile <name>
5803 \family default
5804 \family default
5804 ', it assumes that in your
5805 ', it assumes that in your
5805 \family typewriter
5806 \family typewriter
5806 IPYTHONDIR
5807 IPYTHONDIR
5807 \family default
5808 \family default
5808 there is a file called
5809 there is a file called
5809 \family typewriter
5810 \family typewriter
5810 ipythonrc-<name>
5811 ipythonrc-<name>
5811 \family default
5812 \family default
5812 , and loads it instead of the normal
5813 , and loads it instead of the normal
5813 \family typewriter
5814 \family typewriter
5814 ipythonrc
5815 ipythonrc
5815 \family default
5816 \family default
5816 .
5817 .
5817 \layout Standard
5818 \layout Standard
5818
5819
5819 This system allows you to maintain multiple configurations which load modules,
5820 This system allows you to maintain multiple configurations which load modules,
5820 set options, define functions, etc.
5821 set options, define functions, etc.
5821 suitable for different tasks and activate them in a very simple manner.
5822 suitable for different tasks and activate them in a very simple manner.
5822 In order to avoid having to repeat all of your basic options (common things
5823 In order to avoid having to repeat all of your basic options (common things
5823 that don't change such as your color preferences, for example), any profile
5824 that don't change such as your color preferences, for example), any profile
5824 can include another configuration file.
5825 can include another configuration file.
5825 The most common way to use profiles is then to have each one include your
5826 The most common way to use profiles is then to have each one include your
5826 basic
5827 basic
5827 \family typewriter
5828 \family typewriter
5828 ipythonrc
5829 ipythonrc
5829 \family default
5830 \family default
5830 file as a starting point, and then add further customizations.
5831 file as a starting point, and then add further customizations.
5831 \layout Standard
5832 \layout Standard
5832
5833
5833 In sections
5834 In sections
5834 \begin_inset LatexCommand \ref{sec:syntax-extensions}
5835 \begin_inset LatexCommand \ref{sec:syntax-extensions}
5835
5836
5836 \end_inset
5837 \end_inset
5837
5838
5838 and
5839 and
5839 \begin_inset LatexCommand \ref{sec:Gnuplot}
5840 \begin_inset LatexCommand \ref{sec:Gnuplot}
5840
5841
5841 \end_inset
5842 \end_inset
5842
5843
5843 we discuss some particular profiles which come as part of the standard
5844 we discuss some particular profiles which come as part of the standard
5844 IPython distribution.
5845 IPython distribution.
5845 You may also look in your
5846 You may also look in your
5846 \family typewriter
5847 \family typewriter
5847 IPYTHONDIR
5848 IPYTHONDIR
5848 \family default
5849 \family default
5849 directory, any file whose name begins with
5850 directory, any file whose name begins with
5850 \family typewriter
5851 \family typewriter
5851 ipythonrc-
5852 ipythonrc-
5852 \family default
5853 \family default
5853 is a profile.
5854 is a profile.
5854 You can use those as examples for further customizations to suit your own
5855 You can use those as examples for further customizations to suit your own
5855 needs.
5856 needs.
5856 \layout Section
5857 \layout Section
5857
5858
5858
5859
5859 \begin_inset OptArg
5860 \begin_inset OptArg
5860 collapsed false
5861 collapsed false
5861
5862
5862 \layout Standard
5863 \layout Standard
5863
5864
5864 IPython as default...
5865 IPython as default...
5865 \end_inset
5866 \end_inset
5866
5867
5867 IPython as your default Python environment
5868 IPython as your default Python environment
5868 \layout Standard
5869 \layout Standard
5869
5870
5870 Python honors the environment variable
5871 Python honors the environment variable
5871 \family typewriter
5872 \family typewriter
5872 PYTHONSTARTUP
5873 PYTHONSTARTUP
5873 \family default
5874 \family default
5874 and will execute at startup the file referenced by this variable.
5875 and will execute at startup the file referenced by this variable.
5875 If you put at the end of this file the following two lines of code:
5876 If you put at the end of this file the following two lines of code:
5876 \layout Standard
5877 \layout Standard
5877
5878
5878
5879
5879 \family typewriter
5880 \family typewriter
5880 import IPython
5881 import IPython
5881 \newline
5882 \newline
5882 IPython.Shell.IPShell().mainloop(sys_exit=1)
5883 IPython.Shell.IPShell().mainloop(sys_exit=1)
5883 \layout Standard
5884 \layout Standard
5884
5885
5885 then IPython will be your working environment anytime you start Python.
5886 then IPython will be your working environment anytime you start Python.
5886 The
5887 The
5887 \family typewriter
5888 \family typewriter
5888 sys_exit=1
5889 sys_exit=1
5889 \family default
5890 \family default
5890 is needed to have IPython issue a call to
5891 is needed to have IPython issue a call to
5891 \family typewriter
5892 \family typewriter
5892 sys.exit()
5893 sys.exit()
5893 \family default
5894 \family default
5894 when it finishes, otherwise you'll be back at the normal Python '
5895 when it finishes, otherwise you'll be back at the normal Python '
5895 \family typewriter
5896 \family typewriter
5896 >>>
5897 >>>
5897 \family default
5898 \family default
5898 ' prompt
5899 ' prompt
5899 \begin_inset Foot
5900 \begin_inset Foot
5900 collapsed true
5901 collapsed true
5901
5902
5902 \layout Standard
5903 \layout Standard
5903
5904
5904 Based on an idea by Holger Krekel.
5905 Based on an idea by Holger Krekel.
5905 \end_inset
5906 \end_inset
5906
5907
5907 .
5908 .
5908 \layout Standard
5909 \layout Standard
5909
5910
5910 This is probably useful to developers who manage multiple Python versions
5911 This is probably useful to developers who manage multiple Python versions
5911 and don't want to have correspondingly multiple IPython versions.
5912 and don't want to have correspondingly multiple IPython versions.
5912 Note that in this mode, there is no way to pass IPython any command-line
5913 Note that in this mode, there is no way to pass IPython any command-line
5913 options, as those are trapped first by Python itself.
5914 options, as those are trapped first by Python itself.
5914 \layout Section
5915 \layout Section
5915
5916
5916
5917
5917 \begin_inset LatexCommand \label{sec:embed}
5918 \begin_inset LatexCommand \label{sec:embed}
5918
5919
5919 \end_inset
5920 \end_inset
5920
5921
5921 Embedding IPython
5922 Embedding IPython
5922 \layout Standard
5923 \layout Standard
5923
5924
5924 It is possible to start an IPython instance
5925 It is possible to start an IPython instance
5925 \emph on
5926 \emph on
5926 inside
5927 inside
5927 \emph default
5928 \emph default
5928 your own Python programs.
5929 your own Python programs.
5929 This allows you to evaluate dynamically the state of your code, operate
5930 This allows you to evaluate dynamically the state of your code, operate
5930 with your variables, analyze them, etc.
5931 with your variables, analyze them, etc.
5931 Note however that any changes you make to values while in the shell do
5932 Note however that any changes you make to values while in the shell do
5932
5933
5933 \emph on
5934 \emph on
5934 not
5935 not
5935 \emph default
5936 \emph default
5936 propagate back to the running code, so it is safe to modify your values
5937 propagate back to the running code, so it is safe to modify your values
5937 because you won't break your code in bizarre ways by doing so.
5938 because you won't break your code in bizarre ways by doing so.
5938 \layout Standard
5939 \layout Standard
5939
5940
5940 This feature allows you to easily have a fully functional python environment
5941 This feature allows you to easily have a fully functional python environment
5941 for doing object introspection anywhere in your code with a simple function
5942 for doing object introspection anywhere in your code with a simple function
5942 call.
5943 call.
5943 In some cases a simple print statement is enough, but if you need to do
5944 In some cases a simple print statement is enough, but if you need to do
5944 more detailed analysis of a code fragment this feature can be very valuable.
5945 more detailed analysis of a code fragment this feature can be very valuable.
5945 \layout Standard
5946 \layout Standard
5946
5947
5947 It can also be useful in scientific computing situations where it is common
5948 It can also be useful in scientific computing situations where it is common
5948 to need to do some automatic, computationally intensive part and then stop
5949 to need to do some automatic, computationally intensive part and then stop
5949 to look at data, plots, etc
5950 to look at data, plots, etc
5950 \begin_inset Foot
5951 \begin_inset Foot
5951 collapsed true
5952 collapsed true
5952
5953
5953 \layout Standard
5954 \layout Standard
5954
5955
5955 This functionality was inspired by IDL's combination of the
5956 This functionality was inspired by IDL's combination of the
5956 \family typewriter
5957 \family typewriter
5957 stop
5958 stop
5958 \family default
5959 \family default
5959 keyword and the
5960 keyword and the
5960 \family typewriter
5961 \family typewriter
5961 .continue
5962 .continue
5962 \family default
5963 \family default
5963 executive command, which I have found very useful in the past, and by a
5964 executive command, which I have found very useful in the past, and by a
5964 posting on comp.lang.python by cmkl <cmkleffner-AT-gmx.de> on Dec.
5965 posting on comp.lang.python by cmkl <cmkleffner-AT-gmx.de> on Dec.
5965 06/01 concerning similar uses of pyrepl.
5966 06/01 concerning similar uses of pyrepl.
5966 \end_inset
5967 \end_inset
5967
5968
5968 .
5969 .
5969 Opening an IPython instance will give you full access to your data and
5970 Opening an IPython instance will give you full access to your data and
5970 functions, and you can resume program execution once you are done with
5971 functions, and you can resume program execution once you are done with
5971 the interactive part (perhaps to stop again later, as many times as needed).
5972 the interactive part (perhaps to stop again later, as many times as needed).
5972 \layout Standard
5973 \layout Standard
5973
5974
5974 The following code snippet is the bare minimum you need to include in your
5975 The following code snippet is the bare minimum you need to include in your
5975 Python programs for this to work (detailed examples follow later):
5976 Python programs for this to work (detailed examples follow later):
5976 \layout LyX-Code
5977 \layout LyX-Code
5977
5978
5978 from IPython.Shell import IPShellEmbed
5979 from IPython.Shell import IPShellEmbed
5979 \layout LyX-Code
5980 \layout LyX-Code
5980
5981
5981 ipshell = IPShellEmbed()
5982 ipshell = IPShellEmbed()
5982 \layout LyX-Code
5983 \layout LyX-Code
5983
5984
5984 ipshell() # this call anywhere in your program will start IPython
5985 ipshell() # this call anywhere in your program will start IPython
5985 \layout Standard
5986 \layout Standard
5986
5987
5987 You can run embedded instances even in code which is itself being run at
5988 You can run embedded instances even in code which is itself being run at
5988 the IPython interactive prompt with '
5989 the IPython interactive prompt with '
5989 \family typewriter
5990 \family typewriter
5990 %run\SpecialChar ~
5991 %run\SpecialChar ~
5991 <filename>
5992 <filename>
5992 \family default
5993 \family default
5993 '.
5994 '.
5994 Since it's easy to get lost as to where you are (in your top-level IPython
5995 Since it's easy to get lost as to where you are (in your top-level IPython
5995 or in your embedded one), it's a good idea in such cases to set the in/out
5996 or in your embedded one), it's a good idea in such cases to set the in/out
5996 prompts to something different for the embedded instances.
5997 prompts to something different for the embedded instances.
5997 The code examples below illustrate this.
5998 The code examples below illustrate this.
5998 \layout Standard
5999 \layout Standard
5999
6000
6000 You can also have multiple IPython instances in your program and open them
6001 You can also have multiple IPython instances in your program and open them
6001 separately, for example with different options for data presentation.
6002 separately, for example with different options for data presentation.
6002 If you close and open the same instance multiple times, its prompt counters
6003 If you close and open the same instance multiple times, its prompt counters
6003 simply continue from each execution to the next.
6004 simply continue from each execution to the next.
6004 \layout Standard
6005 \layout Standard
6005
6006
6006 Please look at the docstrings in the
6007 Please look at the docstrings in the
6007 \family typewriter
6008 \family typewriter
6008 Shell.py
6009 Shell.py
6009 \family default
6010 \family default
6010 module for more details on the use of this system.
6011 module for more details on the use of this system.
6011 \layout Standard
6012 \layout Standard
6012
6013
6013 The following sample file illustrating how to use the embedding functionality
6014 The following sample file illustrating how to use the embedding functionality
6014 is provided in the examples directory as
6015 is provided in the examples directory as
6015 \family typewriter
6016 \family typewriter
6016 example-embed.py
6017 example-embed.py
6017 \family default
6018 \family default
6018 .
6019 .
6019 It should be fairly self-explanatory:
6020 It should be fairly self-explanatory:
6020 \layout Standard
6021 \layout Standard
6021
6022
6022
6023
6023 \begin_inset Include \verbatiminput{examples/example-embed.py}
6024 \begin_inset Include \verbatiminput{examples/example-embed.py}
6024 preview false
6025 preview false
6025
6026
6026 \end_inset
6027 \end_inset
6027
6028
6028
6029
6029 \layout Standard
6030 \layout Standard
6030
6031
6031 Once you understand how the system functions, you can use the following
6032 Once you understand how the system functions, you can use the following
6032 code fragments in your programs which are ready for cut and paste:
6033 code fragments in your programs which are ready for cut and paste:
6033 \layout Standard
6034 \layout Standard
6034
6035
6035
6036
6036 \begin_inset Include \verbatiminput{examples/example-embed-short.py}
6037 \begin_inset Include \verbatiminput{examples/example-embed-short.py}
6037 preview false
6038 preview false
6038
6039
6039 \end_inset
6040 \end_inset
6040
6041
6041
6042
6042 \layout Section
6043 \layout Section
6043
6044
6044
6045
6045 \begin_inset LatexCommand \label{sec:using-pdb}
6046 \begin_inset LatexCommand \label{sec:using-pdb}
6046
6047
6047 \end_inset
6048 \end_inset
6048
6049
6049 Using the Python debugger (
6050 Using the Python debugger (
6050 \family typewriter
6051 \family typewriter
6051 pdb
6052 pdb
6052 \family default
6053 \family default
6053 )
6054 )
6054 \layout Subsection
6055 \layout Subsection
6055
6056
6056 Running entire programs via
6057 Running entire programs via
6057 \family typewriter
6058 \family typewriter
6058 pdb
6059 pdb
6059 \layout Standard
6060 \layout Standard
6060
6061
6061
6062
6062 \family typewriter
6063 \family typewriter
6063 pdb
6064 pdb
6064 \family default
6065 \family default
6065 , the Python debugger, is a powerful interactive debugger which allows you
6066 , the Python debugger, is a powerful interactive debugger which allows you
6066 to step through code, set breakpoints, watch variables, etc.
6067 to step through code, set breakpoints, watch variables, etc.
6067 IPython makes it very easy to start any script under the control of
6068 IPython makes it very easy to start any script under the control of
6068 \family typewriter
6069 \family typewriter
6069 pdb
6070 pdb
6070 \family default
6071 \family default
6071 , regardless of whether you have wrapped it into a
6072 , regardless of whether you have wrapped it into a
6072 \family typewriter
6073 \family typewriter
6073 `main()'
6074 `main()'
6074 \family default
6075 \family default
6075 function or not.
6076 function or not.
6076 For this, simply type
6077 For this, simply type
6077 \family typewriter
6078 \family typewriter
6078 `%run -d myscript'
6079 `%run -d myscript'
6079 \family default
6080 \family default
6080 at an IPython prompt.
6081 at an IPython prompt.
6081 See the
6082 See the
6082 \family typewriter
6083 \family typewriter
6083 %run
6084 %run
6084 \family default
6085 \family default
6085 command's documentation (via
6086 command's documentation (via
6086 \family typewriter
6087 \family typewriter
6087 `%run?'
6088 `%run?'
6088 \family default
6089 \family default
6089 or in Sec.\SpecialChar ~
6090 or in Sec.\SpecialChar ~
6090
6091
6091 \begin_inset LatexCommand \ref{sec:magic}
6092 \begin_inset LatexCommand \ref{sec:magic}
6092
6093
6093 \end_inset
6094 \end_inset
6094
6095
6095 ) for more details, including how to control where
6096 ) for more details, including how to control where
6096 \family typewriter
6097 \family typewriter
6097 pdb
6098 pdb
6098 \family default
6099 \family default
6099 will stop execution first.
6100 will stop execution first.
6100 \layout Standard
6101 \layout Standard
6101
6102
6102 For more information on the use of the
6103 For more information on the use of the
6103 \family typewriter
6104 \family typewriter
6104 pdb
6105 pdb
6105 \family default
6106 \family default
6106 debugger, read the included
6107 debugger, read the included
6107 \family typewriter
6108 \family typewriter
6108 pdb.doc
6109 pdb.doc
6109 \family default
6110 \family default
6110 file (part of the standard Python distribution).
6111 file (part of the standard Python distribution).
6111 On a stock Linux system it is located at
6112 On a stock Linux system it is located at
6112 \family typewriter
6113 \family typewriter
6113 /usr/lib/python2.3/pdb.doc
6114 /usr/lib/python2.3/pdb.doc
6114 \family default
6115 \family default
6115 , but the easiest way to read it is by using the
6116 , but the easiest way to read it is by using the
6116 \family typewriter
6117 \family typewriter
6117 help()
6118 help()
6118 \family default
6119 \family default
6119 function of the
6120 function of the
6120 \family typewriter
6121 \family typewriter
6121 pdb
6122 pdb
6122 \family default
6123 \family default
6123 module as follows (in an IPython prompt):
6124 module as follows (in an IPython prompt):
6124 \layout Standard
6125 \layout Standard
6125
6126
6126
6127
6127 \family typewriter
6128 \family typewriter
6128 In [1]: import pdb
6129 In [1]: import pdb
6129 \newline
6130 \newline
6130 In [2]: pdb.help()
6131 In [2]: pdb.help()
6131 \layout Standard
6132 \layout Standard
6132
6133
6133 This will load the
6134 This will load the
6134 \family typewriter
6135 \family typewriter
6135 pdb.doc
6136 pdb.doc
6136 \family default
6137 \family default
6137 document in a file viewer for you automatically.
6138 document in a file viewer for you automatically.
6138 \layout Subsection
6139 \layout Subsection
6139
6140
6140 Automatic invocation of
6141 Automatic invocation of
6141 \family typewriter
6142 \family typewriter
6142 pdb
6143 pdb
6143 \family default
6144 \family default
6144 on exceptions
6145 on exceptions
6145 \layout Standard
6146 \layout Standard
6146
6147
6147 IPython, if started with the
6148 IPython, if started with the
6148 \family typewriter
6149 \family typewriter
6149 -pdb
6150 -pdb
6150 \family default
6151 \family default
6151 option (or if the option is set in your rc file) can call the Python
6152 option (or if the option is set in your rc file) can call the Python
6152 \family typewriter
6153 \family typewriter
6153 pdb
6154 pdb
6154 \family default
6155 \family default
6155 debugger every time your code triggers an uncaught exception
6156 debugger every time your code triggers an uncaught exception
6156 \begin_inset Foot
6157 \begin_inset Foot
6157 collapsed true
6158 collapsed true
6158
6159
6159 \layout Standard
6160 \layout Standard
6160
6161
6161 Many thanks to Christopher Hart for the request which prompted adding this
6162 Many thanks to Christopher Hart for the request which prompted adding this
6162 feature to IPython.
6163 feature to IPython.
6163 \end_inset
6164 \end_inset
6164
6165
6165 .
6166 .
6166 This feature can also be toggled at any time with the
6167 This feature can also be toggled at any time with the
6167 \family typewriter
6168 \family typewriter
6168 %pdb
6169 %pdb
6169 \family default
6170 \family default
6170 magic command.
6171 magic command.
6171 This can be extremely useful in order to find the origin of subtle bugs,
6172 This can be extremely useful in order to find the origin of subtle bugs,
6172 because
6173 because
6173 \family typewriter
6174 \family typewriter
6174 pdb
6175 pdb
6175 \family default
6176 \family default
6176 opens up at the point in your code which triggered the exception, and while
6177 opens up at the point in your code which triggered the exception, and while
6177 your program is at this point `dead', all the data is still available and
6178 your program is at this point `dead', all the data is still available and
6178 you can walk up and down the stack frame and understand the origin of the
6179 you can walk up and down the stack frame and understand the origin of the
6179 problem.
6180 problem.
6180 \layout Standard
6181 \layout Standard
6181
6182
6182 Furthermore, you can use these debugging facilities both with the embedded
6183 Furthermore, you can use these debugging facilities both with the embedded
6183 IPython mode and without IPython at all.
6184 IPython mode and without IPython at all.
6184 For an embedded shell (see sec.
6185 For an embedded shell (see sec.
6185
6186
6186 \begin_inset LatexCommand \ref{sec:embed}
6187 \begin_inset LatexCommand \ref{sec:embed}
6187
6188
6188 \end_inset
6189 \end_inset
6189
6190
6190 ), simply call the constructor with
6191 ), simply call the constructor with
6191 \family typewriter
6192 \family typewriter
6192 `-pdb'
6193 `-pdb'
6193 \family default
6194 \family default
6194 in the argument string and automatically
6195 in the argument string and automatically
6195 \family typewriter
6196 \family typewriter
6196 pdb
6197 pdb
6197 \family default
6198 \family default
6198 will be called if an uncaught exception is triggered by your code.
6199 will be called if an uncaught exception is triggered by your code.
6199
6200
6200 \layout Standard
6201 \layout Standard
6201
6202
6202 For stand-alone use of the feature in your programs which do not use IPython
6203 For stand-alone use of the feature in your programs which do not use IPython
6203 at all, put the following lines toward the top of your `main' routine:
6204 at all, put the following lines toward the top of your `main' routine:
6204 \layout Standard
6205 \layout Standard
6205 \align left
6206 \align left
6206
6207
6207 \family typewriter
6208 \family typewriter
6208 import sys,IPython.ultraTB
6209 import sys,IPython.ultraTB
6209 \newline
6210 \newline
6210 sys.excepthook = IPython.ultraTB.FormattedTB(mode=`Verbose', color_scheme=`Linux',
6211 sys.excepthook = IPython.ultraTB.FormattedTB(mode=`Verbose', color_scheme=`Linux',
6211 call_pdb=1)
6212 call_pdb=1)
6212 \layout Standard
6213 \layout Standard
6213
6214
6214 The
6215 The
6215 \family typewriter
6216 \family typewriter
6216 mode
6217 mode
6217 \family default
6218 \family default
6218 keyword can be either
6219 keyword can be either
6219 \family typewriter
6220 \family typewriter
6220 `Verbose'
6221 `Verbose'
6221 \family default
6222 \family default
6222 or
6223 or
6223 \family typewriter
6224 \family typewriter
6224 `Plain'
6225 `Plain'
6225 \family default
6226 \family default
6226 , giving either very detailed or normal tracebacks respectively.
6227 , giving either very detailed or normal tracebacks respectively.
6227 The
6228 The
6228 \family typewriter
6229 \family typewriter
6229 color_scheme
6230 color_scheme
6230 \family default
6231 \family default
6231 keyword can be one of
6232 keyword can be one of
6232 \family typewriter
6233 \family typewriter
6233 `NoColor'
6234 `NoColor'
6234 \family default
6235 \family default
6235 ,
6236 ,
6236 \family typewriter
6237 \family typewriter
6237 `Linux'
6238 `Linux'
6238 \family default
6239 \family default
6239 (default) or
6240 (default) or
6240 \family typewriter
6241 \family typewriter
6241 `LightBG'
6242 `LightBG'
6242 \family default
6243 \family default
6243 .
6244 .
6244 These are the same options which can be set in IPython with
6245 These are the same options which can be set in IPython with
6245 \family typewriter
6246 \family typewriter
6246 -colors
6247 -colors
6247 \family default
6248 \family default
6248 and
6249 and
6249 \family typewriter
6250 \family typewriter
6250 -xmode
6251 -xmode
6251 \family default
6252 \family default
6252 .
6253 .
6253 \layout Standard
6254 \layout Standard
6254
6255
6255 This will give any of your programs detailed, colored tracebacks with automatic
6256 This will give any of your programs detailed, colored tracebacks with automatic
6256 invocation of
6257 invocation of
6257 \family typewriter
6258 \family typewriter
6258 pdb
6259 pdb
6259 \family default
6260 \family default
6260 .
6261 .
6261 \layout Section
6262 \layout Section
6262
6263
6263
6264
6264 \begin_inset LatexCommand \label{sec:syntax-extensions}
6265 \begin_inset LatexCommand \label{sec:syntax-extensions}
6265
6266
6266 \end_inset
6267 \end_inset
6267
6268
6268 Extensions for syntax processing
6269 Extensions for syntax processing
6269 \layout Standard
6270 \layout Standard
6270
6271
6271 This isn't for the faint of heart, because the potential for breaking things
6272 This isn't for the faint of heart, because the potential for breaking things
6272 is quite high.
6273 is quite high.
6273 But it can be a very powerful and useful feature.
6274 But it can be a very powerful and useful feature.
6274 In a nutshell, you can redefine the way IPython processes the user input
6275 In a nutshell, you can redefine the way IPython processes the user input
6275 line to accept new, special extensions to the syntax without needing to
6276 line to accept new, special extensions to the syntax without needing to
6276 change any of IPython's own code.
6277 change any of IPython's own code.
6277 \layout Standard
6278 \layout Standard
6278
6279
6279 In the
6280 In the
6280 \family typewriter
6281 \family typewriter
6281 IPython/Extensions
6282 IPython/Extensions
6282 \family default
6283 \family default
6283 directory you will find some examples supplied, which we will briefly describe
6284 directory you will find some examples supplied, which we will briefly describe
6284 now.
6285 now.
6285 These can be used `as is' (and both provide very useful functionality),
6286 These can be used `as is' (and both provide very useful functionality),
6286 or you can use them as a starting point for writing your own extensions.
6287 or you can use them as a starting point for writing your own extensions.
6287 \layout Subsection
6288 \layout Subsection
6288
6289
6289 Pasting of code starting with
6290 Pasting of code starting with
6290 \family typewriter
6291 \family typewriter
6291 `>>>
6292 `>>>
6292 \family default
6293 \family default
6293 ' or
6294 ' or
6294 \family typewriter
6295 \family typewriter
6295 `...
6296 `...
6296
6297
6297 \family default
6298 \family default
6298 '
6299 '
6299 \layout Standard
6300 \layout Standard
6300
6301
6301 In the python tutorial it is common to find code examples which have been
6302 In the python tutorial it is common to find code examples which have been
6302 taken from real python sessions.
6303 taken from real python sessions.
6303 The problem with those is that all the lines begin with either
6304 The problem with those is that all the lines begin with either
6304 \family typewriter
6305 \family typewriter
6305 `>>>
6306 `>>>
6306 \family default
6307 \family default
6307 ' or
6308 ' or
6308 \family typewriter
6309 \family typewriter
6309 `...
6310 `...
6310
6311
6311 \family default
6312 \family default
6312 ', which makes it impossible to paste them all at once.
6313 ', which makes it impossible to paste them all at once.
6313 One must instead do a line by line manual copying, carefully removing the
6314 One must instead do a line by line manual copying, carefully removing the
6314 leading extraneous characters.
6315 leading extraneous characters.
6315 \layout Standard
6316 \layout Standard
6316
6317
6317 This extension identifies those starting characters and removes them from
6318 This extension identifies those starting characters and removes them from
6318 the input automatically, so that one can paste multi-line examples directly
6319 the input automatically, so that one can paste multi-line examples directly
6319 into IPython, saving a lot of time.
6320 into IPython, saving a lot of time.
6320 Please look at the file
6321 Please look at the file
6321 \family typewriter
6322 \family typewriter
6322 InterpreterPasteInput.py
6323 InterpreterPasteInput.py
6323 \family default
6324 \family default
6324 in the
6325 in the
6325 \family typewriter
6326 \family typewriter
6326 IPython/Extensions
6327 IPython/Extensions
6327 \family default
6328 \family default
6328 directory for details on how this is done.
6329 directory for details on how this is done.
6329 \layout Standard
6330 \layout Standard
6330
6331
6331 IPython comes with a special profile enabling this feature, called
6332 IPython comes with a special profile enabling this feature, called
6332 \family typewriter
6333 \family typewriter
6333 tutorial
6334 tutorial
6334 \family default
6335 \family default
6335 \emph on
6336 \emph on
6336 .
6337 .
6337
6338
6338 \emph default
6339 \emph default
6339 Simply start IPython via
6340 Simply start IPython via
6340 \family typewriter
6341 \family typewriter
6341 `ipython\SpecialChar ~
6342 `ipython\SpecialChar ~
6342 -p\SpecialChar ~
6343 -p\SpecialChar ~
6343 tutorial'
6344 tutorial'
6344 \family default
6345 \family default
6345 and the feature will be available.
6346 and the feature will be available.
6346 In a normal IPython session you can activate the feature by importing the
6347 In a normal IPython session you can activate the feature by importing the
6347 corresponding module with:
6348 corresponding module with:
6348 \newline
6349 \newline
6349
6350
6350 \family typewriter
6351 \family typewriter
6351 In [1]: import IPython.Extensions.InterpreterPasteInput
6352 In [1]: import IPython.Extensions.InterpreterPasteInput
6352 \layout Standard
6353 \layout Standard
6353
6354
6354 The following is a 'screenshot' of how things work when this extension is
6355 The following is a 'screenshot' of how things work when this extension is
6355 on, copying an example from the standard tutorial:
6356 on, copying an example from the standard tutorial:
6356 \layout Standard
6357 \layout Standard
6357
6358
6358
6359
6359 \family typewriter
6360 \family typewriter
6360 IPython profile: tutorial
6361 IPython profile: tutorial
6361 \newline
6362 \newline
6362 \SpecialChar ~
6363 \SpecialChar ~
6363
6364
6364 \newline
6365 \newline
6365 *** Pasting of code with ">>>" or "..." has been enabled.
6366 *** Pasting of code with ">>>" or "..." has been enabled.
6366 \newline
6367 \newline
6367 \SpecialChar ~
6368 \SpecialChar ~
6368
6369
6369 \newline
6370 \newline
6370 In [1]: >>> def fib2(n): # return Fibonacci series up to n
6371 In [1]: >>> def fib2(n): # return Fibonacci series up to n
6371 \newline
6372 \newline
6372
6373
6373 \begin_inset ERT
6374 \begin_inset ERT
6374 status Collapsed
6375 status Collapsed
6375
6376
6376 \layout Standard
6377 \layout Standard
6377
6378
6378 \backslash
6379 \backslash
6379 hspace*{0mm}
6380 hspace*{0mm}
6380 \end_inset
6381 \end_inset
6381
6382
6382 \SpecialChar ~
6383 \SpecialChar ~
6383 \SpecialChar ~
6384 \SpecialChar ~
6384 ...: ...\SpecialChar ~
6385 ...: ...\SpecialChar ~
6385 \SpecialChar ~
6386 \SpecialChar ~
6386 \SpecialChar ~
6387 \SpecialChar ~
6387 \SpecialChar ~
6388 \SpecialChar ~
6388 """Return a list containing the Fibonacci series up to n."""
6389 """Return a list containing the Fibonacci series up to n."""
6389 \newline
6390 \newline
6390
6391
6391 \begin_inset ERT
6392 \begin_inset ERT
6392 status Collapsed
6393 status Collapsed
6393
6394
6394 \layout Standard
6395 \layout Standard
6395
6396
6396 \backslash
6397 \backslash
6397 hspace*{0mm}
6398 hspace*{0mm}
6398 \end_inset
6399 \end_inset
6399
6400
6400 \SpecialChar ~
6401 \SpecialChar ~
6401 \SpecialChar ~
6402 \SpecialChar ~
6402 ...: ...\SpecialChar ~
6403 ...: ...\SpecialChar ~
6403 \SpecialChar ~
6404 \SpecialChar ~
6404 \SpecialChar ~
6405 \SpecialChar ~
6405 \SpecialChar ~
6406 \SpecialChar ~
6406 result = []
6407 result = []
6407 \newline
6408 \newline
6408
6409
6409 \begin_inset ERT
6410 \begin_inset ERT
6410 status Collapsed
6411 status Collapsed
6411
6412
6412 \layout Standard
6413 \layout Standard
6413
6414
6414 \backslash
6415 \backslash
6415 hspace*{0mm}
6416 hspace*{0mm}
6416 \end_inset
6417 \end_inset
6417
6418
6418 \SpecialChar ~
6419 \SpecialChar ~
6419 \SpecialChar ~
6420 \SpecialChar ~
6420 ...: ...\SpecialChar ~
6421 ...: ...\SpecialChar ~
6421 \SpecialChar ~
6422 \SpecialChar ~
6422 \SpecialChar ~
6423 \SpecialChar ~
6423 \SpecialChar ~
6424 \SpecialChar ~
6424 a, b = 0, 1
6425 a, b = 0, 1
6425 \newline
6426 \newline
6426
6427
6427 \begin_inset ERT
6428 \begin_inset ERT
6428 status Collapsed
6429 status Collapsed
6429
6430
6430 \layout Standard
6431 \layout Standard
6431
6432
6432 \backslash
6433 \backslash
6433 hspace*{0mm}
6434 hspace*{0mm}
6434 \end_inset
6435 \end_inset
6435
6436
6436 \SpecialChar ~
6437 \SpecialChar ~
6437 \SpecialChar ~
6438 \SpecialChar ~
6438 ...: ...\SpecialChar ~
6439 ...: ...\SpecialChar ~
6439 \SpecialChar ~
6440 \SpecialChar ~
6440 \SpecialChar ~
6441 \SpecialChar ~
6441 \SpecialChar ~
6442 \SpecialChar ~
6442 while b < n:
6443 while b < n:
6443 \newline
6444 \newline
6444
6445
6445 \begin_inset ERT
6446 \begin_inset ERT
6446 status Collapsed
6447 status Collapsed
6447
6448
6448 \layout Standard
6449 \layout Standard
6449
6450
6450 \backslash
6451 \backslash
6451 hspace*{0mm}
6452 hspace*{0mm}
6452 \end_inset
6453 \end_inset
6453
6454
6454 \SpecialChar ~
6455 \SpecialChar ~
6455 \SpecialChar ~
6456 \SpecialChar ~
6456 ...: ...\SpecialChar ~
6457 ...: ...\SpecialChar ~
6457 \SpecialChar ~
6458 \SpecialChar ~
6458 \SpecialChar ~
6459 \SpecialChar ~
6459 \SpecialChar ~
6460 \SpecialChar ~
6460 \SpecialChar ~
6461 \SpecialChar ~
6461 \SpecialChar ~
6462 \SpecialChar ~
6462 \SpecialChar ~
6463 \SpecialChar ~
6463 \SpecialChar ~
6464 \SpecialChar ~
6464 result.append(b)\SpecialChar ~
6465 result.append(b)\SpecialChar ~
6465 \SpecialChar ~
6466 \SpecialChar ~
6466 \SpecialChar ~
6467 \SpecialChar ~
6467 # see below
6468 # see below
6468 \newline
6469 \newline
6469
6470
6470 \begin_inset ERT
6471 \begin_inset ERT
6471 status Collapsed
6472 status Collapsed
6472
6473
6473 \layout Standard
6474 \layout Standard
6474
6475
6475 \backslash
6476 \backslash
6476 hspace*{0mm}
6477 hspace*{0mm}
6477 \end_inset
6478 \end_inset
6478
6479
6479 \SpecialChar ~
6480 \SpecialChar ~
6480 \SpecialChar ~
6481 \SpecialChar ~
6481 ...: ...\SpecialChar ~
6482 ...: ...\SpecialChar ~
6482 \SpecialChar ~
6483 \SpecialChar ~
6483 \SpecialChar ~
6484 \SpecialChar ~
6484 \SpecialChar ~
6485 \SpecialChar ~
6485 \SpecialChar ~
6486 \SpecialChar ~
6486 \SpecialChar ~
6487 \SpecialChar ~
6487 \SpecialChar ~
6488 \SpecialChar ~
6488 \SpecialChar ~
6489 \SpecialChar ~
6489 a, b = b, a+b
6490 a, b = b, a+b
6490 \newline
6491 \newline
6491
6492
6492 \begin_inset ERT
6493 \begin_inset ERT
6493 status Collapsed
6494 status Collapsed
6494
6495
6495 \layout Standard
6496 \layout Standard
6496
6497
6497 \backslash
6498 \backslash
6498 hspace*{0mm}
6499 hspace*{0mm}
6499 \end_inset
6500 \end_inset
6500
6501
6501 \SpecialChar ~
6502 \SpecialChar ~
6502 \SpecialChar ~
6503 \SpecialChar ~
6503 ...: ...\SpecialChar ~
6504 ...: ...\SpecialChar ~
6504 \SpecialChar ~
6505 \SpecialChar ~
6505 \SpecialChar ~
6506 \SpecialChar ~
6506 \SpecialChar ~
6507 \SpecialChar ~
6507 return result
6508 return result
6508 \newline
6509 \newline
6509
6510
6510 \begin_inset ERT
6511 \begin_inset ERT
6511 status Collapsed
6512 status Collapsed
6512
6513
6513 \layout Standard
6514 \layout Standard
6514
6515
6515 \backslash
6516 \backslash
6516 hspace*{0mm}
6517 hspace*{0mm}
6517 \end_inset
6518 \end_inset
6518
6519
6519 \SpecialChar ~
6520 \SpecialChar ~
6520 \SpecialChar ~
6521 \SpecialChar ~
6521 ...:
6522 ...:
6522 \newline
6523 \newline
6523 \SpecialChar ~
6524 \SpecialChar ~
6524
6525
6525 \newline
6526 \newline
6526 In [2]: fib2(10)
6527 In [2]: fib2(10)
6527 \newline
6528 \newline
6528 Out[2]: [1, 1, 2, 3, 5, 8]
6529 Out[2]: [1, 1, 2, 3, 5, 8]
6529 \layout Standard
6530 \layout Standard
6530
6531
6531 Note that as currently written, this extension does
6532 Note that as currently written, this extension does
6532 \emph on
6533 \emph on
6533 not
6534 not
6534 \emph default
6535 \emph default
6535 recognize IPython's prompts for pasting.
6536 recognize IPython's prompts for pasting.
6536 Those are more complicated, since the user can change them very easily,
6537 Those are more complicated, since the user can change them very easily,
6537 they involve numbers and can vary in length.
6538 they involve numbers and can vary in length.
6538 One could however extract all the relevant information from the IPython
6539 One could however extract all the relevant information from the IPython
6539 instance and build an appropriate regular expression.
6540 instance and build an appropriate regular expression.
6540 This is left as an exercise for the reader.
6541 This is left as an exercise for the reader.
6541 \layout Subsection
6542 \layout Subsection
6542
6543
6543 Input of physical quantities with units
6544 Input of physical quantities with units
6544 \layout Standard
6545 \layout Standard
6545
6546
6546 The module
6547 The module
6547 \family typewriter
6548 \family typewriter
6548 PhysicalQInput
6549 PhysicalQInput
6549 \family default
6550 \family default
6550 allows a simplified form of input for physical quantities with units.
6551 allows a simplified form of input for physical quantities with units.
6551 This file is meant to be used in conjunction with the
6552 This file is meant to be used in conjunction with the
6552 \family typewriter
6553 \family typewriter
6553 PhysicalQInteractive
6554 PhysicalQInteractive
6554 \family default
6555 \family default
6555 module (in the same directory) and
6556 module (in the same directory) and
6556 \family typewriter
6557 \family typewriter
6557 Physics.PhysicalQuantities
6558 Physics.PhysicalQuantities
6558 \family default
6559 \family default
6559 from Konrad Hinsen's ScientificPython (
6560 from Konrad Hinsen's ScientificPython (
6560 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/hinsen/scientific.html}
6561 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/hinsen/scientific.html}
6561
6562
6562 \end_inset
6563 \end_inset
6563
6564
6564 ).
6565 ).
6565 \layout Standard
6566 \layout Standard
6566
6567
6567 The
6568 The
6568 \family typewriter
6569 \family typewriter
6569 Physics.PhysicalQuantities
6570 Physics.PhysicalQuantities
6570 \family default
6571 \family default
6571 module defines
6572 module defines
6572 \family typewriter
6573 \family typewriter
6573 PhysicalQuantity
6574 PhysicalQuantity
6574 \family default
6575 \family default
6575 objects, but these must be declared as instances of a class.
6576 objects, but these must be declared as instances of a class.
6576 For example, to define
6577 For example, to define
6577 \family typewriter
6578 \family typewriter
6578 v
6579 v
6579 \family default
6580 \family default
6580 as a velocity of 3\SpecialChar ~
6581 as a velocity of 3\SpecialChar ~
6581 m/s, normally you would write:
6582 m/s, normally you would write:
6582 \family typewriter
6583 \family typewriter
6583
6584
6584 \newline
6585 \newline
6585 In [1]: v = PhysicalQuantity(3,'m/s')
6586 In [1]: v = PhysicalQuantity(3,'m/s')
6586 \layout Standard
6587 \layout Standard
6587
6588
6588 Using the
6589 Using the
6589 \family typewriter
6590 \family typewriter
6590 PhysicalQ_Input
6591 PhysicalQ_Input
6591 \family default
6592 \family default
6592 extension this can be input instead as:
6593 extension this can be input instead as:
6593 \family typewriter
6594 \family typewriter
6594
6595
6595 \newline
6596 \newline
6596 In [1]: v = 3 m/s
6597 In [1]: v = 3 m/s
6597 \family default
6598 \family default
6598
6599
6599 \newline
6600 \newline
6600 which is much more convenient for interactive use (even though it is blatantly
6601 which is much more convenient for interactive use (even though it is blatantly
6601 invalid Python syntax).
6602 invalid Python syntax).
6602 \layout Standard
6603 \layout Standard
6603
6604
6604 The
6605 The
6605 \family typewriter
6606 \family typewriter
6606 physics
6607 physics
6607 \family default
6608 \family default
6608 profile supplied with IPython (enabled via
6609 profile supplied with IPython (enabled via
6609 \family typewriter
6610 \family typewriter
6610 'ipython -p physics'
6611 'ipython -p physics'
6611 \family default
6612 \family default
6612 ) uses these extensions, which you can also activate with:
6613 ) uses these extensions, which you can also activate with:
6613 \layout Standard
6614 \layout Standard
6614
6615
6615
6616
6616 \family typewriter
6617 \family typewriter
6617 from math import * # math MUST be imported BEFORE PhysicalQInteractive
6618 from math import * # math MUST be imported BEFORE PhysicalQInteractive
6618 \newline
6619 \newline
6619 from IPython.Extensions.PhysicalQInteractive import *
6620 from IPython.Extensions.PhysicalQInteractive import *
6620 \newline
6621 \newline
6621 import IPython.Extensions.PhysicalQInput
6622 import IPython.Extensions.PhysicalQInput
6622 \layout Section
6623 \layout Section
6623
6624
6624 IPython as a system shell
6625 IPython as a system shell
6625 \layout Standard
6626 \layout Standard
6626
6627
6627 IPython ships with a special profile called
6628 IPython ships with a special profile called
6628 \family typewriter
6629 \family typewriter
6629 pysh
6630 pysh
6630 \family default
6631 \family default
6631 , which you can activate at the command line as
6632 , which you can activate at the command line as
6632 \family typewriter
6633 \family typewriter
6633 `ipython -p pysh'
6634 `ipython -p pysh'
6634 \family default
6635 \family default
6635 .
6636 .
6636 This loads
6637 This loads
6637 \family typewriter
6638 \family typewriter
6638 InterpreterExec
6639 InterpreterExec
6639 \family default
6640 \family default
6640 , along with some additional facilities and a prompt customized for filesystem
6641 , along with some additional facilities and a prompt customized for filesystem
6641 navigation.
6642 navigation.
6642 \layout Standard
6643 \layout Standard
6643
6644
6644 Note that this does
6645 Note that this does
6645 \emph on
6646 \emph on
6646 not
6647 not
6647 \emph default
6648 \emph default
6648 make IPython a full-fledged system shell.
6649 make IPython a full-fledged system shell.
6649 In particular, it has no job control, so if you type Ctrl-Z (under Unix),
6650 In particular, it has no job control, so if you type Ctrl-Z (under Unix),
6650 you'll suspend pysh itself, not the process you just started.
6651 you'll suspend pysh itself, not the process you just started.
6651
6652
6652 \layout Standard
6653 \layout Standard
6653
6654
6654 What the shell profile allows you to do is to use the convenient and powerful
6655 What the shell profile allows you to do is to use the convenient and powerful
6655 syntax of Python to do quick scripting at the command line.
6656 syntax of Python to do quick scripting at the command line.
6656 Below we describe some of its features.
6657 Below we describe some of its features.
6657 \layout Subsection
6658 \layout Subsection
6658
6659
6659 Aliases
6660 Aliases
6660 \layout Standard
6661 \layout Standard
6661
6662
6662 All of your
6663 All of your
6663 \family typewriter
6664 \family typewriter
6664 $PATH
6665 $PATH
6665 \family default
6666 \family default
6666 has been loaded as IPython aliases, so you should be able to type any normal
6667 has been loaded as IPython aliases, so you should be able to type any normal
6667 system command and have it executed.
6668 system command and have it executed.
6668 See
6669 See
6669 \family typewriter
6670 \family typewriter
6670 %alias?
6671 %alias?
6671 \family default
6672 \family default
6672 and
6673 and
6673 \family typewriter
6674 \family typewriter
6674 %unalias?
6675 %unalias?
6675 \family default
6676 \family default
6676 for details on the alias facilities.
6677 for details on the alias facilities.
6677 See also
6678 See also
6678 \family typewriter
6679 \family typewriter
6679 %rehash?
6680 %rehash?
6680 \family default
6681 \family default
6681 and
6682 and
6682 \family typewriter
6683 \family typewriter
6683 %rehashx?
6684 %rehashx?
6684 \family default
6685 \family default
6685 for details on the mechanism used to load
6686 for details on the mechanism used to load
6686 \family typewriter
6687 \family typewriter
6687 $PATH
6688 $PATH
6688 \family default
6689 \family default
6689 .
6690 .
6690 \layout Subsection
6691 \layout Subsection
6691
6692
6692 Special syntax
6693 Special syntax
6693 \layout Standard
6694 \layout Standard
6694
6695
6695 Any lines which begin with
6696 Any lines which begin with
6696 \family typewriter
6697 \family typewriter
6697 `~'
6698 `~'
6698 \family default
6699 \family default
6699 ,
6700 ,
6700 \family typewriter
6701 \family typewriter
6701 `/'
6702 `/'
6702 \family default
6703 \family default
6703 and
6704 and
6704 \family typewriter
6705 \family typewriter
6705 `.'
6706 `.'
6706 \family default
6707 \family default
6707 will be executed as shell commands instead of as Python code.
6708 will be executed as shell commands instead of as Python code.
6708 The special escapes below are also recognized.
6709 The special escapes below are also recognized.
6709
6710
6710 \family typewriter
6711 \family typewriter
6711 !cmd
6712 !cmd
6712 \family default
6713 \family default
6713 is valid in single or multi-line input, all others are only valid in single-lin
6714 is valid in single or multi-line input, all others are only valid in single-lin
6714 e input:
6715 e input:
6715 \layout Description
6716 \layout Description
6716
6717
6717
6718
6718 \family typewriter
6719 \family typewriter
6719 !cmd
6720 !cmd
6720 \family default
6721 \family default
6721 pass `cmd' directly to the shell
6722 pass `cmd' directly to the shell
6722 \layout Description
6723 \layout Description
6723
6724
6724
6725
6725 \family typewriter
6726 \family typewriter
6726 !!cmd
6727 !!cmd
6727 \family default
6728 \family default
6728 execute `cmd' and return output as a list (split on `
6729 execute `cmd' and return output as a list (split on `
6729 \backslash
6730 \backslash
6730 n')
6731 n')
6731 \layout Description
6732 \layout Description
6732
6733
6733
6734
6734 \family typewriter
6735 \family typewriter
6735 $var=cmd
6736 $var=cmd
6736 \family default
6737 \family default
6737 capture output of cmd into var, as a string
6738 capture output of cmd into var, as a string
6738 \layout Description
6739 \layout Description
6739
6740
6740
6741
6741 \family typewriter
6742 \family typewriter
6742 $$var=cmd
6743 $$var=cmd
6743 \family default
6744 \family default
6744 capture output of cmd into var, as a list (split on `
6745 capture output of cmd into var, as a list (split on `
6745 \backslash
6746 \backslash
6746 n')
6747 n')
6747 \layout Standard
6748 \layout Standard
6748
6749
6749 The
6750 The
6750 \family typewriter
6751 \family typewriter
6751 $
6752 $
6752 \family default
6753 \family default
6753 /
6754 /
6754 \family typewriter
6755 \family typewriter
6755 $$
6756 $$
6756 \family default
6757 \family default
6757 syntaxes make Python variables from system output, which you can later
6758 syntaxes make Python variables from system output, which you can later
6758 use for further scripting.
6759 use for further scripting.
6759 The converse is also possible: when executing an alias or calling to the
6760 The converse is also possible: when executing an alias or calling to the
6760 system via
6761 system via
6761 \family typewriter
6762 \family typewriter
6762 !
6763 !
6763 \family default
6764 \family default
6764 /
6765 /
6765 \family typewriter
6766 \family typewriter
6766 !!
6767 !!
6767 \family default
6768 \family default
6768 , you can expand any python variable or expression by prepending it with
6769 , you can expand any python variable or expression by prepending it with
6769
6770
6770 \family typewriter
6771 \family typewriter
6771 $
6772 $
6772 \family default
6773 \family default
6773 .
6774 .
6774 Full details of the allowed syntax can be found in Python's PEP 215.
6775 Full details of the allowed syntax can be found in Python's PEP 215.
6775 \layout Standard
6776 \layout Standard
6776
6777
6777 A few brief examples will illustrate these (note that the indentation below
6778 A few brief examples will illustrate these (note that the indentation below
6778 may be incorrectly displayed):
6779 may be incorrectly displayed):
6779 \layout Standard
6780 \layout Standard
6780
6781
6781
6782
6782 \family typewriter
6783 \family typewriter
6783 fperez[~/test]|3> !ls *s.py
6784 fperez[~/test]|3> !ls *s.py
6784 \newline
6785 \newline
6785 scopes.py strings.py
6786 scopes.py strings.py
6786 \layout Standard
6787 \layout Standard
6787
6788
6788 ls is an internal alias, so there's no need to use
6789 ls is an internal alias, so there's no need to use
6789 \family typewriter
6790 \family typewriter
6790 !
6791 !
6791 \family default
6792 \family default
6792 :
6793 :
6793 \layout Standard
6794 \layout Standard
6794
6795
6795
6796
6796 \family typewriter
6797 \family typewriter
6797 fperez[~/test]|4> ls *s.py
6798 fperez[~/test]|4> ls *s.py
6798 \newline
6799 \newline
6799 scopes.py* strings.py
6800 scopes.py* strings.py
6800 \layout Standard
6801 \layout Standard
6801
6802
6802 !!ls will return the output into a Python variable:
6803 !!ls will return the output into a Python variable:
6803 \layout Standard
6804 \layout Standard
6804
6805
6805
6806
6806 \family typewriter
6807 \family typewriter
6807 fperez[~/test]|5> !!ls *s.py
6808 fperez[~/test]|5> !!ls *s.py
6808 \newline
6809 \newline
6809
6810
6810 \begin_inset ERT
6811 \begin_inset ERT
6811 status Collapsed
6812 status Collapsed
6812
6813
6813 \layout Standard
6814 \layout Standard
6814
6815
6815 \backslash
6816 \backslash
6816 hspace*{0mm}
6817 hspace*{0mm}
6817 \end_inset
6818 \end_inset
6818
6819
6819 \SpecialChar ~
6820 \SpecialChar ~
6820 \SpecialChar ~
6821 \SpecialChar ~
6821 \SpecialChar ~
6822 \SpecialChar ~
6822 \SpecialChar ~
6823 \SpecialChar ~
6823 \SpecialChar ~
6824 \SpecialChar ~
6824 \SpecialChar ~
6825 \SpecialChar ~
6825 \SpecialChar ~
6826 \SpecialChar ~
6826 \SpecialChar ~
6827 \SpecialChar ~
6827 \SpecialChar ~
6828 \SpecialChar ~
6828 \SpecialChar ~
6829 \SpecialChar ~
6829 \SpecialChar ~
6830 \SpecialChar ~
6830 \SpecialChar ~
6831 \SpecialChar ~
6831 \SpecialChar ~
6832 \SpecialChar ~
6832 \SpecialChar ~
6833 \SpecialChar ~
6833 <5> ['scopes.py', 'strings.py']
6834 <5> ['scopes.py', 'strings.py']
6834 \newline
6835 \newline
6835 fperez[~/test]|6> print _5
6836 fperez[~/test]|6> print _5
6836 \newline
6837 \newline
6837 ['scopes.py', 'strings.py']
6838 ['scopes.py', 'strings.py']
6838 \layout Standard
6839 \layout Standard
6839
6840
6840
6841
6841 \family typewriter
6842 \family typewriter
6842 $
6843 $
6843 \family default
6844 \family default
6844 and
6845 and
6845 \family typewriter
6846 \family typewriter
6846 $$
6847 $$
6847 \family default
6848 \family default
6848 allow direct capture to named variables:
6849 allow direct capture to named variables:
6849 \layout Standard
6850 \layout Standard
6850
6851
6851
6852
6852 \family typewriter
6853 \family typewriter
6853 fperez[~/test]|7> $astr = ls *s.py
6854 fperez[~/test]|7> $astr = ls *s.py
6854 \newline
6855 \newline
6855 fperez[~/test]|8> astr
6856 fperez[~/test]|8> astr
6856 \newline
6857 \newline
6857
6858
6858 \begin_inset ERT
6859 \begin_inset ERT
6859 status Collapsed
6860 status Collapsed
6860
6861
6861 \layout Standard
6862 \layout Standard
6862
6863
6863 \backslash
6864 \backslash
6864 hspace*{0mm}
6865 hspace*{0mm}
6865 \end_inset
6866 \end_inset
6866
6867
6867 \SpecialChar ~
6868 \SpecialChar ~
6868 \SpecialChar ~
6869 \SpecialChar ~
6869 \SpecialChar ~
6870 \SpecialChar ~
6870 \SpecialChar ~
6871 \SpecialChar ~
6871 \SpecialChar ~
6872 \SpecialChar ~
6872 \SpecialChar ~
6873 \SpecialChar ~
6873 \SpecialChar ~
6874 \SpecialChar ~
6874 \SpecialChar ~
6875 \SpecialChar ~
6875 \SpecialChar ~
6876 \SpecialChar ~
6876 \SpecialChar ~
6877 \SpecialChar ~
6877 \SpecialChar ~
6878 \SpecialChar ~
6878 \SpecialChar ~
6879 \SpecialChar ~
6879 \SpecialChar ~
6880 \SpecialChar ~
6880 \SpecialChar ~
6881 \SpecialChar ~
6881 <8> 'scopes.py
6882 <8> 'scopes.py
6882 \backslash
6883 \backslash
6883 nstrings.py'
6884 nstrings.py'
6884 \layout Standard
6885 \layout Standard
6885
6886
6886
6887
6887 \family typewriter
6888 \family typewriter
6888 fperez[~/test]|9> $$alist = ls *s.py
6889 fperez[~/test]|9> $$alist = ls *s.py
6889 \newline
6890 \newline
6890 fperez[~/test]|10> alist
6891 fperez[~/test]|10> alist
6891 \newline
6892 \newline
6892
6893
6893 \begin_inset ERT
6894 \begin_inset ERT
6894 status Collapsed
6895 status Collapsed
6895
6896
6896 \layout Standard
6897 \layout Standard
6897
6898
6898 \backslash
6899 \backslash
6899 hspace*{0mm}
6900 hspace*{0mm}
6900 \end_inset
6901 \end_inset
6901
6902
6902 \SpecialChar ~
6903 \SpecialChar ~
6903 \SpecialChar ~
6904 \SpecialChar ~
6904 \SpecialChar ~
6905 \SpecialChar ~
6905 \SpecialChar ~
6906 \SpecialChar ~
6906 \SpecialChar ~
6907 \SpecialChar ~
6907 \SpecialChar ~
6908 \SpecialChar ~
6908 \SpecialChar ~
6909 \SpecialChar ~
6909 \SpecialChar ~
6910 \SpecialChar ~
6910 \SpecialChar ~
6911 \SpecialChar ~
6911 \SpecialChar ~
6912 \SpecialChar ~
6912 \SpecialChar ~
6913 \SpecialChar ~
6913 \SpecialChar ~
6914 \SpecialChar ~
6914 \SpecialChar ~
6915 \SpecialChar ~
6915 \SpecialChar ~
6916 \SpecialChar ~
6916 <10> ['scopes.py', 'strings.py']
6917 <10> ['scopes.py', 'strings.py']
6917 \layout Standard
6918 \layout Standard
6918
6919
6919 alist is now a normal python list you can loop over.
6920 alist is now a normal python list you can loop over.
6920 Using
6921 Using
6921 \family typewriter
6922 \family typewriter
6922 $
6923 $
6923 \family default
6924 \family default
6924 will expand back the python values when alias calls are made:
6925 will expand back the python values when alias calls are made:
6925 \layout Standard
6926 \layout Standard
6926
6927
6927
6928
6928 \family typewriter
6929 \family typewriter
6929 fperez[~/test]|11> for f in alist:
6930 fperez[~/test]|11> for f in alist:
6930 \newline
6931 \newline
6931
6932
6932 \begin_inset ERT
6933 \begin_inset ERT
6933 status Collapsed
6934 status Collapsed
6934
6935
6935 \layout Standard
6936 \layout Standard
6936
6937
6937 \backslash
6938 \backslash
6938 hspace*{0mm}
6939 hspace*{0mm}
6939 \end_inset
6940 \end_inset
6940
6941
6941 \SpecialChar ~
6942 \SpecialChar ~
6942 \SpecialChar ~
6943 \SpecialChar ~
6943 \SpecialChar ~
6944 \SpecialChar ~
6944 \SpecialChar ~
6945 \SpecialChar ~
6945 \SpecialChar ~
6946 \SpecialChar ~
6946 \SpecialChar ~
6947 \SpecialChar ~
6947 \SpecialChar ~
6948 \SpecialChar ~
6948 \SpecialChar ~
6949 \SpecialChar ~
6949 \SpecialChar ~
6950 \SpecialChar ~
6950 \SpecialChar ~
6951 \SpecialChar ~
6951 \SpecialChar ~
6952 \SpecialChar ~
6952 \SpecialChar ~
6953 \SpecialChar ~
6953 \SpecialChar ~
6954 \SpecialChar ~
6954 \SpecialChar ~
6955 \SpecialChar ~
6955 |..> \SpecialChar ~
6956 |..> \SpecialChar ~
6956 \SpecialChar ~
6957 \SpecialChar ~
6957 \SpecialChar ~
6958 \SpecialChar ~
6958 \SpecialChar ~
6959 \SpecialChar ~
6959 print 'file',f,
6960 print 'file',f,
6960 \newline
6961 \newline
6961
6962
6962 \begin_inset ERT
6963 \begin_inset ERT
6963 status Collapsed
6964 status Collapsed
6964
6965
6965 \layout Standard
6966 \layout Standard
6966
6967
6967 \backslash
6968 \backslash
6968 hspace*{0mm}
6969 hspace*{0mm}
6969 \end_inset
6970 \end_inset
6970
6971
6971 \SpecialChar ~
6972 \SpecialChar ~
6972 \SpecialChar ~
6973 \SpecialChar ~
6973 \SpecialChar ~
6974 \SpecialChar ~
6974 \SpecialChar ~
6975 \SpecialChar ~
6975 \SpecialChar ~
6976 \SpecialChar ~
6976 \SpecialChar ~
6977 \SpecialChar ~
6977 \SpecialChar ~
6978 \SpecialChar ~
6978 \SpecialChar ~
6979 \SpecialChar ~
6979 \SpecialChar ~
6980 \SpecialChar ~
6980 \SpecialChar ~
6981 \SpecialChar ~
6981 \SpecialChar ~
6982 \SpecialChar ~
6982 \SpecialChar ~
6983 \SpecialChar ~
6983 \SpecialChar ~
6984 \SpecialChar ~
6984 \SpecialChar ~
6985 \SpecialChar ~
6985 |..> \SpecialChar ~
6986 |..> \SpecialChar ~
6986 \SpecialChar ~
6987 \SpecialChar ~
6987 \SpecialChar ~
6988 \SpecialChar ~
6988 \SpecialChar ~
6989 \SpecialChar ~
6989 wc -l $f
6990 wc -l $f
6990 \newline
6991 \newline
6991
6992
6992 \begin_inset ERT
6993 \begin_inset ERT
6993 status Collapsed
6994 status Collapsed
6994
6995
6995 \layout Standard
6996 \layout Standard
6996
6997
6997 \backslash
6998 \backslash
6998 hspace*{0mm}
6999 hspace*{0mm}
6999 \end_inset
7000 \end_inset
7000
7001
7001 \SpecialChar ~
7002 \SpecialChar ~
7002 \SpecialChar ~
7003 \SpecialChar ~
7003 \SpecialChar ~
7004 \SpecialChar ~
7004 \SpecialChar ~
7005 \SpecialChar ~
7005 \SpecialChar ~
7006 \SpecialChar ~
7006 \SpecialChar ~
7007 \SpecialChar ~
7007 \SpecialChar ~
7008 \SpecialChar ~
7008 \SpecialChar ~
7009 \SpecialChar ~
7009 \SpecialChar ~
7010 \SpecialChar ~
7010 \SpecialChar ~
7011 \SpecialChar ~
7011 \SpecialChar ~
7012 \SpecialChar ~
7012 \SpecialChar ~
7013 \SpecialChar ~
7013 \SpecialChar ~
7014 \SpecialChar ~
7014 \SpecialChar ~
7015 \SpecialChar ~
7015 |..>
7016 |..>
7016 \newline
7017 \newline
7017 file scopes.py 13 scopes.py
7018 file scopes.py 13 scopes.py
7018 \newline
7019 \newline
7019 file strings.py 4 strings.py
7020 file strings.py 4 strings.py
7020 \layout Standard
7021 \layout Standard
7021
7022
7022 Note that you may need to protect your variables with braces if you want
7023 Note that you may need to protect your variables with braces if you want
7023 to append strings to their names.
7024 to append strings to their names.
7024 To copy all files in alist to
7025 To copy all files in alist to
7025 \family typewriter
7026 \family typewriter
7026 .bak
7027 .bak
7027 \family default
7028 \family default
7028 extensions, you must use:
7029 extensions, you must use:
7029 \layout Standard
7030 \layout Standard
7030
7031
7031
7032
7032 \family typewriter
7033 \family typewriter
7033 fperez[~/test]|12> for f in alist:
7034 fperez[~/test]|12> for f in alist:
7034 \newline
7035 \newline
7035
7036
7036 \begin_inset ERT
7037 \begin_inset ERT
7037 status Collapsed
7038 status Collapsed
7038
7039
7039 \layout Standard
7040 \layout Standard
7040
7041
7041 \backslash
7042 \backslash
7042 hspace*{0mm}
7043 hspace*{0mm}
7043 \end_inset
7044 \end_inset
7044
7045
7045 \SpecialChar ~
7046 \SpecialChar ~
7046 \SpecialChar ~
7047 \SpecialChar ~
7047 \SpecialChar ~
7048 \SpecialChar ~
7048 \SpecialChar ~
7049 \SpecialChar ~
7049 \SpecialChar ~
7050 \SpecialChar ~
7050 \SpecialChar ~
7051 \SpecialChar ~
7051 \SpecialChar ~
7052 \SpecialChar ~
7052 \SpecialChar ~
7053 \SpecialChar ~
7053 \SpecialChar ~
7054 \SpecialChar ~
7054 \SpecialChar ~
7055 \SpecialChar ~
7055 \SpecialChar ~
7056 \SpecialChar ~
7056 \SpecialChar ~
7057 \SpecialChar ~
7057 \SpecialChar ~
7058 \SpecialChar ~
7058 \SpecialChar ~
7059 \SpecialChar ~
7059 |..> \SpecialChar ~
7060 |..> \SpecialChar ~
7060 \SpecialChar ~
7061 \SpecialChar ~
7061 \SpecialChar ~
7062 \SpecialChar ~
7062 \SpecialChar ~
7063 \SpecialChar ~
7063 cp $f ${f}.bak
7064 cp $f ${f}.bak
7064 \layout Standard
7065 \layout Standard
7065
7066
7066 If you try using
7067 If you try using
7067 \family typewriter
7068 \family typewriter
7068 $f.bak
7069 $f.bak
7069 \family default
7070 \family default
7070 , you'll get an AttributeError exception saying that your string object
7071 , you'll get an AttributeError exception saying that your string object
7071 doesn't have a
7072 doesn't have a
7072 \family typewriter
7073 \family typewriter
7073 .bak
7074 .bak
7074 \family default
7075 \family default
7075 attribute.
7076 attribute.
7076 This is because the
7077 This is because the
7077 \family typewriter
7078 \family typewriter
7078 $
7079 $
7079 \family default
7080 \family default
7080 expansion mechanism allows you to expand full Python expressions:
7081 expansion mechanism allows you to expand full Python expressions:
7081 \layout Standard
7082 \layout Standard
7082
7083
7083
7084
7084 \family typewriter
7085 \family typewriter
7085 fperez[~/test]|13> echo "sys.platform is: $sys.platform"
7086 fperez[~/test]|13> echo "sys.platform is: $sys.platform"
7086 \newline
7087 \newline
7087 sys.platform is: linux2
7088 sys.platform is: linux2
7088 \layout Standard
7089 \layout Standard
7089
7090
7090 IPython's input history handling is still active, which allows you to rerun
7091 IPython's input history handling is still active, which allows you to rerun
7091 a single block of multi-line input by simply using exec:
7092 a single block of multi-line input by simply using exec:
7092 \newline
7093 \newline
7093
7094
7094 \family typewriter
7095 \family typewriter
7095 fperez[~/test]|14> $$alist = ls *.eps
7096 fperez[~/test]|14> $$alist = ls *.eps
7096 \newline
7097 \newline
7097 fperez[~/test]|15> exec _i11
7098 fperez[~/test]|15> exec _i11
7098 \newline
7099 \newline
7099 file image2.eps 921 image2.eps
7100 file image2.eps 921 image2.eps
7100 \newline
7101 \newline
7101 file image.eps 921 image.eps
7102 file image.eps 921 image.eps
7102 \layout Standard
7103 \layout Standard
7103
7104
7104 While these are new special-case syntaxes, they are designed to allow very
7105 While these are new special-case syntaxes, they are designed to allow very
7105 efficient use of the shell with minimal typing.
7106 efficient use of the shell with minimal typing.
7106 At an interactive shell prompt, conciseness of expression wins over readability.
7107 At an interactive shell prompt, conciseness of expression wins over readability.
7107 \layout Subsection
7108 \layout Subsection
7108
7109
7109 Useful functions and modules
7110 Useful functions and modules
7110 \layout Standard
7111 \layout Standard
7111
7112
7112 The os, sys and shutil modules from the Python standard library are automaticall
7113 The os, sys and shutil modules from the Python standard library are automaticall
7113 y loaded.
7114 y loaded.
7114 Some additional functions, useful for shell usage, are listed below.
7115 Some additional functions, useful for shell usage, are listed below.
7115 You can request more help about them with `
7116 You can request more help about them with `
7116 \family typewriter
7117 \family typewriter
7117 ?
7118 ?
7118 \family default
7119 \family default
7119 '.
7120 '.
7120 \layout Description
7121 \layout Description
7121
7122
7122
7123
7123 \family typewriter
7124 \family typewriter
7124 shell
7125 shell
7125 \family default
7126 \family default
7126 - execute a command in the underlying system shell
7127 - execute a command in the underlying system shell
7127 \layout Description
7128 \layout Description
7128
7129
7129
7130
7130 \family typewriter
7131 \family typewriter
7131 system
7132 system
7132 \family default
7133 \family default
7133 - like
7134 - like
7134 \family typewriter
7135 \family typewriter
7135 shell()
7136 shell()
7136 \family default
7137 \family default
7137 , but return the exit status of the command
7138 , but return the exit status of the command
7138 \layout Description
7139 \layout Description
7139
7140
7140
7141
7141 \family typewriter
7142 \family typewriter
7142 sout
7143 sout
7143 \family default
7144 \family default
7144 - capture the output of a command as a string
7145 - capture the output of a command as a string
7145 \layout Description
7146 \layout Description
7146
7147
7147
7148
7148 \family typewriter
7149 \family typewriter
7149 lout
7150 lout
7150 \family default
7151 \family default
7151 - capture the output of a command as a list (split on `
7152 - capture the output of a command as a list (split on `
7152 \backslash
7153 \backslash
7153 n')
7154 n')
7154 \layout Description
7155 \layout Description
7155
7156
7156
7157
7157 \family typewriter
7158 \family typewriter
7158 getoutputerror
7159 getoutputerror
7159 \family default
7160 \family default
7160 - capture (output,error) of a shell commandss
7161 - capture (output,error) of a shell commandss
7161 \layout Standard
7162 \layout Standard
7162
7163
7163
7164
7164 \family typewriter
7165 \family typewriter
7165 sout
7166 sout
7166 \family default
7167 \family default
7167 /
7168 /
7168 \family typewriter
7169 \family typewriter
7169 lout
7170 lout
7170 \family default
7171 \family default
7171 are the functional equivalents of
7172 are the functional equivalents of
7172 \family typewriter
7173 \family typewriter
7173 $
7174 $
7174 \family default
7175 \family default
7175 /
7176 /
7176 \family typewriter
7177 \family typewriter
7177 $$
7178 $$
7178 \family default
7179 \family default
7179 .
7180 .
7180 They are provided to allow you to capture system output in the middle of
7181 They are provided to allow you to capture system output in the middle of
7181 true python code, function definitions, etc (where
7182 true python code, function definitions, etc (where
7182 \family typewriter
7183 \family typewriter
7183 $
7184 $
7184 \family default
7185 \family default
7185 and
7186 and
7186 \family typewriter
7187 \family typewriter
7187 $$
7188 $$
7188 \family default
7189 \family default
7189 are invalid).
7190 are invalid).
7190 \layout Subsection
7191 \layout Subsection
7191
7192
7192 Directory management
7193 Directory management
7193 \layout Standard
7194 \layout Standard
7194
7195
7195 Since each command passed by pysh to the underlying system is executed in
7196 Since each command passed by pysh to the underlying system is executed in
7196 a subshell which exits immediately, you can NOT use !cd to navigate the
7197 a subshell which exits immediately, you can NOT use !cd to navigate the
7197 filesystem.
7198 filesystem.
7198 \layout Standard
7199 \layout Standard
7199
7200
7200 Pysh provides its own builtin
7201 Pysh provides its own builtin
7201 \family typewriter
7202 \family typewriter
7202 `%cd
7203 `%cd
7203 \family default
7204 \family default
7204 ' magic command to move in the filesystem (the
7205 ' magic command to move in the filesystem (the
7205 \family typewriter
7206 \family typewriter
7206 %
7207 %
7207 \family default
7208 \family default
7208 is not required with automagic on).
7209 is not required with automagic on).
7209 It also maintains a list of visited directories (use
7210 It also maintains a list of visited directories (use
7210 \family typewriter
7211 \family typewriter
7211 %dhist
7212 %dhist
7212 \family default
7213 \family default
7213 to see it) and allows direct switching to any of them.
7214 to see it) and allows direct switching to any of them.
7214 Type
7215 Type
7215 \family typewriter
7216 \family typewriter
7216 `cd?
7217 `cd?
7217 \family default
7218 \family default
7218 ' for more details.
7219 ' for more details.
7219 \layout Standard
7220 \layout Standard
7220
7221
7221
7222
7222 \family typewriter
7223 \family typewriter
7223 %pushd
7224 %pushd
7224 \family default
7225 \family default
7225 ,
7226 ,
7226 \family typewriter
7227 \family typewriter
7227 %popd
7228 %popd
7228 \family default
7229 \family default
7229 and
7230 and
7230 \family typewriter
7231 \family typewriter
7231 %dirs
7232 %dirs
7232 \family default
7233 \family default
7233 are provided for directory stack handling.
7234 are provided for directory stack handling.
7234 \layout Subsection
7235 \layout Subsection
7235
7236
7236 Prompt customization
7237 Prompt customization
7237 \layout Standard
7238 \layout Standard
7238
7239
7239 The supplied
7240 The supplied
7240 \family typewriter
7241 \family typewriter
7241 ipythonrc-pysh
7242 ipythonrc-pysh
7242 \family default
7243 \family default
7243 profile comes with an example of a very colored and detailed prompt, mainly
7244 profile comes with an example of a very colored and detailed prompt, mainly
7244 to serve as an illustration.
7245 to serve as an illustration.
7245 The valid escape sequences, besides color names, are:
7246 The valid escape sequences, besides color names, are:
7246 \layout Description
7247 \layout Description
7247
7248
7248
7249
7249 \backslash
7250 \backslash
7250 # - Prompt number.
7251 # - Prompt number.
7251 \layout Description
7252 \layout Description
7252
7253
7253
7254
7254 \backslash
7255 \backslash
7255 D - Dots, as many as there are digits in
7256 D - Dots, as many as there are digits in
7256 \backslash
7257 \backslash
7257 # (so they align).
7258 # (so they align).
7258 \layout Description
7259 \layout Description
7259
7260
7260
7261
7261 \backslash
7262 \backslash
7262 w - Current working directory (cwd).
7263 w - Current working directory (cwd).
7263 \layout Description
7264 \layout Description
7264
7265
7265
7266
7266 \backslash
7267 \backslash
7267 W - Basename of current working directory.
7268 W - Basename of current working directory.
7268 \layout Description
7269 \layout Description
7269
7270
7270
7271
7271 \backslash
7272 \backslash
7272 X
7273 X
7273 \emph on
7274 \emph on
7274 N
7275 N
7275 \emph default
7276 \emph default
7276 - Where
7277 - Where
7277 \emph on
7278 \emph on
7278 N
7279 N
7279 \emph default
7280 \emph default
7280 =0..5.
7281 =0..5.
7281 N terms of the cwd, with $HOME written as ~.
7282 N terms of the cwd, with $HOME written as ~.
7282 \layout Description
7283 \layout Description
7283
7284
7284
7285
7285 \backslash
7286 \backslash
7286 Y
7287 Y
7287 \emph on
7288 \emph on
7288 N
7289 N
7289 \emph default
7290 \emph default
7290 - Where
7291 - Where
7291 \emph on
7292 \emph on
7292 N
7293 N
7293 \emph default
7294 \emph default
7294 =0..5.
7295 =0..5.
7295 Like X
7296 Like X
7296 \emph on
7297 \emph on
7297 N
7298 N
7298 \emph default
7299 \emph default
7299 , but if ~ is term
7300 , but if ~ is term
7300 \emph on
7301 \emph on
7301 N
7302 N
7302 \emph default
7303 \emph default
7303 +1 it's also shown.
7304 +1 it's also shown.
7304 \layout Description
7305 \layout Description
7305
7306
7306
7307
7307 \backslash
7308 \backslash
7308 u - Username.
7309 u - Username.
7309 \layout Description
7310 \layout Description
7310
7311
7311
7312
7312 \backslash
7313 \backslash
7313 H - Full hostname.
7314 H - Full hostname.
7314 \layout Description
7315 \layout Description
7315
7316
7316
7317
7317 \backslash
7318 \backslash
7318 h - Hostname up to first '.'
7319 h - Hostname up to first '.'
7319 \layout Description
7320 \layout Description
7320
7321
7321
7322
7322 \backslash
7323 \backslash
7323 $ - Root symbol ($ or #).
7324 $ - Root symbol ($ or #).
7324
7325
7325 \layout Description
7326 \layout Description
7326
7327
7327
7328
7328 \backslash
7329 \backslash
7329 t - Current time, in H:M:S format.
7330 t - Current time, in H:M:S format.
7330 \layout Description
7331 \layout Description
7331
7332
7332
7333
7333 \backslash
7334 \backslash
7334 v - IPython release version.
7335 v - IPython release version.
7335
7336
7336 \layout Description
7337 \layout Description
7337
7338
7338
7339
7339 \backslash
7340 \backslash
7340 n - Newline.
7341 n - Newline.
7341
7342
7342 \layout Description
7343 \layout Description
7343
7344
7344
7345
7345 \backslash
7346 \backslash
7346 r - Carriage return.
7347 r - Carriage return.
7347
7348
7348 \layout Description
7349 \layout Description
7349
7350
7350
7351
7351 \backslash
7352 \backslash
7352
7353
7353 \backslash
7354 \backslash
7354 - An explicitly escaped '
7355 - An explicitly escaped '
7355 \backslash
7356 \backslash
7356 '.
7357 '.
7357 \layout Standard
7358 \layout Standard
7358
7359
7359 You can configure your prompt colors using any ANSI color escape.
7360 You can configure your prompt colors using any ANSI color escape.
7360 Each color escape sets the color for any subsequent text, until another
7361 Each color escape sets the color for any subsequent text, until another
7361 escape comes in and changes things.
7362 escape comes in and changes things.
7362 The valid color escapes are:
7363 The valid color escapes are:
7363 \layout Description
7364 \layout Description
7364
7365
7365
7366
7366 \backslash
7367 \backslash
7367 C_Black
7368 C_Black
7368 \layout Description
7369 \layout Description
7369
7370
7370
7371
7371 \backslash
7372 \backslash
7372 C_Blue
7373 C_Blue
7373 \layout Description
7374 \layout Description
7374
7375
7375
7376
7376 \backslash
7377 \backslash
7377 C_Brown
7378 C_Brown
7378 \layout Description
7379 \layout Description
7379
7380
7380
7381
7381 \backslash
7382 \backslash
7382 C_Cyan
7383 C_Cyan
7383 \layout Description
7384 \layout Description
7384
7385
7385
7386
7386 \backslash
7387 \backslash
7387 C_DarkGray
7388 C_DarkGray
7388 \layout Description
7389 \layout Description
7389
7390
7390
7391
7391 \backslash
7392 \backslash
7392 C_Green
7393 C_Green
7393 \layout Description
7394 \layout Description
7394
7395
7395
7396
7396 \backslash
7397 \backslash
7397 C_LightBlue
7398 C_LightBlue
7398 \layout Description
7399 \layout Description
7399
7400
7400
7401
7401 \backslash
7402 \backslash
7402 C_LightCyan
7403 C_LightCyan
7403 \layout Description
7404 \layout Description
7404
7405
7405
7406
7406 \backslash
7407 \backslash
7407 C_LightGray
7408 C_LightGray
7408 \layout Description
7409 \layout Description
7409
7410
7410
7411
7411 \backslash
7412 \backslash
7412 C_LightGreen
7413 C_LightGreen
7413 \layout Description
7414 \layout Description
7414
7415
7415
7416
7416 \backslash
7417 \backslash
7417 C_LightPurple
7418 C_LightPurple
7418 \layout Description
7419 \layout Description
7419
7420
7420
7421
7421 \backslash
7422 \backslash
7422 C_LightRed
7423 C_LightRed
7423 \layout Description
7424 \layout Description
7424
7425
7425
7426
7426 \backslash
7427 \backslash
7427 C_Purple
7428 C_Purple
7428 \layout Description
7429 \layout Description
7429
7430
7430
7431
7431 \backslash
7432 \backslash
7432 C_Red
7433 C_Red
7433 \layout Description
7434 \layout Description
7434
7435
7435
7436
7436 \backslash
7437 \backslash
7437 C_White
7438 C_White
7438 \layout Description
7439 \layout Description
7439
7440
7440
7441
7441 \backslash
7442 \backslash
7442 C_Yellow
7443 C_Yellow
7443 \layout Description
7444 \layout Description
7444
7445
7445
7446
7446 \backslash
7447 \backslash
7447 C_Normal Stop coloring, defaults to your terminal settings.
7448 C_Normal Stop coloring, defaults to your terminal settings.
7448 \layout Section
7449 \layout Section
7449
7450
7450
7451
7451 \begin_inset LatexCommand \label{sec:Threading-support}
7452 \begin_inset LatexCommand \label{sec:Threading-support}
7452
7453
7453 \end_inset
7454 \end_inset
7454
7455
7455 Threading support
7456 Threading support
7456 \layout Standard
7457 \layout Standard
7457
7458
7458
7459
7459 \series bold
7460 \series bold
7460 WARNING:
7461 WARNING:
7461 \series default
7462 \series default
7462 The threading support is still somewhat experimental, and it has only seen
7463 The threading support is still somewhat experimental, and it has only seen
7463 reasonable testing under Linux.
7464 reasonable testing under Linux.
7464 Threaded code is particularly tricky to debug, and it tends to show extremely
7465 Threaded code is particularly tricky to debug, and it tends to show extremely
7465 platform-dependent behavior.
7466 platform-dependent behavior.
7466 Since I only have access to Linux machines, I will have to rely on user's
7467 Since I only have access to Linux machines, I will have to rely on user's
7467 experiences and assistance for this area of IPython to improve under other
7468 experiences and assistance for this area of IPython to improve under other
7468 platforms.
7469 platforms.
7469 \layout Standard
7470 \layout Standard
7470
7471
7471 IPython, via the
7472 IPython, via the
7472 \family typewriter
7473 \family typewriter
7473 -gthread
7474 -gthread
7474 \family default
7475 \family default
7475 and
7476 and
7476 \family typewriter
7477 \family typewriter
7477 -wthread
7478 -wthread
7478 \family default
7479 \family default
7479 options (described in Sec.\SpecialChar ~
7480 options (described in Sec.\SpecialChar ~
7480
7481
7481 \begin_inset LatexCommand \ref{sec:threading-opts}
7482 \begin_inset LatexCommand \ref{sec:threading-opts}
7482
7483
7483 \end_inset
7484 \end_inset
7484
7485
7485 ), can run in multithreaded mode to support pyGTK and WXPython applications
7486 ), can run in multithreaded mode to support pyGTK and WXPython applications
7486 respectively.
7487 respectively.
7487 Both of these GUI toolkits need to control the python main loop of execution,
7488 Both of these GUI toolkits need to control the python main loop of execution,
7488 so under a normal Python interpreter, starting a pyGTK (or WXPython) applicatio
7489 so under a normal Python interpreter, starting a pyGTK (or WXPython) applicatio
7489 n will immediately freeze the shell.
7490 n will immediately freeze the shell.
7490
7491
7491 \layout Standard
7492 \layout Standard
7492
7493
7493 IPython, with one of these options (you can only use one at a time), separates
7494 IPython, with one of these options (you can only use one at a time), separates
7494 the graphical loop and IPython's code execution run into different threads.
7495 the graphical loop and IPython's code execution run into different threads.
7495 This allows you to test interactively (with
7496 This allows you to test interactively (with
7496 \family typewriter
7497 \family typewriter
7497 %run
7498 %run
7498 \family default
7499 \family default
7499 , for example) your GUI code without blocking.
7500 , for example) your GUI code without blocking.
7500 \layout Subsection
7501 \layout Subsection
7501
7502
7502 Tk issues
7503 Tk issues
7503 \layout Standard
7504 \layout Standard
7504
7505
7505 As indicated in Sec.\SpecialChar ~
7506 As indicated in Sec.\SpecialChar ~
7506
7507
7507 \begin_inset LatexCommand \ref{sec:threading-opts}
7508 \begin_inset LatexCommand \ref{sec:threading-opts}
7508
7509
7509 \end_inset
7510 \end_inset
7510
7511
7511 , a special
7512 , a special
7512 \family typewriter
7513 \family typewriter
7513 -tk
7514 -tk
7514 \family default
7515 \family default
7515 option is provided to try and allow Tk graphical applications to coexist
7516 option is provided to try and allow Tk graphical applications to coexist
7516 interactively with WX or GTK ones.
7517 interactively with WX or GTK ones.
7517 Whether this works at all, however, is very platform and configuration
7518 Whether this works at all, however, is very platform and configuration
7518 dependent.
7519 dependent.
7519 Please experiment with simple test cases before committing to using this
7520 Please experiment with simple test cases before committing to using this
7520 combination of Tk and WX/GTK threading in a production environment.
7521 combination of Tk and WX/GTK threading in a production environment.
7521 \layout Subsection
7522 \layout Subsection
7522
7523
7523 Signals and Threads
7524 Signals and Threads
7524 \layout Standard
7525 \layout Standard
7525
7526
7526 When any of the thread systems (WX or GTK) are active, either directly or
7527 When any of the thread systems (WX or GTK) are active, either directly or
7527 via
7528 via
7528 \family typewriter
7529 \family typewriter
7529 -pylab
7530 -pylab
7530 \family default
7531 \family default
7531 with a threaded backend, it is impossible to interrupt long-running Python
7532 with a threaded backend, it is impossible to interrupt long-running Python
7532 code via
7533 code via
7533 \family typewriter
7534 \family typewriter
7534 Ctrl-C
7535 Ctrl-C
7535 \family default
7536 \family default
7536 .
7537 .
7537 IPython can not pass the KeyboardInterrupt exception (or the underlying
7538 IPython can not pass the KeyboardInterrupt exception (or the underlying
7538
7539
7539 \family typewriter
7540 \family typewriter
7540 SIGINT
7541 SIGINT
7541 \family default
7542 \family default
7542 ) across threads, so any long-running process started from IPython will
7543 ) across threads, so any long-running process started from IPython will
7543 run to completion, or will have to be killed via an external (OS-based)
7544 run to completion, or will have to be killed via an external (OS-based)
7544 mechanism.
7545 mechanism.
7545 \layout Standard
7546 \layout Standard
7546
7547
7547 To the best of my knowledge, this limitation is imposed by the Python interprete
7548 To the best of my knowledge, this limitation is imposed by the Python interprete
7548 r itself, and it comes from the difficulty of writing portable signal/threaded
7549 r itself, and it comes from the difficulty of writing portable signal/threaded
7549 code.
7550 code.
7550 If any user is an expert on this topic and can suggest a better solution,
7551 If any user is an expert on this topic and can suggest a better solution,
7551 I would love to hear about it.
7552 I would love to hear about it.
7552 In the IPython sources, look at the
7553 In the IPython sources, look at the
7553 \family typewriter
7554 \family typewriter
7554 Shell.py
7555 Shell.py
7555 \family default
7556 \family default
7556 module, and in particular at the
7557 module, and in particular at the
7557 \family typewriter
7558 \family typewriter
7558 runcode()
7559 runcode()
7559 \family default
7560 \family default
7560 method.
7561 method.
7561
7562
7562 \layout Subsection
7563 \layout Subsection
7563
7564
7564 I/O pitfalls
7565 I/O pitfalls
7565 \layout Standard
7566 \layout Standard
7566
7567
7567 Be mindful that the Python interpreter switches between threads every
7568 Be mindful that the Python interpreter switches between threads every
7568 \begin_inset Formula $N$
7569 \begin_inset Formula $N$
7569 \end_inset
7570 \end_inset
7570
7571
7571 bytecodes, where the default value as of Python\SpecialChar ~
7572 bytecodes, where the default value as of Python\SpecialChar ~
7572 2.3 is
7573 2.3 is
7573 \begin_inset Formula $N=100.$
7574 \begin_inset Formula $N=100.$
7574 \end_inset
7575 \end_inset
7575
7576
7576 This value can be read by using the
7577 This value can be read by using the
7577 \family typewriter
7578 \family typewriter
7578 sys.getcheckinterval()
7579 sys.getcheckinterval()
7579 \family default
7580 \family default
7580 function, and it can be reset via
7581 function, and it can be reset via
7581 \family typewriter
7582 \family typewriter
7582 sys.setcheckinterval(
7583 sys.setcheckinterval(
7583 \emph on
7584 \emph on
7584 N
7585 N
7585 \emph default
7586 \emph default
7586 )
7587 )
7587 \family default
7588 \family default
7588 .
7589 .
7589 This switching of threads can cause subtly confusing effects if one of
7590 This switching of threads can cause subtly confusing effects if one of
7590 your threads is doing file I/O.
7591 your threads is doing file I/O.
7591 In text mode, most systems only flush file buffers when they encounter
7592 In text mode, most systems only flush file buffers when they encounter
7592 a
7593 a
7593 \family typewriter
7594 \family typewriter
7594 `
7595 `
7595 \backslash
7596 \backslash
7596 n'
7597 n'
7597 \family default
7598 \family default
7598 .
7599 .
7599 An instruction as simple as
7600 An instruction as simple as
7600 \family typewriter
7601 \family typewriter
7601
7602
7602 \newline
7603 \newline
7603 \SpecialChar ~
7604 \SpecialChar ~
7604 \SpecialChar ~
7605 \SpecialChar ~
7605 print >> filehandle,
7606 print >> filehandle,
7606 \begin_inset Quotes eld
7607 \begin_inset Quotes eld
7607 \end_inset
7608 \end_inset
7608
7609
7609 hello world
7610 hello world
7610 \begin_inset Quotes erd
7611 \begin_inset Quotes erd
7611 \end_inset
7612 \end_inset
7612
7613
7613
7614
7614 \family default
7615 \family default
7615
7616
7616 \newline
7617 \newline
7617 actually consists of several bytecodes, so it is possible that the newline
7618 actually consists of several bytecodes, so it is possible that the newline
7618 does not reach your file before the next thread switch.
7619 does not reach your file before the next thread switch.
7619 Similarly, if you are writing to a file in binary mode, the file won't
7620 Similarly, if you are writing to a file in binary mode, the file won't
7620 be flushed until the buffer fills, and your other thread may see apparently
7621 be flushed until the buffer fills, and your other thread may see apparently
7621 truncated files.
7622 truncated files.
7622
7623
7623 \layout Standard
7624 \layout Standard
7624
7625
7625 For this reason, if you are using IPython's thread support and have (for
7626 For this reason, if you are using IPython's thread support and have (for
7626 example) a GUI application which will read data generated by files written
7627 example) a GUI application which will read data generated by files written
7627 to from the IPython thread, the safest approach is to open all of your
7628 to from the IPython thread, the safest approach is to open all of your
7628 files in unbuffered mode (the third argument to the
7629 files in unbuffered mode (the third argument to the
7629 \family typewriter
7630 \family typewriter
7630 file/open
7631 file/open
7631 \family default
7632 \family default
7632 function is the buffering value):
7633 function is the buffering value):
7633 \newline
7634 \newline
7634
7635
7635 \family typewriter
7636 \family typewriter
7636 \SpecialChar ~
7637 \SpecialChar ~
7637 \SpecialChar ~
7638 \SpecialChar ~
7638 filehandle = open(filename,mode,0)
7639 filehandle = open(filename,mode,0)
7639 \layout Standard
7640 \layout Standard
7640
7641
7641 This is obviously a brute force way of avoiding race conditions with the
7642 This is obviously a brute force way of avoiding race conditions with the
7642 file buffering.
7643 file buffering.
7643 If you want to do it cleanly, and you have a resource which is being shared
7644 If you want to do it cleanly, and you have a resource which is being shared
7644 by the interactive IPython loop and your GUI thread, you should really
7645 by the interactive IPython loop and your GUI thread, you should really
7645 handle it with thread locking and syncrhonization properties.
7646 handle it with thread locking and syncrhonization properties.
7646 The Python documentation discusses these.
7647 The Python documentation discusses these.
7647 \layout Section
7648 \layout Section
7648
7649
7649
7650
7650 \begin_inset LatexCommand \label{sec:matplotlib-support}
7651 \begin_inset LatexCommand \label{sec:matplotlib-support}
7651
7652
7652 \end_inset
7653 \end_inset
7653
7654
7654 Plotting with
7655 Plotting with
7655 \family typewriter
7656 \family typewriter
7656 matplotlib
7657 matplotlib
7657 \family default
7658 \family default
7658
7659
7659 \layout Standard
7660 \layout Standard
7660
7661
7661 The matplotlib library (
7662 The matplotlib library (
7662 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
7663 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
7663
7664
7664 \end_inset
7665 \end_inset
7665
7666
7666 ) provides high quality 2D plotting for Python.
7667 ) provides high quality 2D plotting for Python.
7667 Matplotlib can produce plots on screen using a variety of GUI toolkits,
7668 Matplotlib can produce plots on screen using a variety of GUI toolkits,
7668 including Tk, GTK and WXPython.
7669 including Tk, GTK and WXPython.
7669 It also provides a number of commands useful for scientific computing,
7670 It also provides a number of commands useful for scientific computing,
7670 all with a syntax compatible with that of the popular Matlab program.
7671 all with a syntax compatible with that of the popular Matlab program.
7671 \layout Standard
7672 \layout Standard
7672
7673
7673 IPython accepts the special option
7674 IPython accepts the special option
7674 \family typewriter
7675 \family typewriter
7675 -pylab
7676 -pylab
7676 \family default
7677 \family default
7677 (Sec.\SpecialChar ~
7678 (Sec.\SpecialChar ~
7678
7679
7679 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
7680 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
7680
7681
7681 \end_inset
7682 \end_inset
7682
7683
7683 ).
7684 ).
7684 This configures it to support matplotlib, honoring the settings in the
7685 This configures it to support matplotlib, honoring the settings in the
7685
7686
7686 \family typewriter
7687 \family typewriter
7687 .matplotlibrc
7688 .matplotlibrc
7688 \family default
7689 \family default
7689 file.
7690 file.
7690 IPython will detect the user's choice of matplotlib GUI backend, and automatica
7691 IPython will detect the user's choice of matplotlib GUI backend, and automatica
7691 lly select the proper threading model to prevent blocking.
7692 lly select the proper threading model to prevent blocking.
7692 It also sets matplotlib in interactive mode and modifies
7693 It also sets matplotlib in interactive mode and modifies
7693 \family typewriter
7694 \family typewriter
7694 %run
7695 %run
7695 \family default
7696 \family default
7696 slightly, so that any matplotlib-based script can be executed using
7697 slightly, so that any matplotlib-based script can be executed using
7697 \family typewriter
7698 \family typewriter
7698 %run
7699 %run
7699 \family default
7700 \family default
7700 and the final
7701 and the final
7701 \family typewriter
7702 \family typewriter
7702 show()
7703 show()
7703 \family default
7704 \family default
7704 command does not block the interactive shell.
7705 command does not block the interactive shell.
7705 \layout Standard
7706 \layout Standard
7706
7707
7707 The
7708 The
7708 \family typewriter
7709 \family typewriter
7709 -pylab
7710 -pylab
7710 \family default
7711 \family default
7711 option must be given first in order for IPython to configure its threading
7712 option must be given first in order for IPython to configure its threading
7712 mode.
7713 mode.
7713 However, you can still issue other options afterwards.
7714 However, you can still issue other options afterwards.
7714 This allows you to have a matplotlib-based environment customized with
7715 This allows you to have a matplotlib-based environment customized with
7715 additional modules using the standard IPython profile mechanism (Sec.\SpecialChar ~
7716 additional modules using the standard IPython profile mechanism (Sec.\SpecialChar ~
7716
7717
7717 \begin_inset LatexCommand \ref{sec:profiles}
7718 \begin_inset LatexCommand \ref{sec:profiles}
7718
7719
7719 \end_inset
7720 \end_inset
7720
7721
7721 ): ``
7722 ): ``
7722 \family typewriter
7723 \family typewriter
7723 ipython -pylab -p myprofile
7724 ipython -pylab -p myprofile
7724 \family default
7725 \family default
7725 '' will load the profile defined in
7726 '' will load the profile defined in
7726 \family typewriter
7727 \family typewriter
7727 ipythonrc-myprofile
7728 ipythonrc-myprofile
7728 \family default
7729 \family default
7729 after configuring matplotlib.
7730 after configuring matplotlib.
7730 \layout Section
7731 \layout Section
7731
7732
7732
7733
7733 \begin_inset LatexCommand \label{sec:Gnuplot}
7734 \begin_inset LatexCommand \label{sec:Gnuplot}
7734
7735
7735 \end_inset
7736 \end_inset
7736
7737
7737 Plotting with
7738 Plotting with
7738 \family typewriter
7739 \family typewriter
7739 Gnuplot
7740 Gnuplot
7740 \layout Standard
7741 \layout Standard
7741
7742
7742 Through the magic extension system described in sec.
7743 Through the magic extension system described in sec.
7743
7744
7744 \begin_inset LatexCommand \ref{sec:magic}
7745 \begin_inset LatexCommand \ref{sec:magic}
7745
7746
7746 \end_inset
7747 \end_inset
7747
7748
7748 , IPython incorporates a mechanism for conveniently interfacing with the
7749 , IPython incorporates a mechanism for conveniently interfacing with the
7749 Gnuplot system (
7750 Gnuplot system (
7750 \begin_inset LatexCommand \htmlurl{http://www.gnuplot.info}
7751 \begin_inset LatexCommand \htmlurl{http://www.gnuplot.info}
7751
7752
7752 \end_inset
7753 \end_inset
7753
7754
7754 ).
7755 ).
7755 Gnuplot is a very complete 2D and 3D plotting package available for many
7756 Gnuplot is a very complete 2D and 3D plotting package available for many
7756 operating systems and commonly included in modern Linux distributions.
7757 operating systems and commonly included in modern Linux distributions.
7757
7758
7758 \layout Standard
7759 \layout Standard
7759
7760
7760 Besides having Gnuplot installed, this functionality requires the
7761 Besides having Gnuplot installed, this functionality requires the
7761 \family typewriter
7762 \family typewriter
7762 Gnuplot.py
7763 Gnuplot.py
7763 \family default
7764 \family default
7764 module for interfacing python with Gnuplot.
7765 module for interfacing python with Gnuplot.
7765 It can be downloaded from:
7766 It can be downloaded from:
7766 \begin_inset LatexCommand \htmlurl{http://gnuplot-py.sourceforge.net}
7767 \begin_inset LatexCommand \htmlurl{http://gnuplot-py.sourceforge.net}
7767
7768
7768 \end_inset
7769 \end_inset
7769
7770
7770 .
7771 .
7771 \layout Subsection
7772 \layout Subsection
7772
7773
7773 Proper Gnuplot configuration
7774 Proper Gnuplot configuration
7774 \layout Standard
7775 \layout Standard
7775
7776
7776 As of version 4.0, Gnuplot has excellent mouse and interactive keyboard support.
7777 As of version 4.0, Gnuplot has excellent mouse and interactive keyboard support.
7777 However, as of
7778 However, as of
7778 \family typewriter
7779 \family typewriter
7779 Gnuplot.py
7780 Gnuplot.py
7780 \family default
7781 \family default
7781 version 1.7, a new option was added to communicate between Python and Gnuplot
7782 version 1.7, a new option was added to communicate between Python and Gnuplot
7782 via FIFOs (pipes).
7783 via FIFOs (pipes).
7783 This mechanism, while fast, also breaks the mouse system.
7784 This mechanism, while fast, also breaks the mouse system.
7784 You must therefore set the variable
7785 You must therefore set the variable
7785 \family typewriter
7786 \family typewriter
7786 prefer_fifo_data
7787 prefer_fifo_data
7787 \family default
7788 \family default
7788 to
7789 to
7789 \family typewriter
7790 \family typewriter
7790 0
7791 0
7791 \family default
7792 \family default
7792 in file
7793 in file
7793 \family typewriter
7794 \family typewriter
7794 gp_unix.py
7795 gp_unix.py
7795 \family default
7796 \family default
7796 if you wish to keep the interactive mouse and keyboard features working
7797 if you wish to keep the interactive mouse and keyboard features working
7797 properly (
7798 properly (
7798 \family typewriter
7799 \family typewriter
7799 prefer_inline_data
7800 prefer_inline_data
7800 \family default
7801 \family default
7801 also must be
7802 also must be
7802 \family typewriter
7803 \family typewriter
7803 0
7804 0
7804 \family default
7805 \family default
7805 , but this is the default so unless you've changed it manually you should
7806 , but this is the default so unless you've changed it manually you should
7806 be fine).
7807 be fine).
7807 \layout Standard
7808 \layout Standard
7808
7809
7809 'Out of the box', Gnuplot is configured with a rather poor set of size,
7810 'Out of the box', Gnuplot is configured with a rather poor set of size,
7810 color and linewidth choices which make the graphs fairly hard to read on
7811 color and linewidth choices which make the graphs fairly hard to read on
7811 modern high-resolution displays (although they work fine on old 640x480
7812 modern high-resolution displays (although they work fine on old 640x480
7812 ones).
7813 ones).
7813 Below is a section of my
7814 Below is a section of my
7814 \family typewriter
7815 \family typewriter
7815 .Xdefaults
7816 .Xdefaults
7816 \family default
7817 \family default
7817 file which I use for having a more convenient Gnuplot setup.
7818 file which I use for having a more convenient Gnuplot setup.
7818 Remember to load it by running
7819 Remember to load it by running
7819 \family typewriter
7820 \family typewriter
7820 `xrdb .Xdefaults`
7821 `xrdb .Xdefaults`
7821 \family default
7822 \family default
7822 :
7823 :
7823 \layout Standard
7824 \layout Standard
7824
7825
7825
7826
7826 \family typewriter
7827 \family typewriter
7827 !******************************************************************
7828 !******************************************************************
7828 \newline
7829 \newline
7829 ! gnuplot options
7830 ! gnuplot options
7830 \newline
7831 \newline
7831 ! modify this for a convenient window size
7832 ! modify this for a convenient window size
7832 \newline
7833 \newline
7833 gnuplot*geometry: 780x580
7834 gnuplot*geometry: 780x580
7834 \layout Standard
7835 \layout Standard
7835
7836
7836
7837
7837 \family typewriter
7838 \family typewriter
7838 ! on-screen font (not for PostScript)
7839 ! on-screen font (not for PostScript)
7839 \newline
7840 \newline
7840 gnuplot*font: -misc-fixed-bold-r-normal--15-120-100-100-c-90-iso8859-1
7841 gnuplot*font: -misc-fixed-bold-r-normal--15-120-100-100-c-90-iso8859-1
7841 \layout Standard
7842 \layout Standard
7842
7843
7843
7844
7844 \family typewriter
7845 \family typewriter
7845 ! color options
7846 ! color options
7846 \newline
7847 \newline
7847 gnuplot*background: black
7848 gnuplot*background: black
7848 \newline
7849 \newline
7849 gnuplot*textColor: white
7850 gnuplot*textColor: white
7850 \newline
7851 \newline
7851 gnuplot*borderColor: white
7852 gnuplot*borderColor: white
7852 \newline
7853 \newline
7853 gnuplot*axisColor: white
7854 gnuplot*axisColor: white
7854 \newline
7855 \newline
7855 gnuplot*line1Color: red
7856 gnuplot*line1Color: red
7856 \newline
7857 \newline
7857 gnuplot*line2Color: green
7858 gnuplot*line2Color: green
7858 \newline
7859 \newline
7859 gnuplot*line3Color: blue
7860 gnuplot*line3Color: blue
7860 \newline
7861 \newline
7861 gnuplot*line4Color: magenta
7862 gnuplot*line4Color: magenta
7862 \newline
7863 \newline
7863 gnuplot*line5Color: cyan
7864 gnuplot*line5Color: cyan
7864 \newline
7865 \newline
7865 gnuplot*line6Color: sienna
7866 gnuplot*line6Color: sienna
7866 \newline
7867 \newline
7867 gnuplot*line7Color: orange
7868 gnuplot*line7Color: orange
7868 \newline
7869 \newline
7869 gnuplot*line8Color: coral
7870 gnuplot*line8Color: coral
7870 \layout Standard
7871 \layout Standard
7871
7872
7872
7873
7873 \family typewriter
7874 \family typewriter
7874 ! multiplicative factor for point styles
7875 ! multiplicative factor for point styles
7875 \newline
7876 \newline
7876 gnuplot*pointsize: 2
7877 gnuplot*pointsize: 2
7877 \layout Standard
7878 \layout Standard
7878
7879
7879
7880
7880 \family typewriter
7881 \family typewriter
7881 ! line width options (in pixels)
7882 ! line width options (in pixels)
7882 \newline
7883 \newline
7883 gnuplot*borderWidth: 2
7884 gnuplot*borderWidth: 2
7884 \newline
7885 \newline
7885 gnuplot*axisWidth: 2
7886 gnuplot*axisWidth: 2
7886 \newline
7887 \newline
7887 gnuplot*line1Width: 2
7888 gnuplot*line1Width: 2
7888 \newline
7889 \newline
7889 gnuplot*line2Width: 2
7890 gnuplot*line2Width: 2
7890 \newline
7891 \newline
7891 gnuplot*line3Width: 2
7892 gnuplot*line3Width: 2
7892 \newline
7893 \newline
7893 gnuplot*line4Width: 2
7894 gnuplot*line4Width: 2
7894 \newline
7895 \newline
7895 gnuplot*line5Width: 2
7896 gnuplot*line5Width: 2
7896 \newline
7897 \newline
7897 gnuplot*line6Width: 2
7898 gnuplot*line6Width: 2
7898 \newline
7899 \newline
7899 gnuplot*line7Width: 2
7900 gnuplot*line7Width: 2
7900 \newline
7901 \newline
7901 gnuplot*line8Width: 2
7902 gnuplot*line8Width: 2
7902 \layout Subsection
7903 \layout Subsection
7903
7904
7904 The
7905 The
7905 \family typewriter
7906 \family typewriter
7906 IPython.GnuplotRuntime
7907 IPython.GnuplotRuntime
7907 \family default
7908 \family default
7908 module
7909 module
7909 \layout Standard
7910 \layout Standard
7910
7911
7911 IPython includes a module called
7912 IPython includes a module called
7912 \family typewriter
7913 \family typewriter
7913 Gnuplot2.py
7914 Gnuplot2.py
7914 \family default
7915 \family default
7915 which extends and improves the default
7916 which extends and improves the default
7916 \family typewriter
7917 \family typewriter
7917 Gnuplot
7918 Gnuplot
7918 \family default
7919 \family default
7919 .
7920 .
7920 \family typewriter
7921 \family typewriter
7921 py
7922 py
7922 \family default
7923 \family default
7923 (which it still relies upon).
7924 (which it still relies upon).
7924 For example, the new
7925 For example, the new
7925 \family typewriter
7926 \family typewriter
7926 plot
7927 plot
7927 \family default
7928 \family default
7928 function adds several improvements to the original making it more convenient
7929 function adds several improvements to the original making it more convenient
7929 for interactive use, and
7930 for interactive use, and
7930 \family typewriter
7931 \family typewriter
7931 hardcopy
7932 hardcopy
7932 \family default
7933 \family default
7933 fixes a bug in the original which under some circumstances blocks the creation
7934 fixes a bug in the original which under some circumstances blocks the creation
7934 of PostScript output.
7935 of PostScript output.
7935 \layout Standard
7936 \layout Standard
7936
7937
7937 For scripting use,
7938 For scripting use,
7938 \family typewriter
7939 \family typewriter
7939 GnuplotRuntime.py
7940 GnuplotRuntime.py
7940 \family default
7941 \family default
7941 is provided, which wraps
7942 is provided, which wraps
7942 \family typewriter
7943 \family typewriter
7943 Gnuplot2.py
7944 Gnuplot2.py
7944 \family default
7945 \family default
7945 and creates a series of global aliases.
7946 and creates a series of global aliases.
7946 These make it easy to control Gnuplot plotting jobs through the Python
7947 These make it easy to control Gnuplot plotting jobs through the Python
7947 language.
7948 language.
7948 \layout Standard
7949 \layout Standard
7949
7950
7950 Below is some example code which illustrates how to configure Gnuplot inside
7951 Below is some example code which illustrates how to configure Gnuplot inside
7951 your own programs but have it available for further interactive use through
7952 your own programs but have it available for further interactive use through
7952 an embedded IPython instance.
7953 an embedded IPython instance.
7953 Simply run this file at a system prompt.
7954 Simply run this file at a system prompt.
7954 This file is provided as
7955 This file is provided as
7955 \family typewriter
7956 \family typewriter
7956 example-gnuplot.py
7957 example-gnuplot.py
7957 \family default
7958 \family default
7958 in the examples directory:
7959 in the examples directory:
7959 \layout Standard
7960 \layout Standard
7960
7961
7961
7962
7962 \begin_inset Include \verbatiminput{examples/example-gnuplot.py}
7963 \begin_inset Include \verbatiminput{examples/example-gnuplot.py}
7963 preview false
7964 preview false
7964
7965
7965 \end_inset
7966 \end_inset
7966
7967
7967
7968
7968 \layout Subsection
7969 \layout Subsection
7969
7970
7970 The
7971 The
7971 \family typewriter
7972 \family typewriter
7972 numeric
7973 numeric
7973 \family default
7974 \family default
7974 profile: a scientific computing environment
7975 profile: a scientific computing environment
7975 \layout Standard
7976 \layout Standard
7976
7977
7977 The
7978 The
7978 \family typewriter
7979 \family typewriter
7979 numeric
7980 numeric
7980 \family default
7981 \family default
7981 IPython profile, which you can activate with
7982 IPython profile, which you can activate with
7982 \family typewriter
7983 \family typewriter
7983 `ipython -p numeric
7984 `ipython -p numeric
7984 \family default
7985 \family default
7985 ' will automatically load the IPython Gnuplot extensions (plus Numeric and
7986 ' will automatically load the IPython Gnuplot extensions (plus Numeric and
7986 other useful things for numerical computing), contained in the
7987 other useful things for numerical computing), contained in the
7987 \family typewriter
7988 \family typewriter
7988 IPython.GnuplotInteractive
7989 IPython.GnuplotInteractive
7989 \family default
7990 \family default
7990 module.
7991 module.
7991 This will create the globals
7992 This will create the globals
7992 \family typewriter
7993 \family typewriter
7993 Gnuplot
7994 Gnuplot
7994 \family default
7995 \family default
7995 (an alias to the improved Gnuplot2 module),
7996 (an alias to the improved Gnuplot2 module),
7996 \family typewriter
7997 \family typewriter
7997 gp
7998 gp
7998 \family default
7999 \family default
7999 (a Gnuplot active instance), the new magic commands
8000 (a Gnuplot active instance), the new magic commands
8000 \family typewriter
8001 \family typewriter
8001 %gpc
8002 %gpc
8002 \family default
8003 \family default
8003 and
8004 and
8004 \family typewriter
8005 \family typewriter
8005 %gp_set_instance
8006 %gp_set_instance
8006 \family default
8007 \family default
8007 and several other convenient globals.
8008 and several other convenient globals.
8008 Type
8009 Type
8009 \family typewriter
8010 \family typewriter
8010 gphelp()
8011 gphelp()
8011 \family default
8012 \family default
8012 for further details.
8013 for further details.
8013 \layout Standard
8014 \layout Standard
8014
8015
8015 This should turn IPython into a convenient environment for numerical computing,
8016 This should turn IPython into a convenient environment for numerical computing,
8016 with all the functions in the NumPy library and the Gnuplot facilities
8017 with all the functions in the NumPy library and the Gnuplot facilities
8017 for plotting.
8018 for plotting.
8018 Further improvements can be obtained by loading the SciPy libraries for
8019 Further improvements can be obtained by loading the SciPy libraries for
8019 scientific computing, available at
8020 scientific computing, available at
8020 \begin_inset LatexCommand \htmlurl{http://scipy.org}
8021 \begin_inset LatexCommand \htmlurl{http://scipy.org}
8021
8022
8022 \end_inset
8023 \end_inset
8023
8024
8024 .
8025 .
8025 \layout Standard
8026 \layout Standard
8026
8027
8027 If you are in the middle of a working session with numerical objects and
8028 If you are in the middle of a working session with numerical objects and
8028 need to plot them but you didn't start the
8029 need to plot them but you didn't start the
8029 \family typewriter
8030 \family typewriter
8030 numeric
8031 numeric
8031 \family default
8032 \family default
8032 profile, you can load these extensions at any time by typing
8033 profile, you can load these extensions at any time by typing
8033 \newline
8034 \newline
8034
8035
8035 \family typewriter
8036 \family typewriter
8036 from IPython.GnuplotInteractive import *
8037 from IPython.GnuplotInteractive import *
8037 \newline
8038 \newline
8038
8039
8039 \family default
8040 \family default
8040 at the IPython prompt.
8041 at the IPython prompt.
8041 This will allow you to keep your objects intact and start using Gnuplot
8042 This will allow you to keep your objects intact and start using Gnuplot
8042 to view them.
8043 to view them.
8043 \layout Section
8044 \layout Section
8044
8045
8045 Reporting bugs
8046 Reporting bugs
8046 \layout Subsection*
8047 \layout Subsection*
8047
8048
8048 Automatic crash reports
8049 Automatic crash reports
8049 \layout Standard
8050 \layout Standard
8050
8051
8051 Ideally, IPython itself shouldn't crash.
8052 Ideally, IPython itself shouldn't crash.
8052 It will catch exceptions produced by you, but bugs in its internals will
8053 It will catch exceptions produced by you, but bugs in its internals will
8053 still crash it.
8054 still crash it.
8054 \layout Standard
8055 \layout Standard
8055
8056
8056 In such a situation, IPython will leave a file named
8057 In such a situation, IPython will leave a file named
8057 \family typewriter
8058 \family typewriter
8058 IPython_crash_report.txt
8059 IPython_crash_report.txt
8059 \family default
8060 \family default
8060 in your IPYTHONDIR directory (that way if crashes happen several times
8061 in your IPYTHONDIR directory (that way if crashes happen several times
8061 it won't litter many directories, the post-mortem file is always located
8062 it won't litter many directories, the post-mortem file is always located
8062 in the same place and new occurrences just overwrite the previous one).
8063 in the same place and new occurrences just overwrite the previous one).
8063 If you can mail this file to the developers (see sec.
8064 If you can mail this file to the developers (see sec.
8064
8065
8065 \begin_inset LatexCommand \ref{sec:credits}
8066 \begin_inset LatexCommand \ref{sec:credits}
8066
8067
8067 \end_inset
8068 \end_inset
8068
8069
8069 for names and addresses), it will help us
8070 for names and addresses), it will help us
8070 \emph on
8071 \emph on
8071 a lot
8072 a lot
8072 \emph default
8073 \emph default
8073 in understanding the cause of the problem and fixing it sooner.
8074 in understanding the cause of the problem and fixing it sooner.
8074 \layout Subsection*
8075 \layout Subsection*
8075
8076
8076 The bug tracker
8077 The bug tracker
8077 \layout Standard
8078 \layout Standard
8078
8079
8079 IPython also has an online bug-tracker, located at
8080 IPython also has an online bug-tracker, located at
8080 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython}
8081 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython}
8081
8082
8082 \end_inset
8083 \end_inset
8083
8084
8084 .
8085 .
8085 In addition to mailing the developers, it would be a good idea to file
8086 In addition to mailing the developers, it would be a good idea to file
8086 a bug report here.
8087 a bug report here.
8087 This will ensure that the issue is properly followed to conclusion.
8088 This will ensure that the issue is properly followed to conclusion.
8088 \layout Standard
8089 \layout Standard
8089
8090
8090 You can also use this bug tracker to file feature requests.
8091 You can also use this bug tracker to file feature requests.
8091 \layout Section
8092 \layout Section
8092
8093
8093 Brief history
8094 Brief history
8094 \layout Subsection
8095 \layout Subsection
8095
8096
8096 Origins
8097 Origins
8097 \layout Standard
8098 \layout Standard
8098
8099
8099 The current IPython system grew out of the following three projects:
8100 The current IPython system grew out of the following three projects:
8100 \layout List
8101 \layout List
8101 \labelwidthstring 00.00.0000
8102 \labelwidthstring 00.00.0000
8102
8103
8103 ipython by Fernando PοΏ½rez.
8104 ipython by Fernando PοΏ½rez.
8104 I was working on adding Mathematica-type prompts and a flexible configuration
8105 I was working on adding Mathematica-type prompts and a flexible configuration
8105 system (something better than
8106 system (something better than
8106 \family typewriter
8107 \family typewriter
8107 $PYTHONSTARTUP
8108 $PYTHONSTARTUP
8108 \family default
8109 \family default
8109 ) to the standard Python interactive interpreter.
8110 ) to the standard Python interactive interpreter.
8110 \layout List
8111 \layout List
8111 \labelwidthstring 00.00.0000
8112 \labelwidthstring 00.00.0000
8112
8113
8113 IPP by Janko Hauser.
8114 IPP by Janko Hauser.
8114 Very well organized, great usability.
8115 Very well organized, great usability.
8115 Had an old help system.
8116 Had an old help system.
8116 IPP was used as the `container' code into which I added the functionality
8117 IPP was used as the `container' code into which I added the functionality
8117 from ipython and LazyPython.
8118 from ipython and LazyPython.
8118 \layout List
8119 \layout List
8119 \labelwidthstring 00.00.0000
8120 \labelwidthstring 00.00.0000
8120
8121
8121 LazyPython by Nathan Gray.
8122 LazyPython by Nathan Gray.
8122 Simple but
8123 Simple but
8123 \emph on
8124 \emph on
8124 very
8125 very
8125 \emph default
8126 \emph default
8126 powerful.
8127 powerful.
8127 The quick syntax (auto parens, auto quotes) and verbose/colored tracebacks
8128 The quick syntax (auto parens, auto quotes) and verbose/colored tracebacks
8128 were all taken from here.
8129 were all taken from here.
8129 \layout Standard
8130 \layout Standard
8130
8131
8131 When I found out (see sec.
8132 When I found out (see sec.
8132
8133
8133 \begin_inset LatexCommand \ref{figgins}
8134 \begin_inset LatexCommand \ref{figgins}
8134
8135
8135 \end_inset
8136 \end_inset
8136
8137
8137 ) about IPP and LazyPython I tried to join all three into a unified system.
8138 ) about IPP and LazyPython I tried to join all three into a unified system.
8138 I thought this could provide a very nice working environment, both for
8139 I thought this could provide a very nice working environment, both for
8139 regular programming and scientific computing: shell-like features, IDL/Matlab
8140 regular programming and scientific computing: shell-like features, IDL/Matlab
8140 numerics, Mathematica-type prompt history and great object introspection
8141 numerics, Mathematica-type prompt history and great object introspection
8141 and help facilities.
8142 and help facilities.
8142 I think it worked reasonably well, though it was a lot more work than I
8143 I think it worked reasonably well, though it was a lot more work than I
8143 had initially planned.
8144 had initially planned.
8144 \layout Subsection
8145 \layout Subsection
8145
8146
8146 Current status
8147 Current status
8147 \layout Standard
8148 \layout Standard
8148
8149
8149 The above listed features work, and quite well for the most part.
8150 The above listed features work, and quite well for the most part.
8150 But until a major internal restructuring is done (see below), only bug
8151 But until a major internal restructuring is done (see below), only bug
8151 fixing will be done, no other features will be added (unless very minor
8152 fixing will be done, no other features will be added (unless very minor
8152 and well localized in the cleaner parts of the code).
8153 and well localized in the cleaner parts of the code).
8153 \layout Standard
8154 \layout Standard
8154
8155
8155 IPython consists of some 12000 lines of pure python code, of which roughly
8156 IPython consists of some 12000 lines of pure python code, of which roughly
8156 50% are fairly clean.
8157 50% are fairly clean.
8157 The other 50% are fragile, messy code which needs a massive restructuring
8158 The other 50% are fragile, messy code which needs a massive restructuring
8158 before any further major work is done.
8159 before any further major work is done.
8159 Even the messy code is fairly well documented though, and most of the problems
8160 Even the messy code is fairly well documented though, and most of the problems
8160 in the (non-existent) class design are well pointed to by a PyChecker run.
8161 in the (non-existent) class design are well pointed to by a PyChecker run.
8161 So the rewriting work isn't that bad, it will just be time-consuming.
8162 So the rewriting work isn't that bad, it will just be time-consuming.
8162 \layout Subsection
8163 \layout Subsection
8163
8164
8164 Future
8165 Future
8165 \layout Standard
8166 \layout Standard
8166
8167
8167 See the separate
8168 See the separate
8168 \family typewriter
8169 \family typewriter
8169 new_design
8170 new_design
8170 \family default
8171 \family default
8171 document for details.
8172 document for details.
8172 Ultimately, I would like to see IPython become part of the standard Python
8173 Ultimately, I would like to see IPython become part of the standard Python
8173 distribution as a `big brother with batteries' to the standard Python interacti
8174 distribution as a `big brother with batteries' to the standard Python interacti
8174 ve interpreter.
8175 ve interpreter.
8175 But that will never happen with the current state of the code, so all contribut
8176 But that will never happen with the current state of the code, so all contribut
8176 ions are welcome.
8177 ions are welcome.
8177 \layout Section
8178 \layout Section
8178
8179
8179 License
8180 License
8180 \layout Standard
8181 \layout Standard
8181
8182
8182 IPython is released under the terms of the BSD license, whose general form
8183 IPython is released under the terms of the BSD license, whose general form
8183 can be found at:
8184 can be found at:
8184 \begin_inset LatexCommand \htmlurl{http://www.opensource.org/licenses/bsd-license.php}
8185 \begin_inset LatexCommand \htmlurl{http://www.opensource.org/licenses/bsd-license.php}
8185
8186
8186 \end_inset
8187 \end_inset
8187
8188
8188 .
8189 .
8189 The full text of the IPython license is reproduced below:
8190 The full text of the IPython license is reproduced below:
8190 \layout Quote
8191 \layout Quote
8191
8192
8192
8193
8193 \family typewriter
8194 \family typewriter
8194 \size small
8195 \size small
8195 IPython is released under a BSD-type license.
8196 IPython is released under a BSD-type license.
8196 \layout Quote
8197 \layout Quote
8197
8198
8198
8199
8199 \family typewriter
8200 \family typewriter
8200 \size small
8201 \size small
8201 Copyright (c) 2001, 2002, 2003, 2004 Fernando Perez <fperez@colorado.edu>.
8202 Copyright (c) 2001, 2002, 2003, 2004 Fernando Perez <fperez@colorado.edu>.
8202 \layout Quote
8203 \layout Quote
8203
8204
8204
8205
8205 \family typewriter
8206 \family typewriter
8206 \size small
8207 \size small
8207 Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and
8208 Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and
8208 \newline
8209 \newline
8209 Nathaniel Gray <n8gray@caltech.edu>.
8210 Nathaniel Gray <n8gray@caltech.edu>.
8210 \layout Quote
8211 \layout Quote
8211
8212
8212
8213
8213 \family typewriter
8214 \family typewriter
8214 \size small
8215 \size small
8215 All rights reserved.
8216 All rights reserved.
8216 \layout Quote
8217 \layout Quote
8217
8218
8218
8219
8219 \family typewriter
8220 \family typewriter
8220 \size small
8221 \size small
8221 Redistribution and use in source and binary forms, with or without modification,
8222 Redistribution and use in source and binary forms, with or without modification,
8222 are permitted provided that the following conditions are met:
8223 are permitted provided that the following conditions are met:
8223 \layout Quote
8224 \layout Quote
8224
8225
8225
8226
8226 \family typewriter
8227 \family typewriter
8227 \size small
8228 \size small
8228 a.
8229 a.
8229 Redistributions of source code must retain the above copyright notice,
8230 Redistributions of source code must retain the above copyright notice,
8230 this list of conditions and the following disclaimer.
8231 this list of conditions and the following disclaimer.
8231 \layout Quote
8232 \layout Quote
8232
8233
8233
8234
8234 \family typewriter
8235 \family typewriter
8235 \size small
8236 \size small
8236 b.
8237 b.
8237 Redistributions in binary form must reproduce the above copyright notice,
8238 Redistributions in binary form must reproduce the above copyright notice,
8238 this list of conditions and the following disclaimer in the documentation
8239 this list of conditions and the following disclaimer in the documentation
8239 and/or other materials provided with the distribution.
8240 and/or other materials provided with the distribution.
8240 \layout Quote
8241 \layout Quote
8241
8242
8242
8243
8243 \family typewriter
8244 \family typewriter
8244 \size small
8245 \size small
8245 c.
8246 c.
8246 Neither the name of the copyright holders nor the names of any contributors
8247 Neither the name of the copyright holders nor the names of any contributors
8247 to this software may be used to endorse or promote products derived from
8248 to this software may be used to endorse or promote products derived from
8248 this software without specific prior written permission.
8249 this software without specific prior written permission.
8249 \layout Quote
8250 \layout Quote
8250
8251
8251
8252
8252 \family typewriter
8253 \family typewriter
8253 \size small
8254 \size small
8254 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
8255 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
8255 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
8256 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
8256 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
8257 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
8257 PURPOSE ARE DISCLAIMED.
8258 PURPOSE ARE DISCLAIMED.
8258 IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
8259 IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
8259 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
8260 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
8260 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8261 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8261 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8262 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8262 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8263 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8263 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8264 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8264 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8265 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8265
8266
8266 \layout Standard
8267 \layout Standard
8267
8268
8268 Individual authors are the holders of the copyright for their code and are
8269 Individual authors are the holders of the copyright for their code and are
8269 listed in each file.
8270 listed in each file.
8270 \layout Standard
8271 \layout Standard
8271
8272
8272 Some files (
8273 Some files (
8273 \family typewriter
8274 \family typewriter
8274 DPyGetOpt.py
8275 DPyGetOpt.py
8275 \family default
8276 \family default
8276 , for example) may be licensed under different conditions.
8277 , for example) may be licensed under different conditions.
8277 Ultimately each file indicates clearly the conditions under which its author/au
8278 Ultimately each file indicates clearly the conditions under which its author/au
8278 thors have decided to publish the code.
8279 thors have decided to publish the code.
8279 \layout Standard
8280 \layout Standard
8280
8281
8281 Versions of IPython up to and including 0.6.3 were released under the GNU
8282 Versions of IPython up to and including 0.6.3 were released under the GNU
8282 Lesser General Public License (LGPL), available at
8283 Lesser General Public License (LGPL), available at
8283 \begin_inset LatexCommand \htmlurl{http://www.gnu.org/copyleft/lesser.html}
8284 \begin_inset LatexCommand \htmlurl{http://www.gnu.org/copyleft/lesser.html}
8284
8285
8285 \end_inset
8286 \end_inset
8286
8287
8287 .
8288 .
8288 \layout Section
8289 \layout Section
8289
8290
8290
8291
8291 \begin_inset LatexCommand \label{sec:credits}
8292 \begin_inset LatexCommand \label{sec:credits}
8292
8293
8293 \end_inset
8294 \end_inset
8294
8295
8295 Credits
8296 Credits
8296 \layout Standard
8297 \layout Standard
8297
8298
8298 IPython is mainly developed by Fernando PοΏ½rez
8299 IPython is mainly developed by Fernando PοΏ½rez
8299 \family typewriter
8300 \family typewriter
8300 <fperez@colorado.edu>
8301 <fperez@colorado.edu>
8301 \family default
8302 \family default
8302 , but the project was born from mixing in Fernando's code with the IPP project
8303 , but the project was born from mixing in Fernando's code with the IPP project
8303 by Janko Hauser
8304 by Janko Hauser
8304 \family typewriter
8305 \family typewriter
8305 <jhauser-AT-zscout.de>
8306 <jhauser-AT-zscout.de>
8306 \family default
8307 \family default
8307 and LazyPython by Nathan Gray
8308 and LazyPython by Nathan Gray
8308 \family typewriter
8309 \family typewriter
8309 <n8gray-AT-caltech.edu>
8310 <n8gray-AT-caltech.edu>
8310 \family default
8311 \family default
8311 .
8312 .
8312 For all IPython-related requests, please contact Fernando.
8313 For all IPython-related requests, please contact Fernando.
8313 User or development help should be requested via the IPython mailing lists:
8314 User or development help should be requested via the IPython mailing lists:
8314 \layout Description
8315 \layout Description
8315
8316
8316 User\SpecialChar ~
8317 User\SpecialChar ~
8317 list:
8318 list:
8318 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-user}
8319 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-user}
8319
8320
8320 \end_inset
8321 \end_inset
8321
8322
8322
8323
8323 \layout Description
8324 \layout Description
8324
8325
8325 Developer's\SpecialChar ~
8326 Developer's\SpecialChar ~
8326 list:
8327 list:
8327 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-dev}
8328 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-dev}
8328
8329
8329 \end_inset
8330 \end_inset
8330
8331
8331
8332
8332 \layout Standard
8333 \layout Standard
8333
8334
8334 The IPython project is also very grateful to
8335 The IPython project is also very grateful to
8335 \begin_inset Foot
8336 \begin_inset Foot
8336 collapsed true
8337 collapsed true
8337
8338
8338 \layout Standard
8339 \layout Standard
8339
8340
8340 I've mangled email addresses to reduce spam, since the IPython manuals can
8341 I've mangled email addresses to reduce spam, since the IPython manuals can
8341 be accessed online.
8342 be accessed online.
8342 \end_inset
8343 \end_inset
8343
8344
8344 :
8345 :
8345 \layout Standard
8346 \layout Standard
8346
8347
8347 Bill Bumgarner
8348 Bill Bumgarner
8348 \family typewriter
8349 \family typewriter
8349 <bbum-AT-friday.com>
8350 <bbum-AT-friday.com>
8350 \family default
8351 \family default
8351 : for providing the DPyGetOpt module which gives very powerful and convenient
8352 : for providing the DPyGetOpt module which gives very powerful and convenient
8352 handling of command-line options (light years ahead of what Python 2.1.1's
8353 handling of command-line options (light years ahead of what Python 2.1.1's
8353 getopt module does).
8354 getopt module does).
8354 \layout Standard
8355 \layout Standard
8355
8356
8356 Ka-Ping Yee
8357 Ka-Ping Yee
8357 \family typewriter
8358 \family typewriter
8358 <ping-AT-lfw.org>
8359 <ping-AT-lfw.org>
8359 \family default
8360 \family default
8360 : for providing the Itpl module for convenient and powerful string interpolation
8361 : for providing the Itpl module for convenient and powerful string interpolation
8361 with a much nicer syntax than formatting through the '%' operator.
8362 with a much nicer syntax than formatting through the '%' operator.
8362 \layout Standard
8363 \layout Standard
8363
8364
8364 Arnd BοΏ½cker
8365 Arnd BοΏ½cker
8365 \family typewriter
8366 \family typewriter
8366 <baecker-AT-physik.tu-dresden.de>
8367 <baecker-AT-physik.tu-dresden.de>
8367 \family default
8368 \family default
8368 : for his many very useful suggestions and comments, and lots of help with
8369 : for his many very useful suggestions and comments, and lots of help with
8369 testing and documentation checking.
8370 testing and documentation checking.
8370 Many of IPython's newer features are a result of discussions with him (bugs
8371 Many of IPython's newer features are a result of discussions with him (bugs
8371 are still my fault, not his).
8372 are still my fault, not his).
8372 \layout Standard
8373 \layout Standard
8373
8374
8374 Obviously Guido van\SpecialChar ~
8375 Obviously Guido van\SpecialChar ~
8375 Rossum and the whole Python development team, that goes
8376 Rossum and the whole Python development team, that goes
8376 without saying.
8377 without saying.
8377 \layout Standard
8378 \layout Standard
8378
8379
8379 IPython's website is generously hosted at
8380 IPython's website is generously hosted at
8380 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
8381 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
8381
8382
8382 \end_inset
8383 \end_inset
8383
8384
8384 by Enthought (
8385 by Enthought (
8385 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
8386 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
8386
8387
8387 \end_inset
8388 \end_inset
8388
8389
8389 ).
8390 ).
8390 I am very grateful to them and all of the SciPy team for their contribution.
8391 I am very grateful to them and all of the SciPy team for their contribution.
8391 \layout Standard
8392 \layout Standard
8392
8393
8393
8394
8394 \begin_inset LatexCommand \label{figgins}
8395 \begin_inset LatexCommand \label{figgins}
8395
8396
8396 \end_inset
8397 \end_inset
8397
8398
8398 Fernando would also like to thank Stephen Figgins
8399 Fernando would also like to thank Stephen Figgins
8399 \family typewriter
8400 \family typewriter
8400 <fig-AT-monitor.net>
8401 <fig-AT-monitor.net>
8401 \family default
8402 \family default
8402 , an O'Reilly Python editor.
8403 , an O'Reilly Python editor.
8403 His Oct/11/2001 article about IPP and LazyPython, was what got this project
8404 His Oct/11/2001 article about IPP and LazyPython, was what got this project
8404 started.
8405 started.
8405 You can read it at:
8406 You can read it at:
8406 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html}
8407 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html}
8407
8408
8408 \end_inset
8409 \end_inset
8409
8410
8410 .
8411 .
8411 \layout Standard
8412 \layout Standard
8412
8413
8413 And last but not least, all the kind IPython users who have emailed new
8414 And last but not least, all the kind IPython users who have emailed new
8414 code, bug reports, fixes, comments and ideas.
8415 code, bug reports, fixes, comments and ideas.
8415 A brief list follows, please let me know if I have ommitted your name by
8416 A brief list follows, please let me know if I have ommitted your name by
8416 accident:
8417 accident:
8417 \layout List
8418 \layout List
8418 \labelwidthstring 00.00.0000
8419 \labelwidthstring 00.00.0000
8419
8420
8420 Jack\SpecialChar ~
8421 Jack\SpecialChar ~
8421 Moffit
8422 Moffit
8422 \family typewriter
8423 \family typewriter
8423 <jack-AT-xiph.org>
8424 <jack-AT-xiph.org>
8424 \family default
8425 \family default
8425 Bug fixes, including the infamous color problem.
8426 Bug fixes, including the infamous color problem.
8426 This bug alone caused many lost hours and frustration, many thanks to him
8427 This bug alone caused many lost hours and frustration, many thanks to him
8427 for the fix.
8428 for the fix.
8428 I've always been a fan of Ogg & friends, now I have one more reason to
8429 I've always been a fan of Ogg & friends, now I have one more reason to
8429 like these folks.
8430 like these folks.
8430 \newline
8431 \newline
8431 Jack is also contributing with Debian packaging and many other things.
8432 Jack is also contributing with Debian packaging and many other things.
8432 \layout List
8433 \layout List
8433 \labelwidthstring 00.00.0000
8434 \labelwidthstring 00.00.0000
8434
8435
8435 Alexander\SpecialChar ~
8436 Alexander\SpecialChar ~
8436 Schmolck
8437 Schmolck
8437 \family typewriter
8438 \family typewriter
8438 <a.schmolck-AT-gmx.net>
8439 <a.schmolck-AT-gmx.net>
8439 \family default
8440 \family default
8440 Emacs work, bug reports, bug fixes, ideas, lots more.
8441 Emacs work, bug reports, bug fixes, ideas, lots more.
8441 The ipython.el mode for (X)Emacs is Alex's code, providing full support
8442 The ipython.el mode for (X)Emacs is Alex's code, providing full support
8442 for IPython under (X)Emacs.
8443 for IPython under (X)Emacs.
8443 \layout List
8444 \layout List
8444 \labelwidthstring 00.00.0000
8445 \labelwidthstring 00.00.0000
8445
8446
8446 Andrea\SpecialChar ~
8447 Andrea\SpecialChar ~
8447 Riciputi
8448 Riciputi
8448 \family typewriter
8449 \family typewriter
8449 <andrea.riciputi-AT-libero.it>
8450 <andrea.riciputi-AT-libero.it>
8450 \family default
8451 \family default
8451 Mac OSX information, Fink package management.
8452 Mac OSX information, Fink package management.
8452 \layout List
8453 \layout List
8453 \labelwidthstring 00.00.0000
8454 \labelwidthstring 00.00.0000
8454
8455
8455 Gary\SpecialChar ~
8456 Gary\SpecialChar ~
8456 Bishop
8457 Bishop
8457 \family typewriter
8458 \family typewriter
8458 <gb-AT-cs.unc.edu>
8459 <gb-AT-cs.unc.edu>
8459 \family default
8460 \family default
8460 Bug reports, and patches to work around the exception handling idiosyncracies
8461 Bug reports, and patches to work around the exception handling idiosyncracies
8461 of WxPython.
8462 of WxPython.
8462 Readline and color support for Windows.
8463 Readline and color support for Windows.
8463 \layout List
8464 \layout List
8464 \labelwidthstring 00.00.0000
8465 \labelwidthstring 00.00.0000
8465
8466
8466 Jeffrey\SpecialChar ~
8467 Jeffrey\SpecialChar ~
8467 Collins
8468 Collins
8468 \family typewriter
8469 \family typewriter
8469 <Jeff.Collins-AT-vexcel.com>
8470 <Jeff.Collins-AT-vexcel.com>
8470 \family default
8471 \family default
8471 Bug reports.
8472 Bug reports.
8472 Much improved readline support, including fixes for Python 2.3.
8473 Much improved readline support, including fixes for Python 2.3.
8473 \layout List
8474 \layout List
8474 \labelwidthstring 00.00.0000
8475 \labelwidthstring 00.00.0000
8475
8476
8476 Dryice\SpecialChar ~
8477 Dryice\SpecialChar ~
8477 Liu
8478 Liu
8478 \family typewriter
8479 \family typewriter
8479 <dryice-AT-liu.com.cn>
8480 <dryice-AT-liu.com.cn>
8480 \family default
8481 \family default
8481 FreeBSD port.
8482 FreeBSD port.
8482 \layout List
8483 \layout List
8483 \labelwidthstring 00.00.0000
8484 \labelwidthstring 00.00.0000
8484
8485
8485 Mike\SpecialChar ~
8486 Mike\SpecialChar ~
8486 Heeter
8487 Heeter
8487 \family typewriter
8488 \family typewriter
8488 <korora-AT-SDF.LONESTAR.ORG>
8489 <korora-AT-SDF.LONESTAR.ORG>
8489 \layout List
8490 \layout List
8490 \labelwidthstring 00.00.0000
8491 \labelwidthstring 00.00.0000
8491
8492
8492 Christopher\SpecialChar ~
8493 Christopher\SpecialChar ~
8493 Hart
8494 Hart
8494 \family typewriter
8495 \family typewriter
8495 <hart-AT-caltech.edu>
8496 <hart-AT-caltech.edu>
8496 \family default
8497 \family default
8497 PDB integration.
8498 PDB integration.
8498 \layout List
8499 \layout List
8499 \labelwidthstring 00.00.0000
8500 \labelwidthstring 00.00.0000
8500
8501
8501 Milan\SpecialChar ~
8502 Milan\SpecialChar ~
8502 Zamazal
8503 Zamazal
8503 \family typewriter
8504 \family typewriter
8504 <pdm-AT-zamazal.org>
8505 <pdm-AT-zamazal.org>
8505 \family default
8506 \family default
8506 Emacs info.
8507 Emacs info.
8507 \layout List
8508 \layout List
8508 \labelwidthstring 00.00.0000
8509 \labelwidthstring 00.00.0000
8509
8510
8510 Philip\SpecialChar ~
8511 Philip\SpecialChar ~
8511 Hisley
8512 Hisley
8512 \family typewriter
8513 \family typewriter
8513 <compsys-AT-starpower.net>
8514 <compsys-AT-starpower.net>
8514 \layout List
8515 \layout List
8515 \labelwidthstring 00.00.0000
8516 \labelwidthstring 00.00.0000
8516
8517
8517 Holger\SpecialChar ~
8518 Holger\SpecialChar ~
8518 Krekel
8519 Krekel
8519 \family typewriter
8520 \family typewriter
8520 <pyth-AT-devel.trillke.net>
8521 <pyth-AT-devel.trillke.net>
8521 \family default
8522 \family default
8522 Tab completion, lots more.
8523 Tab completion, lots more.
8523 \layout List
8524 \layout List
8524 \labelwidthstring 00.00.0000
8525 \labelwidthstring 00.00.0000
8525
8526
8526 Robin\SpecialChar ~
8527 Robin\SpecialChar ~
8527 Siebler
8528 Siebler
8528 \family typewriter
8529 \family typewriter
8529 <robinsiebler-AT-starband.net>
8530 <robinsiebler-AT-starband.net>
8530 \layout List
8531 \layout List
8531 \labelwidthstring 00.00.0000
8532 \labelwidthstring 00.00.0000
8532
8533
8533 Ralf\SpecialChar ~
8534 Ralf\SpecialChar ~
8534 Ahlbrink
8535 Ahlbrink
8535 \family typewriter
8536 \family typewriter
8536 <ralf_ahlbrink-AT-web.de>
8537 <ralf_ahlbrink-AT-web.de>
8537 \layout List
8538 \layout List
8538 \labelwidthstring 00.00.0000
8539 \labelwidthstring 00.00.0000
8539
8540
8540 Thorsten\SpecialChar ~
8541 Thorsten\SpecialChar ~
8541 Kampe
8542 Kampe
8542 \family typewriter
8543 \family typewriter
8543 <thorsten-AT-thorstenkampe.de>
8544 <thorsten-AT-thorstenkampe.de>
8544 \layout List
8545 \layout List
8545 \labelwidthstring 00.00.0000
8546 \labelwidthstring 00.00.0000
8546
8547
8547 Fredrik\SpecialChar ~
8548 Fredrik\SpecialChar ~
8548 Kant
8549 Kant
8549 \family typewriter
8550 \family typewriter
8550 <fredrik.kant-AT-front.com>
8551 <fredrik.kant-AT-front.com>
8551 \family default
8552 \family default
8552 Windows setup.
8553 Windows setup.
8553 \layout List
8554 \layout List
8554 \labelwidthstring 00.00.0000
8555 \labelwidthstring 00.00.0000
8555
8556
8556 Syver\SpecialChar ~
8557 Syver\SpecialChar ~
8557 Enstad
8558 Enstad
8558 \family typewriter
8559 \family typewriter
8559 <syver-en-AT-online.no>
8560 <syver-en-AT-online.no>
8560 \family default
8561 \family default
8561 Windows setup.
8562 Windows setup.
8562 \layout List
8563 \layout List
8563 \labelwidthstring 00.00.0000
8564 \labelwidthstring 00.00.0000
8564
8565
8565 Richard
8566 Richard
8566 \family typewriter
8567 \family typewriter
8567 <rxe-AT-renre-europe.com>
8568 <rxe-AT-renre-europe.com>
8568 \family default
8569 \family default
8569 Global embedding.
8570 Global embedding.
8570 \layout List
8571 \layout List
8571 \labelwidthstring 00.00.0000
8572 \labelwidthstring 00.00.0000
8572
8573
8573 Hayden\SpecialChar ~
8574 Hayden\SpecialChar ~
8574 Callow
8575 Callow
8575 \family typewriter
8576 \family typewriter
8576 <h.callow-AT-elec.canterbury.ac.nz>
8577 <h.callow-AT-elec.canterbury.ac.nz>
8577 \family default
8578 \family default
8578 Gnuplot.py 1.6 compatibility.
8579 Gnuplot.py 1.6 compatibility.
8579 \layout List
8580 \layout List
8580 \labelwidthstring 00.00.0000
8581 \labelwidthstring 00.00.0000
8581
8582
8582 Leonardo\SpecialChar ~
8583 Leonardo\SpecialChar ~
8583 Santagada
8584 Santagada
8584 \family typewriter
8585 \family typewriter
8585 <retype-AT-terra.com.br>
8586 <retype-AT-terra.com.br>
8586 \family default
8587 \family default
8587 Fixes for Windows installation.
8588 Fixes for Windows installation.
8588 \layout List
8589 \layout List
8589 \labelwidthstring 00.00.0000
8590 \labelwidthstring 00.00.0000
8590
8591
8591 Christopher\SpecialChar ~
8592 Christopher\SpecialChar ~
8592 Armstrong
8593 Armstrong
8593 \family typewriter
8594 \family typewriter
8594 <radix-AT-twistedmatrix.com>
8595 <radix-AT-twistedmatrix.com>
8595 \family default
8596 \family default
8596 Bugfixes.
8597 Bugfixes.
8597 \layout List
8598 \layout List
8598 \labelwidthstring 00.00.0000
8599 \labelwidthstring 00.00.0000
8599
8600
8600 Francois\SpecialChar ~
8601 Francois\SpecialChar ~
8601 Pinard
8602 Pinard
8602 \family typewriter
8603 \family typewriter
8603 <pinard-AT-iro.umontreal.ca>
8604 <pinard-AT-iro.umontreal.ca>
8604 \family default
8605 \family default
8605 Code and documentation fixes.
8606 Code and documentation fixes.
8606 \layout List
8607 \layout List
8607 \labelwidthstring 00.00.0000
8608 \labelwidthstring 00.00.0000
8608
8609
8609 Cory\SpecialChar ~
8610 Cory\SpecialChar ~
8610 Dodt
8611 Dodt
8611 \family typewriter
8612 \family typewriter
8612 <cdodt-AT-fcoe.k12.ca.us>
8613 <cdodt-AT-fcoe.k12.ca.us>
8613 \family default
8614 \family default
8614 Bug reports and Windows ideas.
8615 Bug reports and Windows ideas.
8615 Patches for Windows installer.
8616 Patches for Windows installer.
8616 \layout List
8617 \layout List
8617 \labelwidthstring 00.00.0000
8618 \labelwidthstring 00.00.0000
8618
8619
8619 Olivier\SpecialChar ~
8620 Olivier\SpecialChar ~
8620 Aubert
8621 Aubert
8621 \family typewriter
8622 \family typewriter
8622 <oaubert-AT-bat710.univ-lyon1.fr>
8623 <oaubert-AT-bat710.univ-lyon1.fr>
8623 \family default
8624 \family default
8624 New magics.
8625 New magics.
8625 \layout List
8626 \layout List
8626 \labelwidthstring 00.00.0000
8627 \labelwidthstring 00.00.0000
8627
8628
8628 King\SpecialChar ~
8629 King\SpecialChar ~
8629 C.\SpecialChar ~
8630 C.\SpecialChar ~
8630 Shu
8631 Shu
8631 \family typewriter
8632 \family typewriter
8632 <kingshu-AT-myrealbox.com>
8633 <kingshu-AT-myrealbox.com>
8633 \family default
8634 \family default
8634 Autoindent patch.
8635 Autoindent patch.
8635 \layout List
8636 \layout List
8636 \labelwidthstring 00.00.0000
8637 \labelwidthstring 00.00.0000
8637
8638
8638 Chris\SpecialChar ~
8639 Chris\SpecialChar ~
8639 Drexler
8640 Drexler
8640 \family typewriter
8641 \family typewriter
8641 <chris-AT-ac-drexler.de>
8642 <chris-AT-ac-drexler.de>
8642 \family default
8643 \family default
8643 Readline packages for Win32/CygWin.
8644 Readline packages for Win32/CygWin.
8644 \layout List
8645 \layout List
8645 \labelwidthstring 00.00.0000
8646 \labelwidthstring 00.00.0000
8646
8647
8647 Gustavo\SpecialChar ~
8648 Gustavo\SpecialChar ~
8648 CοΏ½rdova\SpecialChar ~
8649 CοΏ½rdova\SpecialChar ~
8649 Avila
8650 Avila
8650 \family typewriter
8651 \family typewriter
8651 <gcordova-AT-sismex.com>
8652 <gcordova-AT-sismex.com>
8652 \family default
8653 \family default
8653 EvalDict code for nice, lightweight string interpolation.
8654 EvalDict code for nice, lightweight string interpolation.
8654 \layout List
8655 \layout List
8655 \labelwidthstring 00.00.0000
8656 \labelwidthstring 00.00.0000
8656
8657
8657 Kasper\SpecialChar ~
8658 Kasper\SpecialChar ~
8658 Souren
8659 Souren
8659 \family typewriter
8660 \family typewriter
8660 <Kasper.Souren-AT-ircam.fr>
8661 <Kasper.Souren-AT-ircam.fr>
8661 \family default
8662 \family default
8662 Bug reports, ideas.
8663 Bug reports, ideas.
8663 \layout List
8664 \layout List
8664 \labelwidthstring 00.00.0000
8665 \labelwidthstring 00.00.0000
8665
8666
8666 Gever\SpecialChar ~
8667 Gever\SpecialChar ~
8667 Tulley
8668 Tulley
8668 \family typewriter
8669 \family typewriter
8669 <gever-AT-helium.com>
8670 <gever-AT-helium.com>
8670 \family default
8671 \family default
8671 Code contributions.
8672 Code contributions.
8672 \layout List
8673 \layout List
8673 \labelwidthstring 00.00.0000
8674 \labelwidthstring 00.00.0000
8674
8675
8675 Ralf\SpecialChar ~
8676 Ralf\SpecialChar ~
8676 Schmitt
8677 Schmitt
8677 \family typewriter
8678 \family typewriter
8678 <ralf-AT-brainbot.com>
8679 <ralf-AT-brainbot.com>
8679 \family default
8680 \family default
8680 Bug reports & fixes.
8681 Bug reports & fixes.
8681 \layout List
8682 \layout List
8682 \labelwidthstring 00.00.0000
8683 \labelwidthstring 00.00.0000
8683
8684
8684 Oliver\SpecialChar ~
8685 Oliver\SpecialChar ~
8685 Sander
8686 Sander
8686 \family typewriter
8687 \family typewriter
8687 <osander-AT-gmx.de>
8688 <osander-AT-gmx.de>
8688 \family default
8689 \family default
8689 Bug reports.
8690 Bug reports.
8690 \layout List
8691 \layout List
8691 \labelwidthstring 00.00.0000
8692 \labelwidthstring 00.00.0000
8692
8693
8693 Rod\SpecialChar ~
8694 Rod\SpecialChar ~
8694 Holland
8695 Holland
8695 \family typewriter
8696 \family typewriter
8696 <rhh-AT-structurelabs.com>
8697 <rhh-AT-structurelabs.com>
8697 \family default
8698 \family default
8698 Bug reports and fixes to logging module.
8699 Bug reports and fixes to logging module.
8699 \layout List
8700 \layout List
8700 \labelwidthstring 00.00.0000
8701 \labelwidthstring 00.00.0000
8701
8702
8702 Daniel\SpecialChar ~
8703 Daniel\SpecialChar ~
8703 'Dang'\SpecialChar ~
8704 'Dang'\SpecialChar ~
8704 Griffith
8705 Griffith
8705 \family typewriter
8706 \family typewriter
8706 <pythondev-dang-AT-lazytwinacres.net>
8707 <pythondev-dang-AT-lazytwinacres.net>
8707 \family default
8708 \family default
8708 Fixes, enhancement suggestions for system shell use.
8709 Fixes, enhancement suggestions for system shell use.
8709 \layout List
8710 \layout List
8710 \labelwidthstring 00.00.0000
8711 \labelwidthstring 00.00.0000
8711
8712
8712 Viktor\SpecialChar ~
8713 Viktor\SpecialChar ~
8713 Ransmayr
8714 Ransmayr
8714 \family typewriter
8715 \family typewriter
8715 <viktor.ransmayr-AT-t-online.de>
8716 <viktor.ransmayr-AT-t-online.de>
8716 \family default
8717 \family default
8717 Tests and reports on Windows installation issues.
8718 Tests and reports on Windows installation issues.
8718 Contributed a true Windows binary installer.
8719 Contributed a true Windows binary installer.
8719 \layout List
8720 \layout List
8720 \labelwidthstring 00.00.0000
8721 \labelwidthstring 00.00.0000
8721
8722
8722 Mike\SpecialChar ~
8723 Mike\SpecialChar ~
8723 Salib
8724 Salib
8724 \family typewriter
8725 \family typewriter
8725 <msalib-AT-mit.edu>
8726 <msalib-AT-mit.edu>
8726 \family default
8727 \family default
8727 Help fixing a subtle bug related to traceback printing.
8728 Help fixing a subtle bug related to traceback printing.
8728 \layout List
8729 \layout List
8729 \labelwidthstring 00.00.0000
8730 \labelwidthstring 00.00.0000
8730
8731
8731 W.J.\SpecialChar ~
8732 W.J.\SpecialChar ~
8732 van\SpecialChar ~
8733 van\SpecialChar ~
8733 der\SpecialChar ~
8734 der\SpecialChar ~
8734 Laan
8735 Laan
8735 \family typewriter
8736 \family typewriter
8736 <gnufnork-AT-hetdigitalegat.nl>
8737 <gnufnork-AT-hetdigitalegat.nl>
8737 \family default
8738 \family default
8738 Bash-like prompt specials.
8739 Bash-like prompt specials.
8739 \layout List
8740 \layout List
8740 \labelwidthstring 00.00.0000
8741 \labelwidthstring 00.00.0000
8741
8742
8742 Ville\SpecialChar ~
8743 Ville\SpecialChar ~
8743 Vainio
8744 Vainio
8744 \family typewriter
8745 \family typewriter
8745 <vivainio-AT-kolumbus.fi>
8746 <vivainio-AT-kolumbus.fi>
8746 \family default
8747 \family default
8747 Bugfixes and suggestions.
8748 Bugfixes and suggestions.
8748 Excellent patches for many new features.
8749 Excellent patches for many new features.
8749 \layout List
8750 \layout List
8750 \labelwidthstring 00.00.0000
8751 \labelwidthstring 00.00.0000
8751
8752
8752 Antoon\SpecialChar ~
8753 Antoon\SpecialChar ~
8753 Pardon
8754 Pardon
8754 \family typewriter
8755 \family typewriter
8755 <Antoon.Pardon-AT-rece.vub.ac.be>
8756 <Antoon.Pardon-AT-rece.vub.ac.be>
8756 \family default
8757 \family default
8757 Critical fix for the multithreaded IPython.
8758 Critical fix for the multithreaded IPython.
8758 \layout List
8759 \layout List
8759 \labelwidthstring 00.00.0000
8760 \labelwidthstring 00.00.0000
8760
8761
8761 John\SpecialChar ~
8762 John\SpecialChar ~
8762 Hunter
8763 Hunter
8763 \family typewriter
8764 \family typewriter
8764 <jdhunter-AT-nitace.bsd.uchicago.edu>
8765 <jdhunter-AT-nitace.bsd.uchicago.edu>
8765 \family default
8766 \family default
8766 Matplotlib author, helped with all the development of support for matplotlib
8767 Matplotlib author, helped with all the development of support for matplotlib
8767 in IPyhton, including making necessary changes to matplotlib itself.
8768 in IPyhton, including making necessary changes to matplotlib itself.
8768 \layout List
8769 \layout List
8769 \labelwidthstring 00.00.0000
8770 \labelwidthstring 00.00.0000
8770
8771
8771 Matthew\SpecialChar ~
8772 Matthew\SpecialChar ~
8772 Arnison
8773 Arnison
8773 \family typewriter
8774 \family typewriter
8774 <maffew-AT-cat.org.au>
8775 <maffew-AT-cat.org.au>
8775 \family default
8776 \family default
8776 Bug reports, `
8777 Bug reports, `
8777 \family typewriter
8778 \family typewriter
8778 %run -d
8779 %run -d
8779 \family default
8780 \family default
8780 ' idea.
8781 ' idea.
8781 \layout List
8782 \layout List
8782 \labelwidthstring 00.00.0000
8783 \labelwidthstring 00.00.0000
8783
8784
8784 Prabhu\SpecialChar ~
8785 Prabhu\SpecialChar ~
8785 Ramachandran
8786 Ramachandran
8786 \family typewriter
8787 \family typewriter
8787 <prabhu_r-AT-users.sourceforge.net>
8788 <prabhu_r-AT-users.sourceforge.net>
8788 \family default
8789 \family default
8789 Help with (X)Emacs support, threading patches, ideas...
8790 Help with (X)Emacs support, threading patches, ideas...
8790 \layout List
8791 \layout List
8791 \labelwidthstring 00.00.0000
8792 \labelwidthstring 00.00.0000
8792
8793
8793 Norbert\SpecialChar ~
8794 Norbert\SpecialChar ~
8794 Tretkowski
8795 Tretkowski
8795 \family typewriter
8796 \family typewriter
8796 <tretkowski-AT-inittab.de>
8797 <tretkowski-AT-inittab.de>
8797 \family default
8798 \family default
8798 help with Debian packaging and distribution.
8799 help with Debian packaging and distribution.
8799 \layout List
8800 \layout List
8800 \labelwidthstring 00.00.0000
8801 \labelwidthstring 00.00.0000
8801
8802
8802 Robert\SpecialChar ~
8803 Robert\SpecialChar ~
8803 Kern
8804 Kern
8804 \family typewriter
8805 \family typewriter
8805 <rkern-AT-ucsd.edu>
8806 <rkern-AT-ucsd.edu>
8806 \family default
8807 \family default
8807 help with OSX issues, much help in general with various Python topics,
8808 help with OSX issues, much help in general with various Python topics,
8808 especially related to scientific computing.
8809 especially related to scientific computing.
8809 \layout List
8810 \layout List
8810 \labelwidthstring 00.00.0000
8811 \labelwidthstring 00.00.0000
8811
8812
8812 George\SpecialChar ~
8813 George\SpecialChar ~
8813 Sakkis <
8814 Sakkis <
8814 \family typewriter
8815 \family typewriter
8815 gsakkis-AT-eden.rutgers.edu>
8816 gsakkis-AT-eden.rutgers.edu>
8816 \family default
8817 \family default
8817 New matcher for tab-completing named arguments of user-defined functions.
8818 New matcher for tab-completing named arguments of user-defined functions.
8818 \the_end
8819 \the_end
General Comments 0
You need to be logged in to leave comments. Login now