##// END OF EJS Templates
Update docs logo to our current one, other minor fixes.
Fernando Perez -
Show More
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -1,1311 +1,1308 b''
1 =================
1 =================
2 IPython reference
2 IPython reference
3 =================
3 =================
4
4
5 .. _command_line_options:
5 .. _command_line_options:
6
6
7 Command-line usage
7 Command-line usage
8 ==================
8 ==================
9
9
10 You start IPython with the command::
10 You start IPython with the command::
11
11
12 $ ipython [options] files
12 $ ipython [options] files
13
13
14 If invoked with no options, it executes all the files listed in sequence
14 If invoked with no options, it executes all the files listed in sequence
15 and drops you into the interpreter while still acknowledging any options
15 and drops you into the interpreter while still acknowledging any options
16 you may have set in your ipython_config.py. This behavior is different from
16 you may have set in your ipython_config.py. This behavior is different from
17 standard Python, which when called as python -i will only execute one
17 standard Python, which when called as python -i will only execute one
18 file and ignore your configuration setup.
18 file and ignore your configuration setup.
19
19
20 Please note that some of the configuration options are not available at
20 Please note that some of the configuration options are not available at
21 the command line, simply because they are not practical here. Look into
21 the command line, simply because they are not practical here. Look into
22 your ipythonrc configuration file for details on those. This file is typically
22 your ipythonrc configuration file for details on those. This file is typically
23 installed in the IPYTHON_DIR directory. For Linux
23 installed in the IPYTHON_DIR directory. For Linux
24 users, this will be $HOME/.config/ipython, and for other users it will be
24 users, this will be $HOME/.config/ipython, and for other users it will be
25 $HOME/.ipython. For Windows users, $HOME resolves to C:\\Documents and
25 $HOME/.ipython. For Windows users, $HOME resolves to C:\\Documents and
26 Settings\\YourUserName in most instances.
26 Settings\\YourUserName in most instances.
27
27
28
28
29 Eventloop integration
29 Eventloop integration
30 ---------------------
30 ---------------------
31
31
32 Previously IPython had command line options for controlling GUI event loop
32 Previously IPython had command line options for controlling GUI event loop
33 integration (-gthread, -qthread, -q4thread, -wthread, -pylab). As of IPython
33 integration (-gthread, -qthread, -q4thread, -wthread, -pylab). As of IPython
34 version 0.11, these have been removed. Please see the new ``%gui``
34 version 0.11, these have been removed. Please see the new ``%gui``
35 magic command or :ref:`this section <gui_support>` for details on the new
35 magic command or :ref:`this section <gui_support>` for details on the new
36 interface, or specify the gui at the commandline::
36 interface, or specify the gui at the commandline::
37
37
38 $ ipython --gui=qt
38 $ ipython --gui=qt
39
39
40
40
41 Regular Options
41 Regular Options
42 ---------------
42 ---------------
43
43
44 After the above threading options have been given, regular options can
44 After the above threading options have been given, regular options can
45 follow in any order. All options can be abbreviated to their shortest
45 follow in any order. All options can be abbreviated to their shortest
46 non-ambiguous form and are case-sensitive. One or two dashes can be
46 non-ambiguous form and are case-sensitive. One or two dashes can be
47 used. Some options have an alternate short form, indicated after a ``|``.
47 used. Some options have an alternate short form, indicated after a ``|``.
48
48
49 Most options can also be set from your ipythonrc configuration file. See
49 Most options can also be set from your ipythonrc configuration file. See
50 the provided example for more details on what the options do. Options
50 the provided example for more details on what the options do. Options
51 given at the command line override the values set in the ipythonrc file.
51 given at the command line override the values set in the ipythonrc file.
52
52
53 All options with a [no] prepended can be specified in negated form
53 All options with a [no] prepended can be specified in negated form
54 (--no-option instead of --option) to turn the feature off.
54 (--no-option instead of --option) to turn the feature off.
55
55
56 ``-h, --help`` print a help message and exit.
56 ``-h, --help`` print a help message and exit.
57
57
58 ``--pylab, pylab=<name>``
58 ``--pylab, pylab=<name>``
59 See :ref:`Matplotlib support <matplotlib_support>`
59 See :ref:`Matplotlib support <matplotlib_support>`
60 for more details.
60 for more details.
61
61
62 ``--autocall=<val>``
62 ``--autocall=<val>``
63 Make IPython automatically call any callable object even if you
63 Make IPython automatically call any callable object even if you
64 didn't type explicit parentheses. For example, 'str 43' becomes
64 didn't type explicit parentheses. For example, 'str 43' becomes
65 'str(43)' automatically. The value can be '0' to disable the feature,
65 'str(43)' automatically. The value can be '0' to disable the feature,
66 '1' for smart autocall, where it is not applied if there are no more
66 '1' for smart autocall, where it is not applied if there are no more
67 arguments on the line, and '2' for full autocall, where all callable
67 arguments on the line, and '2' for full autocall, where all callable
68 objects are automatically called (even if no arguments are
68 objects are automatically called (even if no arguments are
69 present). The default is '1'.
69 present). The default is '1'.
70
70
71 ``--[no-]autoindent``
71 ``--[no-]autoindent``
72 Turn automatic indentation on/off.
72 Turn automatic indentation on/off.
73
73
74 ``--[no-]automagic``
74 ``--[no-]automagic``
75 make magic commands automatic (without needing their first character
75 make magic commands automatic (without needing their first character
76 to be %). Type %magic at the IPython prompt for more information.
76 to be %). Type %magic at the IPython prompt for more information.
77
77
78 ``--[no-]autoedit_syntax``
78 ``--[no-]autoedit_syntax``
79 When a syntax error occurs after editing a file, automatically
79 When a syntax error occurs after editing a file, automatically
80 open the file to the trouble causing line for convenient
80 open the file to the trouble causing line for convenient
81 fixing.
81 fixing.
82
82
83 ``--[no-]banner``
83 ``--[no-]banner``
84 Print the initial information banner (default on).
84 Print the initial information banner (default on).
85
85
86 ``--c=<command>``
86 ``--c=<command>``
87 execute the given command string. This is similar to the -c
87 execute the given command string. This is similar to the -c
88 option in the normal Python interpreter.
88 option in the normal Python interpreter.
89
89
90 ``--cache-size=<n>``
90 ``--cache-size=<n>``
91 size of the output cache (maximum number of entries to hold in
91 size of the output cache (maximum number of entries to hold in
92 memory). The default is 1000, you can change it permanently in your
92 memory). The default is 1000, you can change it permanently in your
93 config file. Setting it to 0 completely disables the caching system,
93 config file. Setting it to 0 completely disables the caching system,
94 and the minimum value accepted is 20 (if you provide a value less than
94 and the minimum value accepted is 20 (if you provide a value less than
95 20, it is reset to 0 and a warning is issued) This limit is defined
95 20, it is reset to 0 and a warning is issued) This limit is defined
96 because otherwise you'll spend more time re-flushing a too small cache
96 because otherwise you'll spend more time re-flushing a too small cache
97 than working.
97 than working.
98
98
99 ``--classic``
99 ``--classic``
100 Gives IPython a similar feel to the classic Python
100 Gives IPython a similar feel to the classic Python
101 prompt.
101 prompt.
102
102
103 ``--colors=<scheme>``
103 ``--colors=<scheme>``
104 Color scheme for prompts and exception reporting. Currently
104 Color scheme for prompts and exception reporting. Currently
105 implemented: NoColor, Linux and LightBG.
105 implemented: NoColor, Linux and LightBG.
106
106
107 ``--[no-]color_info``
107 ``--[no-]color_info``
108 IPython can display information about objects via a set of functions,
108 IPython can display information about objects via a set of functions,
109 and optionally can use colors for this, syntax highlighting source
109 and optionally can use colors for this, syntax highlighting source
110 code and various other elements. However, because this information is
110 code and various other elements. However, because this information is
111 passed through a pager (like 'less') and many pagers get confused with
111 passed through a pager (like 'less') and many pagers get confused with
112 color codes, this option is off by default. You can test it and turn
112 color codes, this option is off by default. You can test it and turn
113 it on permanently in your ipythonrc file if it works for you. As a
113 it on permanently in your ipythonrc file if it works for you. As a
114 reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
114 reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
115 that in RedHat 7.2 doesn't.
115 that in RedHat 7.2 doesn't.
116
116
117 Test it and turn it on permanently if it works with your
117 Test it and turn it on permanently if it works with your
118 system. The magic function %color_info allows you to toggle this
118 system. The magic function %color_info allows you to toggle this
119 interactively for testing.
119 interactively for testing.
120
120
121 ``--[no-]debug``
121 ``--[no-]debug``
122 Show information about the loading process. Very useful to pin down
122 Show information about the loading process. Very useful to pin down
123 problems with your configuration files or to get details about
123 problems with your configuration files or to get details about
124 session restores.
124 session restores.
125
125
126 ``--[no-]deep_reload``
126 ``--[no-]deep_reload``
127 IPython can use the deep_reload module which reloads changes in
127 IPython can use the deep_reload module which reloads changes in
128 modules recursively (it replaces the reload() function, so you don't
128 modules recursively (it replaces the reload() function, so you don't
129 need to change anything to use it). deep_reload() forces a full
129 need to change anything to use it). deep_reload() forces a full
130 reload of modules whose code may have changed, which the default
130 reload of modules whose code may have changed, which the default
131 reload() function does not.
131 reload() function does not.
132
132
133 When deep_reload is off, IPython will use the normal reload(),
133 When deep_reload is off, IPython will use the normal reload(),
134 but deep_reload will still be available as dreload(). This
134 but deep_reload will still be available as dreload(). This
135 feature is off by default [which means that you have both
135 feature is off by default [which means that you have both
136 normal reload() and dreload()].
136 normal reload() and dreload()].
137
137
138 ``--editor=<name>``
138 ``--editor=<name>``
139 Which editor to use with the %edit command. By default,
139 Which editor to use with the %edit command. By default,
140 IPython will honor your EDITOR environment variable (if not
140 IPython will honor your EDITOR environment variable (if not
141 set, vi is the Unix default and notepad the Windows one).
141 set, vi is the Unix default and notepad the Windows one).
142 Since this editor is invoked on the fly by IPython and is
142 Since this editor is invoked on the fly by IPython and is
143 meant for editing small code snippets, you may want to use a
143 meant for editing small code snippets, you may want to use a
144 small, lightweight editor here (in case your default EDITOR is
144 small, lightweight editor here (in case your default EDITOR is
145 something like Emacs).
145 something like Emacs).
146
146
147 ``--ipython_dir=<name>``
147 ``--ipython_dir=<name>``
148 name of your IPython configuration directory IPYTHON_DIR. This
148 name of your IPython configuration directory IPYTHON_DIR. This
149 can also be specified through the environment variable
149 can also be specified through the environment variable
150 IPYTHON_DIR.
150 IPYTHON_DIR.
151
151
152 ``--logfile=<name>``
152 ``--logfile=<name>``
153 specify the name of your logfile.
153 specify the name of your logfile.
154
154
155 This implies ``%logstart`` at the beginning of your session
155 This implies ``%logstart`` at the beginning of your session
156
156
157 generate a log file of all input. The file is named
157 generate a log file of all input. The file is named
158 ipython_log.py in your current directory (which prevents logs
158 ipython_log.py in your current directory (which prevents logs
159 from multiple IPython sessions from trampling each other). You
159 from multiple IPython sessions from trampling each other). You
160 can use this to later restore a session by loading your
160 can use this to later restore a session by loading your
161 logfile with ``ipython --i ipython_log.py``
161 logfile with ``ipython --i ipython_log.py``
162
162
163 ``--logplay=<name>``
163 ``--logplay=<name>``
164
164
165 NOT AVAILABLE in 0.11
165 NOT AVAILABLE in 0.11
166
166
167 you can replay a previous log. For restoring a session as close as
167 you can replay a previous log. For restoring a session as close as
168 possible to the state you left it in, use this option (don't just run
168 possible to the state you left it in, use this option (don't just run
169 the logfile). With -logplay, IPython will try to reconstruct the
169 the logfile). With -logplay, IPython will try to reconstruct the
170 previous working environment in full, not just execute the commands in
170 previous working environment in full, not just execute the commands in
171 the logfile.
171 the logfile.
172
172
173 When a session is restored, logging is automatically turned on
173 When a session is restored, logging is automatically turned on
174 again with the name of the logfile it was invoked with (it is
174 again with the name of the logfile it was invoked with (it is
175 read from the log header). So once you've turned logging on for
175 read from the log header). So once you've turned logging on for
176 a session, you can quit IPython and reload it as many times as
176 a session, you can quit IPython and reload it as many times as
177 you want and it will continue to log its history and restore
177 you want and it will continue to log its history and restore
178 from the beginning every time.
178 from the beginning every time.
179
179
180 Caveats: there are limitations in this option. The history
180 Caveats: there are limitations in this option. The history
181 variables _i*,_* and _dh don't get restored properly. In the
181 variables _i*,_* and _dh don't get restored properly. In the
182 future we will try to implement full session saving by writing
182 future we will try to implement full session saving by writing
183 and retrieving a 'snapshot' of the memory state of IPython. But
183 and retrieving a 'snapshot' of the memory state of IPython. But
184 our first attempts failed because of inherent limitations of
184 our first attempts failed because of inherent limitations of
185 Python's Pickle module, so this may have to wait.
185 Python's Pickle module, so this may have to wait.
186
186
187 ``--[no-]messages``
187 ``--[no-]messages``
188 Print messages which IPython collects about its startup
188 Print messages which IPython collects about its startup
189 process (default on).
189 process (default on).
190
190
191 ``--[no-]pdb``
191 ``--[no-]pdb``
192 Automatically call the pdb debugger after every uncaught
192 Automatically call the pdb debugger after every uncaught
193 exception. If you are used to debugging using pdb, this puts
193 exception. If you are used to debugging using pdb, this puts
194 you automatically inside of it after any call (either in
194 you automatically inside of it after any call (either in
195 IPython or in code called by it) which triggers an exception
195 IPython or in code called by it) which triggers an exception
196 which goes uncaught.
196 which goes uncaught.
197
197
198 ``--[no-]pprint``
198 ``--[no-]pprint``
199 ipython can optionally use the pprint (pretty printer) module
199 ipython can optionally use the pprint (pretty printer) module
200 for displaying results. pprint tends to give a nicer display
200 for displaying results. pprint tends to give a nicer display
201 of nested data structures. If you like it, you can turn it on
201 of nested data structures. If you like it, you can turn it on
202 permanently in your config file (default off).
202 permanently in your config file (default off).
203
203
204 ``--profile=<name>``
204 ``--profile=<name>``
205
205
206 Select the IPython profile by name.
206 Select the IPython profile by name.
207
207
208 This is a quick way to keep and load multiple
208 This is a quick way to keep and load multiple
209 config files for different tasks, especially if you use the
209 config files for different tasks, especially if you use the
210 include option of config files. You can keep a basic
210 include option of config files. You can keep a basic
211 :file:`IPYTHON_DIR/profile_default/ipython_config.py` file
211 :file:`IPYTHON_DIR/profile_default/ipython_config.py` file
212 and then have other 'profiles' which
212 and then have other 'profiles' which
213 include this one and load extra things for particular
213 include this one and load extra things for particular
214 tasks. For example:
214 tasks. For example:
215
215
216 1. $IPYTHON_DIR/profile_default : load basic things you always want.
216 1. $IPYTHON_DIR/profile_default : load basic things you always want.
217 2. $IPYTHON_DIR/profile_math : load (1) and basic math-related modules.
217 2. $IPYTHON_DIR/profile_math : load (1) and basic math-related modules.
218 3. $IPYTHON_DIR/profile_numeric : load (1) and Numeric and plotting modules.
218 3. $IPYTHON_DIR/profile_numeric : load (1) and Numeric and plotting modules.
219
219
220 Since it is possible to create an endless loop by having
220 Since it is possible to create an endless loop by having
221 circular file inclusions, IPython will stop if it reaches 15
221 circular file inclusions, IPython will stop if it reaches 15
222 recursive inclusions.
222 recursive inclusions.
223
223
224 ``InteractiveShell.prompt_in1=<string>``
224 ``InteractiveShell.prompt_in1=<string>``
225
225
226 Specify the string used for input prompts. Note that if you are using
226 Specify the string used for input prompts. Note that if you are using
227 numbered prompts, the number is represented with a '\#' in the
227 numbered prompts, the number is represented with a '\#' in the
228 string. Don't forget to quote strings with spaces embedded in
228 string. Don't forget to quote strings with spaces embedded in
229 them. Default: 'In [\#]:'. The :ref:`prompts section <prompts>`
229 them. Default: 'In [\#]:'. The :ref:`prompts section <prompts>`
230 discusses in detail all the available escapes to customize your
230 discusses in detail all the available escapes to customize your
231 prompts.
231 prompts.
232
232
233 ``InteractiveShell.prompt_in2=<string>``
233 ``InteractiveShell.prompt_in2=<string>``
234 Similar to the previous option, but used for the continuation
234 Similar to the previous option, but used for the continuation
235 prompts. The special sequence '\D' is similar to '\#', but
235 prompts. The special sequence '\D' is similar to '\#', but
236 with all digits replaced dots (so you can have your
236 with all digits replaced dots (so you can have your
237 continuation prompt aligned with your input prompt). Default:
237 continuation prompt aligned with your input prompt). Default:
238 ' .\D.:' (note three spaces at the start for alignment with
238 ' .\D.:' (note three spaces at the start for alignment with
239 'In [\#]').
239 'In [\#]').
240
240
241 ``InteractiveShell.prompt_out=<string>``
241 ``InteractiveShell.prompt_out=<string>``
242 String used for output prompts, also uses numbers like
242 String used for output prompts, also uses numbers like
243 prompt_in1. Default: 'Out[\#]:'
243 prompt_in1. Default: 'Out[\#]:'
244
244
245 ``--quick``
245 ``--quick``
246 start in bare bones mode (no config file loaded).
246 start in bare bones mode (no config file loaded).
247
247
248 ``config_file=<name>``
248 ``config_file=<name>``
249 name of your IPython resource configuration file. Normally
249 name of your IPython resource configuration file. Normally
250 IPython loads ipython_config.py (from current directory) or
250 IPython loads ipython_config.py (from current directory) or
251 IPYTHON_DIR/profile_default.
251 IPYTHON_DIR/profile_default.
252
252
253 If the loading of your config file fails, IPython starts with
253 If the loading of your config file fails, IPython starts with
254 a bare bones configuration (no modules loaded at all).
254 a bare bones configuration (no modules loaded at all).
255
255
256 ``--[no-]readline``
256 ``--[no-]readline``
257 use the readline library, which is needed to support name
257 use the readline library, which is needed to support name
258 completion and command history, among other things. It is
258 completion and command history, among other things. It is
259 enabled by default, but may cause problems for users of
259 enabled by default, but may cause problems for users of
260 X/Emacs in Python comint or shell buffers.
260 X/Emacs in Python comint or shell buffers.
261
261
262 Note that X/Emacs 'eterm' buffers (opened with M-x term) support
262 Note that X/Emacs 'eterm' buffers (opened with M-x term) support
263 IPython's readline and syntax coloring fine, only 'emacs' (M-x
263 IPython's readline and syntax coloring fine, only 'emacs' (M-x
264 shell and C-c !) buffers do not.
264 shell and C-c !) buffers do not.
265
265
266 ``--TerminalInteractiveShell.screen_length=<n>``
266 ``--TerminalInteractiveShell.screen_length=<n>``
267 number of lines of your screen. This is used to control
267 number of lines of your screen. This is used to control
268 printing of very long strings. Strings longer than this number
268 printing of very long strings. Strings longer than this number
269 of lines will be sent through a pager instead of directly
269 of lines will be sent through a pager instead of directly
270 printed.
270 printed.
271
271
272 The default value for this is 0, which means IPython will
272 The default value for this is 0, which means IPython will
273 auto-detect your screen size every time it needs to print certain
273 auto-detect your screen size every time it needs to print certain
274 potentially long strings (this doesn't change the behavior of the
274 potentially long strings (this doesn't change the behavior of the
275 'print' keyword, it's only triggered internally). If for some
275 'print' keyword, it's only triggered internally). If for some
276 reason this isn't working well (it needs curses support), specify
276 reason this isn't working well (it needs curses support), specify
277 it yourself. Otherwise don't change the default.
277 it yourself. Otherwise don't change the default.
278
278
279 ``--TerminalInteractiveShell.separate_in=<string>``
279 ``--TerminalInteractiveShell.separate_in=<string>``
280
280
281 separator before input prompts.
281 separator before input prompts.
282 Default: '\n'
282 Default: '\n'
283
283
284 ``--TerminalInteractiveShell.separate_out=<string>``
284 ``--TerminalInteractiveShell.separate_out=<string>``
285 separator before output prompts.
285 separator before output prompts.
286 Default: nothing.
286 Default: nothing.
287
287
288 ``--TerminalInteractiveShell.separate_out2=<string>``
288 ``--TerminalInteractiveShell.separate_out2=<string>``
289 separator after output prompts.
289 separator after output prompts.
290 Default: nothing.
290 Default: nothing.
291 For these three options, use the value 0 to specify no separator.
291 For these three options, use the value 0 to specify no separator.
292
292
293 ``--nosep``
293 ``--nosep``
294 shorthand for setting the above separators to empty strings.
294 shorthand for setting the above separators to empty strings.
295
295
296 Simply removes all input/output separators.
296 Simply removes all input/output separators.
297
297
298 ``--init``
298 ``--init``
299 allows you to initialize a profile dir for configuration when you
299 allows you to initialize a profile dir for configuration when you
300 install a new version of IPython or want to use a new profile.
300 install a new version of IPython or want to use a new profile.
301 Since new versions may include new command line options or example
301 Since new versions may include new command line options or example
302 files, this copies updated config files. Note that you should probably
302 files, this copies updated config files. Note that you should probably
303 use %upgrade instead,it's a safer alternative.
303 use %upgrade instead,it's a safer alternative.
304
304
305 ``--version`` print version information and exit.
305 ``--version`` print version information and exit.
306
306
307 ``--xmode=<modename>``
307 ``--xmode=<modename>``
308
308
309 Mode for exception reporting.
309 Mode for exception reporting.
310
310
311 Valid modes: Plain, Context and Verbose.
311 Valid modes: Plain, Context and Verbose.
312
312
313 * Plain: similar to python's normal traceback printing.
313 * Plain: similar to python's normal traceback printing.
314 * Context: prints 5 lines of context source code around each
314 * Context: prints 5 lines of context source code around each
315 line in the traceback.
315 line in the traceback.
316 * Verbose: similar to Context, but additionally prints the
316 * Verbose: similar to Context, but additionally prints the
317 variables currently visible where the exception happened
317 variables currently visible where the exception happened
318 (shortening their strings if too long). This can potentially be
318 (shortening their strings if too long). This can potentially be
319 very slow, if you happen to have a huge data structure whose
319 very slow, if you happen to have a huge data structure whose
320 string representation is complex to compute. Your computer may
320 string representation is complex to compute. Your computer may
321 appear to freeze for a while with cpu usage at 100%. If this
321 appear to freeze for a while with cpu usage at 100%. If this
322 occurs, you can cancel the traceback with Ctrl-C (maybe hitting it
322 occurs, you can cancel the traceback with Ctrl-C (maybe hitting it
323 more than once).
323 more than once).
324
324
325 Interactive use
325 Interactive use
326 ===============
326 ===============
327
327
328 IPython is meant to work as a drop-in
328 IPython is meant to work as a drop-in replacement for the standard interactive
329 replacement for the standard interactive interpreter. As such, any code
329 interpreter. As such, any code which is valid python should execute normally
330 which is valid python should execute normally under IPython (cases where
330 under IPython (cases where this is not true should be reported as bugs). It
331 this is not true should be reported as bugs). It does, however, offer
331 does, however, offer many features which are not available at a standard python
332 many features which are not available at a standard python prompt. What
332 prompt. What follows is a list of these.
333 follows is a list of these.
334
333
335
334
336 Caution for Windows users
335 Caution for Windows users
337 -------------------------
336 -------------------------
338
337
339 Windows, unfortunately, uses the '\\' character as a path
338 Windows, unfortunately, uses the '\\' character as a path separator. This is a
340 separator. This is a terrible choice, because '\\' also represents the
339 terrible choice, because '\\' also represents the escape character in most
341 escape character in most modern programming languages, including
340 modern programming languages, including Python. For this reason, using '/'
342 Python. For this reason, using '/' character is recommended if you
341 character is recommended if you have problems with ``\``. However, in Windows
343 have problems with ``\``. However, in Windows commands '/' flags
342 commands '/' flags options, so you can not use it for the root directory. This
344 options, so you can not use it for the root directory. This means that
343 means that paths beginning at the root must be typed in a contrived manner
345 paths beginning at the root must be typed in a contrived manner like:
344 like: ``%copy \opt/foo/bar.txt \tmp``
346 ``%copy \opt/foo/bar.txt \tmp``
347
345
348 .. _magic:
346 .. _magic:
349
347
350 Magic command system
348 Magic command system
351 --------------------
349 --------------------
352
350
353 IPython will treat any line whose first character is a % as a special
351 IPython will treat any line whose first character is a % as a special
354 call to a 'magic' function. These allow you to control the behavior of
352 call to a 'magic' function. These allow you to control the behavior of
355 IPython itself, plus a lot of system-type features. They are all
353 IPython itself, plus a lot of system-type features. They are all
356 prefixed with a % character, but parameters are given without
354 prefixed with a % character, but parameters are given without
357 parentheses or quotes.
355 parentheses or quotes.
358
356
359 Example: typing ``%cd mydir`` changes your working directory to 'mydir', if it
357 Example: typing ``%cd mydir`` changes your working directory to 'mydir', if it
360 exists.
358 exists.
361
359
362 If you have 'automagic' enabled (as it by default), you don't need
360 If you have 'automagic' enabled (as it by default), you don't need
363 to type in the % explicitly. IPython will scan its internal list of
361 to type in the % explicitly. IPython will scan its internal list of
364 magic functions and call one if it exists. With automagic on you can
362 magic functions and call one if it exists. With automagic on you can
365 then just type ``cd mydir`` to go to directory 'mydir'. The automagic
363 then just type ``cd mydir`` to go to directory 'mydir'. The automagic
366 system has the lowest possible precedence in name searches, so defining
364 system has the lowest possible precedence in name searches, so defining
367 an identifier with the same name as an existing magic function will
365 an identifier with the same name as an existing magic function will
368 shadow it for automagic use. You can still access the shadowed magic
366 shadow it for automagic use. You can still access the shadowed magic
369 function by explicitly using the % character at the beginning of the line.
367 function by explicitly using the % character at the beginning of the line.
370
368
371 An example (with automagic on) should clarify all this:
369 An example (with automagic on) should clarify all this:
372
370
373 .. sourcecode:: ipython
371 .. sourcecode:: ipython
374
372
375 In [1]: cd ipython # %cd is called by automagic
373 In [1]: cd ipython # %cd is called by automagic
376
374
377 /home/fperez/ipython
375 /home/fperez/ipython
378
376
379 In [2]: cd=1 # now cd is just a variable
377 In [2]: cd=1 # now cd is just a variable
380
378
381 In [3]: cd .. # and doesn't work as a function anymore
379 In [3]: cd .. # and doesn't work as a function anymore
382
380
383 ------------------------------
381 ------------------------------
384
382
385 File "<console>", line 1
383 File "<console>", line 1
386
384
387 cd ..
385 cd ..
388
386
389 ^
387 ^
390
388
391 SyntaxError: invalid syntax
389 SyntaxError: invalid syntax
392
390
393 In [4]: %cd .. # but %cd always works
391 In [4]: %cd .. # but %cd always works
394
392
395 /home/fperez
393 /home/fperez
396
394
397 In [5]: del cd # if you remove the cd variable
395 In [5]: del cd # if you remove the cd variable
398
396
399 In [6]: cd ipython # automagic can work again
397 In [6]: cd ipython # automagic can work again
400
398
401 /home/fperez/ipython
399 /home/fperez/ipython
402
400
403 You can define your own magic functions to extend the system. The
401 You can define your own magic functions to extend the system. The
404 following example defines a new magic command, %impall:
402 following example defines a new magic command, %impall:
405
403
406 .. sourcecode:: python
404 .. sourcecode:: python
407
405
408 ip = get_ipython()
406 ip = get_ipython()
409
407
410 def doimp(self, arg):
408 def doimp(self, arg):
411
409
412 ip = self.api
410 ip = self.api
413
411
414 ip.ex("import %s; reload(%s); from %s import *" % (
412 ip.ex("import %s; reload(%s); from %s import *" % (
415
413
416 arg,arg,arg)
414 arg,arg,arg)
417
415
418 )
416 )
419
417
420 ip.expose_magic('impall', doimp)
418 ip.expose_magic('impall', doimp)
421
419
422 Type %magic for more information, including a list of all available
420 Type `%magic` for more information, including a list of all available magic
423 magic functions at any time and their docstrings. You can also type
421 functions at any time and their docstrings. You can also type
424 %magic_function_name? (see sec. 6.4 <#sec:dyn-object-info> for
422 %magic_function_name? (see :ref:`below <dynamic_object_info` for information on
425 information on the '?' system) to get information about any particular
423 the '?' system) to get information about any particular magic function you are
426 magic function you are interested in.
424 interested in.
427
425
428 The API documentation for the :mod:`IPython.core.magic` module contains the full
426 The API documentation for the :mod:`IPython.core.magic` module contains the full
429 docstrings of all currently available magic commands.
427 docstrings of all currently available magic commands.
430
428
431
429
432 Access to the standard Python help
430 Access to the standard Python help
433 ----------------------------------
431 ----------------------------------
434
432
435 As of Python 2.1, a help system is available with access to object docstrings
433 As of Python 2.1, a help system is available with access to object docstrings
436 and the Python manuals. Simply type 'help' (no quotes) to access it. You can
434 and the Python manuals. Simply type 'help' (no quotes) to access it. You can
437 also type help(object) to obtain information about a given object, and
435 also type help(object) to obtain information about a given object, and
438 help('keyword') for information on a keyword. As noted :ref:`here
436 help('keyword') for information on a keyword. As noted :ref:`here
439 <accessing_help>`, you need to properly configure your environment variable
437 <accessing_help>`, you need to properly configure your environment variable
440 PYTHONDOCS for this feature to work correctly.
438 PYTHONDOCS for this feature to work correctly.
441
439
442 .. _dynamic_object_info:
440 .. _dynamic_object_info:
443
441
444 Dynamic object information
442 Dynamic object information
445 --------------------------
443 --------------------------
446
444
447 Typing ?word or word? prints detailed information about an object. If
445 Typing ``?word`` or ``word?`` prints detailed information about an object. If
448 certain strings in the object are too long (docstrings, code, etc.) they
446 certain strings in the object are too long (docstrings, code, etc.) they get
449 get snipped in the center for brevity. This system gives access variable
447 snipped in the center for brevity. This system gives access variable types and
450 types and values, full source code for any object (if available),
448 values, full source code for any object (if available), function prototypes and
451 function prototypes and other useful information.
449 other useful information.
452
450
453 Typing ??word or word?? gives access to the full information without
451 Typing ``??word`` or ``word??`` gives access to the full information without
454 snipping long strings. Long strings are sent to the screen through the
452 snipping long strings. Long strings are sent to the screen through the
455 less pager if longer than the screen and printed otherwise. On systems
453 less pager if longer than the screen and printed otherwise. On systems
456 lacking the less command, IPython uses a very basic internal pager.
454 lacking the less command, IPython uses a very basic internal pager.
457
455
458 The following magic functions are particularly useful for gathering
456 The following magic functions are particularly useful for gathering
459 information about your working environment. You can get more details by
457 information about your working environment. You can get more details by
460 typing %magic or querying them individually (use %function_name? with or
458 typing ``%magic`` or querying them individually (use %function_name? with or
461 without the %), this is just a summary:
459 without the %), this is just a summary:
462
460
463 * **%pdoc <object>**: Print (or run through a pager if too long) the
461 * **%pdoc <object>**: Print (or run through a pager if too long) the
464 docstring for an object. If the given object is a class, it will
462 docstring for an object. If the given object is a class, it will
465 print both the class and the constructor docstrings.
463 print both the class and the constructor docstrings.
466 * **%pdef <object>**: Print the definition header for any callable
464 * **%pdef <object>**: Print the definition header for any callable
467 object. If the object is a class, print the constructor information.
465 object. If the object is a class, print the constructor information.
468 * **%psource <object>**: Print (or run through a pager if too long)
466 * **%psource <object>**: Print (or run through a pager if too long)
469 the source code for an object.
467 the source code for an object.
470 * **%pfile <object>**: Show the entire source file where an object was
468 * **%pfile <object>**: Show the entire source file where an object was
471 defined via a pager, opening it at the line where the object
469 defined via a pager, opening it at the line where the object
472 definition begins.
470 definition begins.
473 * **%who/%whos**: These functions give information about identifiers
471 * **%who/%whos**: These functions give information about identifiers
474 you have defined interactively (not things you loaded or defined
472 you have defined interactively (not things you loaded or defined
475 in your configuration files). %who just prints a list of
473 in your configuration files). %who just prints a list of
476 identifiers and %whos prints a table with some basic details about
474 identifiers and %whos prints a table with some basic details about
477 each identifier.
475 each identifier.
478
476
479 Note that the dynamic object information functions (?/??, %pdoc, %pfile,
477 Note that the dynamic object information functions (?/??, ``%pdoc``,
480 %pdef, %psource) give you access to documentation even on things which
478 ``%pfile``, ``%pdef``, ``%psource``) give you access to documentation even on
481 are not really defined as separate identifiers. Try for example typing
479 things which are not really defined as separate identifiers. Try for example
482 {}.get? or after doing import os, type os.path.abspath??.
480 typing {}.get? or after doing import os, type ``os.path.abspath??``.
483
484
481
485 .. _readline:
482 .. _readline:
486
483
487 Readline-based features
484 Readline-based features
488 -----------------------
485 -----------------------
489
486
490 These features require the GNU readline library, so they won't work if
487 These features require the GNU readline library, so they won't work if your
491 your Python installation lacks readline support. We will first describe
488 Python installation lacks readline support. We will first describe the default
492 the default behavior IPython uses, and then how to change it to suit
489 behavior IPython uses, and then how to change it to suit your preferences.
493 your preferences.
494
490
495
491
496 Command line completion
492 Command line completion
497 +++++++++++++++++++++++
493 +++++++++++++++++++++++
498
494
499 At any time, hitting TAB will complete any available python commands or
495 At any time, hitting TAB will complete any available python commands or
500 variable names, and show you a list of the possible completions if
496 variable names, and show you a list of the possible completions if
501 there's no unambiguous one. It will also complete filenames in the
497 there's no unambiguous one. It will also complete filenames in the
502 current directory if no python names match what you've typed so far.
498 current directory if no python names match what you've typed so far.
503
499
504
500
505 Search command history
501 Search command history
506 ++++++++++++++++++++++
502 ++++++++++++++++++++++
507
503
508 IPython provides two ways for searching through previous input and thus
504 IPython provides two ways for searching through previous input and thus
509 reduce the need for repetitive typing:
505 reduce the need for repetitive typing:
510
506
511 1. Start typing, and then use Ctrl-p (previous,up) and Ctrl-n
507 1. Start typing, and then use Ctrl-p (previous,up) and Ctrl-n
512 (next,down) to search through only the history items that match
508 (next,down) to search through only the history items that match
513 what you've typed so far. If you use Ctrl-p/Ctrl-n at a blank
509 what you've typed so far. If you use Ctrl-p/Ctrl-n at a blank
514 prompt, they just behave like normal arrow keys.
510 prompt, they just behave like normal arrow keys.
515 2. Hit Ctrl-r: opens a search prompt. Begin typing and the system
511 2. Hit Ctrl-r: opens a search prompt. Begin typing and the system
516 searches your history for lines that contain what you've typed so
512 searches your history for lines that contain what you've typed so
517 far, completing as much as it can.
513 far, completing as much as it can.
518
514
519
515
520 Persistent command history across sessions
516 Persistent command history across sessions
521 ++++++++++++++++++++++++++++++++++++++++++
517 ++++++++++++++++++++++++++++++++++++++++++
522
518
523 IPython will save your input history when it leaves and reload it next
519 IPython will save your input history when it leaves and reload it next
524 time you restart it. By default, the history file is named
520 time you restart it. By default, the history file is named
525 $IPYTHON_DIR/profile_<name>/history.sqlite. This allows you to keep
521 $IPYTHON_DIR/profile_<name>/history.sqlite. This allows you to keep
526 separate histories related to various tasks: commands related to
522 separate histories related to various tasks: commands related to
527 numerical work will not be clobbered by a system shell history, for
523 numerical work will not be clobbered by a system shell history, for
528 example.
524 example.
529
525
530
526
531 Autoindent
527 Autoindent
532 ++++++++++
528 ++++++++++
533
529
534 IPython can recognize lines ending in ':' and indent the next line,
530 IPython can recognize lines ending in ':' and indent the next line,
535 while also un-indenting automatically after 'raise' or 'return'.
531 while also un-indenting automatically after 'raise' or 'return'.
536
532
537 This feature uses the readline library, so it will honor your ~/.inputrc
533 This feature uses the readline library, so it will honor your
538 configuration (or whatever file your INPUTRC variable points to). Adding
534 :file:`~/.inputrc` configuration (or whatever file your INPUTRC variable points
539 the following lines to your .inputrc file can make indenting/unindenting
535 to). Adding the following lines to your :file:`.inputrc` file can make
540 more convenient (M-i indents, M-u unindents)::
536 indenting/unindenting more convenient (M-i indents, M-u unindents)::
541
537
542 $if Python
538 $if Python
543 "\M-i": " "
539 "\M-i": " "
544 "\M-u": "\d\d\d\d"
540 "\M-u": "\d\d\d\d"
545 $endif
541 $endif
546
542
547 Note that there are 4 spaces between the quote marks after "M-i" above.
543 Note that there are 4 spaces between the quote marks after "M-i" above.
548
544
549 .. warning::
545 .. warning::
550
546
551 Setting the above indents will cause problems with unicode text entry in the terminal.
547 Setting the above indents will cause problems with unicode text entry in
548 the terminal.
552
549
553 .. warning::
550 .. warning::
554
551
555 Autoindent is ON by default, but it can cause problems with
552 Autoindent is ON by default, but it can cause problems with the pasting of
556 the pasting of multi-line indented code (the pasted code gets
553 multi-line indented code (the pasted code gets re-indented on each line). A
557 re-indented on each line). A magic function %autoindent allows you to
554 magic function %autoindent allows you to toggle it on/off at runtime. You
558 toggle it on/off at runtime. You can also disable it permanently on in
555 can also disable it permanently on in your :file:`ipython_config.py` file
559 your :file:`ipython_config.py` file (set TerminalInteractiveShell.autoindent=False).
556 (set TerminalInteractiveShell.autoindent=False).
560
557
561 If you want to paste multiple lines, it is recommended that you use ``%paste``.
558 If you want to paste multiple lines, it is recommended that you use
559 ``%paste``.
562
560
563
561
564 Customizing readline behavior
562 Customizing readline behavior
565 +++++++++++++++++++++++++++++
563 +++++++++++++++++++++++++++++
566
564
567 All these features are based on the GNU readline library, which has an
565 All these features are based on the GNU readline library, which has an
568 extremely customizable interface. Normally, readline is configured via a
566 extremely customizable interface. Normally, readline is configured via a
569 file which defines the behavior of the library; the details of the
567 file which defines the behavior of the library; the details of the
570 syntax for this can be found in the readline documentation available
568 syntax for this can be found in the readline documentation available
571 with your system or on the Internet. IPython doesn't read this file (if
569 with your system or on the Internet. IPython doesn't read this file (if
572 it exists) directly, but it does support passing to readline valid
570 it exists) directly, but it does support passing to readline valid
573 options via a simple interface. In brief, you can customize readline by
571 options via a simple interface. In brief, you can customize readline by
574 setting the following options in your ipythonrc configuration file (note
572 setting the following options in your ipythonrc configuration file (note
575 that these options can not be specified at the command line):
573 that these options can not be specified at the command line):
576
574
577 * **readline_parse_and_bind**: this option can appear as many times as
575 * **readline_parse_and_bind**: this option can appear as many times as
578 you want, each time defining a string to be executed via a
576 you want, each time defining a string to be executed via a
579 readline.parse_and_bind() command. The syntax for valid commands
577 readline.parse_and_bind() command. The syntax for valid commands
580 of this kind can be found by reading the documentation for the GNU
578 of this kind can be found by reading the documentation for the GNU
581 readline library, as these commands are of the kind which readline
579 readline library, as these commands are of the kind which readline
582 accepts in its configuration file.
580 accepts in its configuration file.
583 * **readline_remove_delims**: a string of characters to be removed
581 * **readline_remove_delims**: a string of characters to be removed
584 from the default word-delimiters list used by readline, so that
582 from the default word-delimiters list used by readline, so that
585 completions may be performed on strings which contain them. Do not
583 completions may be performed on strings which contain them. Do not
586 change the default value unless you know what you're doing.
584 change the default value unless you know what you're doing.
587 * **readline_omit__names**: when tab-completion is enabled, hitting
585 * **readline_omit__names**: when tab-completion is enabled, hitting
588 <tab> after a '.' in a name will complete all attributes of an
586 <tab> after a '.' in a name will complete all attributes of an
589 object, including all the special methods whose names include
587 object, including all the special methods whose names include
590 double underscores (like __getitem__ or __class__). If you'd
588 double underscores (like __getitem__ or __class__). If you'd
591 rather not see these names by default, you can set this option to
589 rather not see these names by default, you can set this option to
592 1. Note that even when this option is set, you can still see those
590 1. Note that even when this option is set, you can still see those
593 names by explicitly typing a _ after the period and hitting <tab>:
591 names by explicitly typing a _ after the period and hitting <tab>:
594 'name._<tab>' will always complete attribute names starting with '_'.
592 'name._<tab>' will always complete attribute names starting with '_'.
595
593
596 This option is off by default so that new users see all
594 This option is off by default so that new users see all
597 attributes of any objects they are dealing with.
595 attributes of any objects they are dealing with.
598
596
599 You will find the default values along with a corresponding detailed
597 You will find the default values along with a corresponding detailed
600 explanation in your ipythonrc file.
598 explanation in your ipythonrc file.
601
599
602
600
603 Session logging and restoring
601 Session logging and restoring
604 -----------------------------
602 -----------------------------
605
603
606 You can log all input from a session either by starting IPython with the
604 You can log all input from a session either by starting IPython with the
607 command line switch ``--logfile=foo.py`` (see :ref:`here <command_line_options>`)
605 command line switch ``--logfile=foo.py`` (see :ref:`here <command_line_options>`)
608 or by activating the logging at any moment with the magic function %logstart.
606 or by activating the logging at any moment with the magic function %logstart.
609
607
610 Log files can later be reloaded by running them as scripts and IPython
608 Log files can later be reloaded by running them as scripts and IPython
611 will attempt to 'replay' the log by executing all the lines in it, thus
609 will attempt to 'replay' the log by executing all the lines in it, thus
612 restoring the state of a previous session. This feature is not quite
610 restoring the state of a previous session. This feature is not quite
613 perfect, but can still be useful in many cases.
611 perfect, but can still be useful in many cases.
614
612
615 The log files can also be used as a way to have a permanent record of
613 The log files can also be used as a way to have a permanent record of
616 any code you wrote while experimenting. Log files are regular text files
614 any code you wrote while experimenting. Log files are regular text files
617 which you can later open in your favorite text editor to extract code or
615 which you can later open in your favorite text editor to extract code or
618 to 'clean them up' before using them to replay a session.
616 to 'clean them up' before using them to replay a session.
619
617
620 The %logstart function for activating logging in mid-session is used as
618 The `%logstart` function for activating logging in mid-session is used as
621 follows:
619 follows::
622
620
623 %logstart [log_name [log_mode]]
621 %logstart [log_name [log_mode]]
624
622
625 If no name is given, it defaults to a file named 'ipython_log.py' in your
623 If no name is given, it defaults to a file named 'ipython_log.py' in your
626 current working directory, in 'rotate' mode (see below).
624 current working directory, in 'rotate' mode (see below).
627
625
628 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
626 '%logstart name' saves to file 'name' in 'backup' mode. It saves your
629 history up to that point and then continues logging.
627 history up to that point and then continues logging.
630
628
631 %logstart takes a second optional parameter: logging mode. This can be
629 %logstart takes a second optional parameter: logging mode. This can be
632 one of (note that the modes are given unquoted):
630 one of (note that the modes are given unquoted):
633
631
634 * [over:] overwrite existing log_name.
632 * [over:] overwrite existing log_name.
635 * [backup:] rename (if exists) to log_name~ and start log_name.
633 * [backup:] rename (if exists) to log_name~ and start log_name.
636 * [append:] well, that says it.
634 * [append:] well, that says it.
637 * [rotate:] create rotating logs log_name.1~, log_name.2~, etc.
635 * [rotate:] create rotating logs log_name.1~, log_name.2~, etc.
638
636
639 The %logoff and %logon functions allow you to temporarily stop and
637 The %logoff and %logon functions allow you to temporarily stop and
640 resume logging to a file which had previously been started with
638 resume logging to a file which had previously been started with
641 %logstart. They will fail (with an explanation) if you try to use them
639 %logstart. They will fail (with an explanation) if you try to use them
642 before logging has been started.
640 before logging has been started.
643
641
644 .. _system_shell_access:
642 .. _system_shell_access:
645
643
646 System shell access
644 System shell access
647 -------------------
645 -------------------
648
646
649 Any input line beginning with a ! character is passed verbatim (minus
647 Any input line beginning with a ! character is passed verbatim (minus
650 the !, of course) to the underlying operating system. For example,
648 the !, of course) to the underlying operating system. For example,
651 typing ``!ls`` will run 'ls' in the current directory.
649 typing ``!ls`` will run 'ls' in the current directory.
652
650
653 Manual capture of command output
651 Manual capture of command output
654 --------------------------------
652 --------------------------------
655
653
656 If the input line begins with two exclamation marks, !!, the command is
654 If the input line begins with two exclamation marks, !!, the command is
657 executed but its output is captured and returned as a python list, split
655 executed but its output is captured and returned as a python list, split
658 on newlines. Any output sent by the subprocess to standard error is
656 on newlines. Any output sent by the subprocess to standard error is
659 printed separately, so that the resulting list only captures standard
657 printed separately, so that the resulting list only captures standard
660 output. The !! syntax is a shorthand for the %sx magic command.
658 output. The !! syntax is a shorthand for the %sx magic command.
661
659
662 Finally, the %sc magic (short for 'shell capture') is similar to %sx,
660 Finally, the %sc magic (short for 'shell capture') is similar to %sx,
663 but allowing more fine-grained control of the capture details, and
661 but allowing more fine-grained control of the capture details, and
664 storing the result directly into a named variable. The direct use of
662 storing the result directly into a named variable. The direct use of
665 %sc is now deprecated, and you should ise the ``var = !cmd`` syntax
663 %sc is now deprecated, and you should ise the ``var = !cmd`` syntax
666 instead.
664 instead.
667
665
668 IPython also allows you to expand the value of python variables when
666 IPython also allows you to expand the value of python variables when
669 making system calls. Any python variable or expression which you prepend
667 making system calls. Any python variable or expression which you prepend
670 with $ will get expanded before the system call is made::
668 with $ will get expanded before the system call is made::
671
669
672 In [1]: pyvar='Hello world'
670 In [1]: pyvar='Hello world'
673 In [2]: !echo "A python variable: $pyvar"
671 In [2]: !echo "A python variable: $pyvar"
674 A python variable: Hello world
672 A python variable: Hello world
675
673
676 If you want the shell to actually see a literal $, you need to type it
674 If you want the shell to actually see a literal $, you need to type it
677 twice::
675 twice::
678
676
679 In [3]: !echo "A system variable: $$HOME"
677 In [3]: !echo "A system variable: $$HOME"
680 A system variable: /home/fperez
678 A system variable: /home/fperez
681
679
682 You can pass arbitrary expressions, though you'll need to delimit them
680 You can pass arbitrary expressions, though you'll need to delimit them
683 with {} if there is ambiguity as to the extent of the expression::
681 with {} if there is ambiguity as to the extent of the expression::
684
682
685 In [5]: x=10
683 In [5]: x=10
686 In [6]: y=20
684 In [6]: y=20
687 In [13]: !echo $x+y
685 In [13]: !echo $x+y
688 10+y
686 10+y
689 In [7]: !echo ${x+y}
687 In [7]: !echo ${x+y}
690 30
688 30
691
689
692 Even object attributes can be expanded::
690 Even object attributes can be expanded::
693
691
694 In [12]: !echo $sys.argv
692 In [12]: !echo $sys.argv
695 [/home/fperez/usr/bin/ipython]
693 [/home/fperez/usr/bin/ipython]
696
694
697
695
698 System command aliases
696 System command aliases
699 ----------------------
697 ----------------------
700
698
701 The %alias magic function and the alias option in the ipythonrc
699 The %alias magic function and the alias option in the ipythonrc
702 configuration file allow you to define magic functions which are in fact
700 configuration file allow you to define magic functions which are in fact
703 system shell commands. These aliases can have parameters.
701 system shell commands. These aliases can have parameters.
704
702
705 ``%alias alias_name cmd`` defines 'alias_name' as an alias for 'cmd'
703 ``%alias alias_name cmd`` defines 'alias_name' as an alias for 'cmd'
706
704
707 Then, typing ``%alias_name params`` will execute the system command 'cmd
705 Then, typing ``%alias_name params`` will execute the system command 'cmd
708 params' (from your underlying operating system).
706 params' (from your underlying operating system).
709
707
710 You can also define aliases with parameters using %s specifiers (one per
708 You can also define aliases with parameters using %s specifiers (one per
711 parameter). The following example defines the %parts function as an
709 parameter). The following example defines the %parts function as an
712 alias to the command 'echo first %s second %s' where each %s will be
710 alias to the command 'echo first %s second %s' where each %s will be
713 replaced by a positional parameter to the call to %parts::
711 replaced by a positional parameter to the call to %parts::
714
712
715 In [1]: alias parts echo first %s second %s
713 In [1]: alias parts echo first %s second %s
716 In [2]: %parts A B
714 In [2]: %parts A B
717 first A second B
715 first A second B
718 In [3]: %parts A
716 In [3]: %parts A
719 Incorrect number of arguments: 2 expected.
717 Incorrect number of arguments: 2 expected.
720 parts is an alias to: 'echo first %s second %s'
718 parts is an alias to: 'echo first %s second %s'
721
719
722 If called with no parameters, %alias prints the table of currently
720 If called with no parameters, %alias prints the table of currently
723 defined aliases.
721 defined aliases.
724
722
725 The %rehashx magic allows you to load your entire $PATH as
723 The %rehashx magic allows you to load your entire $PATH as
726 ipython aliases. See its docstring for further details.
724 ipython aliases. See its docstring for further details.
727
725
728
726
729 .. _dreload:
727 .. _dreload:
730
728
731 Recursive reload
729 Recursive reload
732 ----------------
730 ----------------
733
731
734 The dreload function does a recursive reload of a module: changes made
732 The dreload function does a recursive reload of a module: changes made
735 to the module since you imported will actually be available without
733 to the module since you imported will actually be available without
736 having to exit.
734 having to exit.
737
735
738
736
739 Verbose and colored exception traceback printouts
737 Verbose and colored exception traceback printouts
740 -------------------------------------------------
738 -------------------------------------------------
741
739
742 IPython provides the option to see very detailed exception tracebacks,
740 IPython provides the option to see very detailed exception tracebacks,
743 which can be especially useful when debugging large programs. You can
741 which can be especially useful when debugging large programs. You can
744 run any Python file with the %run function to benefit from these
742 run any Python file with the %run function to benefit from these
745 detailed tracebacks. Furthermore, both normal and verbose tracebacks can
743 detailed tracebacks. Furthermore, both normal and verbose tracebacks can
746 be colored (if your terminal supports it) which makes them much easier
744 be colored (if your terminal supports it) which makes them much easier
747 to parse visually.
745 to parse visually.
748
746
749 See the magic xmode and colors functions for details (just type %magic).
747 See the magic xmode and colors functions for details (just type %magic).
750
748
751 These features are basically a terminal version of Ka-Ping Yee's cgitb
749 These features are basically a terminal version of Ka-Ping Yee's cgitb
752 module, now part of the standard Python library.
750 module, now part of the standard Python library.
753
751
754
752
755 .. _input_caching:
753 .. _input_caching:
756
754
757 Input caching system
755 Input caching system
758 --------------------
756 --------------------
759
757
760 IPython offers numbered prompts (In/Out) with input and output caching
758 IPython offers numbered prompts (In/Out) with input and output caching
761 (also referred to as 'input history'). All input is saved and can be
759 (also referred to as 'input history'). All input is saved and can be
762 retrieved as variables (besides the usual arrow key recall), in
760 retrieved as variables (besides the usual arrow key recall), in
763 addition to the %rep magic command that brings a history entry
761 addition to the %rep magic command that brings a history entry
764 up for editing on the next command line.
762 up for editing on the next command line.
765
763
766 The following GLOBAL variables always exist (so don't overwrite them!):
764 The following GLOBAL variables always exist (so don't overwrite them!):
767
765
768 * _i, _ii, _iii: store previous, next previous and next-next previous inputs.
766 * _i, _ii, _iii: store previous, next previous and next-next previous inputs.
769 * In, _ih : a list of all inputs; _ih[n] is the input from line n. If you
767 * In, _ih : a list of all inputs; _ih[n] is the input from line n. If you
770 overwrite In with a variable of your own, you can remake the assignment to the
768 overwrite In with a variable of your own, you can remake the assignment to the
771 internal list with a simple ``In=_ih``.
769 internal list with a simple ``In=_ih``.
772
770
773 Additionally, global variables named _i<n> are dynamically created (<n>
771 Additionally, global variables named _i<n> are dynamically created (<n>
774 being the prompt counter), so ``_i<n> == _ih[<n>] == In[<n>]``.
772 being the prompt counter), so ``_i<n> == _ih[<n>] == In[<n>]``.
775
773
776 For example, what you typed at prompt 14 is available as _i14, _ih[14]
774 For example, what you typed at prompt 14 is available as _i14, _ih[14]
777 and In[14].
775 and In[14].
778
776
779 This allows you to easily cut and paste multi line interactive prompts
777 This allows you to easily cut and paste multi line interactive prompts
780 by printing them out: they print like a clean string, without prompt
778 by printing them out: they print like a clean string, without prompt
781 characters. You can also manipulate them like regular variables (they
779 characters. You can also manipulate them like regular variables (they
782 are strings), modify or exec them (typing ``exec _i9`` will re-execute the
780 are strings), modify or exec them (typing ``exec _i9`` will re-execute the
783 contents of input prompt 9.
781 contents of input prompt 9.
784
782
785 You can also re-execute multiple lines of input easily by using the
783 You can also re-execute multiple lines of input easily by using the
786 magic %macro function (which automates the process and allows
784 magic %macro function (which automates the process and allows
787 re-execution without having to type 'exec' every time). The macro system
785 re-execution without having to type 'exec' every time). The macro system
788 also allows you to re-execute previous lines which include magic
786 also allows you to re-execute previous lines which include magic
789 function calls (which require special processing). Type %macro? for more details
787 function calls (which require special processing). Type %macro? for more details
790 on the macro system.
788 on the macro system.
791
789
792 A history function %hist allows you to see any part of your input
790 A history function %hist allows you to see any part of your input
793 history by printing a range of the _i variables.
791 history by printing a range of the _i variables.
794
792
795 You can also search ('grep') through your history by typing
793 You can also search ('grep') through your history by typing
796 ``%hist -g somestring``. This is handy for searching for URLs, IP addresses,
794 ``%hist -g somestring``. This is handy for searching for URLs, IP addresses,
797 etc. You can bring history entries listed by '%hist -g' up for editing
795 etc. You can bring history entries listed by '%hist -g' up for editing
798 with the %recall command, or run them immediately with %rerun.
796 with the %recall command, or run them immediately with %rerun.
799
797
800 .. _output_caching:
798 .. _output_caching:
801
799
802 Output caching system
800 Output caching system
803 ---------------------
801 ---------------------
804
802
805 For output that is returned from actions, a system similar to the input
803 For output that is returned from actions, a system similar to the input
806 cache exists but using _ instead of _i. Only actions that produce a
804 cache exists but using _ instead of _i. Only actions that produce a
807 result (NOT assignments, for example) are cached. If you are familiar
805 result (NOT assignments, for example) are cached. If you are familiar
808 with Mathematica, IPython's _ variables behave exactly like
806 with Mathematica, IPython's _ variables behave exactly like
809 Mathematica's % variables.
807 Mathematica's % variables.
810
808
811 The following GLOBAL variables always exist (so don't overwrite them!):
809 The following GLOBAL variables always exist (so don't overwrite them!):
812
810
813 * [_] (a single underscore) : stores previous output, like Python's
811 * [_] (a single underscore) : stores previous output, like Python's
814 default interpreter.
812 default interpreter.
815 * [__] (two underscores): next previous.
813 * [__] (two underscores): next previous.
816 * [___] (three underscores): next-next previous.
814 * [___] (three underscores): next-next previous.
817
815
818 Additionally, global variables named _<n> are dynamically created (<n>
816 Additionally, global variables named _<n> are dynamically created (<n>
819 being the prompt counter), such that the result of output <n> is always
817 being the prompt counter), such that the result of output <n> is always
820 available as _<n> (don't use the angle brackets, just the number, e.g.
818 available as _<n> (don't use the angle brackets, just the number, e.g.
821 _21).
819 _21).
822
820
823 These global variables are all stored in a global dictionary (not a
821 These global variables are all stored in a global dictionary (not a
824 list, since it only has entries for lines which returned a result)
822 list, since it only has entries for lines which returned a result)
825 available under the names _oh and Out (similar to _ih and In). So the
823 available under the names _oh and Out (similar to _ih and In). So the
826 output from line 12 can be obtained as _12, Out[12] or _oh[12]. If you
824 output from line 12 can be obtained as _12, Out[12] or _oh[12]. If you
827 accidentally overwrite the Out variable you can recover it by typing
825 accidentally overwrite the Out variable you can recover it by typing
828 'Out=_oh' at the prompt.
826 'Out=_oh' at the prompt.
829
827
830 This system obviously can potentially put heavy memory demands on your
828 This system obviously can potentially put heavy memory demands on your
831 system, since it prevents Python's garbage collector from removing any
829 system, since it prevents Python's garbage collector from removing any
832 previously computed results. You can control how many results are kept
830 previously computed results. You can control how many results are kept
833 in memory with the option (at the command line or in your ipythonrc
831 in memory with the option (at the command line or in your ipythonrc
834 file) cache_size. If you set it to 0, the whole system is completely
832 file) cache_size. If you set it to 0, the whole system is completely
835 disabled and the prompts revert to the classic '>>>' of normal Python.
833 disabled and the prompts revert to the classic '>>>' of normal Python.
836
834
837
835
838 Directory history
836 Directory history
839 -----------------
837 -----------------
840
838
841 Your history of visited directories is kept in the global list _dh, and
839 Your history of visited directories is kept in the global list _dh, and
842 the magic %cd command can be used to go to any entry in that list. The
840 the magic %cd command can be used to go to any entry in that list. The
843 %dhist command allows you to view this history. Do ``cd -<TAB>`` to
841 %dhist command allows you to view this history. Do ``cd -<TAB>`` to
844 conveniently view the directory history.
842 conveniently view the directory history.
845
843
846
844
847 Automatic parentheses and quotes
845 Automatic parentheses and quotes
848 --------------------------------
846 --------------------------------
849
847
850 These features were adapted from Nathan Gray's LazyPython. They are
848 These features were adapted from Nathan Gray's LazyPython. They are
851 meant to allow less typing for common situations.
849 meant to allow less typing for common situations.
852
850
853
851
854 Automatic parentheses
852 Automatic parentheses
855 ---------------------
853 ---------------------
856
854
857 Callable objects (i.e. functions, methods, etc) can be invoked like this
855 Callable objects (i.e. functions, methods, etc) can be invoked like this
858 (notice the commas between the arguments)::
856 (notice the commas between the arguments)::
859
857
860 >>> callable_ob arg1, arg2, arg3
858 >>> callable_ob arg1, arg2, arg3
861
859
862 and the input will be translated to this::
860 and the input will be translated to this::
863
861
864 -> callable_ob(arg1, arg2, arg3)
862 -> callable_ob(arg1, arg2, arg3)
865
863
866 You can force automatic parentheses by using '/' as the first character
864 You can force automatic parentheses by using '/' as the first character
867 of a line. For example::
865 of a line. For example::
868
866
869 >>> /globals # becomes 'globals()'
867 >>> /globals # becomes 'globals()'
870
868
871 Note that the '/' MUST be the first character on the line! This won't work::
869 Note that the '/' MUST be the first character on the line! This won't work::
872
870
873 >>> print /globals # syntax error
871 >>> print /globals # syntax error
874
872
875 In most cases the automatic algorithm should work, so you should rarely
873 In most cases the automatic algorithm should work, so you should rarely
876 need to explicitly invoke /. One notable exception is if you are trying
874 need to explicitly invoke /. One notable exception is if you are trying
877 to call a function with a list of tuples as arguments (the parenthesis
875 to call a function with a list of tuples as arguments (the parenthesis
878 will confuse IPython)::
876 will confuse IPython)::
879
877
880 In [1]: zip (1,2,3),(4,5,6) # won't work
878 In [1]: zip (1,2,3),(4,5,6) # won't work
881
879
882 but this will work::
880 but this will work::
883
881
884 In [2]: /zip (1,2,3),(4,5,6)
882 In [2]: /zip (1,2,3),(4,5,6)
885 ---> zip ((1,2,3),(4,5,6))
883 ---> zip ((1,2,3),(4,5,6))
886 Out[2]= [(1, 4), (2, 5), (3, 6)]
884 Out[2]= [(1, 4), (2, 5), (3, 6)]
887
885
888 IPython tells you that it has altered your command line by displaying
886 IPython tells you that it has altered your command line by displaying
889 the new command line preceded by ->. e.g.::
887 the new command line preceded by ->. e.g.::
890
888
891 In [18]: callable list
889 In [18]: callable list
892 ----> callable (list)
890 ----> callable (list)
893
891
894
892
895 Automatic quoting
893 Automatic quoting
896 -----------------
894 -----------------
897
895
898 You can force automatic quoting of a function's arguments by using ','
896 You can force automatic quoting of a function's arguments by using ','
899 or ';' as the first character of a line. For example::
897 or ';' as the first character of a line. For example::
900
898
901 >>> ,my_function /home/me # becomes my_function("/home/me")
899 >>> ,my_function /home/me # becomes my_function("/home/me")
902
900
903 If you use ';' instead, the whole argument is quoted as a single string
901 If you use ';' instead, the whole argument is quoted as a single string
904 (while ',' splits on whitespace)::
902 (while ',' splits on whitespace)::
905
903
906 >>> ,my_function a b c # becomes my_function("a","b","c")
904 >>> ,my_function a b c # becomes my_function("a","b","c")
907
905
908 >>> ;my_function a b c # becomes my_function("a b c")
906 >>> ;my_function a b c # becomes my_function("a b c")
909
907
910 Note that the ',' or ';' MUST be the first character on the line! This
908 Note that the ',' or ';' MUST be the first character on the line! This
911 won't work::
909 won't work::
912
910
913 >>> x = ,my_function /home/me # syntax error
911 >>> x = ,my_function /home/me # syntax error
914
912
915 IPython as your default Python environment
913 IPython as your default Python environment
916 ==========================================
914 ==========================================
917
915
918 Python honors the environment variable PYTHONSTARTUP and will execute at
916 Python honors the environment variable PYTHONSTARTUP and will execute at
919 startup the file referenced by this variable. If you put at the end of
917 startup the file referenced by this variable. If you put at the end of
920 this file the following two lines of code::
918 this file the following two lines of code::
921
919
922 from IPython.frontend.terminal.ipapp import launch_new_instance
920 from IPython.frontend.terminal.ipapp import launch_new_instance
923 launch_new_instance()
921 launch_new_instance()
924 raise SystemExit
922 raise SystemExit
925
923
926 then IPython will be your working environment anytime you start Python.
924 then IPython will be your working environment anytime you start Python.
927 The ``raise SystemExit`` is needed to exit Python when
925 The ``raise SystemExit`` is needed to exit Python when
928 it finishes, otherwise you'll be back at the normal Python '>>>'
926 it finishes, otherwise you'll be back at the normal Python '>>>'
929 prompt.
927 prompt.
930
928
931 This is probably useful to developers who manage multiple Python
929 This is probably useful to developers who manage multiple Python
932 versions and don't want to have correspondingly multiple IPython
930 versions and don't want to have correspondingly multiple IPython
933 versions. Note that in this mode, there is no way to pass IPython any
931 versions. Note that in this mode, there is no way to pass IPython any
934 command-line options, as those are trapped first by Python itself.
932 command-line options, as those are trapped first by Python itself.
935
933
936 .. _Embedding:
934 .. _Embedding:
937
935
938 Embedding IPython
936 Embedding IPython
939 =================
937 =================
940
938
941 It is possible to start an IPython instance inside your own Python
939 It is possible to start an IPython instance inside your own Python
942 programs. This allows you to evaluate dynamically the state of your
940 programs. This allows you to evaluate dynamically the state of your
943 code, operate with your variables, analyze them, etc. Note however that
941 code, operate with your variables, analyze them, etc. Note however that
944 any changes you make to values while in the shell do not propagate back
942 any changes you make to values while in the shell do not propagate back
945 to the running code, so it is safe to modify your values because you
943 to the running code, so it is safe to modify your values because you
946 won't break your code in bizarre ways by doing so.
944 won't break your code in bizarre ways by doing so.
947
945
948 This feature allows you to easily have a fully functional python
946 This feature allows you to easily have a fully functional python
949 environment for doing object introspection anywhere in your code with a
947 environment for doing object introspection anywhere in your code with a
950 simple function call. In some cases a simple print statement is enough,
948 simple function call. In some cases a simple print statement is enough,
951 but if you need to do more detailed analysis of a code fragment this
949 but if you need to do more detailed analysis of a code fragment this
952 feature can be very valuable.
950 feature can be very valuable.
953
951
954 It can also be useful in scientific computing situations where it is
952 It can also be useful in scientific computing situations where it is
955 common to need to do some automatic, computationally intensive part and
953 common to need to do some automatic, computationally intensive part and
956 then stop to look at data, plots, etc.
954 then stop to look at data, plots, etc.
957 Opening an IPython instance will give you full access to your data and
955 Opening an IPython instance will give you full access to your data and
958 functions, and you can resume program execution once you are done with
956 functions, and you can resume program execution once you are done with
959 the interactive part (perhaps to stop again later, as many times as
957 the interactive part (perhaps to stop again later, as many times as
960 needed).
958 needed).
961
959
962 The following code snippet is the bare minimum you need to include in
960 The following code snippet is the bare minimum you need to include in
963 your Python programs for this to work (detailed examples follow later)::
961 your Python programs for this to work (detailed examples follow later)::
964
962
965 from IPython import embed
963 from IPython import embed
966
964
967 embed() # this call anywhere in your program will start IPython
965 embed() # this call anywhere in your program will start IPython
968
966
969 You can run embedded instances even in code which is itself being run at
967 You can run embedded instances even in code which is itself being run at
970 the IPython interactive prompt with '%run <filename>'. Since it's easy
968 the IPython interactive prompt with '%run <filename>'. Since it's easy
971 to get lost as to where you are (in your top-level IPython or in your
969 to get lost as to where you are (in your top-level IPython or in your
972 embedded one), it's a good idea in such cases to set the in/out prompts
970 embedded one), it's a good idea in such cases to set the in/out prompts
973 to something different for the embedded instances. The code examples
971 to something different for the embedded instances. The code examples
974 below illustrate this.
972 below illustrate this.
975
973
976 You can also have multiple IPython instances in your program and open
974 You can also have multiple IPython instances in your program and open
977 them separately, for example with different options for data
975 them separately, for example with different options for data
978 presentation. If you close and open the same instance multiple times,
976 presentation. If you close and open the same instance multiple times,
979 its prompt counters simply continue from each execution to the next.
977 its prompt counters simply continue from each execution to the next.
980
978
981 Please look at the docstrings in the :mod:`~IPython.frontend.terminal.embed`
979 Please look at the docstrings in the :mod:`~IPython.frontend.terminal.embed`
982 module for more details on the use of this system.
980 module for more details on the use of this system.
983
981
984 The following sample file illustrating how to use the embedding
982 The following sample file illustrating how to use the embedding
985 functionality is provided in the examples directory as example-embed.py.
983 functionality is provided in the examples directory as example-embed.py.
986 It should be fairly self-explanatory:
984 It should be fairly self-explanatory:
987
985
988 .. literalinclude:: ../../examples/core/example-embed.py
986 .. literalinclude:: ../../examples/core/example-embed.py
989 :language: python
987 :language: python
990
988
991 Once you understand how the system functions, you can use the following
989 Once you understand how the system functions, you can use the following
992 code fragments in your programs which are ready for cut and paste:
990 code fragments in your programs which are ready for cut and paste:
993
991
994 .. literalinclude:: ../../examples/core/example-embed-short.py
992 .. literalinclude:: ../../examples/core/example-embed-short.py
995 :language: python
993 :language: python
996
994
997 Using the Python debugger (pdb)
995 Using the Python debugger (pdb)
998 ===============================
996 ===============================
999
997
1000 Running entire programs via pdb
998 Running entire programs via pdb
1001 -------------------------------
999 -------------------------------
1002
1000
1003 pdb, the Python debugger, is a powerful interactive debugger which
1001 pdb, the Python debugger, is a powerful interactive debugger which
1004 allows you to step through code, set breakpoints, watch variables,
1002 allows you to step through code, set breakpoints, watch variables,
1005 etc. IPython makes it very easy to start any script under the control
1003 etc. IPython makes it very easy to start any script under the control
1006 of pdb, regardless of whether you have wrapped it into a 'main()'
1004 of pdb, regardless of whether you have wrapped it into a 'main()'
1007 function or not. For this, simply type '%run -d myscript' at an
1005 function or not. For this, simply type '%run -d myscript' at an
1008 IPython prompt. See the %run command's documentation (via '%run?' or
1006 IPython prompt. See the %run command's documentation (via '%run?' or
1009 in Sec. magic_ for more details, including how to control where pdb
1007 in Sec. magic_ for more details, including how to control where pdb
1010 will stop execution first.
1008 will stop execution first.
1011
1009
1012 For more information on the use of the pdb debugger, read the included
1010 For more information on the use of the pdb debugger, read the included
1013 pdb.doc file (part of the standard Python distribution). On a stock
1011 pdb.doc file (part of the standard Python distribution). On a stock
1014 Linux system it is located at /usr/lib/python2.3/pdb.doc, but the
1012 Linux system it is located at /usr/lib/python2.3/pdb.doc, but the
1015 easiest way to read it is by using the help() function of the pdb module
1013 easiest way to read it is by using the help() function of the pdb module
1016 as follows (in an IPython prompt)::
1014 as follows (in an IPython prompt)::
1017
1015
1018 In [1]: import pdb
1016 In [1]: import pdb
1019 In [2]: pdb.help()
1017 In [2]: pdb.help()
1020
1018
1021 This will load the pdb.doc document in a file viewer for you automatically.
1019 This will load the pdb.doc document in a file viewer for you automatically.
1022
1020
1023
1021
1024 Automatic invocation of pdb on exceptions
1022 Automatic invocation of pdb on exceptions
1025 -----------------------------------------
1023 -----------------------------------------
1026
1024
1027 IPython, if started with the -pdb option (or if the option is set in
1025 IPython, if started with the -pdb option (or if the option is set in
1028 your rc file) can call the Python pdb debugger every time your code
1026 your rc file) can call the Python pdb debugger every time your code
1029 triggers an uncaught exception. This feature
1027 triggers an uncaught exception. This feature
1030 can also be toggled at any time with the %pdb magic command. This can be
1028 can also be toggled at any time with the %pdb magic command. This can be
1031 extremely useful in order to find the origin of subtle bugs, because pdb
1029 extremely useful in order to find the origin of subtle bugs, because pdb
1032 opens up at the point in your code which triggered the exception, and
1030 opens up at the point in your code which triggered the exception, and
1033 while your program is at this point 'dead', all the data is still
1031 while your program is at this point 'dead', all the data is still
1034 available and you can walk up and down the stack frame and understand
1032 available and you can walk up and down the stack frame and understand
1035 the origin of the problem.
1033 the origin of the problem.
1036
1034
1037 Furthermore, you can use these debugging facilities both with the
1035 Furthermore, you can use these debugging facilities both with the
1038 embedded IPython mode and without IPython at all. For an embedded shell
1036 embedded IPython mode and without IPython at all. For an embedded shell
1039 (see sec. Embedding_), simply call the constructor with
1037 (see sec. Embedding_), simply call the constructor with
1040 '--pdb' in the argument string and automatically pdb will be called if an
1038 '--pdb' in the argument string and automatically pdb will be called if an
1041 uncaught exception is triggered by your code.
1039 uncaught exception is triggered by your code.
1042
1040
1043 For stand-alone use of the feature in your programs which do not use
1041 For stand-alone use of the feature in your programs which do not use
1044 IPython at all, put the following lines toward the top of your 'main'
1042 IPython at all, put the following lines toward the top of your 'main'
1045 routine::
1043 routine::
1046
1044
1047 import sys
1045 import sys
1048 from IPython.core import ultratb
1046 from IPython.core import ultratb
1049 sys.excepthook = ultratb.FormattedTB(mode='Verbose',
1047 sys.excepthook = ultratb.FormattedTB(mode='Verbose',
1050 color_scheme='Linux', call_pdb=1)
1048 color_scheme='Linux', call_pdb=1)
1051
1049
1052 The mode keyword can be either 'Verbose' or 'Plain', giving either very
1050 The mode keyword can be either 'Verbose' or 'Plain', giving either very
1053 detailed or normal tracebacks respectively. The color_scheme keyword can
1051 detailed or normal tracebacks respectively. The color_scheme keyword can
1054 be one of 'NoColor', 'Linux' (default) or 'LightBG'. These are the same
1052 be one of 'NoColor', 'Linux' (default) or 'LightBG'. These are the same
1055 options which can be set in IPython with -colors and -xmode.
1053 options which can be set in IPython with -colors and -xmode.
1056
1054
1057 This will give any of your programs detailed, colored tracebacks with
1055 This will give any of your programs detailed, colored tracebacks with
1058 automatic invocation of pdb.
1056 automatic invocation of pdb.
1059
1057
1060
1058
1061 Extensions for syntax processing
1059 Extensions for syntax processing
1062 ================================
1060 ================================
1063
1061
1064 This isn't for the faint of heart, because the potential for breaking
1062 This isn't for the faint of heart, because the potential for breaking
1065 things is quite high. But it can be a very powerful and useful feature.
1063 things is quite high. But it can be a very powerful and useful feature.
1066 In a nutshell, you can redefine the way IPython processes the user input
1064 In a nutshell, you can redefine the way IPython processes the user input
1067 line to accept new, special extensions to the syntax without needing to
1065 line to accept new, special extensions to the syntax without needing to
1068 change any of IPython's own code.
1066 change any of IPython's own code.
1069
1067
1070 In the IPython/extensions directory you will find some examples
1068 In the IPython/extensions directory you will find some examples
1071 supplied, which we will briefly describe now. These can be used 'as is'
1069 supplied, which we will briefly describe now. These can be used 'as is'
1072 (and both provide very useful functionality), or you can use them as a
1070 (and both provide very useful functionality), or you can use them as a
1073 starting point for writing your own extensions.
1071 starting point for writing your own extensions.
1074
1072
1075
1073
1076 Pasting of code starting with '>>> ' or '... '
1074 Pasting of code starting with '>>> ' or '... '
1077 ----------------------------------------------
1075 ----------------------------------------------
1078
1076
1079 In the python tutorial it is common to find code examples which have
1077 In the python tutorial it is common to find code examples which have
1080 been taken from real python sessions. The problem with those is that all
1078 been taken from real python sessions. The problem with those is that all
1081 the lines begin with either '>>> ' or '... ', which makes it impossible
1079 the lines begin with either '>>> ' or '... ', which makes it impossible
1082 to paste them all at once. One must instead do a line by line manual
1080 to paste them all at once. One must instead do a line by line manual
1083 copying, carefully removing the leading extraneous characters.
1081 copying, carefully removing the leading extraneous characters.
1084
1082
1085 This extension identifies those starting characters and removes them
1083 This extension identifies those starting characters and removes them
1086 from the input automatically, so that one can paste multi-line examples
1084 from the input automatically, so that one can paste multi-line examples
1087 directly into IPython, saving a lot of time. Please look at the file
1085 directly into IPython, saving a lot of time. Please look at the file
1088 InterpreterPasteInput.py in the IPython/extensions directory for details
1086 InterpreterPasteInput.py in the IPython/extensions directory for details
1089 on how this is done.
1087 on how this is done.
1090
1088
1091 IPython comes with a special profile enabling this feature, called
1089 IPython comes with a special profile enabling this feature, called
1092 tutorial. Simply start IPython via 'ipython -p tutorial' and the feature
1090 tutorial. Simply start IPython via 'ipython -p tutorial' and the feature
1093 will be available. In a normal IPython session you can activate the
1091 will be available. In a normal IPython session you can activate the
1094 feature by importing the corresponding module with:
1092 feature by importing the corresponding module with:
1095 In [1]: import IPython.extensions.InterpreterPasteInput
1093 In [1]: import IPython.extensions.InterpreterPasteInput
1096
1094
1097 The following is a 'screenshot' of how things work when this extension
1095 The following is a 'screenshot' of how things work when this extension
1098 is on, copying an example from the standard tutorial::
1096 is on, copying an example from the standard tutorial::
1099
1097
1100 IPython profile: tutorial
1098 IPython profile: tutorial
1101
1099
1102 *** Pasting of code with ">>>" or "..." has been enabled.
1100 *** Pasting of code with ">>>" or "..." has been enabled.
1103
1101
1104 In [1]: >>> def fib2(n): # return Fibonacci series up to n
1102 In [1]: >>> def fib2(n): # return Fibonacci series up to n
1105 ...: ... """Return a list containing the Fibonacci series up to
1103 ...: ... """Return a list containing the Fibonacci series up to
1106 n."""
1104 n."""
1107 ...: ... result = []
1105 ...: ... result = []
1108 ...: ... a, b = 0, 1
1106 ...: ... a, b = 0, 1
1109 ...: ... while b < n:
1107 ...: ... while b < n:
1110 ...: ... result.append(b) # see below
1108 ...: ... result.append(b) # see below
1111 ...: ... a, b = b, a+b
1109 ...: ... a, b = b, a+b
1112 ...: ... return result
1110 ...: ... return result
1113 ...:
1111 ...:
1114
1112
1115 In [2]: fib2(10)
1113 In [2]: fib2(10)
1116 Out[2]: [1, 1, 2, 3, 5, 8]
1114 Out[2]: [1, 1, 2, 3, 5, 8]
1117
1115
1118 Note that as currently written, this extension does not recognize
1116 Note that as currently written, this extension does not recognize
1119 IPython's prompts for pasting. Those are more complicated, since the
1117 IPython's prompts for pasting. Those are more complicated, since the
1120 user can change them very easily, they involve numbers and can vary in
1118 user can change them very easily, they involve numbers and can vary in
1121 length. One could however extract all the relevant information from the
1119 length. One could however extract all the relevant information from the
1122 IPython instance and build an appropriate regular expression. This is
1120 IPython instance and build an appropriate regular expression. This is
1123 left as an exercise for the reader.
1121 left as an exercise for the reader.
1124
1122
1125 .. _gui_support:
1123 .. _gui_support:
1126
1124
1127 GUI event loop support
1125 GUI event loop support
1128 ======================
1126 ======================
1129
1127
1130 .. versionadded:: 0.11
1128 .. versionadded:: 0.11
1131 The ``%gui`` magic and :mod:`IPython.lib.inputhook`.
1129 The ``%gui`` magic and :mod:`IPython.lib.inputhook`.
1132
1130
1133 IPython has excellent support for working interactively with Graphical User
1131 IPython has excellent support for working interactively with Graphical User
1134 Interface (GUI) toolkits, such as wxPython, PyQt4, PyGTK and Tk. This is
1132 Interface (GUI) toolkits, such as wxPython, PyQt4, PyGTK and Tk. This is
1135 implemented using Python's builtin ``PyOSInputHook`` hook. This implementation
1133 implemented using Python's builtin ``PyOSInputHook`` hook. This implementation
1136 is extremely robust compared to our previous thread-based version. The
1134 is extremely robust compared to our previous thread-based version. The
1137 advantages of this are:
1135 advantages of this are:
1138
1136
1139 * GUIs can be enabled and disabled dynamically at runtime.
1137 * GUIs can be enabled and disabled dynamically at runtime.
1140 * The active GUI can be switched dynamically at runtime.
1138 * The active GUI can be switched dynamically at runtime.
1141 * In some cases, multiple GUIs can run simultaneously with no problems.
1139 * In some cases, multiple GUIs can run simultaneously with no problems.
1142 * There is a developer API in :mod:`IPython.lib.inputhook` for customizing
1140 * There is a developer API in :mod:`IPython.lib.inputhook` for customizing
1143 all of these things.
1141 all of these things.
1144
1142
1145 For users, enabling GUI event loop integration is simple. You simple use the
1143 For users, enabling GUI event loop integration is simple. You simple use the
1146 ``%gui`` magic as follows::
1144 ``%gui`` magic as follows::
1147
1145
1148 %gui [GUINAME]
1146 %gui [GUINAME]
1149
1147
1150 With no arguments, ``%gui`` removes all GUI support. Valid ``GUINAME``
1148 With no arguments, ``%gui`` removes all GUI support. Valid ``GUINAME``
1151 arguments are ``wx``, ``qt4``, ``gtk`` and ``tk``.
1149 arguments are ``wx``, ``qt4``, ``gtk`` and ``tk``.
1152
1150
1153 Thus, to use wxPython interactively and create a running :class:`wx.App`
1151 Thus, to use wxPython interactively and create a running :class:`wx.App`
1154 object, do::
1152 object, do::
1155
1153
1156 %gui wx
1154 %gui wx
1157
1155
1158 For information on IPython's Matplotlib integration (and the ``pylab`` mode)
1156 For information on IPython's Matplotlib integration (and the ``pylab`` mode)
1159 see :ref:`this section <matplotlib_support>`.
1157 see :ref:`this section <matplotlib_support>`.
1160
1158
1161 For developers that want to use IPython's GUI event loop integration in
1159 For developers that want to use IPython's GUI event loop integration in
1162 the form of a library, these capabilities are exposed in library form
1160 the form of a library, these capabilities are exposed in library form
1163 in the :mod:`IPython.lib.inputhook`. Interested developers should see the
1161 in the :mod:`IPython.lib.inputhook`. Interested developers should see the
1164 module docstrings for more information, but there are a few points that
1162 module docstrings for more information, but there are a few points that
1165 should be mentioned here.
1163 should be mentioned here.
1166
1164
1167 First, the ``PyOSInputHook`` approach only works in command line settings
1165 First, the ``PyOSInputHook`` approach only works in command line settings
1168 where readline is activated.
1166 where readline is activated.
1169
1167
1170 Second, when using the ``PyOSInputHook`` approach, a GUI application should
1168 Second, when using the ``PyOSInputHook`` approach, a GUI application should
1171 *not* start its event loop. Instead all of this is handled by the
1169 *not* start its event loop. Instead all of this is handled by the
1172 ``PyOSInputHook``. This means that applications that are meant to be used both
1170 ``PyOSInputHook``. This means that applications that are meant to be used both
1173 in IPython and as standalone apps need to have special code to detects how the
1171 in IPython and as standalone apps need to have special code to detects how the
1174 application is being run. We highly recommend using IPython's
1172 application is being run. We highly recommend using IPython's
1175 :func:`enable_foo` functions for this. Here is a simple example that shows the
1173 :func:`enable_foo` functions for this. Here is a simple example that shows the
1176 recommended code that should be at the bottom of a wxPython using GUI
1174 recommended code that should be at the bottom of a wxPython using GUI
1177 application::
1175 application::
1178
1176
1179 try:
1177 try:
1180 from IPython.lib.inputhook import enable_wx
1178 from IPython.lib.inputhook import enable_wx
1181 enable_wx(app)
1179 enable_wx(app)
1182 except ImportError:
1180 except ImportError:
1183 app.MainLoop()
1181 app.MainLoop()
1184
1182
1185 This pattern should be used instead of the simple ``app.MainLoop()`` code
1183 This pattern should be used instead of the simple ``app.MainLoop()`` code
1186 that a standalone wxPython application would have.
1184 that a standalone wxPython application would have.
1187
1185
1188 Third, unlike previous versions of IPython, we no longer "hijack" (replace
1186 Third, unlike previous versions of IPython, we no longer "hijack" (replace
1189 them with no-ops) the event loops. This is done to allow applications that
1187 them with no-ops) the event loops. This is done to allow applications that
1190 actually need to run the real event loops to do so. This is often needed to
1188 actually need to run the real event loops to do so. This is often needed to
1191 process pending events at critical points.
1189 process pending events at critical points.
1192
1190
1193 Finally, we also have a number of examples in our source directory
1191 Finally, we also have a number of examples in our source directory
1194 :file:`docs/examples/lib` that demonstrate these capabilities.
1192 :file:`docs/examples/lib` that demonstrate these capabilities.
1195
1193
1196 PyQt and PySide
1194 PyQt and PySide
1197 ---------------
1195 ---------------
1198
1196
1199 .. attempt at explanation of the complete mess that is Qt support
1197 .. attempt at explanation of the complete mess that is Qt support
1200
1198
1201 When you use ``--gui=qt`` or ``--pylab=qt``, IPython can work with either
1199 When you use ``--gui=qt`` or ``--pylab=qt``, IPython can work with either
1202 PyQt4 or PySide. There are three options for configuration here, because
1200 PyQt4 or PySide. There are three options for configuration here, because
1203 PyQt4 has two APIs for QString and QVariant - v1, which is the default on
1201 PyQt4 has two APIs for QString and QVariant - v1, which is the default on
1204 Python 2, and the more natural v2, which is the only API supported by PySide.
1202 Python 2, and the more natural v2, which is the only API supported by PySide.
1205 v2 is also the default for PyQt4 on Python 3. IPython's code for the QtConsole
1203 v2 is also the default for PyQt4 on Python 3. IPython's code for the QtConsole
1206 uses v2, but you can still use any interface in your code, since the
1204 uses v2, but you can still use any interface in your code, since the
1207 Qt frontend is in a different process.
1205 Qt frontend is in a different process.
1208
1206
1209 The default will be to import PyQt4 without configuration of the APIs, thus
1207 The default will be to import PyQt4 without configuration of the APIs, thus
1210 matching what most applications would expect. It will fall back of PySide if
1208 matching what most applications would expect. It will fall back of PySide if
1211 PyQt4 is unavailable.
1209 PyQt4 is unavailable.
1212
1210
1213 If specified, IPython will respect the environment variable ``QT_API`` used
1211 If specified, IPython will respect the environment variable ``QT_API`` used
1214 by ETS. ETS 4.0 also works with both PyQt4 and PySide, but it requires
1212 by ETS. ETS 4.0 also works with both PyQt4 and PySide, but it requires
1215 PyQt4 to use its v2 API. So if ``QT_API=pyside`` PySide will be used,
1213 PyQt4 to use its v2 API. So if ``QT_API=pyside`` PySide will be used,
1216 and if ``QT_API=pyqt`` then PyQt4 will be used *with the v2 API* for
1214 and if ``QT_API=pyqt`` then PyQt4 will be used *with the v2 API* for
1217 QString and QVariant, so ETS codes like MayaVi will also work with IPython.
1215 QString and QVariant, so ETS codes like MayaVi will also work with IPython.
1218
1216
1219 If you launch IPython in pylab mode with ``ipython --pylab=qt``, then IPython
1217 If you launch IPython in pylab mode with ``ipython --pylab=qt``, then IPython
1220 will ask matplotlib which Qt library to use (only if QT_API is *not set*), via
1218 will ask matplotlib which Qt library to use (only if QT_API is *not set*), via
1221 the 'backend.qt4' rcParam. If matplotlib is version 1.0.1 or older, then
1219 the 'backend.qt4' rcParam. If matplotlib is version 1.0.1 or older, then
1222 IPython will always use PyQt4 without setting the v2 APIs, since neither v2
1220 IPython will always use PyQt4 without setting the v2 APIs, since neither v2
1223 PyQt nor PySide work.
1221 PyQt nor PySide work.
1224
1222
1225 .. warning::
1223 .. warning::
1226
1224
1227 Note that this means for ETS 4 to work with PyQt4, ``QT_API`` *must* be set
1225 Note that this means for ETS 4 to work with PyQt4, ``QT_API`` *must* be set
1228 to work with IPython's qt integration, because otherwise PyQt4 will be
1226 to work with IPython's qt integration, because otherwise PyQt4 will be
1229 loaded in an incompatible mode.
1227 loaded in an incompatible mode.
1230
1228
1231 It also means that you must *not* have ``QT_API`` set if you want to
1229 It also means that you must *not* have ``QT_API`` set if you want to
1232 use ``--gui=qt`` with code that requires PyQt4 API v1.
1230 use ``--gui=qt`` with code that requires PyQt4 API v1.
1233
1231
1234
1232
1235 .. _matplotlib_support:
1233 .. _matplotlib_support:
1236
1234
1237 Plotting with matplotlib
1235 Plotting with matplotlib
1238 ========================
1236 ========================
1239
1237
1240 `Matplotlib`_ provides high quality 2D and 3D plotting for Python. Matplotlib
1238 `Matplotlib`_ provides high quality 2D and 3D plotting for Python. Matplotlib
1241 can produce plots on screen using a variety of GUI toolkits, including Tk,
1239 can produce plots on screen using a variety of GUI toolkits, including Tk,
1242 PyGTK, PyQt4 and wxPython. It also provides a number of commands useful for
1240 PyGTK, PyQt4 and wxPython. It also provides a number of commands useful for
1243 scientific computing, all with a syntax compatible with that of the popular
1241 scientific computing, all with a syntax compatible with that of the popular
1244 Matlab program.
1242 Matlab program.
1245
1243
1246 To start IPython with matplotlib support, use the ``--pylab`` switch. If no
1244 To start IPython with matplotlib support, use the ``--pylab`` switch. If no
1247 arguments are given, IPython will automatically detect your choice of
1245 arguments are given, IPython will automatically detect your choice of
1248 matplotlib backend. You can also request a specific backend with
1246 matplotlib backend. You can also request a specific backend with
1249 ``--pylab=backend``, where ``backend`` must be one of: 'tk', 'qt', 'wx', 'gtk',
1247 ``--pylab=backend``, where ``backend`` must be one of: 'tk', 'qt', 'wx', 'gtk',
1250 'osx'.
1248 'osx'.
1251
1249
1252 .. _Matplotlib: http://matplotlib.sourceforge.net
1250 .. _Matplotlib: http://matplotlib.sourceforge.net
1253
1251
1254 .. _interactive_demos:
1252 .. _interactive_demos:
1255
1253
1256 Interactive demos with IPython
1254 Interactive demos with IPython
1257 ==============================
1255 ==============================
1258
1256
1259 IPython ships with a basic system for running scripts interactively in
1257 IPython ships with a basic system for running scripts interactively in
1260 sections, useful when presenting code to audiences. A few tags embedded
1258 sections, useful when presenting code to audiences. A few tags embedded
1261 in comments (so that the script remains valid Python code) divide a file
1259 in comments (so that the script remains valid Python code) divide a file
1262 into separate blocks, and the demo can be run one block at a time, with
1260 into separate blocks, and the demo can be run one block at a time, with
1263 IPython printing (with syntax highlighting) the block before executing
1261 IPython printing (with syntax highlighting) the block before executing
1264 it, and returning to the interactive prompt after each block. The
1262 it, and returning to the interactive prompt after each block. The
1265 interactive namespace is updated after each block is run with the
1263 interactive namespace is updated after each block is run with the
1266 contents of the demo's namespace.
1264 contents of the demo's namespace.
1267
1265
1268 This allows you to show a piece of code, run it and then execute
1266 This allows you to show a piece of code, run it and then execute
1269 interactively commands based on the variables just created. Once you
1267 interactively commands based on the variables just created. Once you
1270 want to continue, you simply execute the next block of the demo. The
1268 want to continue, you simply execute the next block of the demo. The
1271 following listing shows the markup necessary for dividing a script into
1269 following listing shows the markup necessary for dividing a script into
1272 sections for execution as a demo:
1270 sections for execution as a demo:
1273
1271
1274 .. literalinclude:: ../../examples/lib/example-demo.py
1272 .. literalinclude:: ../../examples/lib/example-demo.py
1275 :language: python
1273 :language: python
1276
1274
1277
1278 In order to run a file as a demo, you must first make a Demo object out
1275 In order to run a file as a demo, you must first make a Demo object out
1279 of it. If the file is named myscript.py, the following code will make a
1276 of it. If the file is named myscript.py, the following code will make a
1280 demo::
1277 demo::
1281
1278
1282 from IPython.lib.demo import Demo
1279 from IPython.lib.demo import Demo
1283
1280
1284 mydemo = Demo('myscript.py')
1281 mydemo = Demo('myscript.py')
1285
1282
1286 This creates the mydemo object, whose blocks you run one at a time by
1283 This creates the mydemo object, whose blocks you run one at a time by
1287 simply calling the object with no arguments. If you have autocall active
1284 simply calling the object with no arguments. If you have autocall active
1288 in IPython (the default), all you need to do is type::
1285 in IPython (the default), all you need to do is type::
1289
1286
1290 mydemo
1287 mydemo
1291
1288
1292 and IPython will call it, executing each block. Demo objects can be
1289 and IPython will call it, executing each block. Demo objects can be
1293 restarted, you can move forward or back skipping blocks, re-execute the
1290 restarted, you can move forward or back skipping blocks, re-execute the
1294 last block, etc. Simply use the Tab key on a demo object to see its
1291 last block, etc. Simply use the Tab key on a demo object to see its
1295 methods, and call '?' on them to see their docstrings for more usage
1292 methods, and call '?' on them to see their docstrings for more usage
1296 details. In addition, the demo module itself contains a comprehensive
1293 details. In addition, the demo module itself contains a comprehensive
1297 docstring, which you can access via::
1294 docstring, which you can access via::
1298
1295
1299 from IPython.lib import demo
1296 from IPython.lib import demo
1300
1297
1301 demo?
1298 demo?
1302
1299
1303 Limitations: It is important to note that these demos are limited to
1300 Limitations: It is important to note that these demos are limited to
1304 fairly simple uses. In particular, you can not put division marks in
1301 fairly simple uses. In particular, you can not put division marks in
1305 indented code (loops, if statements, function definitions, etc.)
1302 indented code (loops, if statements, function definitions, etc.)
1306 Supporting something like this would basically require tracking the
1303 Supporting something like this would basically require tracking the
1307 internal execution state of the Python interpreter, so only top-level
1304 internal execution state of the Python interpreter, so only top-level
1308 divisions are allowed. If you want to be able to open an IPython
1305 divisions are allowed. If you want to be able to open an IPython
1309 instance at an arbitrary point in a program, you can use IPython's
1306 instance at an arbitrary point in a program, you can use IPython's
1310 embedding facilities, see :func:`IPython.embed` for details.
1307 embedding facilities, see :func:`IPython.embed` for details.
1311
1308
@@ -1,748 +1,752 b''
1 =============
1 =============
2 0.11 Series
2 0.11 Series
3 =============
3 =============
4
4
5 Release 0.11
5 Release 0.11
6 ============
6 ============
7
7
8 IPython 0.11 is a *major* overhaul of IPython, two years in the making. Most
8 IPython 0.11 is a *major* overhaul of IPython, two years in the making. Most
9 of the code base has been rewritten or at least reorganized, breaking backward
9 of the code base has been rewritten or at least reorganized, breaking backward
10 compatibility with several APIs in previous versions. It is the first major
10 compatibility with several APIs in previous versions. It is the first major
11 release in two years, and probably the most significant change to IPython since
11 release in two years, and probably the most significant change to IPython since
12 its inception. We plan to have a relatively quick succession of releases, as
12 its inception. We plan to have a relatively quick succession of releases, as
13 people discover new bugs and regressions. Once we iron out any significant
13 people discover new bugs and regressions. Once we iron out any significant
14 bugs in this process and settle down the new APIs, this series will become
14 bugs in this process and settle down the new APIs, this series will become
15 IPython 1.0. We encourage feedback now on the core APIs, which we hope to
15 IPython 1.0. We encourage feedback now on the core APIs, which we hope to
16 maintain stable during the 1.0 series.
16 maintain stable during the 1.0 series.
17
17
18 Since the internal APIs have changed so much, projects using IPython as a
18 Since the internal APIs have changed so much, projects using IPython as a
19 library (as opposed to end-users of the application) are the most likely to
19 library (as opposed to end-users of the application) are the most likely to
20 encounter regressions or changes that break their existing use patterns. We
20 encounter regressions or changes that break their existing use patterns. We
21 will make every effort to provide updated versions of the APIs to facilitate
21 will make every effort to provide updated versions of the APIs to facilitate
22 the transition, and we encourage you to contact us on the `development mailing
22 the transition, and we encourage you to contact us on the `development mailing
23 list`__ with questions and feedback.
23 list`__ with questions and feedback.
24
24
25 .. __: http://mail.scipy.org/mailman/listinfo/ipython-dev
25 .. __: http://mail.scipy.org/mailman/listinfo/ipython-dev
26
26
27 Chris Fonnesbeck recently wrote an `excellent post`__ that highlights some of
27 Chris Fonnesbeck recently wrote an `excellent post`__ that highlights some of
28 our major new features, with examples and screenshots. We encourage you to
28 our major new features, with examples and screenshots. We encourage you to
29 read it as it provides an illustrated, high-level overview complementing the
29 read it as it provides an illustrated, high-level overview complementing the
30 detailed feature breakdown in this document.
30 detailed feature breakdown in this document.
31
31
32 .. __: http://stronginference.com/weblog/2011/7/15/innovations-in-ipython.html
32 .. __: http://stronginference.com/weblog/2011/7/15/innovations-in-ipython.html
33
33
34 A quick summary of the major changes (see below for details):
34 A quick summary of the major changes (see below for details):
35
35
36 * **Standalone Qt console**: a new rich console has been added to IPython,
36 * **Standalone Qt console**: a new rich console has been added to IPython,
37 started with `ipython qtconsole`. In this application we have tried to
37 started with `ipython qtconsole`. In this application we have tried to
38 retain the feel of a terminal for fast and efficient workflows, while adding
38 retain the feel of a terminal for fast and efficient workflows, while adding
39 many features that a plain text terminal simply can not support, such as
39 many features that a plain text terminal simply can not support, such as
40 inline figures, full multiline editing with syntax highlighting, tooltips for
40 inline figures, full multiline editing with syntax highlighting, tooltips for
41 function calls and much more. This development was sponsored by `Enthought
41 function calls and much more. This development was sponsored by `Enthought
42 Inc.`__. See :ref:`below <qtconsole_011>` for details.
42 Inc.`__. See :ref:`below <qtconsole_011>` for details.
43
43
44 .. __: http://enthought.com
44 .. __: http://enthought.com
45
45
46 * **High-level parallel computing with ZeroMQ**. Using the same architecture
46 * **High-level parallel computing with ZeroMQ**. Using the same architecture
47 that our Qt console is based on, we have completely rewritten our high-level
47 that our Qt console is based on, we have completely rewritten our high-level
48 parallel computing machinery that in prior versions used the Twisted
48 parallel computing machinery that in prior versions used the Twisted
49 networking framework. While this change will require users to update their
49 networking framework. While this change will require users to update their
50 codes, the improvements in performance, memory control and internal
50 codes, the improvements in performance, memory control and internal
51 consistency across our codebase convinced us it was a price worth paying. We
51 consistency across our codebase convinced us it was a price worth paying. We
52 have tried to explain how to best proceed with this update, and will be happy
52 have tried to explain how to best proceed with this update, and will be happy
53 to answer questions that may arise. A full tutorial describing these
53 to answer questions that may arise. A full tutorial describing these
54 features `was presented at SciPy'11`__.
54 features `was presented at SciPy'11`__.
55
55
56 .. __: http://minrk.github.com/scipy-tutorial-2011
56 .. __: http://minrk.github.com/scipy-tutorial-2011
57
57
58 * **New model for GUI/plotting support in the terminal**. Now instead of the
58 * **New model for GUI/plotting support in the terminal**. Now instead of the
59 various `-Xthread` flags we had before, GUI support is provided without the
59 various `-Xthread` flags we had before, GUI support is provided without the
60 use of any threads, by directly integrating GUI event loops with Python's
60 use of any threads, by directly integrating GUI event loops with Python's
61 `PyOS_InputHook` API. A new command-line flag `--gui` controls GUI support,
61 `PyOS_InputHook` API. A new command-line flag `--gui` controls GUI support,
62 and it can also be enabled after IPython startup via the new `%gui` magic.
62 and it can also be enabled after IPython startup via the new `%gui` magic.
63 This requires some changes if you want to execute GUI-using scripts inside
63 This requires some changes if you want to execute GUI-using scripts inside
64 IPython, see :ref:`the GUI support section <gui_support>` for more details.
64 IPython, see :ref:`the GUI support section <gui_support>` for more details.
65
65
66 * **Integration into Microsoft Visual Studio**. Thanks to the work of the
67 Microsoft `Python Tools for Visual Studio`__ team, this version of IPython
68 has been integrated into Microsoft Visual Studio's Python tools open source
69 plug-in. `Details below`_
70
71 .. __: http://pytools.codeplex.com
72 .. _details below: ms_visual_studio_011_
73
74 * **A two-process architecture.** The Qt console is the first example of using
66 * **A two-process architecture.** The Qt console is the first example of using
75 a new model that splits IPython between a kernel process where code is
67 a new model that splits IPython between a kernel process where code is
76 executed and a client that handles user interaction. We plan on also
68 executed and a client that handles user interaction. We plan on also
77 providing terminal and web-browser based clients using this infrastructure in
69 providing terminal and web-browser based clients using this infrastructure in
78 future releases. This model allows multiple clients to interact with an
70 future releases. This model allows multiple clients to interact with an
79 IPython process through a well-documented protocol using the ZeroMQ
71 IPython process through a well-documented protocol using the ZeroMQ
80 networking library.
72 networking library.
81
73
82 * **Refactoring.** the entire codebase has been refactored, in order to make it
74 * **Refactoring.** the entire codebase has been refactored, in order to make it
83 more modular and easier to contribute to. IPython has traditionally been a
75 more modular and easier to contribute to. IPython has traditionally been a
84 hard project to participate because the old codebase was very monolithic. We
76 hard project to participate because the old codebase was very monolithic. We
85 hope this (ongoing) restructuring will make it easier for new developers to
77 hope this (ongoing) restructuring will make it easier for new developers to
86 join us.
78 join us.
87
79
80 * **Vim integration**. Vim can be configured to seamlessly control an IPython
81 kernel, see the files in :file:`docs/examples/vim` for the full details.
82 This work was done by Paul Ivanov, who prepared a nice `video
83 demonstration`__ of the features it provides.
84
85 .. __: http://pirsquared.org/blog/2011/07/28/vim-ipython/
86
87 * **Integration into Microsoft Visual Studio**. Thanks to the work of the
88 Microsoft `Python Tools for Visual Studio`__ team, this version of IPython
89 has been integrated into Microsoft Visual Studio's Python tools open source
90 plug-in. `Details below`_
91
92 .. __: http://pytools.codeplex.com
93 .. _details below: ms_visual_studio_011_
94
88 * **Improved unicode support**. We closed many bugs related to unicode input.
95 * **Improved unicode support**. We closed many bugs related to unicode input.
89
96
90 * **Python 3**. IPython now runs on Python 3.x. See :ref:`python3_011` for
97 * **Python 3**. IPython now runs on Python 3.x. See :ref:`python3_011` for
91 details.
98 details.
92
99
93 * **New profile model**. Profiles are now directories that contain all relevant
100 * **New profile model**. Profiles are now directories that contain all relevant
94 infromation for that session, and thus better isolate IPython use-cases.
101 infromation for that session, and thus better isolate IPython use-cases.
95
102
96 * **SQLite storage for history**. All history is now stored in a SQLite
103 * **SQLite storage for history**. All history is now stored in a SQLite
97 database, providing support for multiple simultaneous sessions that won't
104 database, providing support for multiple simultaneous sessions that won't
98 clobber each other as well as the ability to perform queries on all stored
105 clobber each other as well as the ability to perform queries on all stored
99 data.
106 data.
100
107
101 * **New configuration system**. All parts of IPython are now configured via a
108 * **New configuration system**. All parts of IPython are now configured via a
102 mechanism inspired by the Enthought Traits library. Any configurable element
109 mechanism inspired by the Enthought Traits library. Any configurable element
103 can have its attributes set either via files that now use real Python syntax
110 can have its attributes set either via files that now use real Python syntax
104 or from the command-line.
111 or from the command-line.
105
112
106 * **Vim integration**. Vim can be configured to seamlessly control an IPython
107 kernel, see the files in :file:`docs/examples/vim` for the full details.
108 This work was done by Paul Ivanov, who prepared a nice `video
109 demonstration`__ of the features it provides.
110
111 .. __: http://pirsquared.org/blog/2011/07/28/vim-ipython/
112
113
113 Authors and support
114 Authors and support
114 -------------------
115 -------------------
115
116
116 Over 60 separate authors have contributed to this release, see :ref:`below
117 Over 60 separate authors have contributed to this release, see :ref:`below
117 <credits_011>` for a full list. In particular, we want to highlight the
118 <credits_011>` for a full list. In particular, we want to highlight the
118 extremely active participation of two new core team members: Evan Patterson
119 extremely active participation of two new core team members: Evan Patterson
119 implemented the Qt console, and Thomas Kluyver started with our Python 3 port
120 implemented the Qt console, and Thomas Kluyver started with our Python 3 port
120 and by now has made major contributions to just about every area of IPython.
121 and by now has made major contributions to just about every area of IPython.
121
122
122 We are also grateful for the support we have received during this development
123 We are also grateful for the support we have received during this development
123 cycle from several institutions:
124 cycle from several institutions:
124
125
125 - `Enthought Inc`__ funded the development of our new Qt console, an effort that
126 - `Enthought Inc`__ funded the development of our new Qt console, an effort that
126 required developing major pieces of underlying infrastructure, which now
127 required developing major pieces of underlying infrastructure, which now
127 power not only the Qt console but also our new parallel machinery. We'd like
128 power not only the Qt console but also our new parallel machinery. We'd like
128 to thank Eric Jones and Travis Oliphant for their support, as well as Ilan
129 to thank Eric Jones and Travis Oliphant for their support, as well as Ilan
129 Schnell for his tireless work integrating and testing IPython in the
130 Schnell for his tireless work integrating and testing IPython in the
130 `Enthought Python Distribution`_.
131 `Enthought Python Distribution`_.
131
132
132 .. __: http://enthought.com
133 .. __: http://enthought.com
133 .. _Enthought Python Distribution: http://www.enthought.com/products/epd.php
134 .. _Enthought Python Distribution: http://www.enthought.com/products/epd.php
134
135
135 - Nipy/NIH: funding via the `NiPy project`__ (NIH grant 5R01MH081909-02) helped
136 - Nipy/NIH: funding via the `NiPy project`__ (NIH grant 5R01MH081909-02) helped
136 us jumpstart the development of this series by restructuring the entire
137 us jumpstart the development of this series by restructuring the entire
137 codebase two years ago in a way that would make modular development and
138 codebase two years ago in a way that would make modular development and
138 testing more approachable. Without this initial groundwork, all the new
139 testing more approachable. Without this initial groundwork, all the new
139 features we have added would have been impossible to develop.
140 features we have added would have been impossible to develop.
140
141
141 .. __: http://nipy.org
142 .. __: http://nipy.org
142
143
143 - Sage/NSF: funding via the grant `Sage: Unifying Mathematical Software for
144 - Sage/NSF: funding via the grant `Sage: Unifying Mathematical Software for
144 Scientists, Engineers, and Mathematicians`__ (NSF grant DMS-1015114)
145 Scientists, Engineers, and Mathematicians`__ (NSF grant DMS-1015114)
145 supported a meeting in spring 2011 of several of the core IPython developers
146 supported a meeting in spring 2011 of several of the core IPython developers
146 where major progress was made integrating the last key pieces leading to this
147 where major progress was made integrating the last key pieces leading to this
147 release.
148 release.
148
149
149 .. __: http://modular.math.washington.edu/grants/compmath09
150 .. __: http://modular.math.washington.edu/grants/compmath09
150
151
151 - Microsoft's team working on `Python Tools for Visual Studio`__ developed the
152 - Microsoft's team working on `Python Tools for Visual Studio`__ developed the
152 integraton of IPython into the Python plugin for Visual Studio 2010.
153 integraton of IPython into the Python plugin for Visual Studio 2010.
153
154
154 .. __: http://pytools.codeplex.com
155 .. __: http://pytools.codeplex.com
155
156
156 - Google Summer of Code: in 2010, we had two students developing prototypes of
157 - Google Summer of Code: in 2010, we had two students developing prototypes of
157 the new machinery that is now maturing in this release: `Omar Zapata`_ and
158 the new machinery that is now maturing in this release: `Omar Zapata`_ and
158 `Gerardo Gutiérrez`_.
159 `Gerardo Gutiérrez`_.
159
160
160 .. _Omar Zapata: http://ipythonzmq.blogspot.com/2010/08/ipython-zmq-status.html
161 .. _Omar Zapata: http://ipythonzmq.blogspot.com/2010/08/ipython-zmq-status.html
161 .. _Gerardo Gutiérrez: http://ipythonqt.blogspot.com/2010/04/ipython-qt-interface-gsoc-2010-proposal.html>
162 .. _Gerardo Gutiérrez: http://ipythonqt.blogspot.com/2010/04/ipython-qt-interface-gsoc-2010-proposal.html>
162
163
163
164
164 Development summary
165 Development summary
165 -------------------
166 -------------------
166
167
167 In April 2010, after `one breakage too many with bzr`__, we decided to move our
168 In April 2010, after `one breakage too many with bzr`__, we decided to move our
168 entire development process to Git and Github.com. This has proven to be one of
169 entire development process to Git and Github.com. This has proven to be one of
169 the best decisions in the project's history, as the combination of git and
170 the best decisions in the project's history, as the combination of git and
170 github have made us far, far more productive than we could be with our previous
171 github have made us far, far more productive than we could be with our previous
171 tools. We first converted our bzr repo to a git one without losing history,
172 tools. We first converted our bzr repo to a git one without losing history,
172 and a few weeks later ported all open Launchpad bugs to github issues with
173 and a few weeks later ported all open Launchpad bugs to github issues with
173 their comments mostly intact (modulo some formatting changes). This ensured a
174 their comments mostly intact (modulo some formatting changes). This ensured a
174 smooth transition where no development history or submitted bugs were lost.
175 smooth transition where no development history or submitted bugs were lost.
175
176
176 .. __: http://mail.scipy.org/pipermail/ipython-dev/2010-April/005944.html
177 .. __: http://mail.scipy.org/pipermail/ipython-dev/2010-April/005944.html
177
178
178 These simple statistics show how much work has been done on the new release, by
179 These simple statistics show how much work has been done on the new release, by
179 comparing the current code to the last point it had in common with the 0.10
180 comparing the current code to the last point it had in common with the 0.10
180 series. A huge diff and over 2000 commits make up this development::
181 series. A huge diff and over 2000 commits make up this development::
181
182
182 git diff $(git merge-base 0.10.2 HEAD) | wc -l
183 git diff $(git merge-base 0.10.2 HEAD) | wc -l
183 287676
184 287676
184
185
185 git log $(git merge-base 0.10.2 HEAD) --oneline | wc -l
186 git log $(git merge-base 0.10.2 HEAD) --oneline | wc -l
186 2046
187 2046
187
188
188 Since our move to github, 510 issues were closed, 225 of which were pull
189 Since our move to github, 510 issues were closed, 225 of which were pull
189 requests and 285 regular issues (see :ref:`below <issues_list_011>` for a full
190 requests and 285 regular issues (see :ref:`below <issues_list_011>` for a full
190 list). Github's pull requests are a fantastic mechanism for reviewing code and
191 list). Github's pull requests are a fantastic mechanism for reviewing code and
191 building a shared ownership of the project, and we are making enthusiastic use
192 building a shared ownership of the project, and we are making enthusiastic use
192 of it.
193 of it.
193
194
194 Note: this undercounts the number of issues closed in this development cycle,
195 .. Note::
195 since we only moved to github for issue tracking in May 2010, but we have no
196 way of collecting statistics on the number of issues closed in the old
197 Launchpad bug tracker prior to that.
198
196
197 This undercounts the number of issues closed in this development cycle,
198 since we only moved to github for issue tracking in May 2010, but we have no
199 way of collecting statistics on the number of issues closed in the old
200 Launchpad bug tracker prior to that.
201
202
199 .. _qtconsole_011:
203 .. _qtconsole_011:
200
204
201 Qt Console
205 Qt Console
202 ----------
206 ----------
203
207
204 IPython now ships with a Qt application that feels very much like a terminal,
208 IPython now ships with a Qt application that feels very much like a terminal,
205 but is in fact a rich GUI that runs an IPython client but supports inline
209 but is in fact a rich GUI that runs an IPython client but supports inline
206 figures, saving sessions to PDF and HTML, multiline editing with syntax
210 figures, saving sessions to PDF and HTML, multiline editing with syntax
207 highlighting, graphical calltips and much more:
211 highlighting, graphical calltips and much more:
208
212
209 .. figure:: ../_static/qtconsole.png
213 .. figure:: ../_static/qtconsole.png
210 :width: 400px
214 :width: 400px
211 :alt: IPython Qt console with embedded plots
215 :alt: IPython Qt console with embedded plots
212 :align: center
216 :align: center
213 :target: ../_static/qtconsole.png
217 :target: ../_static/qtconsole.png
214
218
215 The Qt console for IPython, using inline matplotlib plots.
219 The Qt console for IPython, using inline matplotlib plots.
216
220
217 We hope that many projects will embed this widget, which we've kept
221 We hope that many projects will embed this widget, which we've kept
218 deliberately very lightweight, into their own environments. In the future we
222 deliberately very lightweight, into their own environments. In the future we
219 may also offer a slightly more featureful application (with menus and other GUI
223 may also offer a slightly more featureful application (with menus and other GUI
220 elements), but we remain committed to always shipping this easy to embed
224 elements), but we remain committed to always shipping this easy to embed
221 widget.
225 widget.
222
226
223 See the :ref:`Qt console section <qtconsole>` of the docs for a detailed
227 See the :ref:`Qt console section <qtconsole>` of the docs for a detailed
224 description of the console's features and use.
228 description of the console's features and use.
225
229
226
230
227 High-level parallel computing with ZeroMQ
231 High-level parallel computing with ZeroMQ
228 -----------------------------------------
232 -----------------------------------------
229
233
230 We have completely rewritten the Twisted-based code for high-level parallel
234 We have completely rewritten the Twisted-based code for high-level parallel
231 computing to work atop our new ZeroMQ architecture. While we realize this will
235 computing to work atop our new ZeroMQ architecture. While we realize this will
232 break compatibility for a number of users, we hope to make the transition as
236 break compatibility for a number of users, we hope to make the transition as
233 easy as possible with our docs, and we are convinced the change is worth it.
237 easy as possible with our docs, and we are convinced the change is worth it.
234 ZeroMQ provides us with much tighter control over memory, higher performance,
238 ZeroMQ provides us with much tighter control over memory, higher performance,
235 and its communications are impervious to the Python Global Interpreter Lock
239 and its communications are impervious to the Python Global Interpreter Lock
236 because they take place in a system-level C++ thread. The impact of the GIL in
240 because they take place in a system-level C++ thread. The impact of the GIL in
237 our previous code was something we could simply not work around, given that
241 our previous code was something we could simply not work around, given that
238 Twisted is itself a Python library. So while Twisted is a very capable
242 Twisted is itself a Python library. So while Twisted is a very capable
239 framework, we think ZeroMQ fits our needs much better and we hope you will find
243 framework, we think ZeroMQ fits our needs much better and we hope you will find
240 the change to be a significant improvement in the long run.
244 the change to be a significant improvement in the long run.
241
245
242 Our manual contains :ref:`a full description of how to use IPython for parallel
246 Our manual contains :ref:`a full description of how to use IPython for parallel
243 computing <parallel_overview>`, and the `tutorial`__ presented by Min
247 computing <parallel_overview>`, and the `tutorial`__ presented by Min
244 Ragan-Kelley at the SciPy 2011 conference provides a hands-on complement to the
248 Ragan-Kelley at the SciPy 2011 conference provides a hands-on complement to the
245 reference docs.
249 reference docs.
246
250
247 .. __: http://minrk.github.com/scipy-tutorial-2011
251 .. __: http://minrk.github.com/scipy-tutorial-2011
248
252
249
253
250 Refactoring
254 Refactoring
251 -----------
255 -----------
252
256
253 As of the 0.11 version of IPython, a signifiant portion of the core has been
257 As of this release, a signifiant portion of IPython has been refactored. This
254 refactored. This refactoring is founded on a number of new abstractions.
258 refactoring is founded on a number of new abstractions. The main new classes
255 The main new classes that implement these abstractions are:
259 that implement these abstractions are:
256
260
257 * :class:`IPython.utils.traitlets.HasTraits`.
261 * :class:`IPython.utils.traitlets.HasTraits`.
258 * :class:`IPython.config.configurable.Configurable`.
262 * :class:`IPython.config.configurable.Configurable`.
259 * :class:`IPython.config.application.Application`.
263 * :class:`IPython.config.application.Application`.
260 * :class:`IPython.config.loader.ConfigLoader`.
264 * :class:`IPython.config.loader.ConfigLoader`.
261 * :class:`IPython.config.loader.Config`
265 * :class:`IPython.config.loader.Config`
262
266
263 We are still in the process of writing developer focused documentation about
267 We are still in the process of writing developer focused documentation about
264 these classes, but for now our :ref:`configuration documentation
268 these classes, but for now our :ref:`configuration documentation
265 <config_overview>` contains a high level overview of the concepts that these
269 <config_overview>` contains a high level overview of the concepts that these
266 classes express.
270 classes express.
267
271
268 The biggest user-visible change is likely the move to using the config system to
272 The biggest user-visible change is likely the move to using the config system to
269 determine the command-line arguments for IPython applications. The benefit of
273 determine the command-line arguments for IPython applications. The benefit of
270 this is that *all* configurable values in IPython are exposed on the
274 this is that *all* configurable values in IPython are exposed on the
271 command-line, but the syntax for specifying values has changed. The gist is that
275 command-line, but the syntax for specifying values has changed. The gist is that
272 assigning values is pure Python assignment, so there is always an '=', and never
276 assigning values is pure Python assignment, so there is always an '=', and never
273 a leading '-', nor a space separating key from value. Flags exist, to set
277 a leading '-', nor a space separating key from value. Flags exist, to set
274 multiple values or boolean flags, and these are always prefixed with '--', and
278 multiple values or boolean flags, and these are always prefixed with '--', and
275 never take arguments.
279 never take arguments.
276
280
277 ZMQ architecture
281 ZeroMQ architecture
278 ----------------
282 -------------------
279
283
280 There is a new GUI framework for IPython, based on a client-server model in
284 There is a new GUI framework for IPython, based on a client-server model in
281 which multiple clients can communicate with one IPython kernel, using the
285 which multiple clients can communicate with one IPython kernel, using the
282 ZeroMQ messaging framework. There is already a Qt console client, which can
286 ZeroMQ messaging framework. There is already a Qt console client, which can
283 be started by calling ``ipython qtconsole``. The protocol is :ref:`documented
287 be started by calling ``ipython qtconsole``. The protocol is :ref:`documented
284 <messaging>`.
288 <messaging>`.
285
289
286 The parallel computing framework has also been rewritten using ZMQ. The
290 The parallel computing framework has also been rewritten using ZMQ. The
287 protocol is described :ref:`here <parallel_messages>`, and the code is in the
291 protocol is described :ref:`here <parallel_messages>`, and the code is in the
288 new :mod:`IPython.parallel` module.
292 new :mod:`IPython.parallel` module.
289
293
290 .. _python3_011:
294 .. _python3_011:
291
295
292 Python 3 support
296 Python 3 support
293 ----------------
297 ----------------
294
298
295 A Python 3 version of IPython has been prepared. For the time being, this is
299 A Python 3 version of IPython has been prepared. For the time being, this is
296 maintained separately and updated from the main codebase. Its code can be found
300 maintained separately and updated from the main codebase. Its code can be found
297 `here <https://github.com/ipython/ipython-py3k>`_. The parallel computing
301 `here <https://github.com/ipython/ipython-py3k>`_. The parallel computing
298 components are not perfect on Python3, but most functionality appears to be
302 components are not perfect on Python3, but most functionality appears to be
299 working. As this work is evolving quickly, the best place to find updated
303 working. As this work is evolving quickly, the best place to find updated
300 information about it is our `Python 3 wiki page`__.
304 information about it is our `Python 3 wiki page`__.
301
305
302 .. __: http://wiki.ipython.org/index.php?title=Python_3
306 .. __: http://wiki.ipython.org/index.php?title=Python_3
303
307
304
308
305 Unicode
309 Unicode
306 -------
310 -------
307
311
308 Entering non-ascii characters in unicode literals (``u"€ø"``) now works
312 Entering non-ascii characters in unicode literals (``u"€ø"``) now works
309 properly on all platforms. However, entering these in byte/string literals
313 properly on all platforms. However, entering these in byte/string literals
310 (``"€ø"``) will not work as expected on Windows (or any platform where the
314 (``"€ø"``) will not work as expected on Windows (or any platform where the
311 terminal encoding is not UTF-8, as it typically is for Linux & Mac OS X). You
315 terminal encoding is not UTF-8, as it typically is for Linux & Mac OS X). You
312 can use escape sequences (``"\xe9\x82"``) to get bytes above 128, or use
316 can use escape sequences (``"\xe9\x82"``) to get bytes above 128, or use
313 unicode literals and encode them. This is a limitation of Python 2 which we
317 unicode literals and encode them. This is a limitation of Python 2 which we
314 cannot easily work around.
318 cannot easily work around.
315
319
316 .. _ms_visual_studio_011:
320 .. _ms_visual_studio_011:
317
321
318 Integration with Microsoft Visual Studio
322 Integration with Microsoft Visual Studio
319 ----------------------------------------
323 ----------------------------------------
320
324
321 IPython can be used as the interactive shell in the `Python plugin for
325 IPython can be used as the interactive shell in the `Python plugin for
322 Microsoft Visual Studio`__, as seen here:
326 Microsoft Visual Studio`__, as seen here:
323
327
324 .. figure:: ../_static/ms_visual_studio.png
328 .. figure:: ../_static/ms_visual_studio.png
325 :width: 500px
329 :width: 500px
326 :alt: IPython console embedded in Microsoft Visual Studio.
330 :alt: IPython console embedded in Microsoft Visual Studio.
327 :align: center
331 :align: center
328 :target: ../_static/ms_visual_studio.png
332 :target: ../_static/ms_visual_studio.png
329
333
330 IPython console embedded in Microsoft Visual Studio.
334 IPython console embedded in Microsoft Visual Studio.
331
335
332 The Microsoft team developing this currently has a release candidate out using
336 The Microsoft team developing this currently has a release candidate out using
333 IPython 0.11. We will continue to collaborate with them to ensure that as they
337 IPython 0.11. We will continue to collaborate with them to ensure that as they
334 approach full release time, the integration with IPython is as smooth as
338 approach their final release date, the integration with IPython remains smooth.
335 possible. We'd like to thank Dino Viehland and Shahrokh Mortazavi for the work
339 We'd like to thank Dino Viehland and Shahrokh Mortazavi for the work they have
336 they have done towards this feature, as well as Wenming Ye for his support of
340 done towards this feature, as well as Wenming Ye for his support of our WinHPC
337 our WinHPC features.
341 capabilities.
338
342
339 .. __: http://pytools.codeplex.com
343 .. __: http://pytools.codeplex.com
340
344
341
345
342 Additional new features
346 Additional new features
343 -----------------------
347 -----------------------
344
348
345 * Added ``Bytes`` traitlet, removing ``Str``. All 'string' traitlets should
349 * Added ``Bytes`` traitlet, removing ``Str``. All 'string' traitlets should
346 either be ``Unicode`` if a real string, or ``Bytes`` if a C-string. This
350 either be ``Unicode`` if a real string, or ``Bytes`` if a C-string. This
347 removes ambiguity and helps the Python 3 transition.
351 removes ambiguity and helps the Python 3 transition.
348
352
349 * New magic ``%loadpy`` loads a python file from disk or web URL into
353 * New magic ``%loadpy`` loads a python file from disk or web URL into
350 the current input buffer.
354 the current input buffer.
351
355
352 * New magic ``%pastebin`` for sharing code via the 'Lodge it' pastebin.
356 * New magic ``%pastebin`` for sharing code via the 'Lodge it' pastebin.
353
357
354 * New magic ``%precision`` for controlling float and numpy pretty printing.
358 * New magic ``%precision`` for controlling float and numpy pretty printing.
355
359
356 * IPython applications initiate logging, so any object can gain access to
360 * IPython applications initiate logging, so any object can gain access to
357 a the logger of the currently running Application with:
361 a the logger of the currently running Application with:
358
362
359 .. sourcecode:: python
363 .. sourcecode:: python
360
364
361 from IPython.config.application import Application
365 from IPython.config.application import Application
362 logger = Application.instance().log
366 logger = Application.instance().log
363
367
364 * You can now get help on an object halfway through typing a command. For
368 * You can now get help on an object halfway through typing a command. For
365 instance, typing ``a = zip?`` shows the details of :func:`zip`. It also
369 instance, typing ``a = zip?`` shows the details of :func:`zip`. It also
366 leaves the command at the next prompt so you can carry on with it.
370 leaves the command at the next prompt so you can carry on with it.
367
371
368 * The input history is now written to an SQLite database. The API for
372 * The input history is now written to an SQLite database. The API for
369 retrieving items from the history has also been redesigned.
373 retrieving items from the history has also been redesigned.
370
374
371 * The :mod:`IPython.extensions.pretty` extension has been moved out of
375 * The :mod:`IPython.extensions.pretty` extension has been moved out of
372 quarantine and fully updated to the new extension API.
376 quarantine and fully updated to the new extension API.
373
377
374 * New magics for loading/unloading/reloading extensions have been added:
378 * New magics for loading/unloading/reloading extensions have been added:
375 ``%load_ext``, ``%unload_ext`` and ``%reload_ext``.
379 ``%load_ext``, ``%unload_ext`` and ``%reload_ext``.
376
380
377 * The configuration system and configuration files are brand new. See the
381 * The configuration system and configuration files are brand new. See the
378 configuration system :ref:`documentation <config_index>` for more details.
382 configuration system :ref:`documentation <config_index>` for more details.
379
383
380 * The :class:`~IPython.core.interactiveshell.InteractiveShell` class is now a
384 * The :class:`~IPython.core.interactiveshell.InteractiveShell` class is now a
381 :class:`~IPython.config.configurable.Configurable` subclass and has traitlets
385 :class:`~IPython.config.configurable.Configurable` subclass and has traitlets
382 that determine the defaults and runtime environment. The ``__init__`` method
386 that determine the defaults and runtime environment. The ``__init__`` method
383 has also been refactored so this class can be instantiated and run without
387 has also been refactored so this class can be instantiated and run without
384 the old :mod:`ipmaker` module.
388 the old :mod:`ipmaker` module.
385
389
386 * The methods of :class:`~IPython.core.interactiveshell.InteractiveShell` have
390 * The methods of :class:`~IPython.core.interactiveshell.InteractiveShell` have
387 been organized into sections to make it easier to turn more sections
391 been organized into sections to make it easier to turn more sections
388 of functionality into components.
392 of functionality into components.
389
393
390 * The embedded shell has been refactored into a truly standalone subclass of
394 * The embedded shell has been refactored into a truly standalone subclass of
391 :class:`InteractiveShell` called :class:`InteractiveShellEmbed`. All
395 :class:`InteractiveShell` called :class:`InteractiveShellEmbed`. All
392 embedding logic has been taken out of the base class and put into the
396 embedding logic has been taken out of the base class and put into the
393 embedded subclass.
397 embedded subclass.
394
398
395 * Added methods of :class:`~IPython.core.interactiveshell.InteractiveShell` to
399 * Added methods of :class:`~IPython.core.interactiveshell.InteractiveShell` to
396 help it cleanup after itself. The :meth:`cleanup` method controls this. We
400 help it cleanup after itself. The :meth:`cleanup` method controls this. We
397 couldn't do this in :meth:`__del__` because we have cycles in our object
401 couldn't do this in :meth:`__del__` because we have cycles in our object
398 graph that prevent it from being called.
402 graph that prevent it from being called.
399
403
400 * Created a new module :mod:`IPython.utils.importstring` for resolving
404 * Created a new module :mod:`IPython.utils.importstring` for resolving
401 strings like ``foo.bar.Bar`` to the actual class.
405 strings like ``foo.bar.Bar`` to the actual class.
402
406
403 * Completely refactored the :mod:`IPython.core.prefilter` module into
407 * Completely refactored the :mod:`IPython.core.prefilter` module into
404 :class:`~IPython.config.configurable.Configurable` subclasses. Added a new
408 :class:`~IPython.config.configurable.Configurable` subclasses. Added a new
405 layer into the prefilter system, called "transformations" that all new
409 layer into the prefilter system, called "transformations" that all new
406 prefilter logic should use (rather than the older "checker/handler"
410 prefilter logic should use (rather than the older "checker/handler"
407 approach).
411 approach).
408
412
409 * Aliases are now components (:mod:`IPython.core.alias`).
413 * Aliases are now components (:mod:`IPython.core.alias`).
410
414
411 * New top level :func:`~IPython.frontend.terminal.embed.embed` function that can
415 * New top level :func:`~IPython.frontend.terminal.embed.embed` function that can
412 be called to embed IPython at any place in user's code. On the first call it
416 be called to embed IPython at any place in user's code. On the first call it
413 will create an :class:`~IPython.frontend.terminal.embed.InteractiveShellEmbed`
417 will create an :class:`~IPython.frontend.terminal.embed.InteractiveShellEmbed`
414 instance and call it. In later calls, it just calls the previously created
418 instance and call it. In later calls, it just calls the previously created
415 :class:`~IPython.frontend.terminal.embed.InteractiveShellEmbed`.
419 :class:`~IPython.frontend.terminal.embed.InteractiveShellEmbed`.
416
420
417 * Created a configuration system (:mod:`IPython.config.configurable`) that is
421 * Created a configuration system (:mod:`IPython.config.configurable`) that is
418 based on :mod:`IPython.utils.traitlets`. Configurables are arranged into a
422 based on :mod:`IPython.utils.traitlets`. Configurables are arranged into a
419 runtime containment tree (not inheritance) that i) automatically propagates
423 runtime containment tree (not inheritance) that i) automatically propagates
420 configuration information and ii) allows singletons to discover each other in
424 configuration information and ii) allows singletons to discover each other in
421 a loosely coupled manner. In the future all parts of IPython will be
425 a loosely coupled manner. In the future all parts of IPython will be
422 subclasses of :class:`~IPython.config.configurable.Configurable`. All IPython
426 subclasses of :class:`~IPython.config.configurable.Configurable`. All IPython
423 developers should become familiar with the config system.
427 developers should become familiar with the config system.
424
428
425 * Created a new :class:`~IPython.config.loader.Config` for holding
429 * Created a new :class:`~IPython.config.loader.Config` for holding
426 configuration information. This is a dict like class with a few extras: i)
430 configuration information. This is a dict like class with a few extras: i)
427 it supports attribute style access, ii) it has a merge function that merges
431 it supports attribute style access, ii) it has a merge function that merges
428 two :class:`~IPython.config.loader.Config` instances recursively and iii) it
432 two :class:`~IPython.config.loader.Config` instances recursively and iii) it
429 will automatically create sub-:class:`~IPython.config.loader.Config`
433 will automatically create sub-:class:`~IPython.config.loader.Config`
430 instances for attributes that start with an uppercase character.
434 instances for attributes that start with an uppercase character.
431
435
432 * Created new configuration loaders in :mod:`IPython.config.loader`. These
436 * Created new configuration loaders in :mod:`IPython.config.loader`. These
433 loaders provide a unified loading interface for all configuration
437 loaders provide a unified loading interface for all configuration
434 information including command line arguments and configuration files. We
438 information including command line arguments and configuration files. We
435 have two default implementations based on :mod:`argparse` and plain python
439 have two default implementations based on :mod:`argparse` and plain python
436 files. These are used to implement the new configuration system.
440 files. These are used to implement the new configuration system.
437
441
438 * Created a top-level :class:`Application` class in
442 * Created a top-level :class:`Application` class in
439 :mod:`IPython.core.application` that is designed to encapsulate the starting
443 :mod:`IPython.core.application` that is designed to encapsulate the starting
440 of any basic Python program. An application loads and merges all the
444 of any basic Python program. An application loads and merges all the
441 configuration objects, constructs the main application, configures and
445 configuration objects, constructs the main application, configures and
442 initiates logging, and creates and configures any :class:`Configurable`
446 initiates logging, and creates and configures any :class:`Configurable`
443 instances and then starts the application running. An extended
447 instances and then starts the application running. An extended
444 :class:`BaseIPythonApplication` class adds logic for handling the
448 :class:`BaseIPythonApplication` class adds logic for handling the
445 IPython directory as well as profiles, and all IPython entry points
449 IPython directory as well as profiles, and all IPython entry points
446 extend it.
450 extend it.
447
451
448 * The :class:`Type` and :class:`Instance` traitlets now handle classes given
452 * The :class:`Type` and :class:`Instance` traitlets now handle classes given
449 as strings, like ``foo.bar.Bar``. This is needed for forward declarations.
453 as strings, like ``foo.bar.Bar``. This is needed for forward declarations.
450 But, this was implemented in a careful way so that string to class
454 But, this was implemented in a careful way so that string to class
451 resolution is done at a single point, when the parent
455 resolution is done at a single point, when the parent
452 :class:`~IPython.utils.traitlets.HasTraitlets` is instantiated.
456 :class:`~IPython.utils.traitlets.HasTraitlets` is instantiated.
453
457
454 * :mod:`IPython.utils.ipstruct` has been refactored to be a subclass of
458 * :mod:`IPython.utils.ipstruct` has been refactored to be a subclass of
455 dict. It also now has full docstrings and doctests.
459 dict. It also now has full docstrings and doctests.
456
460
457 * Created a Traits like implementation in :mod:`IPython.utils.traitlets`. This
461 * Created a Traits like implementation in :mod:`IPython.utils.traitlets`. This
458 is a pure Python, lightweight version of a library that is similar to
462 is a pure Python, lightweight version of a library that is similar to
459 Enthought's Traits project, but has no dependencies on Enthought's code. We
463 Enthought's Traits project, but has no dependencies on Enthought's code. We
460 are using this for validation, defaults and notification in our new component
464 are using this for validation, defaults and notification in our new component
461 system. Although it is not 100% API compatible with Enthought's Traits, we
465 system. Although it is not 100% API compatible with Enthought's Traits, we
462 plan on moving in this direction so that eventually our implementation could
466 plan on moving in this direction so that eventually our implementation could
463 be replaced by a (yet to exist) pure Python version of Enthought Traits.
467 be replaced by a (yet to exist) pure Python version of Enthought Traits.
464
468
465 * Added a new module :mod:`IPython.lib.inputhook` to manage the integration
469 * Added a new module :mod:`IPython.lib.inputhook` to manage the integration
466 with GUI event loops using `PyOS_InputHook`. See the docstrings in this
470 with GUI event loops using `PyOS_InputHook`. See the docstrings in this
467 module or the main IPython docs for details.
471 module or the main IPython docs for details.
468
472
469 * For users, GUI event loop integration is now handled through the new
473 * For users, GUI event loop integration is now handled through the new
470 :command:`%gui` magic command. Type ``%gui?`` at an IPython prompt for
474 :command:`%gui` magic command. Type ``%gui?`` at an IPython prompt for
471 documentation.
475 documentation.
472
476
473 * For developers :mod:`IPython.lib.inputhook` provides a simple interface
477 * For developers :mod:`IPython.lib.inputhook` provides a simple interface
474 for managing the event loops in their interactive GUI applications.
478 for managing the event loops in their interactive GUI applications.
475 Examples can be found in our :file:`docs/examples/lib` directory.
479 Examples can be found in our :file:`docs/examples/lib` directory.
476
480
477 Backwards incompatible changes
481 Backwards incompatible changes
478 ------------------------------
482 ------------------------------
479
483
480 * The Twisted-based :mod:`IPython.kernel` has been removed, and completely
484 * The Twisted-based :mod:`IPython.kernel` has been removed, and completely
481 rewritten as :mod:`IPython.parallel`, using ZeroMQ.
485 rewritten as :mod:`IPython.parallel`, using ZeroMQ.
482
486
483 * Profiles are now directories. Instead of a profile being a single config file,
487 * Profiles are now directories. Instead of a profile being a single config file,
484 profiles are now self-contained directories. By default, profiles get their
488 profiles are now self-contained directories. By default, profiles get their
485 own IPython history, log files, and everything. To create a new profile, do
489 own IPython history, log files, and everything. To create a new profile, do
486 ``ipython profile create <name>``.
490 ``ipython profile create <name>``.
487
491
488 * All IPython applications have been rewritten to use
492 * All IPython applications have been rewritten to use
489 :class:`~IPython.config.loader.KeyValueConfigLoader`. This means that
493 :class:`~IPython.config.loader.KeyValueConfigLoader`. This means that
490 command-line options have changed. Now, all configurable values are accessible
494 command-line options have changed. Now, all configurable values are accessible
491 from the command-line with the same syntax as in a configuration file.
495 from the command-line with the same syntax as in a configuration file.
492
496
493 * The command line options ``-wthread``, ``-qthread`` and
497 * The command line options ``-wthread``, ``-qthread`` and
494 ``-gthread`` have been removed. Use ``--gui=wx``, ``--gui=qt``, ``--gui=gtk``
498 ``-gthread`` have been removed. Use ``--gui=wx``, ``--gui=qt``, ``--gui=gtk``
495 instead.
499 instead.
496
500
497 * The extension loading functions have been renamed to
501 * The extension loading functions have been renamed to
498 :func:`load_ipython_extension` and :func:`unload_ipython_extension`.
502 :func:`load_ipython_extension` and :func:`unload_ipython_extension`.
499
503
500 * :class:`~IPython.core.interactiveshell.InteractiveShell` no longer takes an
504 * :class:`~IPython.core.interactiveshell.InteractiveShell` no longer takes an
501 ``embedded`` argument. Instead just use the
505 ``embedded`` argument. Instead just use the
502 :class:`~IPython.core.interactiveshell.InteractiveShellEmbed` class.
506 :class:`~IPython.core.interactiveshell.InteractiveShellEmbed` class.
503
507
504 * ``__IPYTHON__`` is no longer injected into ``__builtin__``.
508 * ``__IPYTHON__`` is no longer injected into ``__builtin__``.
505
509
506 * :meth:`Struct.__init__` no longer takes `None` as its first argument. It
510 * :meth:`Struct.__init__` no longer takes `None` as its first argument. It
507 must be a :class:`dict` or :class:`Struct`.
511 must be a :class:`dict` or :class:`Struct`.
508
512
509 * :meth:`~IPython.core.interactiveshell.InteractiveShell.ipmagic` has been
513 * :meth:`~IPython.core.interactiveshell.InteractiveShell.ipmagic` has been
510 renamed :meth:`~IPython.core.interactiveshell.InteractiveShell.magic.`
514 renamed :meth:`~IPython.core.interactiveshell.InteractiveShell.magic.`
511
515
512 * The functions :func:`ipmagic` and :func:`ipalias` have been removed from
516 * The functions :func:`ipmagic` and :func:`ipalias` have been removed from
513 :mod:`__builtins__`.
517 :mod:`__builtins__`.
514
518
515 * The references to the global
519 * The references to the global
516 :class:`~IPython.core.interactivehell.InteractiveShell` instance (``_ip``, and
520 :class:`~IPython.core.interactivehell.InteractiveShell` instance (``_ip``, and
517 ``__IP``) have been removed from the user's namespace. They are replaced by a
521 ``__IP``) have been removed from the user's namespace. They are replaced by a
518 new function called :func:`get_ipython` that returns the current
522 new function called :func:`get_ipython` that returns the current
519 :class:`~IPython.core.interactiveshell.InteractiveShell` instance. This
523 :class:`~IPython.core.interactiveshell.InteractiveShell` instance. This
520 function is injected into the user's namespace and is now the main way of
524 function is injected into the user's namespace and is now the main way of
521 accessing the running IPython.
525 accessing the running IPython.
522
526
523 * Old style configuration files :file:`ipythonrc` and :file:`ipy_user_conf.py`
527 * Old style configuration files :file:`ipythonrc` and :file:`ipy_user_conf.py`
524 are no longer supported. Users should migrate there configuration files to
528 are no longer supported. Users should migrate there configuration files to
525 the new format described :ref:`here <config_overview>` and :ref:`here
529 the new format described :ref:`here <config_overview>` and :ref:`here
526 <configuring_ipython>`.
530 <configuring_ipython>`.
527
531
528 * The old IPython extension API that relied on :func:`ipapi` has been
532 * The old IPython extension API that relied on :func:`ipapi` has been
529 completely removed. The new extension API is described :ref:`here
533 completely removed. The new extension API is described :ref:`here
530 <configuring_ipython>`.
534 <configuring_ipython>`.
531
535
532 * Support for ``qt3`` has been dropped. Users who need this should use
536 * Support for ``qt3`` has been dropped. Users who need this should use
533 previous versions of IPython.
537 previous versions of IPython.
534
538
535 * Removed :mod:`shellglobals` as it was obsolete.
539 * Removed :mod:`shellglobals` as it was obsolete.
536
540
537 * Removed all the threaded shells in :mod:`IPython.core.shell`. These are no
541 * Removed all the threaded shells in :mod:`IPython.core.shell`. These are no
538 longer needed because of the new capabilities in
542 longer needed because of the new capabilities in
539 :mod:`IPython.lib.inputhook`.
543 :mod:`IPython.lib.inputhook`.
540
544
541 * New top-level sub-packages have been created: :mod:`IPython.core`,
545 * New top-level sub-packages have been created: :mod:`IPython.core`,
542 :mod:`IPython.lib`, :mod:`IPython.utils`, :mod:`IPython.deathrow`,
546 :mod:`IPython.lib`, :mod:`IPython.utils`, :mod:`IPython.deathrow`,
543 :mod:`IPython.quarantine`. All existing top-level modules have been
547 :mod:`IPython.quarantine`. All existing top-level modules have been
544 moved to appropriate sub-packages. All internal import statements
548 moved to appropriate sub-packages. All internal import statements
545 have been updated and tests have been added. The build system (setup.py
549 have been updated and tests have been added. The build system (setup.py
546 and friends) have been updated. See :ref:`this section <module_reorg>` of the
550 and friends) have been updated. See :ref:`this section <module_reorg>` of the
547 documentation for descriptions of these new sub-packages.
551 documentation for descriptions of these new sub-packages.
548
552
549 * :mod:`IPython.ipapi` has been moved to :mod:`IPython.core.ipapi`.
553 * :mod:`IPython.ipapi` has been moved to :mod:`IPython.core.ipapi`.
550 :mod:`IPython.Shell` and :mod:`IPython.iplib` have been split and removed as
554 :mod:`IPython.Shell` and :mod:`IPython.iplib` have been split and removed as
551 part of the refactor.
555 part of the refactor.
552
556
553 * :mod:`Extensions` has been moved to :mod:`extensions` and all existing
557 * :mod:`Extensions` has been moved to :mod:`extensions` and all existing
554 extensions have been moved to either :mod:`IPython.quarantine` or
558 extensions have been moved to either :mod:`IPython.quarantine` or
555 :mod:`IPython.deathrow`. :mod:`IPython.quarantine` contains modules that we
559 :mod:`IPython.deathrow`. :mod:`IPython.quarantine` contains modules that we
556 plan on keeping but that need to be updated. :mod:`IPython.deathrow` contains
560 plan on keeping but that need to be updated. :mod:`IPython.deathrow` contains
557 modules that are either dead or that should be maintained as third party
561 modules that are either dead or that should be maintained as third party
558 libraries. More details about this can be found :ref:`here <module_reorg>`.
562 libraries. More details about this can be found :ref:`here <module_reorg>`.
559
563
560 * Previous IPython GUIs in :mod:`IPython.frontend` and :mod:`IPython.gui` are
564 * Previous IPython GUIs in :mod:`IPython.frontend` and :mod:`IPython.gui` are
561 likely broken, and have been removed to :mod:`IPython.deathrow` because of the
565 likely broken, and have been removed to :mod:`IPython.deathrow` because of the
562 refactoring in the core. With proper updates, these should still work.
566 refactoring in the core. With proper updates, these should still work.
563
567
564
568
565 Known Regressions
569 Known Regressions
566 -----------------
570 -----------------
567
571
568 We do our best to improve IPython, but there are some known regressions in 0.11
572 We do our best to improve IPython, but there are some known regressions in 0.11
569 relative to 0.10.2. First of all, there are features that have yet to be
573 relative to 0.10.2. First of all, there are features that have yet to be
570 ported to the new APIs, and in order to ensure that all of the installed code
574 ported to the new APIs, and in order to ensure that all of the installed code
571 runs for our users, we have moved them to two separate directories in the
575 runs for our users, we have moved them to two separate directories in the
572 source distribution, `quarantine` and `deathrow`. Finally, we have some other
576 source distribution, `quarantine` and `deathrow`. Finally, we have some other
573 miscellaneous regressions that we hope to fix as soon as possible. We now
577 miscellaneous regressions that we hope to fix as soon as possible. We now
574 describe all of these in more detail.
578 describe all of these in more detail.
575
579
576 Quarantine
580 Quarantine
577 ~~~~~~~~~~
581 ~~~~~~~~~~
578
582
579 These are tools and extensions that we consider relatively easy to update to
583 These are tools and extensions that we consider relatively easy to update to
580 the new classes and APIs, but that we simply haven't had time for. Any user
584 the new classes and APIs, but that we simply haven't had time for. Any user
581 who is interested in one of these is encouraged to help us by porting it and
585 who is interested in one of these is encouraged to help us by porting it and
582 submitting a pull request on our `development site`_.
586 submitting a pull request on our `development site`_.
583
587
584 .. _development site:: http://github.com/ipython/ipython
588 .. _development site:: http://github.com/ipython/ipython
585
589
586 Currently, the quarantine directory contains::
590 Currently, the quarantine directory contains::
587
591
588 clearcmd.py ipy_fsops.py ipy_signals.py
592 clearcmd.py ipy_fsops.py ipy_signals.py
589 envpersist.py ipy_gnuglobal.py ipy_synchronize_with.py
593 envpersist.py ipy_gnuglobal.py ipy_synchronize_with.py
590 ext_rescapture.py ipy_greedycompleter.py ipy_system_conf.py
594 ext_rescapture.py ipy_greedycompleter.py ipy_system_conf.py
591 InterpreterExec.py ipy_jot.py ipy_which.py
595 InterpreterExec.py ipy_jot.py ipy_which.py
592 ipy_app_completers.py ipy_lookfor.py ipy_winpdb.py
596 ipy_app_completers.py ipy_lookfor.py ipy_winpdb.py
593 ipy_autoreload.py ipy_profile_doctest.py ipy_workdir.py
597 ipy_autoreload.py ipy_profile_doctest.py ipy_workdir.py
594 ipy_completers.py ipy_pydb.py jobctrl.py
598 ipy_completers.py ipy_pydb.py jobctrl.py
595 ipy_editors.py ipy_rehashdir.py ledit.py
599 ipy_editors.py ipy_rehashdir.py ledit.py
596 ipy_exportdb.py ipy_render.py pspersistence.py
600 ipy_exportdb.py ipy_render.py pspersistence.py
597 ipy_extutil.py ipy_server.py win32clip.py
601 ipy_extutil.py ipy_server.py win32clip.py
598
602
599 Deathrow
603 Deathrow
600 ~~~~~~~~
604 ~~~~~~~~
601
605
602 These packages may be harder to update or make most sense as third-party
606 These packages may be harder to update or make most sense as third-party
603 libraries. Some of them are completely obsolete and have been already replaced
607 libraries. Some of them are completely obsolete and have been already replaced
604 by better functionality (we simply haven't had the time to carefully weed them
608 by better functionality (we simply haven't had the time to carefully weed them
605 out so they are kept here for now). Others simply require fixes to code that
609 out so they are kept here for now). Others simply require fixes to code that
606 the current core team may not be familiar with. If a tool you were used to is
610 the current core team may not be familiar with. If a tool you were used to is
607 included here, we encourage you to contact the dev list and we can discuss
611 included here, we encourage you to contact the dev list and we can discuss
608 whether it makes sense to keep it in IPython (if it can be maintained).
612 whether it makes sense to keep it in IPython (if it can be maintained).
609
613
610 Currently, the deathrow directory contains::
614 Currently, the deathrow directory contains::
611
615
612 astyle.py ipy_defaults.py ipy_vimserver.py
616 astyle.py ipy_defaults.py ipy_vimserver.py
613 dtutils.py ipy_kitcfg.py numeric_formats.py
617 dtutils.py ipy_kitcfg.py numeric_formats.py
614 Gnuplot2.py ipy_legacy.py numutils.py
618 Gnuplot2.py ipy_legacy.py numutils.py
615 GnuplotInteractive.py ipy_p4.py outputtrap.py
619 GnuplotInteractive.py ipy_p4.py outputtrap.py
616 GnuplotRuntime.py ipy_profile_none.py PhysicalQInput.py
620 GnuplotRuntime.py ipy_profile_none.py PhysicalQInput.py
617 ibrowse.py ipy_profile_numpy.py PhysicalQInteractive.py
621 ibrowse.py ipy_profile_numpy.py PhysicalQInteractive.py
618 igrid.py ipy_profile_scipy.py quitter.py*
622 igrid.py ipy_profile_scipy.py quitter.py*
619 ipipe.py ipy_profile_sh.py scitedirector.py
623 ipipe.py ipy_profile_sh.py scitedirector.py
620 iplib.py ipy_profile_zope.py Shell.py
624 iplib.py ipy_profile_zope.py Shell.py
621 ipy_constants.py ipy_traits_completer.py twshell.py
625 ipy_constants.py ipy_traits_completer.py twshell.py
622
626
623
627
624 Other regressions
628 Other regressions
625 ~~~~~~~~~~~~~~~~~
629 ~~~~~~~~~~~~~~~~~
626
630
627 * The machinery that adds functionality to the 'sh' profile for using IPython
631 * The machinery that adds functionality to the 'sh' profile for using IPython
628 as your system shell has not been updated to use the new APIs. As a result,
632 as your system shell has not been updated to use the new APIs. As a result,
629 only the aesthetic (prompt) changes are still implemented. We intend to fix
633 only the aesthetic (prompt) changes are still implemented. We intend to fix
630 this by 0.12. Tracked as issue 547_.
634 this by 0.12. Tracked as issue 547_.
631
635
632 .. _547: https://github.com/ipython/ipython/issues/547
636 .. _547: https://github.com/ipython/ipython/issues/547
633
637
634 * The installation of scripts on Windows was broken without setuptools, so we
638 * The installation of scripts on Windows was broken without setuptools, so we
635 now depend on setuptools on Windows. We hope to fix setuptools-less
639 now depend on setuptools on Windows. We hope to fix setuptools-less
636 installation, and then remove the setuptools dependency. Issue 539_.
640 installation, and then remove the setuptools dependency. Issue 539_.
637
641
638 .. _539: https://github.com/ipython/ipython/issues/539
642 .. _539: https://github.com/ipython/ipython/issues/539
639
643
640 * The directory history `_dh` is not saved between sessions. Issue 634_.
644 * The directory history `_dh` is not saved between sessions. Issue 634_.
641
645
642 .. _634: https://github.com/ipython/ipython/issues/634
646 .. _634: https://github.com/ipython/ipython/issues/634
643
647
644
648
645 Removed Features
649 Removed Features
646 ----------------
650 ----------------
647
651
648 As part of the updating of IPython, we have removed a few features for the
652 As part of the updating of IPython, we have removed a few features for the
649 purpsoes of cleaning up the codebase and interfaces. These removals are
653 purpsoes of cleaning up the codebase and interfaces. These removals are
650 permanent, but for any item listed below, equivalent functionality is
654 permanent, but for any item listed below, equivalent functionality is
651 available.
655 available.
652
656
653 * The magics Exit and Quit have been dropped as ways to exit IPython. Instead,
657 * The magics Exit and Quit have been dropped as ways to exit IPython. Instead,
654 the lowercase forms of both work either as a bare name (``exit``) or a
658 the lowercase forms of both work either as a bare name (``exit``) or a
655 function call (``exit()``). You can assign these to other names using
659 function call (``exit()``). You can assign these to other names using
656 exec_lines in the config file.
660 exec_lines in the config file.
657
661
658
662
659 .. _credits_011::
663 .. _credits_011::
660
664
661 Credits
665 Credits
662 -------
666 -------
663
667
664 Many users and developers contributed code, features, bug reports and ideas to
668 Many users and developers contributed code, features, bug reports and ideas to
665 this release. Please do not hesitate in contacting us if we've failed to
669 this release. Please do not hesitate in contacting us if we've failed to
666 acknowledge your contribution here. In particular, for this release we have
670 acknowledge your contribution here. In particular, for this release we have
667 contribution from the following people, a mix of new and regular names (in
671 contribution from the following people, a mix of new and regular names (in
668 alphabetical order by first name):
672 alphabetical order by first name):
669
673
670 * Aenugu Sai Kiran Reddy <saikrn08-at-gmail.com>
674 * Aenugu Sai Kiran Reddy <saikrn08-at-gmail.com>
671 * andy wilson <wilson.andrew.j+github-at-gmail.com>
675 * andy wilson <wilson.andrew.j+github-at-gmail.com>
672 * Antonio Cuni <antocuni>
676 * Antonio Cuni <antocuni>
673 * Barry Wark <barrywark-at-gmail.com>
677 * Barry Wark <barrywark-at-gmail.com>
674 * Beetoju Anuradha <anu.beethoju-at-gmail.com>
678 * Beetoju Anuradha <anu.beethoju-at-gmail.com>
675 * Benjamin Ragan-Kelley <minrk-at-Mercury.local>
679 * Benjamin Ragan-Kelley <minrk-at-Mercury.local>
676 * Brad Reisfeld
680 * Brad Reisfeld
677 * Brian E. Granger <ellisonbg-at-gmail.com>
681 * Brian E. Granger <ellisonbg-at-gmail.com>
678 * Christoph Gohlke <cgohlke-at-uci.edu>
682 * Christoph Gohlke <cgohlke-at-uci.edu>
679 * Cody Precord
683 * Cody Precord
680 * dan.milstein
684 * dan.milstein
681 * Darren Dale <dsdale24-at-gmail.com>
685 * Darren Dale <dsdale24-at-gmail.com>
682 * Dav Clark <davclark-at-berkeley.edu>
686 * Dav Clark <davclark-at-berkeley.edu>
683 * David Warde-Farley <wardefar-at-iro.umontreal.ca>
687 * David Warde-Farley <wardefar-at-iro.umontreal.ca>
684 * epatters <ejpatters-at-gmail.com>
688 * epatters <ejpatters-at-gmail.com>
685 * epatters <epatters-at-caltech.edu>
689 * epatters <epatters-at-caltech.edu>
686 * epatters <epatters-at-enthought.com>
690 * epatters <epatters-at-enthought.com>
687 * Eric Firing <efiring-at-hawaii.edu>
691 * Eric Firing <efiring-at-hawaii.edu>
688 * Erik Tollerud <erik.tollerud-at-gmail.com>
692 * Erik Tollerud <erik.tollerud-at-gmail.com>
689 * Evan Patterson <epatters-at-enthought.com>
693 * Evan Patterson <epatters-at-enthought.com>
690 * Fernando Perez <Fernando.Perez-at-berkeley.edu>
694 * Fernando Perez <Fernando.Perez-at-berkeley.edu>
691 * Gael Varoquaux <gael.varoquaux-at-normalesup.org>
695 * Gael Varoquaux <gael.varoquaux-at-normalesup.org>
692 * Gerardo <muzgash-at-Muzpelheim>
696 * Gerardo <muzgash-at-Muzpelheim>
693 * Jason Grout <jason.grout-at-drake.edu>
697 * Jason Grout <jason.grout-at-drake.edu>
694 * John Hunter <jdh2358-at-gmail.com>
698 * John Hunter <jdh2358-at-gmail.com>
695 * Jens Hedegaard Nielsen <jenshnielsen-at-gmail.com>
699 * Jens Hedegaard Nielsen <jenshnielsen-at-gmail.com>
696 * Johann Cohen-Tanugi <johann.cohentanugi-at-gmail.com>
700 * Johann Cohen-Tanugi <johann.cohentanugi-at-gmail.com>
697 * Jörgen Stenarson <jorgen.stenarson-at-bostream.nu>
701 * Jörgen Stenarson <jorgen.stenarson-at-bostream.nu>
698 * Justin Riley <justin.t.riley-at-gmail.com>
702 * Justin Riley <justin.t.riley-at-gmail.com>
699 * Kiorky
703 * Kiorky
700 * Laurent Dufrechou <laurent.dufrechou-at-gmail.com>
704 * Laurent Dufrechou <laurent.dufrechou-at-gmail.com>
701 * Luis Pedro Coelho <lpc-at-cmu.edu>
705 * Luis Pedro Coelho <lpc-at-cmu.edu>
702 * Mani chandra <mchandra-at-iitk.ac.in>
706 * Mani chandra <mchandra-at-iitk.ac.in>
703 * Mark E. Smith
707 * Mark E. Smith
704 * Mark Voorhies <mark.voorhies-at-ucsf.edu>
708 * Mark Voorhies <mark.voorhies-at-ucsf.edu>
705 * Martin Spacek <git-at-mspacek.mm.st>
709 * Martin Spacek <git-at-mspacek.mm.st>
706 * Michael Droettboom <mdroe-at-stsci.edu>
710 * Michael Droettboom <mdroe-at-stsci.edu>
707 * MinRK <benjaminrk-at-gmail.com>
711 * MinRK <benjaminrk-at-gmail.com>
708 * muzuiget <muzuiget-at-gmail.com>
712 * muzuiget <muzuiget-at-gmail.com>
709 * Nick Tarleton <nick-at-quixey.com>
713 * Nick Tarleton <nick-at-quixey.com>
710 * Nicolas Rougier <Nicolas.rougier-at-inria.fr>
714 * Nicolas Rougier <Nicolas.rougier-at-inria.fr>
711 * Omar Andres Zapata Mesa <andresete.chaos-at-gmail.com>
715 * Omar Andres Zapata Mesa <andresete.chaos-at-gmail.com>
712 * Paul Ivanov <pivanov314-at-gmail.com>
716 * Paul Ivanov <pivanov314-at-gmail.com>
713 * Pauli Virtanen <pauli.virtanen-at-iki.fi>
717 * Pauli Virtanen <pauli.virtanen-at-iki.fi>
714 * Prabhu Ramachandran
718 * Prabhu Ramachandran
715 * Ramana <sramana9-at-gmail.com>
719 * Ramana <sramana9-at-gmail.com>
716 * Robert Kern <robert.kern-at-gmail.com>
720 * Robert Kern <robert.kern-at-gmail.com>
717 * Sathesh Chandra <satheshchandra88-at-gmail.com>
721 * Sathesh Chandra <satheshchandra88-at-gmail.com>
718 * Satrajit Ghosh <satra-at-mit.edu>
722 * Satrajit Ghosh <satra-at-mit.edu>
719 * Sebastian Busch
723 * Sebastian Busch
720 * Skipper Seabold <jsseabold-at-gmail.com>
724 * Skipper Seabold <jsseabold-at-gmail.com>
721 * Stefan van der Walt <bzr-at-mentat.za.net>
725 * Stefan van der Walt <bzr-at-mentat.za.net>
722 * Stephan Peijnik <debian-at-sp.or.at>
726 * Stephan Peijnik <debian-at-sp.or.at>
723 * Steven Bethard
727 * Steven Bethard
724 * Thomas Kluyver <takowl-at-gmail.com>
728 * Thomas Kluyver <takowl-at-gmail.com>
725 * Thomas Spura <tomspur-at-fedoraproject.org>
729 * Thomas Spura <tomspur-at-fedoraproject.org>
726 * Tom Fetherston <tfetherston-at-aol.com>
730 * Tom Fetherston <tfetherston-at-aol.com>
727 * Tom MacWright
731 * Tom MacWright
728 * tzanko
732 * tzanko
729 * vankayala sowjanya <hai.sowjanya-at-gmail.com>
733 * vankayala sowjanya <hai.sowjanya-at-gmail.com>
730 * Vivian De Smedt <vds2212-at-VIVIAN>
734 * Vivian De Smedt <vds2212-at-VIVIAN>
731 * Ville M. Vainio <vivainio-at-gmail.com>
735 * Ville M. Vainio <vivainio-at-gmail.com>
732 * Vishal Vatsa <vishal.vatsa-at-gmail.com>
736 * Vishal Vatsa <vishal.vatsa-at-gmail.com>
733 * Vishnu S G <sgvishnu777-at-gmail.com>
737 * Vishnu S G <sgvishnu777-at-gmail.com>
734 * Walter Doerwald <walter-at-livinglogic.de>
738 * Walter Doerwald <walter-at-livinglogic.de>
735
739
736 .. note::
740 .. note::
737
741
738 This list was generated with the output of
742 This list was generated with the output of
739 ``git log dev-0.11 HEAD --format='* %aN <%aE>' | sed 's/@/\-at\-/' | sed 's/<>//' | sort -u``
743 ``git log dev-0.11 HEAD --format='* %aN <%aE>' | sed 's/@/\-at\-/' | sed 's/<>//' | sort -u``
740 after some cleanup. If you should be on this list, please add yourself.
744 after some cleanup. If you should be on this list, please add yourself.
741
745
742
746
743 .. _issues_list_011:
747 .. _issues_list_011:
744
748
745 Closed issues
749 Closed issues
746 =============
750 =============
747
751
748 .. include:: github-stats-011.txt
752 .. include:: github-stats-011.txt
General Comments 0
You need to be logged in to leave comments. Login now