##// END OF EJS Templates
Add egg support.
fperez -
Show More
@@ -0,0 +1,11 b''
1 #!/usr/bin/env python
2 """Simple wrapper to build IPython as an egg (setuptools format)."""
3
4 import sys
5
6 import pkg_resources
7 pkg_resources.require("setuptools")
8 import setuptools
9
10 sys.argv=['','bdist_egg']
11 execfile('setup.py')
@@ -1,4799 +1,4804 b''
1 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * setup_bdist_egg.py: little script to build an egg. Added
4 support in the release tools as well.
5
1 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
6 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2
7
3 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
8 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
4 version selection (new -wxversion command line and ipythonrc
9 version selection (new -wxversion command line and ipythonrc
5 parameter). Patch contributed by Arnd Baecker
10 parameter). Patch contributed by Arnd Baecker
6 <arnd.baecker-AT-web.de>.
11 <arnd.baecker-AT-web.de>.
7
12
8 * IPython/iplib.py (embed_mainloop): fix tab-completion in
13 * IPython/iplib.py (embed_mainloop): fix tab-completion in
9 embedded instances, for variables defined at the interactive
14 embedded instances, for variables defined at the interactive
10 prompt of the embedded ipython. Reported by Arnd.
15 prompt of the embedded ipython. Reported by Arnd.
11
16
12 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
17 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
13 it can be used as a (stateful) toggle, or with a direct parameter.
18 it can be used as a (stateful) toggle, or with a direct parameter.
14
19
15 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
20 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
16 could be triggered in certain cases and cause the traceback
21 could be triggered in certain cases and cause the traceback
17 printer not to work.
22 printer not to work.
18
23
19 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
24 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
20
25
21 * IPython/iplib.py (_should_recompile): Small fix, closes
26 * IPython/iplib.py (_should_recompile): Small fix, closes
22 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
27 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
23
28
24 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
29 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
25
30
26 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
31 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
27 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
32 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
28 Moad for help with tracking it down.
33 Moad for help with tracking it down.
29
34
30 * IPython/iplib.py (handle_auto): fix autocall handling for
35 * IPython/iplib.py (handle_auto): fix autocall handling for
31 objects which support BOTH __getitem__ and __call__ (so that f [x]
36 objects which support BOTH __getitem__ and __call__ (so that f [x]
32 is left alone, instead of becoming f([x]) automatically).
37 is left alone, instead of becoming f([x]) automatically).
33
38
34 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
39 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
35 Ville's patch.
40 Ville's patch.
36
41
37 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
42 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
38
43
39 * IPython/iplib.py (handle_auto): changed autocall semantics to
44 * IPython/iplib.py (handle_auto): changed autocall semantics to
40 include 'smart' mode, where the autocall transformation is NOT
45 include 'smart' mode, where the autocall transformation is NOT
41 applied if there are no arguments on the line. This allows you to
46 applied if there are no arguments on the line. This allows you to
42 just type 'foo' if foo is a callable to see its internal form,
47 just type 'foo' if foo is a callable to see its internal form,
43 instead of having it called with no arguments (typically a
48 instead of having it called with no arguments (typically a
44 mistake). The old 'full' autocall still exists: for that, you
49 mistake). The old 'full' autocall still exists: for that, you
45 need to set the 'autocall' parameter to 2 in your ipythonrc file.
50 need to set the 'autocall' parameter to 2 in your ipythonrc file.
46
51
47 * IPython/completer.py (Completer.attr_matches): add
52 * IPython/completer.py (Completer.attr_matches): add
48 tab-completion support for Enthoughts' traits. After a report by
53 tab-completion support for Enthoughts' traits. After a report by
49 Arnd and a patch by Prabhu.
54 Arnd and a patch by Prabhu.
50
55
51 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
56 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
52
57
53 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
58 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
54 Schmolck's patch to fix inspect.getinnerframes().
59 Schmolck's patch to fix inspect.getinnerframes().
55
60
56 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
61 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
57 for embedded instances, regarding handling of namespaces and items
62 for embedded instances, regarding handling of namespaces and items
58 added to the __builtin__ one. Multiple embedded instances and
63 added to the __builtin__ one. Multiple embedded instances and
59 recursive embeddings should work better now (though I'm not sure
64 recursive embeddings should work better now (though I'm not sure
60 I've got all the corner cases fixed, that code is a bit of a brain
65 I've got all the corner cases fixed, that code is a bit of a brain
61 twister).
66 twister).
62
67
63 * IPython/Magic.py (magic_edit): added support to edit in-memory
68 * IPython/Magic.py (magic_edit): added support to edit in-memory
64 macros (automatically creates the necessary temp files). %edit
69 macros (automatically creates the necessary temp files). %edit
65 also doesn't return the file contents anymore, it's just noise.
70 also doesn't return the file contents anymore, it's just noise.
66
71
67 * IPython/completer.py (Completer.attr_matches): revert change to
72 * IPython/completer.py (Completer.attr_matches): revert change to
68 complete only on attributes listed in __all__. I realized it
73 complete only on attributes listed in __all__. I realized it
69 cripples the tab-completion system as a tool for exploring the
74 cripples the tab-completion system as a tool for exploring the
70 internals of unknown libraries (it renders any non-__all__
75 internals of unknown libraries (it renders any non-__all__
71 attribute off-limits). I got bit by this when trying to see
76 attribute off-limits). I got bit by this when trying to see
72 something inside the dis module.
77 something inside the dis module.
73
78
74 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
79 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
75
80
76 * IPython/iplib.py (InteractiveShell.__init__): add .meta
81 * IPython/iplib.py (InteractiveShell.__init__): add .meta
77 namespace for users and extension writers to hold data in. This
82 namespace for users and extension writers to hold data in. This
78 follows the discussion in
83 follows the discussion in
79 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
84 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
80
85
81 * IPython/completer.py (IPCompleter.complete): small patch to help
86 * IPython/completer.py (IPCompleter.complete): small patch to help
82 tab-completion under Emacs, after a suggestion by John Barnard
87 tab-completion under Emacs, after a suggestion by John Barnard
83 <barnarj-AT-ccf.org>.
88 <barnarj-AT-ccf.org>.
84
89
85 * IPython/Magic.py (Magic.extract_input_slices): added support for
90 * IPython/Magic.py (Magic.extract_input_slices): added support for
86 the slice notation in magics to use N-M to represent numbers N...M
91 the slice notation in magics to use N-M to represent numbers N...M
87 (closed endpoints). This is used by %macro and %save.
92 (closed endpoints). This is used by %macro and %save.
88
93
89 * IPython/completer.py (Completer.attr_matches): for modules which
94 * IPython/completer.py (Completer.attr_matches): for modules which
90 define __all__, complete only on those. After a patch by Jeffrey
95 define __all__, complete only on those. After a patch by Jeffrey
91 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
96 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
92 speed up this routine.
97 speed up this routine.
93
98
94 * IPython/Logger.py (Logger.log): fix a history handling bug. I
99 * IPython/Logger.py (Logger.log): fix a history handling bug. I
95 don't know if this is the end of it, but the behavior now is
100 don't know if this is the end of it, but the behavior now is
96 certainly much more correct. Note that coupled with macros,
101 certainly much more correct. Note that coupled with macros,
97 slightly surprising (at first) behavior may occur: a macro will in
102 slightly surprising (at first) behavior may occur: a macro will in
98 general expand to multiple lines of input, so upon exiting, the
103 general expand to multiple lines of input, so upon exiting, the
99 in/out counters will both be bumped by the corresponding amount
104 in/out counters will both be bumped by the corresponding amount
100 (as if the macro's contents had been typed interactively). Typing
105 (as if the macro's contents had been typed interactively). Typing
101 %hist will reveal the intermediate (silently processed) lines.
106 %hist will reveal the intermediate (silently processed) lines.
102
107
103 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
108 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
104 pickle to fail (%run was overwriting __main__ and not restoring
109 pickle to fail (%run was overwriting __main__ and not restoring
105 it, but pickle relies on __main__ to operate).
110 it, but pickle relies on __main__ to operate).
106
111
107 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
112 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
108 using properties, but forgot to make the main InteractiveShell
113 using properties, but forgot to make the main InteractiveShell
109 class a new-style class. Properties fail silently, and
114 class a new-style class. Properties fail silently, and
110 misteriously, with old-style class (getters work, but
115 misteriously, with old-style class (getters work, but
111 setters don't do anything).
116 setters don't do anything).
112
117
113 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
118 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
114
119
115 * IPython/Magic.py (magic_history): fix history reporting bug (I
120 * IPython/Magic.py (magic_history): fix history reporting bug (I
116 know some nasties are still there, I just can't seem to find a
121 know some nasties are still there, I just can't seem to find a
117 reproducible test case to track them down; the input history is
122 reproducible test case to track them down; the input history is
118 falling out of sync...)
123 falling out of sync...)
119
124
120 * IPython/iplib.py (handle_shell_escape): fix bug where both
125 * IPython/iplib.py (handle_shell_escape): fix bug where both
121 aliases and system accesses where broken for indented code (such
126 aliases and system accesses where broken for indented code (such
122 as loops).
127 as loops).
123
128
124 * IPython/genutils.py (shell): fix small but critical bug for
129 * IPython/genutils.py (shell): fix small but critical bug for
125 win32 system access.
130 win32 system access.
126
131
127 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
132 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
128
133
129 * IPython/iplib.py (showtraceback): remove use of the
134 * IPython/iplib.py (showtraceback): remove use of the
130 sys.last_{type/value/traceback} structures, which are non
135 sys.last_{type/value/traceback} structures, which are non
131 thread-safe.
136 thread-safe.
132 (_prefilter): change control flow to ensure that we NEVER
137 (_prefilter): change control flow to ensure that we NEVER
133 introspect objects when autocall is off. This will guarantee that
138 introspect objects when autocall is off. This will guarantee that
134 having an input line of the form 'x.y', where access to attribute
139 having an input line of the form 'x.y', where access to attribute
135 'y' has side effects, doesn't trigger the side effect TWICE. It
140 'y' has side effects, doesn't trigger the side effect TWICE. It
136 is important to note that, with autocall on, these side effects
141 is important to note that, with autocall on, these side effects
137 can still happen.
142 can still happen.
138 (ipsystem): new builtin, to complete the ip{magic/alias/system}
143 (ipsystem): new builtin, to complete the ip{magic/alias/system}
139 trio. IPython offers these three kinds of special calls which are
144 trio. IPython offers these three kinds of special calls which are
140 not python code, and it's a good thing to have their call method
145 not python code, and it's a good thing to have their call method
141 be accessible as pure python functions (not just special syntax at
146 be accessible as pure python functions (not just special syntax at
142 the command line). It gives us a better internal implementation
147 the command line). It gives us a better internal implementation
143 structure, as well as exposing these for user scripting more
148 structure, as well as exposing these for user scripting more
144 cleanly.
149 cleanly.
145
150
146 * IPython/macro.py (Macro.__init__): moved macros to a standalone
151 * IPython/macro.py (Macro.__init__): moved macros to a standalone
147 file. Now that they'll be more likely to be used with the
152 file. Now that they'll be more likely to be used with the
148 persistance system (%store), I want to make sure their module path
153 persistance system (%store), I want to make sure their module path
149 doesn't change in the future, so that we don't break things for
154 doesn't change in the future, so that we don't break things for
150 users' persisted data.
155 users' persisted data.
151
156
152 * IPython/iplib.py (autoindent_update): move indentation
157 * IPython/iplib.py (autoindent_update): move indentation
153 management into the _text_ processing loop, not the keyboard
158 management into the _text_ processing loop, not the keyboard
154 interactive one. This is necessary to correctly process non-typed
159 interactive one. This is necessary to correctly process non-typed
155 multiline input (such as macros).
160 multiline input (such as macros).
156
161
157 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
162 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
158 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
163 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
159 which was producing problems in the resulting manual.
164 which was producing problems in the resulting manual.
160 (magic_whos): improve reporting of instances (show their class,
165 (magic_whos): improve reporting of instances (show their class,
161 instead of simply printing 'instance' which isn't terribly
166 instead of simply printing 'instance' which isn't terribly
162 informative).
167 informative).
163
168
164 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
169 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
165 (minor mods) to support network shares under win32.
170 (minor mods) to support network shares under win32.
166
171
167 * IPython/winconsole.py (get_console_size): add new winconsole
172 * IPython/winconsole.py (get_console_size): add new winconsole
168 module and fixes to page_dumb() to improve its behavior under
173 module and fixes to page_dumb() to improve its behavior under
169 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
174 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
170
175
171 * IPython/Magic.py (Macro): simplified Macro class to just
176 * IPython/Magic.py (Macro): simplified Macro class to just
172 subclass list. We've had only 2.2 compatibility for a very long
177 subclass list. We've had only 2.2 compatibility for a very long
173 time, yet I was still avoiding subclassing the builtin types. No
178 time, yet I was still avoiding subclassing the builtin types. No
174 more (I'm also starting to use properties, though I won't shift to
179 more (I'm also starting to use properties, though I won't shift to
175 2.3-specific features quite yet).
180 2.3-specific features quite yet).
176 (magic_store): added Ville's patch for lightweight variable
181 (magic_store): added Ville's patch for lightweight variable
177 persistence, after a request on the user list by Matt Wilkie
182 persistence, after a request on the user list by Matt Wilkie
178 <maphew-AT-gmail.com>. The new %store magic's docstring has full
183 <maphew-AT-gmail.com>. The new %store magic's docstring has full
179 details.
184 details.
180
185
181 * IPython/iplib.py (InteractiveShell.post_config_initialization):
186 * IPython/iplib.py (InteractiveShell.post_config_initialization):
182 changed the default logfile name from 'ipython.log' to
187 changed the default logfile name from 'ipython.log' to
183 'ipython_log.py'. These logs are real python files, and now that
188 'ipython_log.py'. These logs are real python files, and now that
184 we have much better multiline support, people are more likely to
189 we have much better multiline support, people are more likely to
185 want to use them as such. Might as well name them correctly.
190 want to use them as such. Might as well name them correctly.
186
191
187 * IPython/Magic.py: substantial cleanup. While we can't stop
192 * IPython/Magic.py: substantial cleanup. While we can't stop
188 using magics as mixins, due to the existing customizations 'out
193 using magics as mixins, due to the existing customizations 'out
189 there' which rely on the mixin naming conventions, at least I
194 there' which rely on the mixin naming conventions, at least I
190 cleaned out all cross-class name usage. So once we are OK with
195 cleaned out all cross-class name usage. So once we are OK with
191 breaking compatibility, the two systems can be separated.
196 breaking compatibility, the two systems can be separated.
192
197
193 * IPython/Logger.py: major cleanup. This one is NOT a mixin
198 * IPython/Logger.py: major cleanup. This one is NOT a mixin
194 anymore, and the class is a fair bit less hideous as well. New
199 anymore, and the class is a fair bit less hideous as well. New
195 features were also introduced: timestamping of input, and logging
200 features were also introduced: timestamping of input, and logging
196 of output results. These are user-visible with the -t and -o
201 of output results. These are user-visible with the -t and -o
197 options to %logstart. Closes
202 options to %logstart. Closes
198 http://www.scipy.net/roundup/ipython/issue11 and a request by
203 http://www.scipy.net/roundup/ipython/issue11 and a request by
199 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
204 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
200
205
201 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
206 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
202
207
203 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
208 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
204 better hadnle backslashes in paths. See the thread 'More Windows
209 better hadnle backslashes in paths. See the thread 'More Windows
205 questions part 2 - \/ characters revisited' on the iypthon user
210 questions part 2 - \/ characters revisited' on the iypthon user
206 list:
211 list:
207 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
212 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
208
213
209 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
214 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
210
215
211 (InteractiveShell.__init__): change threaded shells to not use the
216 (InteractiveShell.__init__): change threaded shells to not use the
212 ipython crash handler. This was causing more problems than not,
217 ipython crash handler. This was causing more problems than not,
213 as exceptions in the main thread (GUI code, typically) would
218 as exceptions in the main thread (GUI code, typically) would
214 always show up as a 'crash', when they really weren't.
219 always show up as a 'crash', when they really weren't.
215
220
216 The colors and exception mode commands (%colors/%xmode) have been
221 The colors and exception mode commands (%colors/%xmode) have been
217 synchronized to also take this into account, so users can get
222 synchronized to also take this into account, so users can get
218 verbose exceptions for their threaded code as well. I also added
223 verbose exceptions for their threaded code as well. I also added
219 support for activating pdb inside this exception handler as well,
224 support for activating pdb inside this exception handler as well,
220 so now GUI authors can use IPython's enhanced pdb at runtime.
225 so now GUI authors can use IPython's enhanced pdb at runtime.
221
226
222 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
227 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
223 true by default, and add it to the shipped ipythonrc file. Since
228 true by default, and add it to the shipped ipythonrc file. Since
224 this asks the user before proceeding, I think it's OK to make it
229 this asks the user before proceeding, I think it's OK to make it
225 true by default.
230 true by default.
226
231
227 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
232 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
228 of the previous special-casing of input in the eval loop. I think
233 of the previous special-casing of input in the eval loop. I think
229 this is cleaner, as they really are commands and shouldn't have
234 this is cleaner, as they really are commands and shouldn't have
230 a special role in the middle of the core code.
235 a special role in the middle of the core code.
231
236
232 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
237 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
233
238
234 * IPython/iplib.py (edit_syntax_error): added support for
239 * IPython/iplib.py (edit_syntax_error): added support for
235 automatically reopening the editor if the file had a syntax error
240 automatically reopening the editor if the file had a syntax error
236 in it. Thanks to scottt who provided the patch at:
241 in it. Thanks to scottt who provided the patch at:
237 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
242 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
238 version committed).
243 version committed).
239
244
240 * IPython/iplib.py (handle_normal): add suport for multi-line
245 * IPython/iplib.py (handle_normal): add suport for multi-line
241 input with emtpy lines. This fixes
246 input with emtpy lines. This fixes
242 http://www.scipy.net/roundup/ipython/issue43 and a similar
247 http://www.scipy.net/roundup/ipython/issue43 and a similar
243 discussion on the user list.
248 discussion on the user list.
244
249
245 WARNING: a behavior change is necessarily introduced to support
250 WARNING: a behavior change is necessarily introduced to support
246 blank lines: now a single blank line with whitespace does NOT
251 blank lines: now a single blank line with whitespace does NOT
247 break the input loop, which means that when autoindent is on, by
252 break the input loop, which means that when autoindent is on, by
248 default hitting return on the next (indented) line does NOT exit.
253 default hitting return on the next (indented) line does NOT exit.
249
254
250 Instead, to exit a multiline input you can either have:
255 Instead, to exit a multiline input you can either have:
251
256
252 - TWO whitespace lines (just hit return again), or
257 - TWO whitespace lines (just hit return again), or
253 - a single whitespace line of a different length than provided
258 - a single whitespace line of a different length than provided
254 by the autoindent (add or remove a space).
259 by the autoindent (add or remove a space).
255
260
256 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
261 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
257 module to better organize all readline-related functionality.
262 module to better organize all readline-related functionality.
258 I've deleted FlexCompleter and put all completion clases here.
263 I've deleted FlexCompleter and put all completion clases here.
259
264
260 * IPython/iplib.py (raw_input): improve indentation management.
265 * IPython/iplib.py (raw_input): improve indentation management.
261 It is now possible to paste indented code with autoindent on, and
266 It is now possible to paste indented code with autoindent on, and
262 the code is interpreted correctly (though it still looks bad on
267 the code is interpreted correctly (though it still looks bad on
263 screen, due to the line-oriented nature of ipython).
268 screen, due to the line-oriented nature of ipython).
264 (MagicCompleter.complete): change behavior so that a TAB key on an
269 (MagicCompleter.complete): change behavior so that a TAB key on an
265 otherwise empty line actually inserts a tab, instead of completing
270 otherwise empty line actually inserts a tab, instead of completing
266 on the entire global namespace. This makes it easier to use the
271 on the entire global namespace. This makes it easier to use the
267 TAB key for indentation. After a request by Hans Meine
272 TAB key for indentation. After a request by Hans Meine
268 <hans_meine-AT-gmx.net>
273 <hans_meine-AT-gmx.net>
269 (_prefilter): add support so that typing plain 'exit' or 'quit'
274 (_prefilter): add support so that typing plain 'exit' or 'quit'
270 does a sensible thing. Originally I tried to deviate as little as
275 does a sensible thing. Originally I tried to deviate as little as
271 possible from the default python behavior, but even that one may
276 possible from the default python behavior, but even that one may
272 change in this direction (thread on python-dev to that effect).
277 change in this direction (thread on python-dev to that effect).
273 Regardless, ipython should do the right thing even if CPython's
278 Regardless, ipython should do the right thing even if CPython's
274 '>>>' prompt doesn't.
279 '>>>' prompt doesn't.
275 (InteractiveShell): removed subclassing code.InteractiveConsole
280 (InteractiveShell): removed subclassing code.InteractiveConsole
276 class. By now we'd overridden just about all of its methods: I've
281 class. By now we'd overridden just about all of its methods: I've
277 copied the remaining two over, and now ipython is a standalone
282 copied the remaining two over, and now ipython is a standalone
278 class. This will provide a clearer picture for the chainsaw
283 class. This will provide a clearer picture for the chainsaw
279 branch refactoring.
284 branch refactoring.
280
285
281 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
286 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
282
287
283 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
288 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
284 failures for objects which break when dir() is called on them.
289 failures for objects which break when dir() is called on them.
285
290
286 * IPython/FlexCompleter.py (Completer.__init__): Added support for
291 * IPython/FlexCompleter.py (Completer.__init__): Added support for
287 distinct local and global namespaces in the completer API. This
292 distinct local and global namespaces in the completer API. This
288 change allows us top properly handle completion with distinct
293 change allows us top properly handle completion with distinct
289 scopes, including in embedded instances (this had never really
294 scopes, including in embedded instances (this had never really
290 worked correctly).
295 worked correctly).
291
296
292 Note: this introduces a change in the constructor for
297 Note: this introduces a change in the constructor for
293 MagicCompleter, as a new global_namespace parameter is now the
298 MagicCompleter, as a new global_namespace parameter is now the
294 second argument (the others were bumped one position).
299 second argument (the others were bumped one position).
295
300
296 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
301 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
297
302
298 * IPython/iplib.py (embed_mainloop): fix tab-completion in
303 * IPython/iplib.py (embed_mainloop): fix tab-completion in
299 embedded instances (which can be done now thanks to Vivian's
304 embedded instances (which can be done now thanks to Vivian's
300 frame-handling fixes for pdb).
305 frame-handling fixes for pdb).
301 (InteractiveShell.__init__): Fix namespace handling problem in
306 (InteractiveShell.__init__): Fix namespace handling problem in
302 embedded instances. We were overwriting __main__ unconditionally,
307 embedded instances. We were overwriting __main__ unconditionally,
303 and this should only be done for 'full' (non-embedded) IPython;
308 and this should only be done for 'full' (non-embedded) IPython;
304 embedded instances must respect the caller's __main__. Thanks to
309 embedded instances must respect the caller's __main__. Thanks to
305 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
310 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
306
311
307 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
312 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
308
313
309 * setup.py: added download_url to setup(). This registers the
314 * setup.py: added download_url to setup(). This registers the
310 download address at PyPI, which is not only useful to humans
315 download address at PyPI, which is not only useful to humans
311 browsing the site, but is also picked up by setuptools (the Eggs
316 browsing the site, but is also picked up by setuptools (the Eggs
312 machinery). Thanks to Ville and R. Kern for the info/discussion
317 machinery). Thanks to Ville and R. Kern for the info/discussion
313 on this.
318 on this.
314
319
315 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
320 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
316
321
317 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
322 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
318 This brings a lot of nice functionality to the pdb mode, which now
323 This brings a lot of nice functionality to the pdb mode, which now
319 has tab-completion, syntax highlighting, and better stack handling
324 has tab-completion, syntax highlighting, and better stack handling
320 than before. Many thanks to Vivian De Smedt
325 than before. Many thanks to Vivian De Smedt
321 <vivian-AT-vdesmedt.com> for the original patches.
326 <vivian-AT-vdesmedt.com> for the original patches.
322
327
323 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
328 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
324
329
325 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
330 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
326 sequence to consistently accept the banner argument. The
331 sequence to consistently accept the banner argument. The
327 inconsistency was tripping SAGE, thanks to Gary Zablackis
332 inconsistency was tripping SAGE, thanks to Gary Zablackis
328 <gzabl-AT-yahoo.com> for the report.
333 <gzabl-AT-yahoo.com> for the report.
329
334
330 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
335 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
331
336
332 * IPython/iplib.py (InteractiveShell.post_config_initialization):
337 * IPython/iplib.py (InteractiveShell.post_config_initialization):
333 Fix bug where a naked 'alias' call in the ipythonrc file would
338 Fix bug where a naked 'alias' call in the ipythonrc file would
334 cause a crash. Bug reported by Jorgen Stenarson.
339 cause a crash. Bug reported by Jorgen Stenarson.
335
340
336 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
341 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
337
342
338 * IPython/ipmaker.py (make_IPython): cleanups which should improve
343 * IPython/ipmaker.py (make_IPython): cleanups which should improve
339 startup time.
344 startup time.
340
345
341 * IPython/iplib.py (runcode): my globals 'fix' for embedded
346 * IPython/iplib.py (runcode): my globals 'fix' for embedded
342 instances had introduced a bug with globals in normal code. Now
347 instances had introduced a bug with globals in normal code. Now
343 it's working in all cases.
348 it's working in all cases.
344
349
345 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
350 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
346 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
351 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
347 has been introduced to set the default case sensitivity of the
352 has been introduced to set the default case sensitivity of the
348 searches. Users can still select either mode at runtime on a
353 searches. Users can still select either mode at runtime on a
349 per-search basis.
354 per-search basis.
350
355
351 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
356 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
352
357
353 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
358 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
354 attributes in wildcard searches for subclasses. Modified version
359 attributes in wildcard searches for subclasses. Modified version
355 of a patch by Jorgen.
360 of a patch by Jorgen.
356
361
357 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
362 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
358
363
359 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
364 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
360 embedded instances. I added a user_global_ns attribute to the
365 embedded instances. I added a user_global_ns attribute to the
361 InteractiveShell class to handle this.
366 InteractiveShell class to handle this.
362
367
363 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
368 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
364
369
365 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
370 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
366 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
371 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
367 (reported under win32, but may happen also in other platforms).
372 (reported under win32, but may happen also in other platforms).
368 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
373 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
369
374
370 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
375 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
371
376
372 * IPython/Magic.py (magic_psearch): new support for wildcard
377 * IPython/Magic.py (magic_psearch): new support for wildcard
373 patterns. Now, typing ?a*b will list all names which begin with a
378 patterns. Now, typing ?a*b will list all names which begin with a
374 and end in b, for example. The %psearch magic has full
379 and end in b, for example. The %psearch magic has full
375 docstrings. Many thanks to Jörgen Stenarson
380 docstrings. Many thanks to Jörgen Stenarson
376 <jorgen.stenarson-AT-bostream.nu>, author of the patches
381 <jorgen.stenarson-AT-bostream.nu>, author of the patches
377 implementing this functionality.
382 implementing this functionality.
378
383
379 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
384 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
380
385
381 * Manual: fixed long-standing annoyance of double-dashes (as in
386 * Manual: fixed long-standing annoyance of double-dashes (as in
382 --prefix=~, for example) being stripped in the HTML version. This
387 --prefix=~, for example) being stripped in the HTML version. This
383 is a latex2html bug, but a workaround was provided. Many thanks
388 is a latex2html bug, but a workaround was provided. Many thanks
384 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
389 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
385 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
390 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
386 rolling. This seemingly small issue had tripped a number of users
391 rolling. This seemingly small issue had tripped a number of users
387 when first installing, so I'm glad to see it gone.
392 when first installing, so I'm glad to see it gone.
388
393
389 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
394 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
390
395
391 * IPython/Extensions/numeric_formats.py: fix missing import,
396 * IPython/Extensions/numeric_formats.py: fix missing import,
392 reported by Stephen Walton.
397 reported by Stephen Walton.
393
398
394 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
399 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
395
400
396 * IPython/demo.py: finish demo module, fully documented now.
401 * IPython/demo.py: finish demo module, fully documented now.
397
402
398 * IPython/genutils.py (file_read): simple little utility to read a
403 * IPython/genutils.py (file_read): simple little utility to read a
399 file and ensure it's closed afterwards.
404 file and ensure it's closed afterwards.
400
405
401 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
406 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
402
407
403 * IPython/demo.py (Demo.__init__): added support for individually
408 * IPython/demo.py (Demo.__init__): added support for individually
404 tagging blocks for automatic execution.
409 tagging blocks for automatic execution.
405
410
406 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
411 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
407 syntax-highlighted python sources, requested by John.
412 syntax-highlighted python sources, requested by John.
408
413
409 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
414 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
410
415
411 * IPython/demo.py (Demo.again): fix bug where again() blocks after
416 * IPython/demo.py (Demo.again): fix bug where again() blocks after
412 finishing.
417 finishing.
413
418
414 * IPython/genutils.py (shlex_split): moved from Magic to here,
419 * IPython/genutils.py (shlex_split): moved from Magic to here,
415 where all 2.2 compatibility stuff lives. I needed it for demo.py.
420 where all 2.2 compatibility stuff lives. I needed it for demo.py.
416
421
417 * IPython/demo.py (Demo.__init__): added support for silent
422 * IPython/demo.py (Demo.__init__): added support for silent
418 blocks, improved marks as regexps, docstrings written.
423 blocks, improved marks as regexps, docstrings written.
419 (Demo.__init__): better docstring, added support for sys.argv.
424 (Demo.__init__): better docstring, added support for sys.argv.
420
425
421 * IPython/genutils.py (marquee): little utility used by the demo
426 * IPython/genutils.py (marquee): little utility used by the demo
422 code, handy in general.
427 code, handy in general.
423
428
424 * IPython/demo.py (Demo.__init__): new class for interactive
429 * IPython/demo.py (Demo.__init__): new class for interactive
425 demos. Not documented yet, I just wrote it in a hurry for
430 demos. Not documented yet, I just wrote it in a hurry for
426 scipy'05. Will docstring later.
431 scipy'05. Will docstring later.
427
432
428 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
433 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
429
434
430 * IPython/Shell.py (sigint_handler): Drastic simplification which
435 * IPython/Shell.py (sigint_handler): Drastic simplification which
431 also seems to make Ctrl-C work correctly across threads! This is
436 also seems to make Ctrl-C work correctly across threads! This is
432 so simple, that I can't beleive I'd missed it before. Needs more
437 so simple, that I can't beleive I'd missed it before. Needs more
433 testing, though.
438 testing, though.
434 (KBINT): Never mind, revert changes. I'm sure I'd tried something
439 (KBINT): Never mind, revert changes. I'm sure I'd tried something
435 like this before...
440 like this before...
436
441
437 * IPython/genutils.py (get_home_dir): add protection against
442 * IPython/genutils.py (get_home_dir): add protection against
438 non-dirs in win32 registry.
443 non-dirs in win32 registry.
439
444
440 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
445 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
441 bug where dict was mutated while iterating (pysh crash).
446 bug where dict was mutated while iterating (pysh crash).
442
447
443 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
448 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
444
449
445 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
450 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
446 spurious newlines added by this routine. After a report by
451 spurious newlines added by this routine. After a report by
447 F. Mantegazza.
452 F. Mantegazza.
448
453
449 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
454 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
450
455
451 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
456 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
452 calls. These were a leftover from the GTK 1.x days, and can cause
457 calls. These were a leftover from the GTK 1.x days, and can cause
453 problems in certain cases (after a report by John Hunter).
458 problems in certain cases (after a report by John Hunter).
454
459
455 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
460 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
456 os.getcwd() fails at init time. Thanks to patch from David Remahl
461 os.getcwd() fails at init time. Thanks to patch from David Remahl
457 <chmod007-AT-mac.com>.
462 <chmod007-AT-mac.com>.
458 (InteractiveShell.__init__): prevent certain special magics from
463 (InteractiveShell.__init__): prevent certain special magics from
459 being shadowed by aliases. Closes
464 being shadowed by aliases. Closes
460 http://www.scipy.net/roundup/ipython/issue41.
465 http://www.scipy.net/roundup/ipython/issue41.
461
466
462 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
467 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
463
468
464 * IPython/iplib.py (InteractiveShell.complete): Added new
469 * IPython/iplib.py (InteractiveShell.complete): Added new
465 top-level completion method to expose the completion mechanism
470 top-level completion method to expose the completion mechanism
466 beyond readline-based environments.
471 beyond readline-based environments.
467
472
468 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
473 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
469
474
470 * tools/ipsvnc (svnversion): fix svnversion capture.
475 * tools/ipsvnc (svnversion): fix svnversion capture.
471
476
472 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
477 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
473 attribute to self, which was missing. Before, it was set by a
478 attribute to self, which was missing. Before, it was set by a
474 routine which in certain cases wasn't being called, so the
479 routine which in certain cases wasn't being called, so the
475 instance could end up missing the attribute. This caused a crash.
480 instance could end up missing the attribute. This caused a crash.
476 Closes http://www.scipy.net/roundup/ipython/issue40.
481 Closes http://www.scipy.net/roundup/ipython/issue40.
477
482
478 2005-08-16 Fernando Perez <fperez@colorado.edu>
483 2005-08-16 Fernando Perez <fperez@colorado.edu>
479
484
480 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
485 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
481 contains non-string attribute. Closes
486 contains non-string attribute. Closes
482 http://www.scipy.net/roundup/ipython/issue38.
487 http://www.scipy.net/roundup/ipython/issue38.
483
488
484 2005-08-14 Fernando Perez <fperez@colorado.edu>
489 2005-08-14 Fernando Perez <fperez@colorado.edu>
485
490
486 * tools/ipsvnc: Minor improvements, to add changeset info.
491 * tools/ipsvnc: Minor improvements, to add changeset info.
487
492
488 2005-08-12 Fernando Perez <fperez@colorado.edu>
493 2005-08-12 Fernando Perez <fperez@colorado.edu>
489
494
490 * IPython/iplib.py (runsource): remove self.code_to_run_src
495 * IPython/iplib.py (runsource): remove self.code_to_run_src
491 attribute. I realized this is nothing more than
496 attribute. I realized this is nothing more than
492 '\n'.join(self.buffer), and having the same data in two different
497 '\n'.join(self.buffer), and having the same data in two different
493 places is just asking for synchronization bugs. This may impact
498 places is just asking for synchronization bugs. This may impact
494 people who have custom exception handlers, so I need to warn
499 people who have custom exception handlers, so I need to warn
495 ipython-dev about it (F. Mantegazza may use them).
500 ipython-dev about it (F. Mantegazza may use them).
496
501
497 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
502 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
498
503
499 * IPython/genutils.py: fix 2.2 compatibility (generators)
504 * IPython/genutils.py: fix 2.2 compatibility (generators)
500
505
501 2005-07-18 Fernando Perez <fperez@colorado.edu>
506 2005-07-18 Fernando Perez <fperez@colorado.edu>
502
507
503 * IPython/genutils.py (get_home_dir): fix to help users with
508 * IPython/genutils.py (get_home_dir): fix to help users with
504 invalid $HOME under win32.
509 invalid $HOME under win32.
505
510
506 2005-07-17 Fernando Perez <fperez@colorado.edu>
511 2005-07-17 Fernando Perez <fperez@colorado.edu>
507
512
508 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
513 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
509 some old hacks and clean up a bit other routines; code should be
514 some old hacks and clean up a bit other routines; code should be
510 simpler and a bit faster.
515 simpler and a bit faster.
511
516
512 * IPython/iplib.py (interact): removed some last-resort attempts
517 * IPython/iplib.py (interact): removed some last-resort attempts
513 to survive broken stdout/stderr. That code was only making it
518 to survive broken stdout/stderr. That code was only making it
514 harder to abstract out the i/o (necessary for gui integration),
519 harder to abstract out the i/o (necessary for gui integration),
515 and the crashes it could prevent were extremely rare in practice
520 and the crashes it could prevent were extremely rare in practice
516 (besides being fully user-induced in a pretty violent manner).
521 (besides being fully user-induced in a pretty violent manner).
517
522
518 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
523 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
519 Nothing major yet, but the code is simpler to read; this should
524 Nothing major yet, but the code is simpler to read; this should
520 make it easier to do more serious modifications in the future.
525 make it easier to do more serious modifications in the future.
521
526
522 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
527 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
523 which broke in .15 (thanks to a report by Ville).
528 which broke in .15 (thanks to a report by Ville).
524
529
525 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
530 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
526 be quite correct, I know next to nothing about unicode). This
531 be quite correct, I know next to nothing about unicode). This
527 will allow unicode strings to be used in prompts, amongst other
532 will allow unicode strings to be used in prompts, amongst other
528 cases. It also will prevent ipython from crashing when unicode
533 cases. It also will prevent ipython from crashing when unicode
529 shows up unexpectedly in many places. If ascii encoding fails, we
534 shows up unexpectedly in many places. If ascii encoding fails, we
530 assume utf_8. Currently the encoding is not a user-visible
535 assume utf_8. Currently the encoding is not a user-visible
531 setting, though it could be made so if there is demand for it.
536 setting, though it could be made so if there is demand for it.
532
537
533 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
538 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
534
539
535 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
540 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
536
541
537 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
542 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
538
543
539 * IPython/genutils.py: Add 2.2 compatibility here, so all other
544 * IPython/genutils.py: Add 2.2 compatibility here, so all other
540 code can work transparently for 2.2/2.3.
545 code can work transparently for 2.2/2.3.
541
546
542 2005-07-16 Fernando Perez <fperez@colorado.edu>
547 2005-07-16 Fernando Perez <fperez@colorado.edu>
543
548
544 * IPython/ultraTB.py (ExceptionColors): Make a global variable
549 * IPython/ultraTB.py (ExceptionColors): Make a global variable
545 out of the color scheme table used for coloring exception
550 out of the color scheme table used for coloring exception
546 tracebacks. This allows user code to add new schemes at runtime.
551 tracebacks. This allows user code to add new schemes at runtime.
547 This is a minimally modified version of the patch at
552 This is a minimally modified version of the patch at
548 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
553 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
549 for the contribution.
554 for the contribution.
550
555
551 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
556 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
552 slightly modified version of the patch in
557 slightly modified version of the patch in
553 http://www.scipy.net/roundup/ipython/issue34, which also allows me
558 http://www.scipy.net/roundup/ipython/issue34, which also allows me
554 to remove the previous try/except solution (which was costlier).
559 to remove the previous try/except solution (which was costlier).
555 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
560 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
556
561
557 2005-06-08 Fernando Perez <fperez@colorado.edu>
562 2005-06-08 Fernando Perez <fperez@colorado.edu>
558
563
559 * IPython/iplib.py (write/write_err): Add methods to abstract all
564 * IPython/iplib.py (write/write_err): Add methods to abstract all
560 I/O a bit more.
565 I/O a bit more.
561
566
562 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
567 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
563 warning, reported by Aric Hagberg, fix by JD Hunter.
568 warning, reported by Aric Hagberg, fix by JD Hunter.
564
569
565 2005-06-02 *** Released version 0.6.15
570 2005-06-02 *** Released version 0.6.15
566
571
567 2005-06-01 Fernando Perez <fperez@colorado.edu>
572 2005-06-01 Fernando Perez <fperez@colorado.edu>
568
573
569 * IPython/iplib.py (MagicCompleter.file_matches): Fix
574 * IPython/iplib.py (MagicCompleter.file_matches): Fix
570 tab-completion of filenames within open-quoted strings. Note that
575 tab-completion of filenames within open-quoted strings. Note that
571 this requires that in ~/.ipython/ipythonrc, users change the
576 this requires that in ~/.ipython/ipythonrc, users change the
572 readline delimiters configuration to read:
577 readline delimiters configuration to read:
573
578
574 readline_remove_delims -/~
579 readline_remove_delims -/~
575
580
576
581
577 2005-05-31 *** Released version 0.6.14
582 2005-05-31 *** Released version 0.6.14
578
583
579 2005-05-29 Fernando Perez <fperez@colorado.edu>
584 2005-05-29 Fernando Perez <fperez@colorado.edu>
580
585
581 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
586 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
582 with files not on the filesystem. Reported by Eliyahu Sandler
587 with files not on the filesystem. Reported by Eliyahu Sandler
583 <eli@gondolin.net>
588 <eli@gondolin.net>
584
589
585 2005-05-22 Fernando Perez <fperez@colorado.edu>
590 2005-05-22 Fernando Perez <fperez@colorado.edu>
586
591
587 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
592 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
588 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
593 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
589
594
590 2005-05-19 Fernando Perez <fperez@colorado.edu>
595 2005-05-19 Fernando Perez <fperez@colorado.edu>
591
596
592 * IPython/iplib.py (safe_execfile): close a file which could be
597 * IPython/iplib.py (safe_execfile): close a file which could be
593 left open (causing problems in win32, which locks open files).
598 left open (causing problems in win32, which locks open files).
594 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
599 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
595
600
596 2005-05-18 Fernando Perez <fperez@colorado.edu>
601 2005-05-18 Fernando Perez <fperez@colorado.edu>
597
602
598 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
603 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
599 keyword arguments correctly to safe_execfile().
604 keyword arguments correctly to safe_execfile().
600
605
601 2005-05-13 Fernando Perez <fperez@colorado.edu>
606 2005-05-13 Fernando Perez <fperez@colorado.edu>
602
607
603 * ipython.1: Added info about Qt to manpage, and threads warning
608 * ipython.1: Added info about Qt to manpage, and threads warning
604 to usage page (invoked with --help).
609 to usage page (invoked with --help).
605
610
606 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
611 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
607 new matcher (it goes at the end of the priority list) to do
612 new matcher (it goes at the end of the priority list) to do
608 tab-completion on named function arguments. Submitted by George
613 tab-completion on named function arguments. Submitted by George
609 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
614 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
610 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
615 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
611 for more details.
616 for more details.
612
617
613 * IPython/Magic.py (magic_run): Added new -e flag to ignore
618 * IPython/Magic.py (magic_run): Added new -e flag to ignore
614 SystemExit exceptions in the script being run. Thanks to a report
619 SystemExit exceptions in the script being run. Thanks to a report
615 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
620 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
616 producing very annoying behavior when running unit tests.
621 producing very annoying behavior when running unit tests.
617
622
618 2005-05-12 Fernando Perez <fperez@colorado.edu>
623 2005-05-12 Fernando Perez <fperez@colorado.edu>
619
624
620 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
625 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
621 which I'd broken (again) due to a changed regexp. In the process,
626 which I'd broken (again) due to a changed regexp. In the process,
622 added ';' as an escape to auto-quote the whole line without
627 added ';' as an escape to auto-quote the whole line without
623 splitting its arguments. Thanks to a report by Jerry McRae
628 splitting its arguments. Thanks to a report by Jerry McRae
624 <qrs0xyc02-AT-sneakemail.com>.
629 <qrs0xyc02-AT-sneakemail.com>.
625
630
626 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
631 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
627 possible crashes caused by a TokenError. Reported by Ed Schofield
632 possible crashes caused by a TokenError. Reported by Ed Schofield
628 <schofield-AT-ftw.at>.
633 <schofield-AT-ftw.at>.
629
634
630 2005-05-06 Fernando Perez <fperez@colorado.edu>
635 2005-05-06 Fernando Perez <fperez@colorado.edu>
631
636
632 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
637 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
633
638
634 2005-04-29 Fernando Perez <fperez@colorado.edu>
639 2005-04-29 Fernando Perez <fperez@colorado.edu>
635
640
636 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
641 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
637 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
642 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
638 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
643 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
639 which provides support for Qt interactive usage (similar to the
644 which provides support for Qt interactive usage (similar to the
640 existing one for WX and GTK). This had been often requested.
645 existing one for WX and GTK). This had been often requested.
641
646
642 2005-04-14 *** Released version 0.6.13
647 2005-04-14 *** Released version 0.6.13
643
648
644 2005-04-08 Fernando Perez <fperez@colorado.edu>
649 2005-04-08 Fernando Perez <fperez@colorado.edu>
645
650
646 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
651 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
647 from _ofind, which gets called on almost every input line. Now,
652 from _ofind, which gets called on almost every input line. Now,
648 we only try to get docstrings if they are actually going to be
653 we only try to get docstrings if they are actually going to be
649 used (the overhead of fetching unnecessary docstrings can be
654 used (the overhead of fetching unnecessary docstrings can be
650 noticeable for certain objects, such as Pyro proxies).
655 noticeable for certain objects, such as Pyro proxies).
651
656
652 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
657 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
653 for completers. For some reason I had been passing them the state
658 for completers. For some reason I had been passing them the state
654 variable, which completers never actually need, and was in
659 variable, which completers never actually need, and was in
655 conflict with the rlcompleter API. Custom completers ONLY need to
660 conflict with the rlcompleter API. Custom completers ONLY need to
656 take the text parameter.
661 take the text parameter.
657
662
658 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
663 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
659 work correctly in pysh. I've also moved all the logic which used
664 work correctly in pysh. I've also moved all the logic which used
660 to be in pysh.py here, which will prevent problems with future
665 to be in pysh.py here, which will prevent problems with future
661 upgrades. However, this time I must warn users to update their
666 upgrades. However, this time I must warn users to update their
662 pysh profile to include the line
667 pysh profile to include the line
663
668
664 import_all IPython.Extensions.InterpreterExec
669 import_all IPython.Extensions.InterpreterExec
665
670
666 because otherwise things won't work for them. They MUST also
671 because otherwise things won't work for them. They MUST also
667 delete pysh.py and the line
672 delete pysh.py and the line
668
673
669 execfile pysh.py
674 execfile pysh.py
670
675
671 from their ipythonrc-pysh.
676 from their ipythonrc-pysh.
672
677
673 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
678 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
674 robust in the face of objects whose dir() returns non-strings
679 robust in the face of objects whose dir() returns non-strings
675 (which it shouldn't, but some broken libs like ITK do). Thanks to
680 (which it shouldn't, but some broken libs like ITK do). Thanks to
676 a patch by John Hunter (implemented differently, though). Also
681 a patch by John Hunter (implemented differently, though). Also
677 minor improvements by using .extend instead of + on lists.
682 minor improvements by using .extend instead of + on lists.
678
683
679 * pysh.py:
684 * pysh.py:
680
685
681 2005-04-06 Fernando Perez <fperez@colorado.edu>
686 2005-04-06 Fernando Perez <fperez@colorado.edu>
682
687
683 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
688 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
684 by default, so that all users benefit from it. Those who don't
689 by default, so that all users benefit from it. Those who don't
685 want it can still turn it off.
690 want it can still turn it off.
686
691
687 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
692 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
688 config file, I'd forgotten about this, so users were getting it
693 config file, I'd forgotten about this, so users were getting it
689 off by default.
694 off by default.
690
695
691 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
696 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
692 consistency. Now magics can be called in multiline statements,
697 consistency. Now magics can be called in multiline statements,
693 and python variables can be expanded in magic calls via $var.
698 and python variables can be expanded in magic calls via $var.
694 This makes the magic system behave just like aliases or !system
699 This makes the magic system behave just like aliases or !system
695 calls.
700 calls.
696
701
697 2005-03-28 Fernando Perez <fperez@colorado.edu>
702 2005-03-28 Fernando Perez <fperez@colorado.edu>
698
703
699 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
704 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
700 expensive string additions for building command. Add support for
705 expensive string additions for building command. Add support for
701 trailing ';' when autocall is used.
706 trailing ';' when autocall is used.
702
707
703 2005-03-26 Fernando Perez <fperez@colorado.edu>
708 2005-03-26 Fernando Perez <fperez@colorado.edu>
704
709
705 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
710 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
706 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
711 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
707 ipython.el robust against prompts with any number of spaces
712 ipython.el robust against prompts with any number of spaces
708 (including 0) after the ':' character.
713 (including 0) after the ':' character.
709
714
710 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
715 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
711 continuation prompt, which misled users to think the line was
716 continuation prompt, which misled users to think the line was
712 already indented. Closes debian Bug#300847, reported to me by
717 already indented. Closes debian Bug#300847, reported to me by
713 Norbert Tretkowski <tretkowski-AT-inittab.de>.
718 Norbert Tretkowski <tretkowski-AT-inittab.de>.
714
719
715 2005-03-23 Fernando Perez <fperez@colorado.edu>
720 2005-03-23 Fernando Perez <fperez@colorado.edu>
716
721
717 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
722 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
718 properly aligned if they have embedded newlines.
723 properly aligned if they have embedded newlines.
719
724
720 * IPython/iplib.py (runlines): Add a public method to expose
725 * IPython/iplib.py (runlines): Add a public method to expose
721 IPython's code execution machinery, so that users can run strings
726 IPython's code execution machinery, so that users can run strings
722 as if they had been typed at the prompt interactively.
727 as if they had been typed at the prompt interactively.
723 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
728 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
724 methods which can call the system shell, but with python variable
729 methods which can call the system shell, but with python variable
725 expansion. The three such methods are: __IPYTHON__.system,
730 expansion. The three such methods are: __IPYTHON__.system,
726 .getoutput and .getoutputerror. These need to be documented in a
731 .getoutput and .getoutputerror. These need to be documented in a
727 'public API' section (to be written) of the manual.
732 'public API' section (to be written) of the manual.
728
733
729 2005-03-20 Fernando Perez <fperez@colorado.edu>
734 2005-03-20 Fernando Perez <fperez@colorado.edu>
730
735
731 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
736 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
732 for custom exception handling. This is quite powerful, and it
737 for custom exception handling. This is quite powerful, and it
733 allows for user-installable exception handlers which can trap
738 allows for user-installable exception handlers which can trap
734 custom exceptions at runtime and treat them separately from
739 custom exceptions at runtime and treat them separately from
735 IPython's default mechanisms. At the request of Frédéric
740 IPython's default mechanisms. At the request of Frédéric
736 Mantegazza <mantegazza-AT-ill.fr>.
741 Mantegazza <mantegazza-AT-ill.fr>.
737 (InteractiveShell.set_custom_completer): public API function to
742 (InteractiveShell.set_custom_completer): public API function to
738 add new completers at runtime.
743 add new completers at runtime.
739
744
740 2005-03-19 Fernando Perez <fperez@colorado.edu>
745 2005-03-19 Fernando Perez <fperez@colorado.edu>
741
746
742 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
747 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
743 allow objects which provide their docstrings via non-standard
748 allow objects which provide their docstrings via non-standard
744 mechanisms (like Pyro proxies) to still be inspected by ipython's
749 mechanisms (like Pyro proxies) to still be inspected by ipython's
745 ? system.
750 ? system.
746
751
747 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
752 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
748 automatic capture system. I tried quite hard to make it work
753 automatic capture system. I tried quite hard to make it work
749 reliably, and simply failed. I tried many combinations with the
754 reliably, and simply failed. I tried many combinations with the
750 subprocess module, but eventually nothing worked in all needed
755 subprocess module, but eventually nothing worked in all needed
751 cases (not blocking stdin for the child, duplicating stdout
756 cases (not blocking stdin for the child, duplicating stdout
752 without blocking, etc). The new %sc/%sx still do capture to these
757 without blocking, etc). The new %sc/%sx still do capture to these
753 magical list/string objects which make shell use much more
758 magical list/string objects which make shell use much more
754 conveninent, so not all is lost.
759 conveninent, so not all is lost.
755
760
756 XXX - FIX MANUAL for the change above!
761 XXX - FIX MANUAL for the change above!
757
762
758 (runsource): I copied code.py's runsource() into ipython to modify
763 (runsource): I copied code.py's runsource() into ipython to modify
759 it a bit. Now the code object and source to be executed are
764 it a bit. Now the code object and source to be executed are
760 stored in ipython. This makes this info accessible to third-party
765 stored in ipython. This makes this info accessible to third-party
761 tools, like custom exception handlers. After a request by Frédéric
766 tools, like custom exception handlers. After a request by Frédéric
762 Mantegazza <mantegazza-AT-ill.fr>.
767 Mantegazza <mantegazza-AT-ill.fr>.
763
768
764 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
769 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
765 history-search via readline (like C-p/C-n). I'd wanted this for a
770 history-search via readline (like C-p/C-n). I'd wanted this for a
766 long time, but only recently found out how to do it. For users
771 long time, but only recently found out how to do it. For users
767 who already have their ipythonrc files made and want this, just
772 who already have their ipythonrc files made and want this, just
768 add:
773 add:
769
774
770 readline_parse_and_bind "\e[A": history-search-backward
775 readline_parse_and_bind "\e[A": history-search-backward
771 readline_parse_and_bind "\e[B": history-search-forward
776 readline_parse_and_bind "\e[B": history-search-forward
772
777
773 2005-03-18 Fernando Perez <fperez@colorado.edu>
778 2005-03-18 Fernando Perez <fperez@colorado.edu>
774
779
775 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
780 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
776 LSString and SList classes which allow transparent conversions
781 LSString and SList classes which allow transparent conversions
777 between list mode and whitespace-separated string.
782 between list mode and whitespace-separated string.
778 (magic_r): Fix recursion problem in %r.
783 (magic_r): Fix recursion problem in %r.
779
784
780 * IPython/genutils.py (LSString): New class to be used for
785 * IPython/genutils.py (LSString): New class to be used for
781 automatic storage of the results of all alias/system calls in _o
786 automatic storage of the results of all alias/system calls in _o
782 and _e (stdout/err). These provide a .l/.list attribute which
787 and _e (stdout/err). These provide a .l/.list attribute which
783 does automatic splitting on newlines. This means that for most
788 does automatic splitting on newlines. This means that for most
784 uses, you'll never need to do capturing of output with %sc/%sx
789 uses, you'll never need to do capturing of output with %sc/%sx
785 anymore, since ipython keeps this always done for you. Note that
790 anymore, since ipython keeps this always done for you. Note that
786 only the LAST results are stored, the _o/e variables are
791 only the LAST results are stored, the _o/e variables are
787 overwritten on each call. If you need to save their contents
792 overwritten on each call. If you need to save their contents
788 further, simply bind them to any other name.
793 further, simply bind them to any other name.
789
794
790 2005-03-17 Fernando Perez <fperez@colorado.edu>
795 2005-03-17 Fernando Perez <fperez@colorado.edu>
791
796
792 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
797 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
793 prompt namespace handling.
798 prompt namespace handling.
794
799
795 2005-03-16 Fernando Perez <fperez@colorado.edu>
800 2005-03-16 Fernando Perez <fperez@colorado.edu>
796
801
797 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
802 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
798 classic prompts to be '>>> ' (final space was missing, and it
803 classic prompts to be '>>> ' (final space was missing, and it
799 trips the emacs python mode).
804 trips the emacs python mode).
800 (BasePrompt.__str__): Added safe support for dynamic prompt
805 (BasePrompt.__str__): Added safe support for dynamic prompt
801 strings. Now you can set your prompt string to be '$x', and the
806 strings. Now you can set your prompt string to be '$x', and the
802 value of x will be printed from your interactive namespace. The
807 value of x will be printed from your interactive namespace. The
803 interpolation syntax includes the full Itpl support, so
808 interpolation syntax includes the full Itpl support, so
804 ${foo()+x+bar()} is a valid prompt string now, and the function
809 ${foo()+x+bar()} is a valid prompt string now, and the function
805 calls will be made at runtime.
810 calls will be made at runtime.
806
811
807 2005-03-15 Fernando Perez <fperez@colorado.edu>
812 2005-03-15 Fernando Perez <fperez@colorado.edu>
808
813
809 * IPython/Magic.py (magic_history): renamed %hist to %history, to
814 * IPython/Magic.py (magic_history): renamed %hist to %history, to
810 avoid name clashes in pylab. %hist still works, it just forwards
815 avoid name clashes in pylab. %hist still works, it just forwards
811 the call to %history.
816 the call to %history.
812
817
813 2005-03-02 *** Released version 0.6.12
818 2005-03-02 *** Released version 0.6.12
814
819
815 2005-03-02 Fernando Perez <fperez@colorado.edu>
820 2005-03-02 Fernando Perez <fperez@colorado.edu>
816
821
817 * IPython/iplib.py (handle_magic): log magic calls properly as
822 * IPython/iplib.py (handle_magic): log magic calls properly as
818 ipmagic() function calls.
823 ipmagic() function calls.
819
824
820 * IPython/Magic.py (magic_time): Improved %time to support
825 * IPython/Magic.py (magic_time): Improved %time to support
821 statements and provide wall-clock as well as CPU time.
826 statements and provide wall-clock as well as CPU time.
822
827
823 2005-02-27 Fernando Perez <fperez@colorado.edu>
828 2005-02-27 Fernando Perez <fperez@colorado.edu>
824
829
825 * IPython/hooks.py: New hooks module, to expose user-modifiable
830 * IPython/hooks.py: New hooks module, to expose user-modifiable
826 IPython functionality in a clean manner. For now only the editor
831 IPython functionality in a clean manner. For now only the editor
827 hook is actually written, and other thigns which I intend to turn
832 hook is actually written, and other thigns which I intend to turn
828 into proper hooks aren't yet there. The display and prefilter
833 into proper hooks aren't yet there. The display and prefilter
829 stuff, for example, should be hooks. But at least now the
834 stuff, for example, should be hooks. But at least now the
830 framework is in place, and the rest can be moved here with more
835 framework is in place, and the rest can be moved here with more
831 time later. IPython had had a .hooks variable for a long time for
836 time later. IPython had had a .hooks variable for a long time for
832 this purpose, but I'd never actually used it for anything.
837 this purpose, but I'd never actually used it for anything.
833
838
834 2005-02-26 Fernando Perez <fperez@colorado.edu>
839 2005-02-26 Fernando Perez <fperez@colorado.edu>
835
840
836 * IPython/ipmaker.py (make_IPython): make the default ipython
841 * IPython/ipmaker.py (make_IPython): make the default ipython
837 directory be called _ipython under win32, to follow more the
842 directory be called _ipython under win32, to follow more the
838 naming peculiarities of that platform (where buggy software like
843 naming peculiarities of that platform (where buggy software like
839 Visual Sourcesafe breaks with .named directories). Reported by
844 Visual Sourcesafe breaks with .named directories). Reported by
840 Ville Vainio.
845 Ville Vainio.
841
846
842 2005-02-23 Fernando Perez <fperez@colorado.edu>
847 2005-02-23 Fernando Perez <fperez@colorado.edu>
843
848
844 * IPython/iplib.py (InteractiveShell.__init__): removed a few
849 * IPython/iplib.py (InteractiveShell.__init__): removed a few
845 auto_aliases for win32 which were causing problems. Users can
850 auto_aliases for win32 which were causing problems. Users can
846 define the ones they personally like.
851 define the ones they personally like.
847
852
848 2005-02-21 Fernando Perez <fperez@colorado.edu>
853 2005-02-21 Fernando Perez <fperez@colorado.edu>
849
854
850 * IPython/Magic.py (magic_time): new magic to time execution of
855 * IPython/Magic.py (magic_time): new magic to time execution of
851 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
856 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
852
857
853 2005-02-19 Fernando Perez <fperez@colorado.edu>
858 2005-02-19 Fernando Perez <fperez@colorado.edu>
854
859
855 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
860 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
856 into keys (for prompts, for example).
861 into keys (for prompts, for example).
857
862
858 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
863 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
859 prompts in case users want them. This introduces a small behavior
864 prompts in case users want them. This introduces a small behavior
860 change: ipython does not automatically add a space to all prompts
865 change: ipython does not automatically add a space to all prompts
861 anymore. To get the old prompts with a space, users should add it
866 anymore. To get the old prompts with a space, users should add it
862 manually to their ipythonrc file, so for example prompt_in1 should
867 manually to their ipythonrc file, so for example prompt_in1 should
863 now read 'In [\#]: ' instead of 'In [\#]:'.
868 now read 'In [\#]: ' instead of 'In [\#]:'.
864 (BasePrompt.__init__): New option prompts_pad_left (only in rc
869 (BasePrompt.__init__): New option prompts_pad_left (only in rc
865 file) to control left-padding of secondary prompts.
870 file) to control left-padding of secondary prompts.
866
871
867 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
872 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
868 the profiler can't be imported. Fix for Debian, which removed
873 the profiler can't be imported. Fix for Debian, which removed
869 profile.py because of License issues. I applied a slightly
874 profile.py because of License issues. I applied a slightly
870 modified version of the original Debian patch at
875 modified version of the original Debian patch at
871 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
876 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
872
877
873 2005-02-17 Fernando Perez <fperez@colorado.edu>
878 2005-02-17 Fernando Perez <fperez@colorado.edu>
874
879
875 * IPython/genutils.py (native_line_ends): Fix bug which would
880 * IPython/genutils.py (native_line_ends): Fix bug which would
876 cause improper line-ends under win32 b/c I was not opening files
881 cause improper line-ends under win32 b/c I was not opening files
877 in binary mode. Bug report and fix thanks to Ville.
882 in binary mode. Bug report and fix thanks to Ville.
878
883
879 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
884 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
880 trying to catch spurious foo[1] autocalls. My fix actually broke
885 trying to catch spurious foo[1] autocalls. My fix actually broke
881 ',/' autoquote/call with explicit escape (bad regexp).
886 ',/' autoquote/call with explicit escape (bad regexp).
882
887
883 2005-02-15 *** Released version 0.6.11
888 2005-02-15 *** Released version 0.6.11
884
889
885 2005-02-14 Fernando Perez <fperez@colorado.edu>
890 2005-02-14 Fernando Perez <fperez@colorado.edu>
886
891
887 * IPython/background_jobs.py: New background job management
892 * IPython/background_jobs.py: New background job management
888 subsystem. This is implemented via a new set of classes, and
893 subsystem. This is implemented via a new set of classes, and
889 IPython now provides a builtin 'jobs' object for background job
894 IPython now provides a builtin 'jobs' object for background job
890 execution. A convenience %bg magic serves as a lightweight
895 execution. A convenience %bg magic serves as a lightweight
891 frontend for starting the more common type of calls. This was
896 frontend for starting the more common type of calls. This was
892 inspired by discussions with B. Granger and the BackgroundCommand
897 inspired by discussions with B. Granger and the BackgroundCommand
893 class described in the book Python Scripting for Computational
898 class described in the book Python Scripting for Computational
894 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
899 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
895 (although ultimately no code from this text was used, as IPython's
900 (although ultimately no code from this text was used, as IPython's
896 system is a separate implementation).
901 system is a separate implementation).
897
902
898 * IPython/iplib.py (MagicCompleter.python_matches): add new option
903 * IPython/iplib.py (MagicCompleter.python_matches): add new option
899 to control the completion of single/double underscore names
904 to control the completion of single/double underscore names
900 separately. As documented in the example ipytonrc file, the
905 separately. As documented in the example ipytonrc file, the
901 readline_omit__names variable can now be set to 2, to omit even
906 readline_omit__names variable can now be set to 2, to omit even
902 single underscore names. Thanks to a patch by Brian Wong
907 single underscore names. Thanks to a patch by Brian Wong
903 <BrianWong-AT-AirgoNetworks.Com>.
908 <BrianWong-AT-AirgoNetworks.Com>.
904 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
909 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
905 be autocalled as foo([1]) if foo were callable. A problem for
910 be autocalled as foo([1]) if foo were callable. A problem for
906 things which are both callable and implement __getitem__.
911 things which are both callable and implement __getitem__.
907 (init_readline): Fix autoindentation for win32. Thanks to a patch
912 (init_readline): Fix autoindentation for win32. Thanks to a patch
908 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
913 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
909
914
910 2005-02-12 Fernando Perez <fperez@colorado.edu>
915 2005-02-12 Fernando Perez <fperez@colorado.edu>
911
916
912 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
917 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
913 which I had written long ago to sort out user error messages which
918 which I had written long ago to sort out user error messages which
914 may occur during startup. This seemed like a good idea initially,
919 may occur during startup. This seemed like a good idea initially,
915 but it has proven a disaster in retrospect. I don't want to
920 but it has proven a disaster in retrospect. I don't want to
916 change much code for now, so my fix is to set the internal 'debug'
921 change much code for now, so my fix is to set the internal 'debug'
917 flag to true everywhere, whose only job was precisely to control
922 flag to true everywhere, whose only job was precisely to control
918 this subsystem. This closes issue 28 (as well as avoiding all
923 this subsystem. This closes issue 28 (as well as avoiding all
919 sorts of strange hangups which occur from time to time).
924 sorts of strange hangups which occur from time to time).
920
925
921 2005-02-07 Fernando Perez <fperez@colorado.edu>
926 2005-02-07 Fernando Perez <fperez@colorado.edu>
922
927
923 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
928 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
924 previous call produced a syntax error.
929 previous call produced a syntax error.
925
930
926 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
931 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
927 classes without constructor.
932 classes without constructor.
928
933
929 2005-02-06 Fernando Perez <fperez@colorado.edu>
934 2005-02-06 Fernando Perez <fperez@colorado.edu>
930
935
931 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
936 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
932 completions with the results of each matcher, so we return results
937 completions with the results of each matcher, so we return results
933 to the user from all namespaces. This breaks with ipython
938 to the user from all namespaces. This breaks with ipython
934 tradition, but I think it's a nicer behavior. Now you get all
939 tradition, but I think it's a nicer behavior. Now you get all
935 possible completions listed, from all possible namespaces (python,
940 possible completions listed, from all possible namespaces (python,
936 filesystem, magics...) After a request by John Hunter
941 filesystem, magics...) After a request by John Hunter
937 <jdhunter-AT-nitace.bsd.uchicago.edu>.
942 <jdhunter-AT-nitace.bsd.uchicago.edu>.
938
943
939 2005-02-05 Fernando Perez <fperez@colorado.edu>
944 2005-02-05 Fernando Perez <fperez@colorado.edu>
940
945
941 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
946 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
942 the call had quote characters in it (the quotes were stripped).
947 the call had quote characters in it (the quotes were stripped).
943
948
944 2005-01-31 Fernando Perez <fperez@colorado.edu>
949 2005-01-31 Fernando Perez <fperez@colorado.edu>
945
950
946 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
951 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
947 Itpl.itpl() to make the code more robust against psyco
952 Itpl.itpl() to make the code more robust against psyco
948 optimizations.
953 optimizations.
949
954
950 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
955 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
951 of causing an exception. Quicker, cleaner.
956 of causing an exception. Quicker, cleaner.
952
957
953 2005-01-28 Fernando Perez <fperez@colorado.edu>
958 2005-01-28 Fernando Perez <fperez@colorado.edu>
954
959
955 * scripts/ipython_win_post_install.py (install): hardcode
960 * scripts/ipython_win_post_install.py (install): hardcode
956 sys.prefix+'python.exe' as the executable path. It turns out that
961 sys.prefix+'python.exe' as the executable path. It turns out that
957 during the post-installation run, sys.executable resolves to the
962 during the post-installation run, sys.executable resolves to the
958 name of the binary installer! I should report this as a distutils
963 name of the binary installer! I should report this as a distutils
959 bug, I think. I updated the .10 release with this tiny fix, to
964 bug, I think. I updated the .10 release with this tiny fix, to
960 avoid annoying the lists further.
965 avoid annoying the lists further.
961
966
962 2005-01-27 *** Released version 0.6.10
967 2005-01-27 *** Released version 0.6.10
963
968
964 2005-01-27 Fernando Perez <fperez@colorado.edu>
969 2005-01-27 Fernando Perez <fperez@colorado.edu>
965
970
966 * IPython/numutils.py (norm): Added 'inf' as optional name for
971 * IPython/numutils.py (norm): Added 'inf' as optional name for
967 L-infinity norm, included references to mathworld.com for vector
972 L-infinity norm, included references to mathworld.com for vector
968 norm definitions.
973 norm definitions.
969 (amin/amax): added amin/amax for array min/max. Similar to what
974 (amin/amax): added amin/amax for array min/max. Similar to what
970 pylab ships with after the recent reorganization of names.
975 pylab ships with after the recent reorganization of names.
971 (spike/spike_odd): removed deprecated spike/spike_odd functions.
976 (spike/spike_odd): removed deprecated spike/spike_odd functions.
972
977
973 * ipython.el: committed Alex's recent fixes and improvements.
978 * ipython.el: committed Alex's recent fixes and improvements.
974 Tested with python-mode from CVS, and it looks excellent. Since
979 Tested with python-mode from CVS, and it looks excellent. Since
975 python-mode hasn't released anything in a while, I'm temporarily
980 python-mode hasn't released anything in a while, I'm temporarily
976 putting a copy of today's CVS (v 4.70) of python-mode in:
981 putting a copy of today's CVS (v 4.70) of python-mode in:
977 http://ipython.scipy.org/tmp/python-mode.el
982 http://ipython.scipy.org/tmp/python-mode.el
978
983
979 * scripts/ipython_win_post_install.py (install): Win32 fix to use
984 * scripts/ipython_win_post_install.py (install): Win32 fix to use
980 sys.executable for the executable name, instead of assuming it's
985 sys.executable for the executable name, instead of assuming it's
981 called 'python.exe' (the post-installer would have produced broken
986 called 'python.exe' (the post-installer would have produced broken
982 setups on systems with a differently named python binary).
987 setups on systems with a differently named python binary).
983
988
984 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
989 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
985 references to os.linesep, to make the code more
990 references to os.linesep, to make the code more
986 platform-independent. This is also part of the win32 coloring
991 platform-independent. This is also part of the win32 coloring
987 fixes.
992 fixes.
988
993
989 * IPython/genutils.py (page_dumb): Remove attempts to chop long
994 * IPython/genutils.py (page_dumb): Remove attempts to chop long
990 lines, which actually cause coloring bugs because the length of
995 lines, which actually cause coloring bugs because the length of
991 the line is very difficult to correctly compute with embedded
996 the line is very difficult to correctly compute with embedded
992 escapes. This was the source of all the coloring problems under
997 escapes. This was the source of all the coloring problems under
993 Win32. I think that _finally_, Win32 users have a properly
998 Win32. I think that _finally_, Win32 users have a properly
994 working ipython in all respects. This would never have happened
999 working ipython in all respects. This would never have happened
995 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1000 if not for Gary Bishop and Viktor Ransmayr's great help and work.
996
1001
997 2005-01-26 *** Released version 0.6.9
1002 2005-01-26 *** Released version 0.6.9
998
1003
999 2005-01-25 Fernando Perez <fperez@colorado.edu>
1004 2005-01-25 Fernando Perez <fperez@colorado.edu>
1000
1005
1001 * setup.py: finally, we have a true Windows installer, thanks to
1006 * setup.py: finally, we have a true Windows installer, thanks to
1002 the excellent work of Viktor Ransmayr
1007 the excellent work of Viktor Ransmayr
1003 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1008 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1004 Windows users. The setup routine is quite a bit cleaner thanks to
1009 Windows users. The setup routine is quite a bit cleaner thanks to
1005 this, and the post-install script uses the proper functions to
1010 this, and the post-install script uses the proper functions to
1006 allow a clean de-installation using the standard Windows Control
1011 allow a clean de-installation using the standard Windows Control
1007 Panel.
1012 Panel.
1008
1013
1009 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1014 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1010 environment variable under all OSes (including win32) if
1015 environment variable under all OSes (including win32) if
1011 available. This will give consistency to win32 users who have set
1016 available. This will give consistency to win32 users who have set
1012 this variable for any reason. If os.environ['HOME'] fails, the
1017 this variable for any reason. If os.environ['HOME'] fails, the
1013 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1018 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1014
1019
1015 2005-01-24 Fernando Perez <fperez@colorado.edu>
1020 2005-01-24 Fernando Perez <fperez@colorado.edu>
1016
1021
1017 * IPython/numutils.py (empty_like): add empty_like(), similar to
1022 * IPython/numutils.py (empty_like): add empty_like(), similar to
1018 zeros_like() but taking advantage of the new empty() Numeric routine.
1023 zeros_like() but taking advantage of the new empty() Numeric routine.
1019
1024
1020 2005-01-23 *** Released version 0.6.8
1025 2005-01-23 *** Released version 0.6.8
1021
1026
1022 2005-01-22 Fernando Perez <fperez@colorado.edu>
1027 2005-01-22 Fernando Perez <fperez@colorado.edu>
1023
1028
1024 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1029 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1025 automatic show() calls. After discussing things with JDH, it
1030 automatic show() calls. After discussing things with JDH, it
1026 turns out there are too many corner cases where this can go wrong.
1031 turns out there are too many corner cases where this can go wrong.
1027 It's best not to try to be 'too smart', and simply have ipython
1032 It's best not to try to be 'too smart', and simply have ipython
1028 reproduce as much as possible the default behavior of a normal
1033 reproduce as much as possible the default behavior of a normal
1029 python shell.
1034 python shell.
1030
1035
1031 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1036 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1032 line-splitting regexp and _prefilter() to avoid calling getattr()
1037 line-splitting regexp and _prefilter() to avoid calling getattr()
1033 on assignments. This closes
1038 on assignments. This closes
1034 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1039 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1035 readline uses getattr(), so a simple <TAB> keypress is still
1040 readline uses getattr(), so a simple <TAB> keypress is still
1036 enough to trigger getattr() calls on an object.
1041 enough to trigger getattr() calls on an object.
1037
1042
1038 2005-01-21 Fernando Perez <fperez@colorado.edu>
1043 2005-01-21 Fernando Perez <fperez@colorado.edu>
1039
1044
1040 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1045 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1041 docstring under pylab so it doesn't mask the original.
1046 docstring under pylab so it doesn't mask the original.
1042
1047
1043 2005-01-21 *** Released version 0.6.7
1048 2005-01-21 *** Released version 0.6.7
1044
1049
1045 2005-01-21 Fernando Perez <fperez@colorado.edu>
1050 2005-01-21 Fernando Perez <fperez@colorado.edu>
1046
1051
1047 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
1052 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
1048 signal handling for win32 users in multithreaded mode.
1053 signal handling for win32 users in multithreaded mode.
1049
1054
1050 2005-01-17 Fernando Perez <fperez@colorado.edu>
1055 2005-01-17 Fernando Perez <fperez@colorado.edu>
1051
1056
1052 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1057 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1053 instances with no __init__. After a crash report by Norbert Nemec
1058 instances with no __init__. After a crash report by Norbert Nemec
1054 <Norbert-AT-nemec-online.de>.
1059 <Norbert-AT-nemec-online.de>.
1055
1060
1056 2005-01-14 Fernando Perez <fperez@colorado.edu>
1061 2005-01-14 Fernando Perez <fperez@colorado.edu>
1057
1062
1058 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
1063 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
1059 names for verbose exceptions, when multiple dotted names and the
1064 names for verbose exceptions, when multiple dotted names and the
1060 'parent' object were present on the same line.
1065 'parent' object were present on the same line.
1061
1066
1062 2005-01-11 Fernando Perez <fperez@colorado.edu>
1067 2005-01-11 Fernando Perez <fperez@colorado.edu>
1063
1068
1064 * IPython/genutils.py (flag_calls): new utility to trap and flag
1069 * IPython/genutils.py (flag_calls): new utility to trap and flag
1065 calls in functions. I need it to clean up matplotlib support.
1070 calls in functions. I need it to clean up matplotlib support.
1066 Also removed some deprecated code in genutils.
1071 Also removed some deprecated code in genutils.
1067
1072
1068 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
1073 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
1069 that matplotlib scripts called with %run, which don't call show()
1074 that matplotlib scripts called with %run, which don't call show()
1070 themselves, still have their plotting windows open.
1075 themselves, still have their plotting windows open.
1071
1076
1072 2005-01-05 Fernando Perez <fperez@colorado.edu>
1077 2005-01-05 Fernando Perez <fperez@colorado.edu>
1073
1078
1074 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1079 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1075 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1080 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1076
1081
1077 2004-12-19 Fernando Perez <fperez@colorado.edu>
1082 2004-12-19 Fernando Perez <fperez@colorado.edu>
1078
1083
1079 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1084 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1080 parent_runcode, which was an eyesore. The same result can be
1085 parent_runcode, which was an eyesore. The same result can be
1081 obtained with Python's regular superclass mechanisms.
1086 obtained with Python's regular superclass mechanisms.
1082
1087
1083 2004-12-17 Fernando Perez <fperez@colorado.edu>
1088 2004-12-17 Fernando Perez <fperez@colorado.edu>
1084
1089
1085 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1090 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1086 reported by Prabhu.
1091 reported by Prabhu.
1087 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1092 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1088 sys.stderr) instead of explicitly calling sys.stderr. This helps
1093 sys.stderr) instead of explicitly calling sys.stderr. This helps
1089 maintain our I/O abstractions clean, for future GUI embeddings.
1094 maintain our I/O abstractions clean, for future GUI embeddings.
1090
1095
1091 * IPython/genutils.py (info): added new utility for sys.stderr
1096 * IPython/genutils.py (info): added new utility for sys.stderr
1092 unified info message handling (thin wrapper around warn()).
1097 unified info message handling (thin wrapper around warn()).
1093
1098
1094 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1099 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1095 composite (dotted) names on verbose exceptions.
1100 composite (dotted) names on verbose exceptions.
1096 (VerboseTB.nullrepr): harden against another kind of errors which
1101 (VerboseTB.nullrepr): harden against another kind of errors which
1097 Python's inspect module can trigger, and which were crashing
1102 Python's inspect module can trigger, and which were crashing
1098 IPython. Thanks to a report by Marco Lombardi
1103 IPython. Thanks to a report by Marco Lombardi
1099 <mlombard-AT-ma010192.hq.eso.org>.
1104 <mlombard-AT-ma010192.hq.eso.org>.
1100
1105
1101 2004-12-13 *** Released version 0.6.6
1106 2004-12-13 *** Released version 0.6.6
1102
1107
1103 2004-12-12 Fernando Perez <fperez@colorado.edu>
1108 2004-12-12 Fernando Perez <fperez@colorado.edu>
1104
1109
1105 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1110 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1106 generated by pygtk upon initialization if it was built without
1111 generated by pygtk upon initialization if it was built without
1107 threads (for matplotlib users). After a crash reported by
1112 threads (for matplotlib users). After a crash reported by
1108 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1113 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1109
1114
1110 * IPython/ipmaker.py (make_IPython): fix small bug in the
1115 * IPython/ipmaker.py (make_IPython): fix small bug in the
1111 import_some parameter for multiple imports.
1116 import_some parameter for multiple imports.
1112
1117
1113 * IPython/iplib.py (ipmagic): simplified the interface of
1118 * IPython/iplib.py (ipmagic): simplified the interface of
1114 ipmagic() to take a single string argument, just as it would be
1119 ipmagic() to take a single string argument, just as it would be
1115 typed at the IPython cmd line.
1120 typed at the IPython cmd line.
1116 (ipalias): Added new ipalias() with an interface identical to
1121 (ipalias): Added new ipalias() with an interface identical to
1117 ipmagic(). This completes exposing a pure python interface to the
1122 ipmagic(). This completes exposing a pure python interface to the
1118 alias and magic system, which can be used in loops or more complex
1123 alias and magic system, which can be used in loops or more complex
1119 code where IPython's automatic line mangling is not active.
1124 code where IPython's automatic line mangling is not active.
1120
1125
1121 * IPython/genutils.py (timing): changed interface of timing to
1126 * IPython/genutils.py (timing): changed interface of timing to
1122 simply run code once, which is the most common case. timings()
1127 simply run code once, which is the most common case. timings()
1123 remains unchanged, for the cases where you want multiple runs.
1128 remains unchanged, for the cases where you want multiple runs.
1124
1129
1125 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1130 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1126 bug where Python2.2 crashes with exec'ing code which does not end
1131 bug where Python2.2 crashes with exec'ing code which does not end
1127 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1132 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1128 before.
1133 before.
1129
1134
1130 2004-12-10 Fernando Perez <fperez@colorado.edu>
1135 2004-12-10 Fernando Perez <fperez@colorado.edu>
1131
1136
1132 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1137 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1133 -t to -T, to accomodate the new -t flag in %run (the %run and
1138 -t to -T, to accomodate the new -t flag in %run (the %run and
1134 %prun options are kind of intermixed, and it's not easy to change
1139 %prun options are kind of intermixed, and it's not easy to change
1135 this with the limitations of python's getopt).
1140 this with the limitations of python's getopt).
1136
1141
1137 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1142 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1138 the execution of scripts. It's not as fine-tuned as timeit.py,
1143 the execution of scripts. It's not as fine-tuned as timeit.py,
1139 but it works from inside ipython (and under 2.2, which lacks
1144 but it works from inside ipython (and under 2.2, which lacks
1140 timeit.py). Optionally a number of runs > 1 can be given for
1145 timeit.py). Optionally a number of runs > 1 can be given for
1141 timing very short-running code.
1146 timing very short-running code.
1142
1147
1143 * IPython/genutils.py (uniq_stable): new routine which returns a
1148 * IPython/genutils.py (uniq_stable): new routine which returns a
1144 list of unique elements in any iterable, but in stable order of
1149 list of unique elements in any iterable, but in stable order of
1145 appearance. I needed this for the ultraTB fixes, and it's a handy
1150 appearance. I needed this for the ultraTB fixes, and it's a handy
1146 utility.
1151 utility.
1147
1152
1148 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1153 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1149 dotted names in Verbose exceptions. This had been broken since
1154 dotted names in Verbose exceptions. This had been broken since
1150 the very start, now x.y will properly be printed in a Verbose
1155 the very start, now x.y will properly be printed in a Verbose
1151 traceback, instead of x being shown and y appearing always as an
1156 traceback, instead of x being shown and y appearing always as an
1152 'undefined global'. Getting this to work was a bit tricky,
1157 'undefined global'. Getting this to work was a bit tricky,
1153 because by default python tokenizers are stateless. Saved by
1158 because by default python tokenizers are stateless. Saved by
1154 python's ability to easily add a bit of state to an arbitrary
1159 python's ability to easily add a bit of state to an arbitrary
1155 function (without needing to build a full-blown callable object).
1160 function (without needing to build a full-blown callable object).
1156
1161
1157 Also big cleanup of this code, which had horrendous runtime
1162 Also big cleanup of this code, which had horrendous runtime
1158 lookups of zillions of attributes for colorization. Moved all
1163 lookups of zillions of attributes for colorization. Moved all
1159 this code into a few templates, which make it cleaner and quicker.
1164 this code into a few templates, which make it cleaner and quicker.
1160
1165
1161 Printout quality was also improved for Verbose exceptions: one
1166 Printout quality was also improved for Verbose exceptions: one
1162 variable per line, and memory addresses are printed (this can be
1167 variable per line, and memory addresses are printed (this can be
1163 quite handy in nasty debugging situations, which is what Verbose
1168 quite handy in nasty debugging situations, which is what Verbose
1164 is for).
1169 is for).
1165
1170
1166 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1171 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1167 the command line as scripts to be loaded by embedded instances.
1172 the command line as scripts to be loaded by embedded instances.
1168 Doing so has the potential for an infinite recursion if there are
1173 Doing so has the potential for an infinite recursion if there are
1169 exceptions thrown in the process. This fixes a strange crash
1174 exceptions thrown in the process. This fixes a strange crash
1170 reported by Philippe MULLER <muller-AT-irit.fr>.
1175 reported by Philippe MULLER <muller-AT-irit.fr>.
1171
1176
1172 2004-12-09 Fernando Perez <fperez@colorado.edu>
1177 2004-12-09 Fernando Perez <fperez@colorado.edu>
1173
1178
1174 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1179 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1175 to reflect new names in matplotlib, which now expose the
1180 to reflect new names in matplotlib, which now expose the
1176 matlab-compatible interface via a pylab module instead of the
1181 matlab-compatible interface via a pylab module instead of the
1177 'matlab' name. The new code is backwards compatible, so users of
1182 'matlab' name. The new code is backwards compatible, so users of
1178 all matplotlib versions are OK. Patch by J. Hunter.
1183 all matplotlib versions are OK. Patch by J. Hunter.
1179
1184
1180 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1185 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1181 of __init__ docstrings for instances (class docstrings are already
1186 of __init__ docstrings for instances (class docstrings are already
1182 automatically printed). Instances with customized docstrings
1187 automatically printed). Instances with customized docstrings
1183 (indep. of the class) are also recognized and all 3 separate
1188 (indep. of the class) are also recognized and all 3 separate
1184 docstrings are printed (instance, class, constructor). After some
1189 docstrings are printed (instance, class, constructor). After some
1185 comments/suggestions by J. Hunter.
1190 comments/suggestions by J. Hunter.
1186
1191
1187 2004-12-05 Fernando Perez <fperez@colorado.edu>
1192 2004-12-05 Fernando Perez <fperez@colorado.edu>
1188
1193
1189 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1194 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1190 warnings when tab-completion fails and triggers an exception.
1195 warnings when tab-completion fails and triggers an exception.
1191
1196
1192 2004-12-03 Fernando Perez <fperez@colorado.edu>
1197 2004-12-03 Fernando Perez <fperez@colorado.edu>
1193
1198
1194 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1199 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1195 be triggered when using 'run -p'. An incorrect option flag was
1200 be triggered when using 'run -p'. An incorrect option flag was
1196 being set ('d' instead of 'D').
1201 being set ('d' instead of 'D').
1197 (manpage): fix missing escaped \- sign.
1202 (manpage): fix missing escaped \- sign.
1198
1203
1199 2004-11-30 *** Released version 0.6.5
1204 2004-11-30 *** Released version 0.6.5
1200
1205
1201 2004-11-30 Fernando Perez <fperez@colorado.edu>
1206 2004-11-30 Fernando Perez <fperez@colorado.edu>
1202
1207
1203 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1208 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1204 setting with -d option.
1209 setting with -d option.
1205
1210
1206 * setup.py (docfiles): Fix problem where the doc glob I was using
1211 * setup.py (docfiles): Fix problem where the doc glob I was using
1207 was COMPLETELY BROKEN. It was giving the right files by pure
1212 was COMPLETELY BROKEN. It was giving the right files by pure
1208 accident, but failed once I tried to include ipython.el. Note:
1213 accident, but failed once I tried to include ipython.el. Note:
1209 glob() does NOT allow you to do exclusion on multiple endings!
1214 glob() does NOT allow you to do exclusion on multiple endings!
1210
1215
1211 2004-11-29 Fernando Perez <fperez@colorado.edu>
1216 2004-11-29 Fernando Perez <fperez@colorado.edu>
1212
1217
1213 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1218 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1214 the manpage as the source. Better formatting & consistency.
1219 the manpage as the source. Better formatting & consistency.
1215
1220
1216 * IPython/Magic.py (magic_run): Added new -d option, to run
1221 * IPython/Magic.py (magic_run): Added new -d option, to run
1217 scripts under the control of the python pdb debugger. Note that
1222 scripts under the control of the python pdb debugger. Note that
1218 this required changing the %prun option -d to -D, to avoid a clash
1223 this required changing the %prun option -d to -D, to avoid a clash
1219 (since %run must pass options to %prun, and getopt is too dumb to
1224 (since %run must pass options to %prun, and getopt is too dumb to
1220 handle options with string values with embedded spaces). Thanks
1225 handle options with string values with embedded spaces). Thanks
1221 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1226 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1222 (magic_who_ls): added type matching to %who and %whos, so that one
1227 (magic_who_ls): added type matching to %who and %whos, so that one
1223 can filter their output to only include variables of certain
1228 can filter their output to only include variables of certain
1224 types. Another suggestion by Matthew.
1229 types. Another suggestion by Matthew.
1225 (magic_whos): Added memory summaries in kb and Mb for arrays.
1230 (magic_whos): Added memory summaries in kb and Mb for arrays.
1226 (magic_who): Improve formatting (break lines every 9 vars).
1231 (magic_who): Improve formatting (break lines every 9 vars).
1227
1232
1228 2004-11-28 Fernando Perez <fperez@colorado.edu>
1233 2004-11-28 Fernando Perez <fperez@colorado.edu>
1229
1234
1230 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1235 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1231 cache when empty lines were present.
1236 cache when empty lines were present.
1232
1237
1233 2004-11-24 Fernando Perez <fperez@colorado.edu>
1238 2004-11-24 Fernando Perez <fperez@colorado.edu>
1234
1239
1235 * IPython/usage.py (__doc__): document the re-activated threading
1240 * IPython/usage.py (__doc__): document the re-activated threading
1236 options for WX and GTK.
1241 options for WX and GTK.
1237
1242
1238 2004-11-23 Fernando Perez <fperez@colorado.edu>
1243 2004-11-23 Fernando Perez <fperez@colorado.edu>
1239
1244
1240 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1245 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1241 the -wthread and -gthread options, along with a new -tk one to try
1246 the -wthread and -gthread options, along with a new -tk one to try
1242 and coordinate Tk threading with wx/gtk. The tk support is very
1247 and coordinate Tk threading with wx/gtk. The tk support is very
1243 platform dependent, since it seems to require Tcl and Tk to be
1248 platform dependent, since it seems to require Tcl and Tk to be
1244 built with threads (Fedora1/2 appears NOT to have it, but in
1249 built with threads (Fedora1/2 appears NOT to have it, but in
1245 Prabhu's Debian boxes it works OK). But even with some Tk
1250 Prabhu's Debian boxes it works OK). But even with some Tk
1246 limitations, this is a great improvement.
1251 limitations, this is a great improvement.
1247
1252
1248 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1253 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1249 info in user prompts. Patch by Prabhu.
1254 info in user prompts. Patch by Prabhu.
1250
1255
1251 2004-11-18 Fernando Perez <fperez@colorado.edu>
1256 2004-11-18 Fernando Perez <fperez@colorado.edu>
1252
1257
1253 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1258 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1254 EOFErrors and bail, to avoid infinite loops if a non-terminating
1259 EOFErrors and bail, to avoid infinite loops if a non-terminating
1255 file is fed into ipython. Patch submitted in issue 19 by user,
1260 file is fed into ipython. Patch submitted in issue 19 by user,
1256 many thanks.
1261 many thanks.
1257
1262
1258 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1263 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1259 autoquote/parens in continuation prompts, which can cause lots of
1264 autoquote/parens in continuation prompts, which can cause lots of
1260 problems. Closes roundup issue 20.
1265 problems. Closes roundup issue 20.
1261
1266
1262 2004-11-17 Fernando Perez <fperez@colorado.edu>
1267 2004-11-17 Fernando Perez <fperez@colorado.edu>
1263
1268
1264 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1269 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1265 reported as debian bug #280505. I'm not sure my local changelog
1270 reported as debian bug #280505. I'm not sure my local changelog
1266 entry has the proper debian format (Jack?).
1271 entry has the proper debian format (Jack?).
1267
1272
1268 2004-11-08 *** Released version 0.6.4
1273 2004-11-08 *** Released version 0.6.4
1269
1274
1270 2004-11-08 Fernando Perez <fperez@colorado.edu>
1275 2004-11-08 Fernando Perez <fperez@colorado.edu>
1271
1276
1272 * IPython/iplib.py (init_readline): Fix exit message for Windows
1277 * IPython/iplib.py (init_readline): Fix exit message for Windows
1273 when readline is active. Thanks to a report by Eric Jones
1278 when readline is active. Thanks to a report by Eric Jones
1274 <eric-AT-enthought.com>.
1279 <eric-AT-enthought.com>.
1275
1280
1276 2004-11-07 Fernando Perez <fperez@colorado.edu>
1281 2004-11-07 Fernando Perez <fperez@colorado.edu>
1277
1282
1278 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1283 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1279 sometimes seen by win2k/cygwin users.
1284 sometimes seen by win2k/cygwin users.
1280
1285
1281 2004-11-06 Fernando Perez <fperez@colorado.edu>
1286 2004-11-06 Fernando Perez <fperez@colorado.edu>
1282
1287
1283 * IPython/iplib.py (interact): Change the handling of %Exit from
1288 * IPython/iplib.py (interact): Change the handling of %Exit from
1284 trying to propagate a SystemExit to an internal ipython flag.
1289 trying to propagate a SystemExit to an internal ipython flag.
1285 This is less elegant than using Python's exception mechanism, but
1290 This is less elegant than using Python's exception mechanism, but
1286 I can't get that to work reliably with threads, so under -pylab
1291 I can't get that to work reliably with threads, so under -pylab
1287 %Exit was hanging IPython. Cross-thread exception handling is
1292 %Exit was hanging IPython. Cross-thread exception handling is
1288 really a bitch. Thaks to a bug report by Stephen Walton
1293 really a bitch. Thaks to a bug report by Stephen Walton
1289 <stephen.walton-AT-csun.edu>.
1294 <stephen.walton-AT-csun.edu>.
1290
1295
1291 2004-11-04 Fernando Perez <fperez@colorado.edu>
1296 2004-11-04 Fernando Perez <fperez@colorado.edu>
1292
1297
1293 * IPython/iplib.py (raw_input_original): store a pointer to the
1298 * IPython/iplib.py (raw_input_original): store a pointer to the
1294 true raw_input to harden against code which can modify it
1299 true raw_input to harden against code which can modify it
1295 (wx.py.PyShell does this and would otherwise crash ipython).
1300 (wx.py.PyShell does this and would otherwise crash ipython).
1296 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1301 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1297
1302
1298 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1303 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1299 Ctrl-C problem, which does not mess up the input line.
1304 Ctrl-C problem, which does not mess up the input line.
1300
1305
1301 2004-11-03 Fernando Perez <fperez@colorado.edu>
1306 2004-11-03 Fernando Perez <fperez@colorado.edu>
1302
1307
1303 * IPython/Release.py: Changed licensing to BSD, in all files.
1308 * IPython/Release.py: Changed licensing to BSD, in all files.
1304 (name): lowercase name for tarball/RPM release.
1309 (name): lowercase name for tarball/RPM release.
1305
1310
1306 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1311 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1307 use throughout ipython.
1312 use throughout ipython.
1308
1313
1309 * IPython/Magic.py (Magic._ofind): Switch to using the new
1314 * IPython/Magic.py (Magic._ofind): Switch to using the new
1310 OInspect.getdoc() function.
1315 OInspect.getdoc() function.
1311
1316
1312 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1317 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1313 of the line currently being canceled via Ctrl-C. It's extremely
1318 of the line currently being canceled via Ctrl-C. It's extremely
1314 ugly, but I don't know how to do it better (the problem is one of
1319 ugly, but I don't know how to do it better (the problem is one of
1315 handling cross-thread exceptions).
1320 handling cross-thread exceptions).
1316
1321
1317 2004-10-28 Fernando Perez <fperez@colorado.edu>
1322 2004-10-28 Fernando Perez <fperez@colorado.edu>
1318
1323
1319 * IPython/Shell.py (signal_handler): add signal handlers to trap
1324 * IPython/Shell.py (signal_handler): add signal handlers to trap
1320 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1325 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1321 report by Francesc Alted.
1326 report by Francesc Alted.
1322
1327
1323 2004-10-21 Fernando Perez <fperez@colorado.edu>
1328 2004-10-21 Fernando Perez <fperez@colorado.edu>
1324
1329
1325 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1330 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1326 to % for pysh syntax extensions.
1331 to % for pysh syntax extensions.
1327
1332
1328 2004-10-09 Fernando Perez <fperez@colorado.edu>
1333 2004-10-09 Fernando Perez <fperez@colorado.edu>
1329
1334
1330 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1335 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1331 arrays to print a more useful summary, without calling str(arr).
1336 arrays to print a more useful summary, without calling str(arr).
1332 This avoids the problem of extremely lengthy computations which
1337 This avoids the problem of extremely lengthy computations which
1333 occur if arr is large, and appear to the user as a system lockup
1338 occur if arr is large, and appear to the user as a system lockup
1334 with 100% cpu activity. After a suggestion by Kristian Sandberg
1339 with 100% cpu activity. After a suggestion by Kristian Sandberg
1335 <Kristian.Sandberg@colorado.edu>.
1340 <Kristian.Sandberg@colorado.edu>.
1336 (Magic.__init__): fix bug in global magic escapes not being
1341 (Magic.__init__): fix bug in global magic escapes not being
1337 correctly set.
1342 correctly set.
1338
1343
1339 2004-10-08 Fernando Perez <fperez@colorado.edu>
1344 2004-10-08 Fernando Perez <fperez@colorado.edu>
1340
1345
1341 * IPython/Magic.py (__license__): change to absolute imports of
1346 * IPython/Magic.py (__license__): change to absolute imports of
1342 ipython's own internal packages, to start adapting to the absolute
1347 ipython's own internal packages, to start adapting to the absolute
1343 import requirement of PEP-328.
1348 import requirement of PEP-328.
1344
1349
1345 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1350 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1346 files, and standardize author/license marks through the Release
1351 files, and standardize author/license marks through the Release
1347 module instead of having per/file stuff (except for files with
1352 module instead of having per/file stuff (except for files with
1348 particular licenses, like the MIT/PSF-licensed codes).
1353 particular licenses, like the MIT/PSF-licensed codes).
1349
1354
1350 * IPython/Debugger.py: remove dead code for python 2.1
1355 * IPython/Debugger.py: remove dead code for python 2.1
1351
1356
1352 2004-10-04 Fernando Perez <fperez@colorado.edu>
1357 2004-10-04 Fernando Perez <fperez@colorado.edu>
1353
1358
1354 * IPython/iplib.py (ipmagic): New function for accessing magics
1359 * IPython/iplib.py (ipmagic): New function for accessing magics
1355 via a normal python function call.
1360 via a normal python function call.
1356
1361
1357 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1362 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1358 from '@' to '%', to accomodate the new @decorator syntax of python
1363 from '@' to '%', to accomodate the new @decorator syntax of python
1359 2.4.
1364 2.4.
1360
1365
1361 2004-09-29 Fernando Perez <fperez@colorado.edu>
1366 2004-09-29 Fernando Perez <fperez@colorado.edu>
1362
1367
1363 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1368 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1364 matplotlib.use to prevent running scripts which try to switch
1369 matplotlib.use to prevent running scripts which try to switch
1365 interactive backends from within ipython. This will just crash
1370 interactive backends from within ipython. This will just crash
1366 the python interpreter, so we can't allow it (but a detailed error
1371 the python interpreter, so we can't allow it (but a detailed error
1367 is given to the user).
1372 is given to the user).
1368
1373
1369 2004-09-28 Fernando Perez <fperez@colorado.edu>
1374 2004-09-28 Fernando Perez <fperez@colorado.edu>
1370
1375
1371 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1376 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1372 matplotlib-related fixes so that using @run with non-matplotlib
1377 matplotlib-related fixes so that using @run with non-matplotlib
1373 scripts doesn't pop up spurious plot windows. This requires
1378 scripts doesn't pop up spurious plot windows. This requires
1374 matplotlib >= 0.63, where I had to make some changes as well.
1379 matplotlib >= 0.63, where I had to make some changes as well.
1375
1380
1376 * IPython/ipmaker.py (make_IPython): update version requirement to
1381 * IPython/ipmaker.py (make_IPython): update version requirement to
1377 python 2.2.
1382 python 2.2.
1378
1383
1379 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1384 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1380 banner arg for embedded customization.
1385 banner arg for embedded customization.
1381
1386
1382 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1387 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1383 explicit uses of __IP as the IPython's instance name. Now things
1388 explicit uses of __IP as the IPython's instance name. Now things
1384 are properly handled via the shell.name value. The actual code
1389 are properly handled via the shell.name value. The actual code
1385 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1390 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1386 is much better than before. I'll clean things completely when the
1391 is much better than before. I'll clean things completely when the
1387 magic stuff gets a real overhaul.
1392 magic stuff gets a real overhaul.
1388
1393
1389 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1394 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1390 minor changes to debian dir.
1395 minor changes to debian dir.
1391
1396
1392 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1397 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1393 pointer to the shell itself in the interactive namespace even when
1398 pointer to the shell itself in the interactive namespace even when
1394 a user-supplied dict is provided. This is needed for embedding
1399 a user-supplied dict is provided. This is needed for embedding
1395 purposes (found by tests with Michel Sanner).
1400 purposes (found by tests with Michel Sanner).
1396
1401
1397 2004-09-27 Fernando Perez <fperez@colorado.edu>
1402 2004-09-27 Fernando Perez <fperez@colorado.edu>
1398
1403
1399 * IPython/UserConfig/ipythonrc: remove []{} from
1404 * IPython/UserConfig/ipythonrc: remove []{} from
1400 readline_remove_delims, so that things like [modname.<TAB> do
1405 readline_remove_delims, so that things like [modname.<TAB> do
1401 proper completion. This disables [].TAB, but that's a less common
1406 proper completion. This disables [].TAB, but that's a less common
1402 case than module names in list comprehensions, for example.
1407 case than module names in list comprehensions, for example.
1403 Thanks to a report by Andrea Riciputi.
1408 Thanks to a report by Andrea Riciputi.
1404
1409
1405 2004-09-09 Fernando Perez <fperez@colorado.edu>
1410 2004-09-09 Fernando Perez <fperez@colorado.edu>
1406
1411
1407 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1412 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1408 blocking problems in win32 and osx. Fix by John.
1413 blocking problems in win32 and osx. Fix by John.
1409
1414
1410 2004-09-08 Fernando Perez <fperez@colorado.edu>
1415 2004-09-08 Fernando Perez <fperez@colorado.edu>
1411
1416
1412 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1417 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1413 for Win32 and OSX. Fix by John Hunter.
1418 for Win32 and OSX. Fix by John Hunter.
1414
1419
1415 2004-08-30 *** Released version 0.6.3
1420 2004-08-30 *** Released version 0.6.3
1416
1421
1417 2004-08-30 Fernando Perez <fperez@colorado.edu>
1422 2004-08-30 Fernando Perez <fperez@colorado.edu>
1418
1423
1419 * setup.py (isfile): Add manpages to list of dependent files to be
1424 * setup.py (isfile): Add manpages to list of dependent files to be
1420 updated.
1425 updated.
1421
1426
1422 2004-08-27 Fernando Perez <fperez@colorado.edu>
1427 2004-08-27 Fernando Perez <fperez@colorado.edu>
1423
1428
1424 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1429 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1425 for now. They don't really work with standalone WX/GTK code
1430 for now. They don't really work with standalone WX/GTK code
1426 (though matplotlib IS working fine with both of those backends).
1431 (though matplotlib IS working fine with both of those backends).
1427 This will neeed much more testing. I disabled most things with
1432 This will neeed much more testing. I disabled most things with
1428 comments, so turning it back on later should be pretty easy.
1433 comments, so turning it back on later should be pretty easy.
1429
1434
1430 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1435 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1431 autocalling of expressions like r'foo', by modifying the line
1436 autocalling of expressions like r'foo', by modifying the line
1432 split regexp. Closes
1437 split regexp. Closes
1433 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1438 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1434 Riley <ipythonbugs-AT-sabi.net>.
1439 Riley <ipythonbugs-AT-sabi.net>.
1435 (InteractiveShell.mainloop): honor --nobanner with banner
1440 (InteractiveShell.mainloop): honor --nobanner with banner
1436 extensions.
1441 extensions.
1437
1442
1438 * IPython/Shell.py: Significant refactoring of all classes, so
1443 * IPython/Shell.py: Significant refactoring of all classes, so
1439 that we can really support ALL matplotlib backends and threading
1444 that we can really support ALL matplotlib backends and threading
1440 models (John spotted a bug with Tk which required this). Now we
1445 models (John spotted a bug with Tk which required this). Now we
1441 should support single-threaded, WX-threads and GTK-threads, both
1446 should support single-threaded, WX-threads and GTK-threads, both
1442 for generic code and for matplotlib.
1447 for generic code and for matplotlib.
1443
1448
1444 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1449 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1445 -pylab, to simplify things for users. Will also remove the pylab
1450 -pylab, to simplify things for users. Will also remove the pylab
1446 profile, since now all of matplotlib configuration is directly
1451 profile, since now all of matplotlib configuration is directly
1447 handled here. This also reduces startup time.
1452 handled here. This also reduces startup time.
1448
1453
1449 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1454 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1450 shell wasn't being correctly called. Also in IPShellWX.
1455 shell wasn't being correctly called. Also in IPShellWX.
1451
1456
1452 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1457 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1453 fine-tune banner.
1458 fine-tune banner.
1454
1459
1455 * IPython/numutils.py (spike): Deprecate these spike functions,
1460 * IPython/numutils.py (spike): Deprecate these spike functions,
1456 delete (long deprecated) gnuplot_exec handler.
1461 delete (long deprecated) gnuplot_exec handler.
1457
1462
1458 2004-08-26 Fernando Perez <fperez@colorado.edu>
1463 2004-08-26 Fernando Perez <fperez@colorado.edu>
1459
1464
1460 * ipython.1: Update for threading options, plus some others which
1465 * ipython.1: Update for threading options, plus some others which
1461 were missing.
1466 were missing.
1462
1467
1463 * IPython/ipmaker.py (__call__): Added -wthread option for
1468 * IPython/ipmaker.py (__call__): Added -wthread option for
1464 wxpython thread handling. Make sure threading options are only
1469 wxpython thread handling. Make sure threading options are only
1465 valid at the command line.
1470 valid at the command line.
1466
1471
1467 * scripts/ipython: moved shell selection into a factory function
1472 * scripts/ipython: moved shell selection into a factory function
1468 in Shell.py, to keep the starter script to a minimum.
1473 in Shell.py, to keep the starter script to a minimum.
1469
1474
1470 2004-08-25 Fernando Perez <fperez@colorado.edu>
1475 2004-08-25 Fernando Perez <fperez@colorado.edu>
1471
1476
1472 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1477 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1473 John. Along with some recent changes he made to matplotlib, the
1478 John. Along with some recent changes he made to matplotlib, the
1474 next versions of both systems should work very well together.
1479 next versions of both systems should work very well together.
1475
1480
1476 2004-08-24 Fernando Perez <fperez@colorado.edu>
1481 2004-08-24 Fernando Perez <fperez@colorado.edu>
1477
1482
1478 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1483 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1479 tried to switch the profiling to using hotshot, but I'm getting
1484 tried to switch the profiling to using hotshot, but I'm getting
1480 strange errors from prof.runctx() there. I may be misreading the
1485 strange errors from prof.runctx() there. I may be misreading the
1481 docs, but it looks weird. For now the profiling code will
1486 docs, but it looks weird. For now the profiling code will
1482 continue to use the standard profiler.
1487 continue to use the standard profiler.
1483
1488
1484 2004-08-23 Fernando Perez <fperez@colorado.edu>
1489 2004-08-23 Fernando Perez <fperez@colorado.edu>
1485
1490
1486 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1491 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1487 threaded shell, by John Hunter. It's not quite ready yet, but
1492 threaded shell, by John Hunter. It's not quite ready yet, but
1488 close.
1493 close.
1489
1494
1490 2004-08-22 Fernando Perez <fperez@colorado.edu>
1495 2004-08-22 Fernando Perez <fperez@colorado.edu>
1491
1496
1492 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1497 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1493 in Magic and ultraTB.
1498 in Magic and ultraTB.
1494
1499
1495 * ipython.1: document threading options in manpage.
1500 * ipython.1: document threading options in manpage.
1496
1501
1497 * scripts/ipython: Changed name of -thread option to -gthread,
1502 * scripts/ipython: Changed name of -thread option to -gthread,
1498 since this is GTK specific. I want to leave the door open for a
1503 since this is GTK specific. I want to leave the door open for a
1499 -wthread option for WX, which will most likely be necessary. This
1504 -wthread option for WX, which will most likely be necessary. This
1500 change affects usage and ipmaker as well.
1505 change affects usage and ipmaker as well.
1501
1506
1502 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1507 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1503 handle the matplotlib shell issues. Code by John Hunter
1508 handle the matplotlib shell issues. Code by John Hunter
1504 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1509 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1505 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1510 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1506 broken (and disabled for end users) for now, but it puts the
1511 broken (and disabled for end users) for now, but it puts the
1507 infrastructure in place.
1512 infrastructure in place.
1508
1513
1509 2004-08-21 Fernando Perez <fperez@colorado.edu>
1514 2004-08-21 Fernando Perez <fperez@colorado.edu>
1510
1515
1511 * ipythonrc-pylab: Add matplotlib support.
1516 * ipythonrc-pylab: Add matplotlib support.
1512
1517
1513 * matplotlib_config.py: new files for matplotlib support, part of
1518 * matplotlib_config.py: new files for matplotlib support, part of
1514 the pylab profile.
1519 the pylab profile.
1515
1520
1516 * IPython/usage.py (__doc__): documented the threading options.
1521 * IPython/usage.py (__doc__): documented the threading options.
1517
1522
1518 2004-08-20 Fernando Perez <fperez@colorado.edu>
1523 2004-08-20 Fernando Perez <fperez@colorado.edu>
1519
1524
1520 * ipython: Modified the main calling routine to handle the -thread
1525 * ipython: Modified the main calling routine to handle the -thread
1521 and -mpthread options. This needs to be done as a top-level hack,
1526 and -mpthread options. This needs to be done as a top-level hack,
1522 because it determines which class to instantiate for IPython
1527 because it determines which class to instantiate for IPython
1523 itself.
1528 itself.
1524
1529
1525 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
1530 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
1526 classes to support multithreaded GTK operation without blocking,
1531 classes to support multithreaded GTK operation without blocking,
1527 and matplotlib with all backends. This is a lot of still very
1532 and matplotlib with all backends. This is a lot of still very
1528 experimental code, and threads are tricky. So it may still have a
1533 experimental code, and threads are tricky. So it may still have a
1529 few rough edges... This code owes a lot to
1534 few rough edges... This code owes a lot to
1530 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
1535 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
1531 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
1536 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
1532 to John Hunter for all the matplotlib work.
1537 to John Hunter for all the matplotlib work.
1533
1538
1534 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
1539 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
1535 options for gtk thread and matplotlib support.
1540 options for gtk thread and matplotlib support.
1536
1541
1537 2004-08-16 Fernando Perez <fperez@colorado.edu>
1542 2004-08-16 Fernando Perez <fperez@colorado.edu>
1538
1543
1539 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
1544 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
1540 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
1545 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
1541 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
1546 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
1542
1547
1543 2004-08-11 Fernando Perez <fperez@colorado.edu>
1548 2004-08-11 Fernando Perez <fperez@colorado.edu>
1544
1549
1545 * setup.py (isfile): Fix build so documentation gets updated for
1550 * setup.py (isfile): Fix build so documentation gets updated for
1546 rpms (it was only done for .tgz builds).
1551 rpms (it was only done for .tgz builds).
1547
1552
1548 2004-08-10 Fernando Perez <fperez@colorado.edu>
1553 2004-08-10 Fernando Perez <fperez@colorado.edu>
1549
1554
1550 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
1555 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
1551
1556
1552 * iplib.py : Silence syntax error exceptions in tab-completion.
1557 * iplib.py : Silence syntax error exceptions in tab-completion.
1553
1558
1554 2004-08-05 Fernando Perez <fperez@colorado.edu>
1559 2004-08-05 Fernando Perez <fperez@colorado.edu>
1555
1560
1556 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
1561 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
1557 'color off' mark for continuation prompts. This was causing long
1562 'color off' mark for continuation prompts. This was causing long
1558 continuation lines to mis-wrap.
1563 continuation lines to mis-wrap.
1559
1564
1560 2004-08-01 Fernando Perez <fperez@colorado.edu>
1565 2004-08-01 Fernando Perez <fperez@colorado.edu>
1561
1566
1562 * IPython/ipmaker.py (make_IPython): Allow the shell class used
1567 * IPython/ipmaker.py (make_IPython): Allow the shell class used
1563 for building ipython to be a parameter. All this is necessary
1568 for building ipython to be a parameter. All this is necessary
1564 right now to have a multithreaded version, but this insane
1569 right now to have a multithreaded version, but this insane
1565 non-design will be cleaned up soon. For now, it's a hack that
1570 non-design will be cleaned up soon. For now, it's a hack that
1566 works.
1571 works.
1567
1572
1568 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
1573 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
1569 args in various places. No bugs so far, but it's a dangerous
1574 args in various places. No bugs so far, but it's a dangerous
1570 practice.
1575 practice.
1571
1576
1572 2004-07-31 Fernando Perez <fperez@colorado.edu>
1577 2004-07-31 Fernando Perez <fperez@colorado.edu>
1573
1578
1574 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
1579 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
1575 fix completion of files with dots in their names under most
1580 fix completion of files with dots in their names under most
1576 profiles (pysh was OK because the completion order is different).
1581 profiles (pysh was OK because the completion order is different).
1577
1582
1578 2004-07-27 Fernando Perez <fperez@colorado.edu>
1583 2004-07-27 Fernando Perez <fperez@colorado.edu>
1579
1584
1580 * IPython/iplib.py (InteractiveShell.__init__): build dict of
1585 * IPython/iplib.py (InteractiveShell.__init__): build dict of
1581 keywords manually, b/c the one in keyword.py was removed in python
1586 keywords manually, b/c the one in keyword.py was removed in python
1582 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
1587 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
1583 This is NOT a bug under python 2.3 and earlier.
1588 This is NOT a bug under python 2.3 and earlier.
1584
1589
1585 2004-07-26 Fernando Perez <fperez@colorado.edu>
1590 2004-07-26 Fernando Perez <fperez@colorado.edu>
1586
1591
1587 * IPython/ultraTB.py (VerboseTB.text): Add another
1592 * IPython/ultraTB.py (VerboseTB.text): Add another
1588 linecache.checkcache() call to try to prevent inspect.py from
1593 linecache.checkcache() call to try to prevent inspect.py from
1589 crashing under python 2.3. I think this fixes
1594 crashing under python 2.3. I think this fixes
1590 http://www.scipy.net/roundup/ipython/issue17.
1595 http://www.scipy.net/roundup/ipython/issue17.
1591
1596
1592 2004-07-26 *** Released version 0.6.2
1597 2004-07-26 *** Released version 0.6.2
1593
1598
1594 2004-07-26 Fernando Perez <fperez@colorado.edu>
1599 2004-07-26 Fernando Perez <fperez@colorado.edu>
1595
1600
1596 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
1601 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
1597 fail for any number.
1602 fail for any number.
1598 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
1603 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
1599 empty bookmarks.
1604 empty bookmarks.
1600
1605
1601 2004-07-26 *** Released version 0.6.1
1606 2004-07-26 *** Released version 0.6.1
1602
1607
1603 2004-07-26 Fernando Perez <fperez@colorado.edu>
1608 2004-07-26 Fernando Perez <fperez@colorado.edu>
1604
1609
1605 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
1610 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
1606
1611
1607 * IPython/iplib.py (protect_filename): Applied Ville's patch for
1612 * IPython/iplib.py (protect_filename): Applied Ville's patch for
1608 escaping '()[]{}' in filenames.
1613 escaping '()[]{}' in filenames.
1609
1614
1610 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
1615 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
1611 Python 2.2 users who lack a proper shlex.split.
1616 Python 2.2 users who lack a proper shlex.split.
1612
1617
1613 2004-07-19 Fernando Perez <fperez@colorado.edu>
1618 2004-07-19 Fernando Perez <fperez@colorado.edu>
1614
1619
1615 * IPython/iplib.py (InteractiveShell.init_readline): Add support
1620 * IPython/iplib.py (InteractiveShell.init_readline): Add support
1616 for reading readline's init file. I follow the normal chain:
1621 for reading readline's init file. I follow the normal chain:
1617 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
1622 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
1618 report by Mike Heeter. This closes
1623 report by Mike Heeter. This closes
1619 http://www.scipy.net/roundup/ipython/issue16.
1624 http://www.scipy.net/roundup/ipython/issue16.
1620
1625
1621 2004-07-18 Fernando Perez <fperez@colorado.edu>
1626 2004-07-18 Fernando Perez <fperez@colorado.edu>
1622
1627
1623 * IPython/iplib.py (__init__): Add better handling of '\' under
1628 * IPython/iplib.py (__init__): Add better handling of '\' under
1624 Win32 for filenames. After a patch by Ville.
1629 Win32 for filenames. After a patch by Ville.
1625
1630
1626 2004-07-17 Fernando Perez <fperez@colorado.edu>
1631 2004-07-17 Fernando Perez <fperez@colorado.edu>
1627
1632
1628 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
1633 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
1629 autocalling would be triggered for 'foo is bar' if foo is
1634 autocalling would be triggered for 'foo is bar' if foo is
1630 callable. I also cleaned up the autocall detection code to use a
1635 callable. I also cleaned up the autocall detection code to use a
1631 regexp, which is faster. Bug reported by Alexander Schmolck.
1636 regexp, which is faster. Bug reported by Alexander Schmolck.
1632
1637
1633 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
1638 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
1634 '?' in them would confuse the help system. Reported by Alex
1639 '?' in them would confuse the help system. Reported by Alex
1635 Schmolck.
1640 Schmolck.
1636
1641
1637 2004-07-16 Fernando Perez <fperez@colorado.edu>
1642 2004-07-16 Fernando Perez <fperez@colorado.edu>
1638
1643
1639 * IPython/GnuplotInteractive.py (__all__): added plot2.
1644 * IPython/GnuplotInteractive.py (__all__): added plot2.
1640
1645
1641 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
1646 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
1642 plotting dictionaries, lists or tuples of 1d arrays.
1647 plotting dictionaries, lists or tuples of 1d arrays.
1643
1648
1644 * IPython/Magic.py (Magic.magic_hist): small clenaups and
1649 * IPython/Magic.py (Magic.magic_hist): small clenaups and
1645 optimizations.
1650 optimizations.
1646
1651
1647 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
1652 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
1648 the information which was there from Janko's original IPP code:
1653 the information which was there from Janko's original IPP code:
1649
1654
1650 03.05.99 20:53 porto.ifm.uni-kiel.de
1655 03.05.99 20:53 porto.ifm.uni-kiel.de
1651 --Started changelog.
1656 --Started changelog.
1652 --make clear do what it say it does
1657 --make clear do what it say it does
1653 --added pretty output of lines from inputcache
1658 --added pretty output of lines from inputcache
1654 --Made Logger a mixin class, simplifies handling of switches
1659 --Made Logger a mixin class, simplifies handling of switches
1655 --Added own completer class. .string<TAB> expands to last history
1660 --Added own completer class. .string<TAB> expands to last history
1656 line which starts with string. The new expansion is also present
1661 line which starts with string. The new expansion is also present
1657 with Ctrl-r from the readline library. But this shows, who this
1662 with Ctrl-r from the readline library. But this shows, who this
1658 can be done for other cases.
1663 can be done for other cases.
1659 --Added convention that all shell functions should accept a
1664 --Added convention that all shell functions should accept a
1660 parameter_string This opens the door for different behaviour for
1665 parameter_string This opens the door for different behaviour for
1661 each function. @cd is a good example of this.
1666 each function. @cd is a good example of this.
1662
1667
1663 04.05.99 12:12 porto.ifm.uni-kiel.de
1668 04.05.99 12:12 porto.ifm.uni-kiel.de
1664 --added logfile rotation
1669 --added logfile rotation
1665 --added new mainloop method which freezes first the namespace
1670 --added new mainloop method which freezes first the namespace
1666
1671
1667 07.05.99 21:24 porto.ifm.uni-kiel.de
1672 07.05.99 21:24 porto.ifm.uni-kiel.de
1668 --added the docreader classes. Now there is a help system.
1673 --added the docreader classes. Now there is a help system.
1669 -This is only a first try. Currently it's not easy to put new
1674 -This is only a first try. Currently it's not easy to put new
1670 stuff in the indices. But this is the way to go. Info would be
1675 stuff in the indices. But this is the way to go. Info would be
1671 better, but HTML is every where and not everybody has an info
1676 better, but HTML is every where and not everybody has an info
1672 system installed and it's not so easy to change html-docs to info.
1677 system installed and it's not so easy to change html-docs to info.
1673 --added global logfile option
1678 --added global logfile option
1674 --there is now a hook for object inspection method pinfo needs to
1679 --there is now a hook for object inspection method pinfo needs to
1675 be provided for this. Can be reached by two '??'.
1680 be provided for this. Can be reached by two '??'.
1676
1681
1677 08.05.99 20:51 porto.ifm.uni-kiel.de
1682 08.05.99 20:51 porto.ifm.uni-kiel.de
1678 --added a README
1683 --added a README
1679 --bug in rc file. Something has changed so functions in the rc
1684 --bug in rc file. Something has changed so functions in the rc
1680 file need to reference the shell and not self. Not clear if it's a
1685 file need to reference the shell and not self. Not clear if it's a
1681 bug or feature.
1686 bug or feature.
1682 --changed rc file for new behavior
1687 --changed rc file for new behavior
1683
1688
1684 2004-07-15 Fernando Perez <fperez@colorado.edu>
1689 2004-07-15 Fernando Perez <fperez@colorado.edu>
1685
1690
1686 * IPython/Logger.py (Logger.log): fixed recent bug where the input
1691 * IPython/Logger.py (Logger.log): fixed recent bug where the input
1687 cache was falling out of sync in bizarre manners when multi-line
1692 cache was falling out of sync in bizarre manners when multi-line
1688 input was present. Minor optimizations and cleanup.
1693 input was present. Minor optimizations and cleanup.
1689
1694
1690 (Logger): Remove old Changelog info for cleanup. This is the
1695 (Logger): Remove old Changelog info for cleanup. This is the
1691 information which was there from Janko's original code:
1696 information which was there from Janko's original code:
1692
1697
1693 Changes to Logger: - made the default log filename a parameter
1698 Changes to Logger: - made the default log filename a parameter
1694
1699
1695 - put a check for lines beginning with !@? in log(). Needed
1700 - put a check for lines beginning with !@? in log(). Needed
1696 (even if the handlers properly log their lines) for mid-session
1701 (even if the handlers properly log their lines) for mid-session
1697 logging activation to work properly. Without this, lines logged
1702 logging activation to work properly. Without this, lines logged
1698 in mid session, which get read from the cache, would end up
1703 in mid session, which get read from the cache, would end up
1699 'bare' (with !@? in the open) in the log. Now they are caught
1704 'bare' (with !@? in the open) in the log. Now they are caught
1700 and prepended with a #.
1705 and prepended with a #.
1701
1706
1702 * IPython/iplib.py (InteractiveShell.init_readline): added check
1707 * IPython/iplib.py (InteractiveShell.init_readline): added check
1703 in case MagicCompleter fails to be defined, so we don't crash.
1708 in case MagicCompleter fails to be defined, so we don't crash.
1704
1709
1705 2004-07-13 Fernando Perez <fperez@colorado.edu>
1710 2004-07-13 Fernando Perez <fperez@colorado.edu>
1706
1711
1707 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
1712 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
1708 of EPS if the requested filename ends in '.eps'.
1713 of EPS if the requested filename ends in '.eps'.
1709
1714
1710 2004-07-04 Fernando Perez <fperez@colorado.edu>
1715 2004-07-04 Fernando Perez <fperez@colorado.edu>
1711
1716
1712 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
1717 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
1713 escaping of quotes when calling the shell.
1718 escaping of quotes when calling the shell.
1714
1719
1715 2004-07-02 Fernando Perez <fperez@colorado.edu>
1720 2004-07-02 Fernando Perez <fperez@colorado.edu>
1716
1721
1717 * IPython/Prompts.py (CachedOutput.update): Fix problem with
1722 * IPython/Prompts.py (CachedOutput.update): Fix problem with
1718 gettext not working because we were clobbering '_'. Fixes
1723 gettext not working because we were clobbering '_'. Fixes
1719 http://www.scipy.net/roundup/ipython/issue6.
1724 http://www.scipy.net/roundup/ipython/issue6.
1720
1725
1721 2004-07-01 Fernando Perez <fperez@colorado.edu>
1726 2004-07-01 Fernando Perez <fperez@colorado.edu>
1722
1727
1723 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
1728 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
1724 into @cd. Patch by Ville.
1729 into @cd. Patch by Ville.
1725
1730
1726 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1731 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1727 new function to store things after ipmaker runs. Patch by Ville.
1732 new function to store things after ipmaker runs. Patch by Ville.
1728 Eventually this will go away once ipmaker is removed and the class
1733 Eventually this will go away once ipmaker is removed and the class
1729 gets cleaned up, but for now it's ok. Key functionality here is
1734 gets cleaned up, but for now it's ok. Key functionality here is
1730 the addition of the persistent storage mechanism, a dict for
1735 the addition of the persistent storage mechanism, a dict for
1731 keeping data across sessions (for now just bookmarks, but more can
1736 keeping data across sessions (for now just bookmarks, but more can
1732 be implemented later).
1737 be implemented later).
1733
1738
1734 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
1739 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
1735 persistent across sections. Patch by Ville, I modified it
1740 persistent across sections. Patch by Ville, I modified it
1736 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
1741 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
1737 added a '-l' option to list all bookmarks.
1742 added a '-l' option to list all bookmarks.
1738
1743
1739 * IPython/iplib.py (InteractiveShell.atexit_operations): new
1744 * IPython/iplib.py (InteractiveShell.atexit_operations): new
1740 center for cleanup. Registered with atexit.register(). I moved
1745 center for cleanup. Registered with atexit.register(). I moved
1741 here the old exit_cleanup(). After a patch by Ville.
1746 here the old exit_cleanup(). After a patch by Ville.
1742
1747
1743 * IPython/Magic.py (get_py_filename): added '~' to the accepted
1748 * IPython/Magic.py (get_py_filename): added '~' to the accepted
1744 characters in the hacked shlex_split for python 2.2.
1749 characters in the hacked shlex_split for python 2.2.
1745
1750
1746 * IPython/iplib.py (file_matches): more fixes to filenames with
1751 * IPython/iplib.py (file_matches): more fixes to filenames with
1747 whitespace in them. It's not perfect, but limitations in python's
1752 whitespace in them. It's not perfect, but limitations in python's
1748 readline make it impossible to go further.
1753 readline make it impossible to go further.
1749
1754
1750 2004-06-29 Fernando Perez <fperez@colorado.edu>
1755 2004-06-29 Fernando Perez <fperez@colorado.edu>
1751
1756
1752 * IPython/iplib.py (file_matches): escape whitespace correctly in
1757 * IPython/iplib.py (file_matches): escape whitespace correctly in
1753 filename completions. Bug reported by Ville.
1758 filename completions. Bug reported by Ville.
1754
1759
1755 2004-06-28 Fernando Perez <fperez@colorado.edu>
1760 2004-06-28 Fernando Perez <fperez@colorado.edu>
1756
1761
1757 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
1762 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
1758 the history file will be called 'history-PROFNAME' (or just
1763 the history file will be called 'history-PROFNAME' (or just
1759 'history' if no profile is loaded). I was getting annoyed at
1764 'history' if no profile is loaded). I was getting annoyed at
1760 getting my Numerical work history clobbered by pysh sessions.
1765 getting my Numerical work history clobbered by pysh sessions.
1761
1766
1762 * IPython/iplib.py (InteractiveShell.__init__): Internal
1767 * IPython/iplib.py (InteractiveShell.__init__): Internal
1763 getoutputerror() function so that we can honor the system_verbose
1768 getoutputerror() function so that we can honor the system_verbose
1764 flag for _all_ system calls. I also added escaping of #
1769 flag for _all_ system calls. I also added escaping of #
1765 characters here to avoid confusing Itpl.
1770 characters here to avoid confusing Itpl.
1766
1771
1767 * IPython/Magic.py (shlex_split): removed call to shell in
1772 * IPython/Magic.py (shlex_split): removed call to shell in
1768 parse_options and replaced it with shlex.split(). The annoying
1773 parse_options and replaced it with shlex.split(). The annoying
1769 part was that in Python 2.2, shlex.split() doesn't exist, so I had
1774 part was that in Python 2.2, shlex.split() doesn't exist, so I had
1770 to backport it from 2.3, with several frail hacks (the shlex
1775 to backport it from 2.3, with several frail hacks (the shlex
1771 module is rather limited in 2.2). Thanks to a suggestion by Ville
1776 module is rather limited in 2.2). Thanks to a suggestion by Ville
1772 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
1777 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
1773 problem.
1778 problem.
1774
1779
1775 (Magic.magic_system_verbose): new toggle to print the actual
1780 (Magic.magic_system_verbose): new toggle to print the actual
1776 system calls made by ipython. Mainly for debugging purposes.
1781 system calls made by ipython. Mainly for debugging purposes.
1777
1782
1778 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
1783 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
1779 doesn't support persistence. Reported (and fix suggested) by
1784 doesn't support persistence. Reported (and fix suggested) by
1780 Travis Caldwell <travis_caldwell2000@yahoo.com>.
1785 Travis Caldwell <travis_caldwell2000@yahoo.com>.
1781
1786
1782 2004-06-26 Fernando Perez <fperez@colorado.edu>
1787 2004-06-26 Fernando Perez <fperez@colorado.edu>
1783
1788
1784 * IPython/Logger.py (Logger.log): fix to handle correctly empty
1789 * IPython/Logger.py (Logger.log): fix to handle correctly empty
1785 continue prompts.
1790 continue prompts.
1786
1791
1787 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
1792 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
1788 function (basically a big docstring) and a few more things here to
1793 function (basically a big docstring) and a few more things here to
1789 speedup startup. pysh.py is now very lightweight. We want because
1794 speedup startup. pysh.py is now very lightweight. We want because
1790 it gets execfile'd, while InterpreterExec gets imported, so
1795 it gets execfile'd, while InterpreterExec gets imported, so
1791 byte-compilation saves time.
1796 byte-compilation saves time.
1792
1797
1793 2004-06-25 Fernando Perez <fperez@colorado.edu>
1798 2004-06-25 Fernando Perez <fperez@colorado.edu>
1794
1799
1795 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
1800 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
1796 -NUM', which was recently broken.
1801 -NUM', which was recently broken.
1797
1802
1798 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
1803 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
1799 in multi-line input (but not !!, which doesn't make sense there).
1804 in multi-line input (but not !!, which doesn't make sense there).
1800
1805
1801 * IPython/UserConfig/ipythonrc: made autoindent on by default.
1806 * IPython/UserConfig/ipythonrc: made autoindent on by default.
1802 It's just too useful, and people can turn it off in the less
1807 It's just too useful, and people can turn it off in the less
1803 common cases where it's a problem.
1808 common cases where it's a problem.
1804
1809
1805 2004-06-24 Fernando Perez <fperez@colorado.edu>
1810 2004-06-24 Fernando Perez <fperez@colorado.edu>
1806
1811
1807 * IPython/iplib.py (InteractiveShell._prefilter): big change -
1812 * IPython/iplib.py (InteractiveShell._prefilter): big change -
1808 special syntaxes (like alias calling) is now allied in multi-line
1813 special syntaxes (like alias calling) is now allied in multi-line
1809 input. This is still _very_ experimental, but it's necessary for
1814 input. This is still _very_ experimental, but it's necessary for
1810 efficient shell usage combining python looping syntax with system
1815 efficient shell usage combining python looping syntax with system
1811 calls. For now it's restricted to aliases, I don't think it
1816 calls. For now it's restricted to aliases, I don't think it
1812 really even makes sense to have this for magics.
1817 really even makes sense to have this for magics.
1813
1818
1814 2004-06-23 Fernando Perez <fperez@colorado.edu>
1819 2004-06-23 Fernando Perez <fperez@colorado.edu>
1815
1820
1816 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
1821 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
1817 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
1822 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
1818
1823
1819 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
1824 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
1820 extensions under Windows (after code sent by Gary Bishop). The
1825 extensions under Windows (after code sent by Gary Bishop). The
1821 extensions considered 'executable' are stored in IPython's rc
1826 extensions considered 'executable' are stored in IPython's rc
1822 structure as win_exec_ext.
1827 structure as win_exec_ext.
1823
1828
1824 * IPython/genutils.py (shell): new function, like system() but
1829 * IPython/genutils.py (shell): new function, like system() but
1825 without return value. Very useful for interactive shell work.
1830 without return value. Very useful for interactive shell work.
1826
1831
1827 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
1832 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
1828 delete aliases.
1833 delete aliases.
1829
1834
1830 * IPython/iplib.py (InteractiveShell.alias_table_update): make
1835 * IPython/iplib.py (InteractiveShell.alias_table_update): make
1831 sure that the alias table doesn't contain python keywords.
1836 sure that the alias table doesn't contain python keywords.
1832
1837
1833 2004-06-21 Fernando Perez <fperez@colorado.edu>
1838 2004-06-21 Fernando Perez <fperez@colorado.edu>
1834
1839
1835 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
1840 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
1836 non-existent items are found in $PATH. Reported by Thorsten.
1841 non-existent items are found in $PATH. Reported by Thorsten.
1837
1842
1838 2004-06-20 Fernando Perez <fperez@colorado.edu>
1843 2004-06-20 Fernando Perez <fperez@colorado.edu>
1839
1844
1840 * IPython/iplib.py (complete): modified the completer so that the
1845 * IPython/iplib.py (complete): modified the completer so that the
1841 order of priorities can be easily changed at runtime.
1846 order of priorities can be easily changed at runtime.
1842
1847
1843 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
1848 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
1844 Modified to auto-execute all lines beginning with '~', '/' or '.'.
1849 Modified to auto-execute all lines beginning with '~', '/' or '.'.
1845
1850
1846 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
1851 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
1847 expand Python variables prepended with $ in all system calls. The
1852 expand Python variables prepended with $ in all system calls. The
1848 same was done to InteractiveShell.handle_shell_escape. Now all
1853 same was done to InteractiveShell.handle_shell_escape. Now all
1849 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
1854 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
1850 expansion of python variables and expressions according to the
1855 expansion of python variables and expressions according to the
1851 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
1856 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
1852
1857
1853 Though PEP-215 has been rejected, a similar (but simpler) one
1858 Though PEP-215 has been rejected, a similar (but simpler) one
1854 seems like it will go into Python 2.4, PEP-292 -
1859 seems like it will go into Python 2.4, PEP-292 -
1855 http://www.python.org/peps/pep-0292.html.
1860 http://www.python.org/peps/pep-0292.html.
1856
1861
1857 I'll keep the full syntax of PEP-215, since IPython has since the
1862 I'll keep the full syntax of PEP-215, since IPython has since the
1858 start used Ka-Ping Yee's reference implementation discussed there
1863 start used Ka-Ping Yee's reference implementation discussed there
1859 (Itpl), and I actually like the powerful semantics it offers.
1864 (Itpl), and I actually like the powerful semantics it offers.
1860
1865
1861 In order to access normal shell variables, the $ has to be escaped
1866 In order to access normal shell variables, the $ has to be escaped
1862 via an extra $. For example:
1867 via an extra $. For example:
1863
1868
1864 In [7]: PATH='a python variable'
1869 In [7]: PATH='a python variable'
1865
1870
1866 In [8]: !echo $PATH
1871 In [8]: !echo $PATH
1867 a python variable
1872 a python variable
1868
1873
1869 In [9]: !echo $$PATH
1874 In [9]: !echo $$PATH
1870 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
1875 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
1871
1876
1872 (Magic.parse_options): escape $ so the shell doesn't evaluate
1877 (Magic.parse_options): escape $ so the shell doesn't evaluate
1873 things prematurely.
1878 things prematurely.
1874
1879
1875 * IPython/iplib.py (InteractiveShell.call_alias): added the
1880 * IPython/iplib.py (InteractiveShell.call_alias): added the
1876 ability for aliases to expand python variables via $.
1881 ability for aliases to expand python variables via $.
1877
1882
1878 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
1883 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
1879 system, now there's a @rehash/@rehashx pair of magics. These work
1884 system, now there's a @rehash/@rehashx pair of magics. These work
1880 like the csh rehash command, and can be invoked at any time. They
1885 like the csh rehash command, and can be invoked at any time. They
1881 build a table of aliases to everything in the user's $PATH
1886 build a table of aliases to everything in the user's $PATH
1882 (@rehash uses everything, @rehashx is slower but only adds
1887 (@rehash uses everything, @rehashx is slower but only adds
1883 executable files). With this, the pysh.py-based shell profile can
1888 executable files). With this, the pysh.py-based shell profile can
1884 now simply call rehash upon startup, and full access to all
1889 now simply call rehash upon startup, and full access to all
1885 programs in the user's path is obtained.
1890 programs in the user's path is obtained.
1886
1891
1887 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
1892 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
1888 functionality is now fully in place. I removed the old dynamic
1893 functionality is now fully in place. I removed the old dynamic
1889 code generation based approach, in favor of a much lighter one
1894 code generation based approach, in favor of a much lighter one
1890 based on a simple dict. The advantage is that this allows me to
1895 based on a simple dict. The advantage is that this allows me to
1891 now have thousands of aliases with negligible cost (unthinkable
1896 now have thousands of aliases with negligible cost (unthinkable
1892 with the old system).
1897 with the old system).
1893
1898
1894 2004-06-19 Fernando Perez <fperez@colorado.edu>
1899 2004-06-19 Fernando Perez <fperez@colorado.edu>
1895
1900
1896 * IPython/iplib.py (__init__): extended MagicCompleter class to
1901 * IPython/iplib.py (__init__): extended MagicCompleter class to
1897 also complete (last in priority) on user aliases.
1902 also complete (last in priority) on user aliases.
1898
1903
1899 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
1904 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
1900 call to eval.
1905 call to eval.
1901 (ItplNS.__init__): Added a new class which functions like Itpl,
1906 (ItplNS.__init__): Added a new class which functions like Itpl,
1902 but allows configuring the namespace for the evaluation to occur
1907 but allows configuring the namespace for the evaluation to occur
1903 in.
1908 in.
1904
1909
1905 2004-06-18 Fernando Perez <fperez@colorado.edu>
1910 2004-06-18 Fernando Perez <fperez@colorado.edu>
1906
1911
1907 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
1912 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
1908 better message when 'exit' or 'quit' are typed (a common newbie
1913 better message when 'exit' or 'quit' are typed (a common newbie
1909 confusion).
1914 confusion).
1910
1915
1911 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
1916 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
1912 check for Windows users.
1917 check for Windows users.
1913
1918
1914 * IPython/iplib.py (InteractiveShell.user_setup): removed
1919 * IPython/iplib.py (InteractiveShell.user_setup): removed
1915 disabling of colors for Windows. I'll test at runtime and issue a
1920 disabling of colors for Windows. I'll test at runtime and issue a
1916 warning if Gary's readline isn't found, as to nudge users to
1921 warning if Gary's readline isn't found, as to nudge users to
1917 download it.
1922 download it.
1918
1923
1919 2004-06-16 Fernando Perez <fperez@colorado.edu>
1924 2004-06-16 Fernando Perez <fperez@colorado.edu>
1920
1925
1921 * IPython/genutils.py (Stream.__init__): changed to print errors
1926 * IPython/genutils.py (Stream.__init__): changed to print errors
1922 to sys.stderr. I had a circular dependency here. Now it's
1927 to sys.stderr. I had a circular dependency here. Now it's
1923 possible to run ipython as IDLE's shell (consider this pre-alpha,
1928 possible to run ipython as IDLE's shell (consider this pre-alpha,
1924 since true stdout things end up in the starting terminal instead
1929 since true stdout things end up in the starting terminal instead
1925 of IDLE's out).
1930 of IDLE's out).
1926
1931
1927 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
1932 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
1928 users who haven't # updated their prompt_in2 definitions. Remove
1933 users who haven't # updated their prompt_in2 definitions. Remove
1929 eventually.
1934 eventually.
1930 (multiple_replace): added credit to original ASPN recipe.
1935 (multiple_replace): added credit to original ASPN recipe.
1931
1936
1932 2004-06-15 Fernando Perez <fperez@colorado.edu>
1937 2004-06-15 Fernando Perez <fperez@colorado.edu>
1933
1938
1934 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
1939 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
1935 list of auto-defined aliases.
1940 list of auto-defined aliases.
1936
1941
1937 2004-06-13 Fernando Perez <fperez@colorado.edu>
1942 2004-06-13 Fernando Perez <fperez@colorado.edu>
1938
1943
1939 * setup.py (scriptfiles): Don't trigger win_post_install unless an
1944 * setup.py (scriptfiles): Don't trigger win_post_install unless an
1940 install was really requested (so setup.py can be used for other
1945 install was really requested (so setup.py can be used for other
1941 things under Windows).
1946 things under Windows).
1942
1947
1943 2004-06-10 Fernando Perez <fperez@colorado.edu>
1948 2004-06-10 Fernando Perez <fperez@colorado.edu>
1944
1949
1945 * IPython/Logger.py (Logger.create_log): Manually remove any old
1950 * IPython/Logger.py (Logger.create_log): Manually remove any old
1946 backup, since os.remove may fail under Windows. Fixes bug
1951 backup, since os.remove may fail under Windows. Fixes bug
1947 reported by Thorsten.
1952 reported by Thorsten.
1948
1953
1949 2004-06-09 Fernando Perez <fperez@colorado.edu>
1954 2004-06-09 Fernando Perez <fperez@colorado.edu>
1950
1955
1951 * examples/example-embed.py: fixed all references to %n (replaced
1956 * examples/example-embed.py: fixed all references to %n (replaced
1952 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
1957 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
1953 for all examples and the manual as well.
1958 for all examples and the manual as well.
1954
1959
1955 2004-06-08 Fernando Perez <fperez@colorado.edu>
1960 2004-06-08 Fernando Perez <fperez@colorado.edu>
1956
1961
1957 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
1962 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
1958 alignment and color management. All 3 prompt subsystems now
1963 alignment and color management. All 3 prompt subsystems now
1959 inherit from BasePrompt.
1964 inherit from BasePrompt.
1960
1965
1961 * tools/release: updates for windows installer build and tag rpms
1966 * tools/release: updates for windows installer build and tag rpms
1962 with python version (since paths are fixed).
1967 with python version (since paths are fixed).
1963
1968
1964 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
1969 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
1965 which will become eventually obsolete. Also fixed the default
1970 which will become eventually obsolete. Also fixed the default
1966 prompt_in2 to use \D, so at least new users start with the correct
1971 prompt_in2 to use \D, so at least new users start with the correct
1967 defaults.
1972 defaults.
1968 WARNING: Users with existing ipythonrc files will need to apply
1973 WARNING: Users with existing ipythonrc files will need to apply
1969 this fix manually!
1974 this fix manually!
1970
1975
1971 * setup.py: make windows installer (.exe). This is finally the
1976 * setup.py: make windows installer (.exe). This is finally the
1972 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
1977 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
1973 which I hadn't included because it required Python 2.3 (or recent
1978 which I hadn't included because it required Python 2.3 (or recent
1974 distutils).
1979 distutils).
1975
1980
1976 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
1981 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
1977 usage of new '\D' escape.
1982 usage of new '\D' escape.
1978
1983
1979 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
1984 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
1980 lacks os.getuid())
1985 lacks os.getuid())
1981 (CachedOutput.set_colors): Added the ability to turn coloring
1986 (CachedOutput.set_colors): Added the ability to turn coloring
1982 on/off with @colors even for manually defined prompt colors. It
1987 on/off with @colors even for manually defined prompt colors. It
1983 uses a nasty global, but it works safely and via the generic color
1988 uses a nasty global, but it works safely and via the generic color
1984 handling mechanism.
1989 handling mechanism.
1985 (Prompt2.__init__): Introduced new escape '\D' for continuation
1990 (Prompt2.__init__): Introduced new escape '\D' for continuation
1986 prompts. It represents the counter ('\#') as dots.
1991 prompts. It represents the counter ('\#') as dots.
1987 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
1992 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
1988 need to update their ipythonrc files and replace '%n' with '\D' in
1993 need to update their ipythonrc files and replace '%n' with '\D' in
1989 their prompt_in2 settings everywhere. Sorry, but there's
1994 their prompt_in2 settings everywhere. Sorry, but there's
1990 otherwise no clean way to get all prompts to properly align. The
1995 otherwise no clean way to get all prompts to properly align. The
1991 ipythonrc shipped with IPython has been updated.
1996 ipythonrc shipped with IPython has been updated.
1992
1997
1993 2004-06-07 Fernando Perez <fperez@colorado.edu>
1998 2004-06-07 Fernando Perez <fperez@colorado.edu>
1994
1999
1995 * setup.py (isfile): Pass local_icons option to latex2html, so the
2000 * setup.py (isfile): Pass local_icons option to latex2html, so the
1996 resulting HTML file is self-contained. Thanks to
2001 resulting HTML file is self-contained. Thanks to
1997 dryice-AT-liu.com.cn for the tip.
2002 dryice-AT-liu.com.cn for the tip.
1998
2003
1999 * pysh.py: I created a new profile 'shell', which implements a
2004 * pysh.py: I created a new profile 'shell', which implements a
2000 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2005 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2001 system shell, nor will it become one anytime soon. It's mainly
2006 system shell, nor will it become one anytime soon. It's mainly
2002 meant to illustrate the use of the new flexible bash-like prompts.
2007 meant to illustrate the use of the new flexible bash-like prompts.
2003 I guess it could be used by hardy souls for true shell management,
2008 I guess it could be used by hardy souls for true shell management,
2004 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2009 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2005 profile. This uses the InterpreterExec extension provided by
2010 profile. This uses the InterpreterExec extension provided by
2006 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2011 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2007
2012
2008 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2013 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2009 auto-align itself with the length of the previous input prompt
2014 auto-align itself with the length of the previous input prompt
2010 (taking into account the invisible color escapes).
2015 (taking into account the invisible color escapes).
2011 (CachedOutput.__init__): Large restructuring of this class. Now
2016 (CachedOutput.__init__): Large restructuring of this class. Now
2012 all three prompts (primary1, primary2, output) are proper objects,
2017 all three prompts (primary1, primary2, output) are proper objects,
2013 managed by the 'parent' CachedOutput class. The code is still a
2018 managed by the 'parent' CachedOutput class. The code is still a
2014 bit hackish (all prompts share state via a pointer to the cache),
2019 bit hackish (all prompts share state via a pointer to the cache),
2015 but it's overall far cleaner than before.
2020 but it's overall far cleaner than before.
2016
2021
2017 * IPython/genutils.py (getoutputerror): modified to add verbose,
2022 * IPython/genutils.py (getoutputerror): modified to add verbose,
2018 debug and header options. This makes the interface of all getout*
2023 debug and header options. This makes the interface of all getout*
2019 functions uniform.
2024 functions uniform.
2020 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2025 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2021
2026
2022 * IPython/Magic.py (Magic.default_option): added a function to
2027 * IPython/Magic.py (Magic.default_option): added a function to
2023 allow registering default options for any magic command. This
2028 allow registering default options for any magic command. This
2024 makes it easy to have profiles which customize the magics globally
2029 makes it easy to have profiles which customize the magics globally
2025 for a certain use. The values set through this function are
2030 for a certain use. The values set through this function are
2026 picked up by the parse_options() method, which all magics should
2031 picked up by the parse_options() method, which all magics should
2027 use to parse their options.
2032 use to parse their options.
2028
2033
2029 * IPython/genutils.py (warn): modified the warnings framework to
2034 * IPython/genutils.py (warn): modified the warnings framework to
2030 use the Term I/O class. I'm trying to slowly unify all of
2035 use the Term I/O class. I'm trying to slowly unify all of
2031 IPython's I/O operations to pass through Term.
2036 IPython's I/O operations to pass through Term.
2032
2037
2033 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2038 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2034 the secondary prompt to correctly match the length of the primary
2039 the secondary prompt to correctly match the length of the primary
2035 one for any prompt. Now multi-line code will properly line up
2040 one for any prompt. Now multi-line code will properly line up
2036 even for path dependent prompts, such as the new ones available
2041 even for path dependent prompts, such as the new ones available
2037 via the prompt_specials.
2042 via the prompt_specials.
2038
2043
2039 2004-06-06 Fernando Perez <fperez@colorado.edu>
2044 2004-06-06 Fernando Perez <fperez@colorado.edu>
2040
2045
2041 * IPython/Prompts.py (prompt_specials): Added the ability to have
2046 * IPython/Prompts.py (prompt_specials): Added the ability to have
2042 bash-like special sequences in the prompts, which get
2047 bash-like special sequences in the prompts, which get
2043 automatically expanded. Things like hostname, current working
2048 automatically expanded. Things like hostname, current working
2044 directory and username are implemented already, but it's easy to
2049 directory and username are implemented already, but it's easy to
2045 add more in the future. Thanks to a patch by W.J. van der Laan
2050 add more in the future. Thanks to a patch by W.J. van der Laan
2046 <gnufnork-AT-hetdigitalegat.nl>
2051 <gnufnork-AT-hetdigitalegat.nl>
2047 (prompt_specials): Added color support for prompt strings, so
2052 (prompt_specials): Added color support for prompt strings, so
2048 users can define arbitrary color setups for their prompts.
2053 users can define arbitrary color setups for their prompts.
2049
2054
2050 2004-06-05 Fernando Perez <fperez@colorado.edu>
2055 2004-06-05 Fernando Perez <fperez@colorado.edu>
2051
2056
2052 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
2057 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
2053 code to load Gary Bishop's readline and configure it
2058 code to load Gary Bishop's readline and configure it
2054 automatically. Thanks to Gary for help on this.
2059 automatically. Thanks to Gary for help on this.
2055
2060
2056 2004-06-01 Fernando Perez <fperez@colorado.edu>
2061 2004-06-01 Fernando Perez <fperez@colorado.edu>
2057
2062
2058 * IPython/Logger.py (Logger.create_log): fix bug for logging
2063 * IPython/Logger.py (Logger.create_log): fix bug for logging
2059 with no filename (previous fix was incomplete).
2064 with no filename (previous fix was incomplete).
2060
2065
2061 2004-05-25 Fernando Perez <fperez@colorado.edu>
2066 2004-05-25 Fernando Perez <fperez@colorado.edu>
2062
2067
2063 * IPython/Magic.py (Magic.parse_options): fix bug where naked
2068 * IPython/Magic.py (Magic.parse_options): fix bug where naked
2064 parens would get passed to the shell.
2069 parens would get passed to the shell.
2065
2070
2066 2004-05-20 Fernando Perez <fperez@colorado.edu>
2071 2004-05-20 Fernando Perez <fperez@colorado.edu>
2067
2072
2068 * IPython/Magic.py (Magic.magic_prun): changed default profile
2073 * IPython/Magic.py (Magic.magic_prun): changed default profile
2069 sort order to 'time' (the more common profiling need).
2074 sort order to 'time' (the more common profiling need).
2070
2075
2071 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
2076 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
2072 so that source code shown is guaranteed in sync with the file on
2077 so that source code shown is guaranteed in sync with the file on
2073 disk (also changed in psource). Similar fix to the one for
2078 disk (also changed in psource). Similar fix to the one for
2074 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2079 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2075 <yann.ledu-AT-noos.fr>.
2080 <yann.ledu-AT-noos.fr>.
2076
2081
2077 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2082 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2078 with a single option would not be correctly parsed. Closes
2083 with a single option would not be correctly parsed. Closes
2079 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2084 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2080 introduced in 0.6.0 (on 2004-05-06).
2085 introduced in 0.6.0 (on 2004-05-06).
2081
2086
2082 2004-05-13 *** Released version 0.6.0
2087 2004-05-13 *** Released version 0.6.0
2083
2088
2084 2004-05-13 Fernando Perez <fperez@colorado.edu>
2089 2004-05-13 Fernando Perez <fperez@colorado.edu>
2085
2090
2086 * debian/: Added debian/ directory to CVS, so that debian support
2091 * debian/: Added debian/ directory to CVS, so that debian support
2087 is publicly accessible. The debian package is maintained by Jack
2092 is publicly accessible. The debian package is maintained by Jack
2088 Moffit <jack-AT-xiph.org>.
2093 Moffit <jack-AT-xiph.org>.
2089
2094
2090 * Documentation: included the notes about an ipython-based system
2095 * Documentation: included the notes about an ipython-based system
2091 shell (the hypothetical 'pysh') into the new_design.pdf document,
2096 shell (the hypothetical 'pysh') into the new_design.pdf document,
2092 so that these ideas get distributed to users along with the
2097 so that these ideas get distributed to users along with the
2093 official documentation.
2098 official documentation.
2094
2099
2095 2004-05-10 Fernando Perez <fperez@colorado.edu>
2100 2004-05-10 Fernando Perez <fperez@colorado.edu>
2096
2101
2097 * IPython/Logger.py (Logger.create_log): fix recently introduced
2102 * IPython/Logger.py (Logger.create_log): fix recently introduced
2098 bug (misindented line) where logstart would fail when not given an
2103 bug (misindented line) where logstart would fail when not given an
2099 explicit filename.
2104 explicit filename.
2100
2105
2101 2004-05-09 Fernando Perez <fperez@colorado.edu>
2106 2004-05-09 Fernando Perez <fperez@colorado.edu>
2102
2107
2103 * IPython/Magic.py (Magic.parse_options): skip system call when
2108 * IPython/Magic.py (Magic.parse_options): skip system call when
2104 there are no options to look for. Faster, cleaner for the common
2109 there are no options to look for. Faster, cleaner for the common
2105 case.
2110 case.
2106
2111
2107 * Documentation: many updates to the manual: describing Windows
2112 * Documentation: many updates to the manual: describing Windows
2108 support better, Gnuplot updates, credits, misc small stuff. Also
2113 support better, Gnuplot updates, credits, misc small stuff. Also
2109 updated the new_design doc a bit.
2114 updated the new_design doc a bit.
2110
2115
2111 2004-05-06 *** Released version 0.6.0.rc1
2116 2004-05-06 *** Released version 0.6.0.rc1
2112
2117
2113 2004-05-06 Fernando Perez <fperez@colorado.edu>
2118 2004-05-06 Fernando Perez <fperez@colorado.edu>
2114
2119
2115 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2120 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2116 operations to use the vastly more efficient list/''.join() method.
2121 operations to use the vastly more efficient list/''.join() method.
2117 (FormattedTB.text): Fix
2122 (FormattedTB.text): Fix
2118 http://www.scipy.net/roundup/ipython/issue12 - exception source
2123 http://www.scipy.net/roundup/ipython/issue12 - exception source
2119 extract not updated after reload. Thanks to Mike Salib
2124 extract not updated after reload. Thanks to Mike Salib
2120 <msalib-AT-mit.edu> for pinning the source of the problem.
2125 <msalib-AT-mit.edu> for pinning the source of the problem.
2121 Fortunately, the solution works inside ipython and doesn't require
2126 Fortunately, the solution works inside ipython and doesn't require
2122 any changes to python proper.
2127 any changes to python proper.
2123
2128
2124 * IPython/Magic.py (Magic.parse_options): Improved to process the
2129 * IPython/Magic.py (Magic.parse_options): Improved to process the
2125 argument list as a true shell would (by actually using the
2130 argument list as a true shell would (by actually using the
2126 underlying system shell). This way, all @magics automatically get
2131 underlying system shell). This way, all @magics automatically get
2127 shell expansion for variables. Thanks to a comment by Alex
2132 shell expansion for variables. Thanks to a comment by Alex
2128 Schmolck.
2133 Schmolck.
2129
2134
2130 2004-04-04 Fernando Perez <fperez@colorado.edu>
2135 2004-04-04 Fernando Perez <fperez@colorado.edu>
2131
2136
2132 * IPython/iplib.py (InteractiveShell.interact): Added a special
2137 * IPython/iplib.py (InteractiveShell.interact): Added a special
2133 trap for a debugger quit exception, which is basically impossible
2138 trap for a debugger quit exception, which is basically impossible
2134 to handle by normal mechanisms, given what pdb does to the stack.
2139 to handle by normal mechanisms, given what pdb does to the stack.
2135 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2140 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2136
2141
2137 2004-04-03 Fernando Perez <fperez@colorado.edu>
2142 2004-04-03 Fernando Perez <fperez@colorado.edu>
2138
2143
2139 * IPython/genutils.py (Term): Standardized the names of the Term
2144 * IPython/genutils.py (Term): Standardized the names of the Term
2140 class streams to cin/cout/cerr, following C++ naming conventions
2145 class streams to cin/cout/cerr, following C++ naming conventions
2141 (I can't use in/out/err because 'in' is not a valid attribute
2146 (I can't use in/out/err because 'in' is not a valid attribute
2142 name).
2147 name).
2143
2148
2144 * IPython/iplib.py (InteractiveShell.interact): don't increment
2149 * IPython/iplib.py (InteractiveShell.interact): don't increment
2145 the prompt if there's no user input. By Daniel 'Dang' Griffith
2150 the prompt if there's no user input. By Daniel 'Dang' Griffith
2146 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2151 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2147 Francois Pinard.
2152 Francois Pinard.
2148
2153
2149 2004-04-02 Fernando Perez <fperez@colorado.edu>
2154 2004-04-02 Fernando Perez <fperez@colorado.edu>
2150
2155
2151 * IPython/genutils.py (Stream.__init__): Modified to survive at
2156 * IPython/genutils.py (Stream.__init__): Modified to survive at
2152 least importing in contexts where stdin/out/err aren't true file
2157 least importing in contexts where stdin/out/err aren't true file
2153 objects, such as PyCrust (they lack fileno() and mode). However,
2158 objects, such as PyCrust (they lack fileno() and mode). However,
2154 the recovery facilities which rely on these things existing will
2159 the recovery facilities which rely on these things existing will
2155 not work.
2160 not work.
2156
2161
2157 2004-04-01 Fernando Perez <fperez@colorado.edu>
2162 2004-04-01 Fernando Perez <fperez@colorado.edu>
2158
2163
2159 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2164 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2160 use the new getoutputerror() function, so it properly
2165 use the new getoutputerror() function, so it properly
2161 distinguishes stdout/err.
2166 distinguishes stdout/err.
2162
2167
2163 * IPython/genutils.py (getoutputerror): added a function to
2168 * IPython/genutils.py (getoutputerror): added a function to
2164 capture separately the standard output and error of a command.
2169 capture separately the standard output and error of a command.
2165 After a comment from dang on the mailing lists. This code is
2170 After a comment from dang on the mailing lists. This code is
2166 basically a modified version of commands.getstatusoutput(), from
2171 basically a modified version of commands.getstatusoutput(), from
2167 the standard library.
2172 the standard library.
2168
2173
2169 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2174 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2170 '!!' as a special syntax (shorthand) to access @sx.
2175 '!!' as a special syntax (shorthand) to access @sx.
2171
2176
2172 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2177 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2173 command and return its output as a list split on '\n'.
2178 command and return its output as a list split on '\n'.
2174
2179
2175 2004-03-31 Fernando Perez <fperez@colorado.edu>
2180 2004-03-31 Fernando Perez <fperez@colorado.edu>
2176
2181
2177 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2182 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2178 method to dictionaries used as FakeModule instances if they lack
2183 method to dictionaries used as FakeModule instances if they lack
2179 it. At least pydoc in python2.3 breaks for runtime-defined
2184 it. At least pydoc in python2.3 breaks for runtime-defined
2180 functions without this hack. At some point I need to _really_
2185 functions without this hack. At some point I need to _really_
2181 understand what FakeModule is doing, because it's a gross hack.
2186 understand what FakeModule is doing, because it's a gross hack.
2182 But it solves Arnd's problem for now...
2187 But it solves Arnd's problem for now...
2183
2188
2184 2004-02-27 Fernando Perez <fperez@colorado.edu>
2189 2004-02-27 Fernando Perez <fperez@colorado.edu>
2185
2190
2186 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2191 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2187 mode would behave erratically. Also increased the number of
2192 mode would behave erratically. Also increased the number of
2188 possible logs in rotate mod to 999. Thanks to Rod Holland
2193 possible logs in rotate mod to 999. Thanks to Rod Holland
2189 <rhh@StructureLABS.com> for the report and fixes.
2194 <rhh@StructureLABS.com> for the report and fixes.
2190
2195
2191 2004-02-26 Fernando Perez <fperez@colorado.edu>
2196 2004-02-26 Fernando Perez <fperez@colorado.edu>
2192
2197
2193 * IPython/genutils.py (page): Check that the curses module really
2198 * IPython/genutils.py (page): Check that the curses module really
2194 has the initscr attribute before trying to use it. For some
2199 has the initscr attribute before trying to use it. For some
2195 reason, the Solaris curses module is missing this. I think this
2200 reason, the Solaris curses module is missing this. I think this
2196 should be considered a Solaris python bug, but I'm not sure.
2201 should be considered a Solaris python bug, but I'm not sure.
2197
2202
2198 2004-01-17 Fernando Perez <fperez@colorado.edu>
2203 2004-01-17 Fernando Perez <fperez@colorado.edu>
2199
2204
2200 * IPython/genutils.py (Stream.__init__): Changes to try to make
2205 * IPython/genutils.py (Stream.__init__): Changes to try to make
2201 ipython robust against stdin/out/err being closed by the user.
2206 ipython robust against stdin/out/err being closed by the user.
2202 This is 'user error' (and blocks a normal python session, at least
2207 This is 'user error' (and blocks a normal python session, at least
2203 the stdout case). However, Ipython should be able to survive such
2208 the stdout case). However, Ipython should be able to survive such
2204 instances of abuse as gracefully as possible. To simplify the
2209 instances of abuse as gracefully as possible. To simplify the
2205 coding and maintain compatibility with Gary Bishop's Term
2210 coding and maintain compatibility with Gary Bishop's Term
2206 contributions, I've made use of classmethods for this. I think
2211 contributions, I've made use of classmethods for this. I think
2207 this introduces a dependency on python 2.2.
2212 this introduces a dependency on python 2.2.
2208
2213
2209 2004-01-13 Fernando Perez <fperez@colorado.edu>
2214 2004-01-13 Fernando Perez <fperez@colorado.edu>
2210
2215
2211 * IPython/numutils.py (exp_safe): simplified the code a bit and
2216 * IPython/numutils.py (exp_safe): simplified the code a bit and
2212 removed the need for importing the kinds module altogether.
2217 removed the need for importing the kinds module altogether.
2213
2218
2214 2004-01-06 Fernando Perez <fperez@colorado.edu>
2219 2004-01-06 Fernando Perez <fperez@colorado.edu>
2215
2220
2216 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2221 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2217 a magic function instead, after some community feedback. No
2222 a magic function instead, after some community feedback. No
2218 special syntax will exist for it, but its name is deliberately
2223 special syntax will exist for it, but its name is deliberately
2219 very short.
2224 very short.
2220
2225
2221 2003-12-20 Fernando Perez <fperez@colorado.edu>
2226 2003-12-20 Fernando Perez <fperez@colorado.edu>
2222
2227
2223 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2228 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2224 new functionality, to automagically assign the result of a shell
2229 new functionality, to automagically assign the result of a shell
2225 command to a variable. I'll solicit some community feedback on
2230 command to a variable. I'll solicit some community feedback on
2226 this before making it permanent.
2231 this before making it permanent.
2227
2232
2228 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2233 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2229 requested about callables for which inspect couldn't obtain a
2234 requested about callables for which inspect couldn't obtain a
2230 proper argspec. Thanks to a crash report sent by Etienne
2235 proper argspec. Thanks to a crash report sent by Etienne
2231 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2236 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2232
2237
2233 2003-12-09 Fernando Perez <fperez@colorado.edu>
2238 2003-12-09 Fernando Perez <fperez@colorado.edu>
2234
2239
2235 * IPython/genutils.py (page): patch for the pager to work across
2240 * IPython/genutils.py (page): patch for the pager to work across
2236 various versions of Windows. By Gary Bishop.
2241 various versions of Windows. By Gary Bishop.
2237
2242
2238 2003-12-04 Fernando Perez <fperez@colorado.edu>
2243 2003-12-04 Fernando Perez <fperez@colorado.edu>
2239
2244
2240 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2245 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2241 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2246 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2242 While I tested this and it looks ok, there may still be corner
2247 While I tested this and it looks ok, there may still be corner
2243 cases I've missed.
2248 cases I've missed.
2244
2249
2245 2003-12-01 Fernando Perez <fperez@colorado.edu>
2250 2003-12-01 Fernando Perez <fperez@colorado.edu>
2246
2251
2247 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2252 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2248 where a line like 'p,q=1,2' would fail because the automagic
2253 where a line like 'p,q=1,2' would fail because the automagic
2249 system would be triggered for @p.
2254 system would be triggered for @p.
2250
2255
2251 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2256 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2252 cleanups, code unmodified.
2257 cleanups, code unmodified.
2253
2258
2254 * IPython/genutils.py (Term): added a class for IPython to handle
2259 * IPython/genutils.py (Term): added a class for IPython to handle
2255 output. In most cases it will just be a proxy for stdout/err, but
2260 output. In most cases it will just be a proxy for stdout/err, but
2256 having this allows modifications to be made for some platforms,
2261 having this allows modifications to be made for some platforms,
2257 such as handling color escapes under Windows. All of this code
2262 such as handling color escapes under Windows. All of this code
2258 was contributed by Gary Bishop, with minor modifications by me.
2263 was contributed by Gary Bishop, with minor modifications by me.
2259 The actual changes affect many files.
2264 The actual changes affect many files.
2260
2265
2261 2003-11-30 Fernando Perez <fperez@colorado.edu>
2266 2003-11-30 Fernando Perez <fperez@colorado.edu>
2262
2267
2263 * IPython/iplib.py (file_matches): new completion code, courtesy
2268 * IPython/iplib.py (file_matches): new completion code, courtesy
2264 of Jeff Collins. This enables filename completion again under
2269 of Jeff Collins. This enables filename completion again under
2265 python 2.3, which disabled it at the C level.
2270 python 2.3, which disabled it at the C level.
2266
2271
2267 2003-11-11 Fernando Perez <fperez@colorado.edu>
2272 2003-11-11 Fernando Perez <fperez@colorado.edu>
2268
2273
2269 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2274 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2270 for Numeric.array(map(...)), but often convenient.
2275 for Numeric.array(map(...)), but often convenient.
2271
2276
2272 2003-11-05 Fernando Perez <fperez@colorado.edu>
2277 2003-11-05 Fernando Perez <fperez@colorado.edu>
2273
2278
2274 * IPython/numutils.py (frange): Changed a call from int() to
2279 * IPython/numutils.py (frange): Changed a call from int() to
2275 int(round()) to prevent a problem reported with arange() in the
2280 int(round()) to prevent a problem reported with arange() in the
2276 numpy list.
2281 numpy list.
2277
2282
2278 2003-10-06 Fernando Perez <fperez@colorado.edu>
2283 2003-10-06 Fernando Perez <fperez@colorado.edu>
2279
2284
2280 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2285 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2281 prevent crashes if sys lacks an argv attribute (it happens with
2286 prevent crashes if sys lacks an argv attribute (it happens with
2282 embedded interpreters which build a bare-bones sys module).
2287 embedded interpreters which build a bare-bones sys module).
2283 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2288 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2284
2289
2285 2003-09-24 Fernando Perez <fperez@colorado.edu>
2290 2003-09-24 Fernando Perez <fperez@colorado.edu>
2286
2291
2287 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2292 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2288 to protect against poorly written user objects where __getattr__
2293 to protect against poorly written user objects where __getattr__
2289 raises exceptions other than AttributeError. Thanks to a bug
2294 raises exceptions other than AttributeError. Thanks to a bug
2290 report by Oliver Sander <osander-AT-gmx.de>.
2295 report by Oliver Sander <osander-AT-gmx.de>.
2291
2296
2292 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2297 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2293 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2298 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2294
2299
2295 2003-09-09 Fernando Perez <fperez@colorado.edu>
2300 2003-09-09 Fernando Perez <fperez@colorado.edu>
2296
2301
2297 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2302 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2298 unpacking a list whith a callable as first element would
2303 unpacking a list whith a callable as first element would
2299 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2304 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2300 Collins.
2305 Collins.
2301
2306
2302 2003-08-25 *** Released version 0.5.0
2307 2003-08-25 *** Released version 0.5.0
2303
2308
2304 2003-08-22 Fernando Perez <fperez@colorado.edu>
2309 2003-08-22 Fernando Perez <fperez@colorado.edu>
2305
2310
2306 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2311 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2307 improperly defined user exceptions. Thanks to feedback from Mark
2312 improperly defined user exceptions. Thanks to feedback from Mark
2308 Russell <mrussell-AT-verio.net>.
2313 Russell <mrussell-AT-verio.net>.
2309
2314
2310 2003-08-20 Fernando Perez <fperez@colorado.edu>
2315 2003-08-20 Fernando Perez <fperez@colorado.edu>
2311
2316
2312 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2317 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2313 printing so that it would print multi-line string forms starting
2318 printing so that it would print multi-line string forms starting
2314 with a new line. This way the formatting is better respected for
2319 with a new line. This way the formatting is better respected for
2315 objects which work hard to make nice string forms.
2320 objects which work hard to make nice string forms.
2316
2321
2317 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2322 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2318 autocall would overtake data access for objects with both
2323 autocall would overtake data access for objects with both
2319 __getitem__ and __call__.
2324 __getitem__ and __call__.
2320
2325
2321 2003-08-19 *** Released version 0.5.0-rc1
2326 2003-08-19 *** Released version 0.5.0-rc1
2322
2327
2323 2003-08-19 Fernando Perez <fperez@colorado.edu>
2328 2003-08-19 Fernando Perez <fperez@colorado.edu>
2324
2329
2325 * IPython/deep_reload.py (load_tail): single tiny change here
2330 * IPython/deep_reload.py (load_tail): single tiny change here
2326 seems to fix the long-standing bug of dreload() failing to work
2331 seems to fix the long-standing bug of dreload() failing to work
2327 for dotted names. But this module is pretty tricky, so I may have
2332 for dotted names. But this module is pretty tricky, so I may have
2328 missed some subtlety. Needs more testing!.
2333 missed some subtlety. Needs more testing!.
2329
2334
2330 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2335 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2331 exceptions which have badly implemented __str__ methods.
2336 exceptions which have badly implemented __str__ methods.
2332 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2337 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2333 which I've been getting reports about from Python 2.3 users. I
2338 which I've been getting reports about from Python 2.3 users. I
2334 wish I had a simple test case to reproduce the problem, so I could
2339 wish I had a simple test case to reproduce the problem, so I could
2335 either write a cleaner workaround or file a bug report if
2340 either write a cleaner workaround or file a bug report if
2336 necessary.
2341 necessary.
2337
2342
2338 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2343 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2339 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2344 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2340 a bug report by Tjabo Kloppenburg.
2345 a bug report by Tjabo Kloppenburg.
2341
2346
2342 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2347 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2343 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2348 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2344 seems rather unstable. Thanks to a bug report by Tjabo
2349 seems rather unstable. Thanks to a bug report by Tjabo
2345 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2350 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2346
2351
2347 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2352 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2348 this out soon because of the critical fixes in the inner loop for
2353 this out soon because of the critical fixes in the inner loop for
2349 generators.
2354 generators.
2350
2355
2351 * IPython/Magic.py (Magic.getargspec): removed. This (and
2356 * IPython/Magic.py (Magic.getargspec): removed. This (and
2352 _get_def) have been obsoleted by OInspect for a long time, I
2357 _get_def) have been obsoleted by OInspect for a long time, I
2353 hadn't noticed that they were dead code.
2358 hadn't noticed that they were dead code.
2354 (Magic._ofind): restored _ofind functionality for a few literals
2359 (Magic._ofind): restored _ofind functionality for a few literals
2355 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2360 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2356 for things like "hello".capitalize?, since that would require a
2361 for things like "hello".capitalize?, since that would require a
2357 potentially dangerous eval() again.
2362 potentially dangerous eval() again.
2358
2363
2359 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2364 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2360 logic a bit more to clean up the escapes handling and minimize the
2365 logic a bit more to clean up the escapes handling and minimize the
2361 use of _ofind to only necessary cases. The interactive 'feel' of
2366 use of _ofind to only necessary cases. The interactive 'feel' of
2362 IPython should have improved quite a bit with the changes in
2367 IPython should have improved quite a bit with the changes in
2363 _prefilter and _ofind (besides being far safer than before).
2368 _prefilter and _ofind (besides being far safer than before).
2364
2369
2365 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2370 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2366 obscure, never reported). Edit would fail to find the object to
2371 obscure, never reported). Edit would fail to find the object to
2367 edit under some circumstances.
2372 edit under some circumstances.
2368 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2373 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2369 which were causing double-calling of generators. Those eval calls
2374 which were causing double-calling of generators. Those eval calls
2370 were _very_ dangerous, since code with side effects could be
2375 were _very_ dangerous, since code with side effects could be
2371 triggered. As they say, 'eval is evil'... These were the
2376 triggered. As they say, 'eval is evil'... These were the
2372 nastiest evals in IPython. Besides, _ofind is now far simpler,
2377 nastiest evals in IPython. Besides, _ofind is now far simpler,
2373 and it should also be quite a bit faster. Its use of inspect is
2378 and it should also be quite a bit faster. Its use of inspect is
2374 also safer, so perhaps some of the inspect-related crashes I've
2379 also safer, so perhaps some of the inspect-related crashes I've
2375 seen lately with Python 2.3 might be taken care of. That will
2380 seen lately with Python 2.3 might be taken care of. That will
2376 need more testing.
2381 need more testing.
2377
2382
2378 2003-08-17 Fernando Perez <fperez@colorado.edu>
2383 2003-08-17 Fernando Perez <fperez@colorado.edu>
2379
2384
2380 * IPython/iplib.py (InteractiveShell._prefilter): significant
2385 * IPython/iplib.py (InteractiveShell._prefilter): significant
2381 simplifications to the logic for handling user escapes. Faster
2386 simplifications to the logic for handling user escapes. Faster
2382 and simpler code.
2387 and simpler code.
2383
2388
2384 2003-08-14 Fernando Perez <fperez@colorado.edu>
2389 2003-08-14 Fernando Perez <fperez@colorado.edu>
2385
2390
2386 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2391 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2387 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2392 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2388 but it should be quite a bit faster. And the recursive version
2393 but it should be quite a bit faster. And the recursive version
2389 generated O(log N) intermediate storage for all rank>1 arrays,
2394 generated O(log N) intermediate storage for all rank>1 arrays,
2390 even if they were contiguous.
2395 even if they were contiguous.
2391 (l1norm): Added this function.
2396 (l1norm): Added this function.
2392 (norm): Added this function for arbitrary norms (including
2397 (norm): Added this function for arbitrary norms (including
2393 l-infinity). l1 and l2 are still special cases for convenience
2398 l-infinity). l1 and l2 are still special cases for convenience
2394 and speed.
2399 and speed.
2395
2400
2396 2003-08-03 Fernando Perez <fperez@colorado.edu>
2401 2003-08-03 Fernando Perez <fperez@colorado.edu>
2397
2402
2398 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2403 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2399 exceptions, which now raise PendingDeprecationWarnings in Python
2404 exceptions, which now raise PendingDeprecationWarnings in Python
2400 2.3. There were some in Magic and some in Gnuplot2.
2405 2.3. There were some in Magic and some in Gnuplot2.
2401
2406
2402 2003-06-30 Fernando Perez <fperez@colorado.edu>
2407 2003-06-30 Fernando Perez <fperez@colorado.edu>
2403
2408
2404 * IPython/genutils.py (page): modified to call curses only for
2409 * IPython/genutils.py (page): modified to call curses only for
2405 terminals where TERM=='xterm'. After problems under many other
2410 terminals where TERM=='xterm'. After problems under many other
2406 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2411 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2407
2412
2408 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2413 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2409 would be triggered when readline was absent. This was just an old
2414 would be triggered when readline was absent. This was just an old
2410 debugging statement I'd forgotten to take out.
2415 debugging statement I'd forgotten to take out.
2411
2416
2412 2003-06-20 Fernando Perez <fperez@colorado.edu>
2417 2003-06-20 Fernando Perez <fperez@colorado.edu>
2413
2418
2414 * IPython/genutils.py (clock): modified to return only user time
2419 * IPython/genutils.py (clock): modified to return only user time
2415 (not counting system time), after a discussion on scipy. While
2420 (not counting system time), after a discussion on scipy. While
2416 system time may be a useful quantity occasionally, it may much
2421 system time may be a useful quantity occasionally, it may much
2417 more easily be skewed by occasional swapping or other similar
2422 more easily be skewed by occasional swapping or other similar
2418 activity.
2423 activity.
2419
2424
2420 2003-06-05 Fernando Perez <fperez@colorado.edu>
2425 2003-06-05 Fernando Perez <fperez@colorado.edu>
2421
2426
2422 * IPython/numutils.py (identity): new function, for building
2427 * IPython/numutils.py (identity): new function, for building
2423 arbitrary rank Kronecker deltas (mostly backwards compatible with
2428 arbitrary rank Kronecker deltas (mostly backwards compatible with
2424 Numeric.identity)
2429 Numeric.identity)
2425
2430
2426 2003-06-03 Fernando Perez <fperez@colorado.edu>
2431 2003-06-03 Fernando Perez <fperez@colorado.edu>
2427
2432
2428 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2433 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2429 arguments passed to magics with spaces, to allow trailing '\' to
2434 arguments passed to magics with spaces, to allow trailing '\' to
2430 work normally (mainly for Windows users).
2435 work normally (mainly for Windows users).
2431
2436
2432 2003-05-29 Fernando Perez <fperez@colorado.edu>
2437 2003-05-29 Fernando Perez <fperez@colorado.edu>
2433
2438
2434 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2439 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2435 instead of pydoc.help. This fixes a bizarre behavior where
2440 instead of pydoc.help. This fixes a bizarre behavior where
2436 printing '%s' % locals() would trigger the help system. Now
2441 printing '%s' % locals() would trigger the help system. Now
2437 ipython behaves like normal python does.
2442 ipython behaves like normal python does.
2438
2443
2439 Note that if one does 'from pydoc import help', the bizarre
2444 Note that if one does 'from pydoc import help', the bizarre
2440 behavior returns, but this will also happen in normal python, so
2445 behavior returns, but this will also happen in normal python, so
2441 it's not an ipython bug anymore (it has to do with how pydoc.help
2446 it's not an ipython bug anymore (it has to do with how pydoc.help
2442 is implemented).
2447 is implemented).
2443
2448
2444 2003-05-22 Fernando Perez <fperez@colorado.edu>
2449 2003-05-22 Fernando Perez <fperez@colorado.edu>
2445
2450
2446 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2451 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2447 return [] instead of None when nothing matches, also match to end
2452 return [] instead of None when nothing matches, also match to end
2448 of line. Patch by Gary Bishop.
2453 of line. Patch by Gary Bishop.
2449
2454
2450 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2455 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2451 protection as before, for files passed on the command line. This
2456 protection as before, for files passed on the command line. This
2452 prevents the CrashHandler from kicking in if user files call into
2457 prevents the CrashHandler from kicking in if user files call into
2453 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2458 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2454 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2459 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2455
2460
2456 2003-05-20 *** Released version 0.4.0
2461 2003-05-20 *** Released version 0.4.0
2457
2462
2458 2003-05-20 Fernando Perez <fperez@colorado.edu>
2463 2003-05-20 Fernando Perez <fperez@colorado.edu>
2459
2464
2460 * setup.py: added support for manpages. It's a bit hackish b/c of
2465 * setup.py: added support for manpages. It's a bit hackish b/c of
2461 a bug in the way the bdist_rpm distutils target handles gzipped
2466 a bug in the way the bdist_rpm distutils target handles gzipped
2462 manpages, but it works. After a patch by Jack.
2467 manpages, but it works. After a patch by Jack.
2463
2468
2464 2003-05-19 Fernando Perez <fperez@colorado.edu>
2469 2003-05-19 Fernando Perez <fperez@colorado.edu>
2465
2470
2466 * IPython/numutils.py: added a mockup of the kinds module, since
2471 * IPython/numutils.py: added a mockup of the kinds module, since
2467 it was recently removed from Numeric. This way, numutils will
2472 it was recently removed from Numeric. This way, numutils will
2468 work for all users even if they are missing kinds.
2473 work for all users even if they are missing kinds.
2469
2474
2470 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2475 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2471 failure, which can occur with SWIG-wrapped extensions. After a
2476 failure, which can occur with SWIG-wrapped extensions. After a
2472 crash report from Prabhu.
2477 crash report from Prabhu.
2473
2478
2474 2003-05-16 Fernando Perez <fperez@colorado.edu>
2479 2003-05-16 Fernando Perez <fperez@colorado.edu>
2475
2480
2476 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2481 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2477 protect ipython from user code which may call directly
2482 protect ipython from user code which may call directly
2478 sys.excepthook (this looks like an ipython crash to the user, even
2483 sys.excepthook (this looks like an ipython crash to the user, even
2479 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2484 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2480 This is especially important to help users of WxWindows, but may
2485 This is especially important to help users of WxWindows, but may
2481 also be useful in other cases.
2486 also be useful in other cases.
2482
2487
2483 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2488 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2484 an optional tb_offset to be specified, and to preserve exception
2489 an optional tb_offset to be specified, and to preserve exception
2485 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2490 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2486
2491
2487 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2492 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2488
2493
2489 2003-05-15 Fernando Perez <fperez@colorado.edu>
2494 2003-05-15 Fernando Perez <fperez@colorado.edu>
2490
2495
2491 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2496 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2492 installing for a new user under Windows.
2497 installing for a new user under Windows.
2493
2498
2494 2003-05-12 Fernando Perez <fperez@colorado.edu>
2499 2003-05-12 Fernando Perez <fperez@colorado.edu>
2495
2500
2496 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2501 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2497 handler for Emacs comint-based lines. Currently it doesn't do
2502 handler for Emacs comint-based lines. Currently it doesn't do
2498 much (but importantly, it doesn't update the history cache). In
2503 much (but importantly, it doesn't update the history cache). In
2499 the future it may be expanded if Alex needs more functionality
2504 the future it may be expanded if Alex needs more functionality
2500 there.
2505 there.
2501
2506
2502 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2507 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2503 info to crash reports.
2508 info to crash reports.
2504
2509
2505 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2510 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2506 just like Python's -c. Also fixed crash with invalid -color
2511 just like Python's -c. Also fixed crash with invalid -color
2507 option value at startup. Thanks to Will French
2512 option value at startup. Thanks to Will French
2508 <wfrench-AT-bestweb.net> for the bug report.
2513 <wfrench-AT-bestweb.net> for the bug report.
2509
2514
2510 2003-05-09 Fernando Perez <fperez@colorado.edu>
2515 2003-05-09 Fernando Perez <fperez@colorado.edu>
2511
2516
2512 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2517 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2513 to EvalDict (it's a mapping, after all) and simplified its code
2518 to EvalDict (it's a mapping, after all) and simplified its code
2514 quite a bit, after a nice discussion on c.l.py where Gustavo
2519 quite a bit, after a nice discussion on c.l.py where Gustavo
2515 Córdova <gcordova-AT-sismex.com> suggested the new version.
2520 Córdova <gcordova-AT-sismex.com> suggested the new version.
2516
2521
2517 2003-04-30 Fernando Perez <fperez@colorado.edu>
2522 2003-04-30 Fernando Perez <fperez@colorado.edu>
2518
2523
2519 * IPython/genutils.py (timings_out): modified it to reduce its
2524 * IPython/genutils.py (timings_out): modified it to reduce its
2520 overhead in the common reps==1 case.
2525 overhead in the common reps==1 case.
2521
2526
2522 2003-04-29 Fernando Perez <fperez@colorado.edu>
2527 2003-04-29 Fernando Perez <fperez@colorado.edu>
2523
2528
2524 * IPython/genutils.py (timings_out): Modified to use the resource
2529 * IPython/genutils.py (timings_out): Modified to use the resource
2525 module, which avoids the wraparound problems of time.clock().
2530 module, which avoids the wraparound problems of time.clock().
2526
2531
2527 2003-04-17 *** Released version 0.2.15pre4
2532 2003-04-17 *** Released version 0.2.15pre4
2528
2533
2529 2003-04-17 Fernando Perez <fperez@colorado.edu>
2534 2003-04-17 Fernando Perez <fperez@colorado.edu>
2530
2535
2531 * setup.py (scriptfiles): Split windows-specific stuff over to a
2536 * setup.py (scriptfiles): Split windows-specific stuff over to a
2532 separate file, in an attempt to have a Windows GUI installer.
2537 separate file, in an attempt to have a Windows GUI installer.
2533 That didn't work, but part of the groundwork is done.
2538 That didn't work, but part of the groundwork is done.
2534
2539
2535 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
2540 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
2536 indent/unindent with 4 spaces. Particularly useful in combination
2541 indent/unindent with 4 spaces. Particularly useful in combination
2537 with the new auto-indent option.
2542 with the new auto-indent option.
2538
2543
2539 2003-04-16 Fernando Perez <fperez@colorado.edu>
2544 2003-04-16 Fernando Perez <fperez@colorado.edu>
2540
2545
2541 * IPython/Magic.py: various replacements of self.rc for
2546 * IPython/Magic.py: various replacements of self.rc for
2542 self.shell.rc. A lot more remains to be done to fully disentangle
2547 self.shell.rc. A lot more remains to be done to fully disentangle
2543 this class from the main Shell class.
2548 this class from the main Shell class.
2544
2549
2545 * IPython/GnuplotRuntime.py: added checks for mouse support so
2550 * IPython/GnuplotRuntime.py: added checks for mouse support so
2546 that we don't try to enable it if the current gnuplot doesn't
2551 that we don't try to enable it if the current gnuplot doesn't
2547 really support it. Also added checks so that we don't try to
2552 really support it. Also added checks so that we don't try to
2548 enable persist under Windows (where Gnuplot doesn't recognize the
2553 enable persist under Windows (where Gnuplot doesn't recognize the
2549 option).
2554 option).
2550
2555
2551 * IPython/iplib.py (InteractiveShell.interact): Added optional
2556 * IPython/iplib.py (InteractiveShell.interact): Added optional
2552 auto-indenting code, after a patch by King C. Shu
2557 auto-indenting code, after a patch by King C. Shu
2553 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
2558 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
2554 get along well with pasting indented code. If I ever figure out
2559 get along well with pasting indented code. If I ever figure out
2555 how to make that part go well, it will become on by default.
2560 how to make that part go well, it will become on by default.
2556
2561
2557 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
2562 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
2558 crash ipython if there was an unmatched '%' in the user's prompt
2563 crash ipython if there was an unmatched '%' in the user's prompt
2559 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2564 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2560
2565
2561 * IPython/iplib.py (InteractiveShell.interact): removed the
2566 * IPython/iplib.py (InteractiveShell.interact): removed the
2562 ability to ask the user whether he wants to crash or not at the
2567 ability to ask the user whether he wants to crash or not at the
2563 'last line' exception handler. Calling functions at that point
2568 'last line' exception handler. Calling functions at that point
2564 changes the stack, and the error reports would have incorrect
2569 changes the stack, and the error reports would have incorrect
2565 tracebacks.
2570 tracebacks.
2566
2571
2567 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
2572 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
2568 pass through a peger a pretty-printed form of any object. After a
2573 pass through a peger a pretty-printed form of any object. After a
2569 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
2574 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
2570
2575
2571 2003-04-14 Fernando Perez <fperez@colorado.edu>
2576 2003-04-14 Fernando Perez <fperez@colorado.edu>
2572
2577
2573 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
2578 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
2574 all files in ~ would be modified at first install (instead of
2579 all files in ~ would be modified at first install (instead of
2575 ~/.ipython). This could be potentially disastrous, as the
2580 ~/.ipython). This could be potentially disastrous, as the
2576 modification (make line-endings native) could damage binary files.
2581 modification (make line-endings native) could damage binary files.
2577
2582
2578 2003-04-10 Fernando Perez <fperez@colorado.edu>
2583 2003-04-10 Fernando Perez <fperez@colorado.edu>
2579
2584
2580 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
2585 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
2581 handle only lines which are invalid python. This now means that
2586 handle only lines which are invalid python. This now means that
2582 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
2587 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
2583 for the bug report.
2588 for the bug report.
2584
2589
2585 2003-04-01 Fernando Perez <fperez@colorado.edu>
2590 2003-04-01 Fernando Perez <fperez@colorado.edu>
2586
2591
2587 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
2592 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
2588 where failing to set sys.last_traceback would crash pdb.pm().
2593 where failing to set sys.last_traceback would crash pdb.pm().
2589 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
2594 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
2590 report.
2595 report.
2591
2596
2592 2003-03-25 Fernando Perez <fperez@colorado.edu>
2597 2003-03-25 Fernando Perez <fperez@colorado.edu>
2593
2598
2594 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
2599 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
2595 before printing it (it had a lot of spurious blank lines at the
2600 before printing it (it had a lot of spurious blank lines at the
2596 end).
2601 end).
2597
2602
2598 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
2603 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
2599 output would be sent 21 times! Obviously people don't use this
2604 output would be sent 21 times! Obviously people don't use this
2600 too often, or I would have heard about it.
2605 too often, or I would have heard about it.
2601
2606
2602 2003-03-24 Fernando Perez <fperez@colorado.edu>
2607 2003-03-24 Fernando Perez <fperez@colorado.edu>
2603
2608
2604 * setup.py (scriptfiles): renamed the data_files parameter from
2609 * setup.py (scriptfiles): renamed the data_files parameter from
2605 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
2610 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
2606 for the patch.
2611 for the patch.
2607
2612
2608 2003-03-20 Fernando Perez <fperez@colorado.edu>
2613 2003-03-20 Fernando Perez <fperez@colorado.edu>
2609
2614
2610 * IPython/genutils.py (error): added error() and fatal()
2615 * IPython/genutils.py (error): added error() and fatal()
2611 functions.
2616 functions.
2612
2617
2613 2003-03-18 *** Released version 0.2.15pre3
2618 2003-03-18 *** Released version 0.2.15pre3
2614
2619
2615 2003-03-18 Fernando Perez <fperez@colorado.edu>
2620 2003-03-18 Fernando Perez <fperez@colorado.edu>
2616
2621
2617 * setupext/install_data_ext.py
2622 * setupext/install_data_ext.py
2618 (install_data_ext.initialize_options): Class contributed by Jack
2623 (install_data_ext.initialize_options): Class contributed by Jack
2619 Moffit for fixing the old distutils hack. He is sending this to
2624 Moffit for fixing the old distutils hack. He is sending this to
2620 the distutils folks so in the future we may not need it as a
2625 the distutils folks so in the future we may not need it as a
2621 private fix.
2626 private fix.
2622
2627
2623 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
2628 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
2624 changes for Debian packaging. See his patch for full details.
2629 changes for Debian packaging. See his patch for full details.
2625 The old distutils hack of making the ipythonrc* files carry a
2630 The old distutils hack of making the ipythonrc* files carry a
2626 bogus .py extension is gone, at last. Examples were moved to a
2631 bogus .py extension is gone, at last. Examples were moved to a
2627 separate subdir under doc/, and the separate executable scripts
2632 separate subdir under doc/, and the separate executable scripts
2628 now live in their own directory. Overall a great cleanup. The
2633 now live in their own directory. Overall a great cleanup. The
2629 manual was updated to use the new files, and setup.py has been
2634 manual was updated to use the new files, and setup.py has been
2630 fixed for this setup.
2635 fixed for this setup.
2631
2636
2632 * IPython/PyColorize.py (Parser.usage): made non-executable and
2637 * IPython/PyColorize.py (Parser.usage): made non-executable and
2633 created a pycolor wrapper around it to be included as a script.
2638 created a pycolor wrapper around it to be included as a script.
2634
2639
2635 2003-03-12 *** Released version 0.2.15pre2
2640 2003-03-12 *** Released version 0.2.15pre2
2636
2641
2637 2003-03-12 Fernando Perez <fperez@colorado.edu>
2642 2003-03-12 Fernando Perez <fperez@colorado.edu>
2638
2643
2639 * IPython/ColorANSI.py (make_color_table): Finally fixed the
2644 * IPython/ColorANSI.py (make_color_table): Finally fixed the
2640 long-standing problem with garbage characters in some terminals.
2645 long-standing problem with garbage characters in some terminals.
2641 The issue was really that the \001 and \002 escapes must _only_ be
2646 The issue was really that the \001 and \002 escapes must _only_ be
2642 passed to input prompts (which call readline), but _never_ to
2647 passed to input prompts (which call readline), but _never_ to
2643 normal text to be printed on screen. I changed ColorANSI to have
2648 normal text to be printed on screen. I changed ColorANSI to have
2644 two classes: TermColors and InputTermColors, each with the
2649 two classes: TermColors and InputTermColors, each with the
2645 appropriate escapes for input prompts or normal text. The code in
2650 appropriate escapes for input prompts or normal text. The code in
2646 Prompts.py got slightly more complicated, but this very old and
2651 Prompts.py got slightly more complicated, but this very old and
2647 annoying bug is finally fixed.
2652 annoying bug is finally fixed.
2648
2653
2649 All the credit for nailing down the real origin of this problem
2654 All the credit for nailing down the real origin of this problem
2650 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
2655 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
2651 *Many* thanks to him for spending quite a bit of effort on this.
2656 *Many* thanks to him for spending quite a bit of effort on this.
2652
2657
2653 2003-03-05 *** Released version 0.2.15pre1
2658 2003-03-05 *** Released version 0.2.15pre1
2654
2659
2655 2003-03-03 Fernando Perez <fperez@colorado.edu>
2660 2003-03-03 Fernando Perez <fperez@colorado.edu>
2656
2661
2657 * IPython/FakeModule.py: Moved the former _FakeModule to a
2662 * IPython/FakeModule.py: Moved the former _FakeModule to a
2658 separate file, because it's also needed by Magic (to fix a similar
2663 separate file, because it's also needed by Magic (to fix a similar
2659 pickle-related issue in @run).
2664 pickle-related issue in @run).
2660
2665
2661 2003-03-02 Fernando Perez <fperez@colorado.edu>
2666 2003-03-02 Fernando Perez <fperez@colorado.edu>
2662
2667
2663 * IPython/Magic.py (Magic.magic_autocall): new magic to control
2668 * IPython/Magic.py (Magic.magic_autocall): new magic to control
2664 the autocall option at runtime.
2669 the autocall option at runtime.
2665 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
2670 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
2666 across Magic.py to start separating Magic from InteractiveShell.
2671 across Magic.py to start separating Magic from InteractiveShell.
2667 (Magic._ofind): Fixed to return proper namespace for dotted
2672 (Magic._ofind): Fixed to return proper namespace for dotted
2668 names. Before, a dotted name would always return 'not currently
2673 names. Before, a dotted name would always return 'not currently
2669 defined', because it would find the 'parent'. s.x would be found,
2674 defined', because it would find the 'parent'. s.x would be found,
2670 but since 'x' isn't defined by itself, it would get confused.
2675 but since 'x' isn't defined by itself, it would get confused.
2671 (Magic.magic_run): Fixed pickling problems reported by Ralf
2676 (Magic.magic_run): Fixed pickling problems reported by Ralf
2672 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
2677 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
2673 that I'd used when Mike Heeter reported similar issues at the
2678 that I'd used when Mike Heeter reported similar issues at the
2674 top-level, but now for @run. It boils down to injecting the
2679 top-level, but now for @run. It boils down to injecting the
2675 namespace where code is being executed with something that looks
2680 namespace where code is being executed with something that looks
2676 enough like a module to fool pickle.dump(). Since a pickle stores
2681 enough like a module to fool pickle.dump(). Since a pickle stores
2677 a named reference to the importing module, we need this for
2682 a named reference to the importing module, we need this for
2678 pickles to save something sensible.
2683 pickles to save something sensible.
2679
2684
2680 * IPython/ipmaker.py (make_IPython): added an autocall option.
2685 * IPython/ipmaker.py (make_IPython): added an autocall option.
2681
2686
2682 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
2687 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
2683 the auto-eval code. Now autocalling is an option, and the code is
2688 the auto-eval code. Now autocalling is an option, and the code is
2684 also vastly safer. There is no more eval() involved at all.
2689 also vastly safer. There is no more eval() involved at all.
2685
2690
2686 2003-03-01 Fernando Perez <fperez@colorado.edu>
2691 2003-03-01 Fernando Perez <fperez@colorado.edu>
2687
2692
2688 * IPython/Magic.py (Magic._ofind): Changed interface to return a
2693 * IPython/Magic.py (Magic._ofind): Changed interface to return a
2689 dict with named keys instead of a tuple.
2694 dict with named keys instead of a tuple.
2690
2695
2691 * IPython: Started using CVS for IPython as of 0.2.15pre1.
2696 * IPython: Started using CVS for IPython as of 0.2.15pre1.
2692
2697
2693 * setup.py (make_shortcut): Fixed message about directories
2698 * setup.py (make_shortcut): Fixed message about directories
2694 created during Windows installation (the directories were ok, just
2699 created during Windows installation (the directories were ok, just
2695 the printed message was misleading). Thanks to Chris Liechti
2700 the printed message was misleading). Thanks to Chris Liechti
2696 <cliechti-AT-gmx.net> for the heads up.
2701 <cliechti-AT-gmx.net> for the heads up.
2697
2702
2698 2003-02-21 Fernando Perez <fperez@colorado.edu>
2703 2003-02-21 Fernando Perez <fperez@colorado.edu>
2699
2704
2700 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
2705 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
2701 of ValueError exception when checking for auto-execution. This
2706 of ValueError exception when checking for auto-execution. This
2702 one is raised by things like Numeric arrays arr.flat when the
2707 one is raised by things like Numeric arrays arr.flat when the
2703 array is non-contiguous.
2708 array is non-contiguous.
2704
2709
2705 2003-01-31 Fernando Perez <fperez@colorado.edu>
2710 2003-01-31 Fernando Perez <fperez@colorado.edu>
2706
2711
2707 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
2712 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
2708 not return any value at all (even though the command would get
2713 not return any value at all (even though the command would get
2709 executed).
2714 executed).
2710 (xsys): Flush stdout right after printing the command to ensure
2715 (xsys): Flush stdout right after printing the command to ensure
2711 proper ordering of commands and command output in the total
2716 proper ordering of commands and command output in the total
2712 output.
2717 output.
2713 (SystemExec/xsys/bq): Switched the names of xsys/bq and
2718 (SystemExec/xsys/bq): Switched the names of xsys/bq and
2714 system/getoutput as defaults. The old ones are kept for
2719 system/getoutput as defaults. The old ones are kept for
2715 compatibility reasons, so no code which uses this library needs
2720 compatibility reasons, so no code which uses this library needs
2716 changing.
2721 changing.
2717
2722
2718 2003-01-27 *** Released version 0.2.14
2723 2003-01-27 *** Released version 0.2.14
2719
2724
2720 2003-01-25 Fernando Perez <fperez@colorado.edu>
2725 2003-01-25 Fernando Perez <fperez@colorado.edu>
2721
2726
2722 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
2727 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
2723 functions defined in previous edit sessions could not be re-edited
2728 functions defined in previous edit sessions could not be re-edited
2724 (because the temp files were immediately removed). Now temp files
2729 (because the temp files were immediately removed). Now temp files
2725 are removed only at IPython's exit.
2730 are removed only at IPython's exit.
2726 (Magic.magic_run): Improved @run to perform shell-like expansions
2731 (Magic.magic_run): Improved @run to perform shell-like expansions
2727 on its arguments (~users and $VARS). With this, @run becomes more
2732 on its arguments (~users and $VARS). With this, @run becomes more
2728 like a normal command-line.
2733 like a normal command-line.
2729
2734
2730 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
2735 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
2731 bugs related to embedding and cleaned up that code. A fairly
2736 bugs related to embedding and cleaned up that code. A fairly
2732 important one was the impossibility to access the global namespace
2737 important one was the impossibility to access the global namespace
2733 through the embedded IPython (only local variables were visible).
2738 through the embedded IPython (only local variables were visible).
2734
2739
2735 2003-01-14 Fernando Perez <fperez@colorado.edu>
2740 2003-01-14 Fernando Perez <fperez@colorado.edu>
2736
2741
2737 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
2742 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
2738 auto-calling to be a bit more conservative. Now it doesn't get
2743 auto-calling to be a bit more conservative. Now it doesn't get
2739 triggered if any of '!=()<>' are in the rest of the input line, to
2744 triggered if any of '!=()<>' are in the rest of the input line, to
2740 allow comparing callables. Thanks to Alex for the heads up.
2745 allow comparing callables. Thanks to Alex for the heads up.
2741
2746
2742 2003-01-07 Fernando Perez <fperez@colorado.edu>
2747 2003-01-07 Fernando Perez <fperez@colorado.edu>
2743
2748
2744 * IPython/genutils.py (page): fixed estimation of the number of
2749 * IPython/genutils.py (page): fixed estimation of the number of
2745 lines in a string to be paged to simply count newlines. This
2750 lines in a string to be paged to simply count newlines. This
2746 prevents over-guessing due to embedded escape sequences. A better
2751 prevents over-guessing due to embedded escape sequences. A better
2747 long-term solution would involve stripping out the control chars
2752 long-term solution would involve stripping out the control chars
2748 for the count, but it's potentially so expensive I just don't
2753 for the count, but it's potentially so expensive I just don't
2749 think it's worth doing.
2754 think it's worth doing.
2750
2755
2751 2002-12-19 *** Released version 0.2.14pre50
2756 2002-12-19 *** Released version 0.2.14pre50
2752
2757
2753 2002-12-19 Fernando Perez <fperez@colorado.edu>
2758 2002-12-19 Fernando Perez <fperez@colorado.edu>
2754
2759
2755 * tools/release (version): Changed release scripts to inform
2760 * tools/release (version): Changed release scripts to inform
2756 Andrea and build a NEWS file with a list of recent changes.
2761 Andrea and build a NEWS file with a list of recent changes.
2757
2762
2758 * IPython/ColorANSI.py (__all__): changed terminal detection
2763 * IPython/ColorANSI.py (__all__): changed terminal detection
2759 code. Seems to work better for xterms without breaking
2764 code. Seems to work better for xterms without breaking
2760 konsole. Will need more testing to determine if WinXP and Mac OSX
2765 konsole. Will need more testing to determine if WinXP and Mac OSX
2761 also work ok.
2766 also work ok.
2762
2767
2763 2002-12-18 *** Released version 0.2.14pre49
2768 2002-12-18 *** Released version 0.2.14pre49
2764
2769
2765 2002-12-18 Fernando Perez <fperez@colorado.edu>
2770 2002-12-18 Fernando Perez <fperez@colorado.edu>
2766
2771
2767 * Docs: added new info about Mac OSX, from Andrea.
2772 * Docs: added new info about Mac OSX, from Andrea.
2768
2773
2769 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
2774 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
2770 allow direct plotting of python strings whose format is the same
2775 allow direct plotting of python strings whose format is the same
2771 of gnuplot data files.
2776 of gnuplot data files.
2772
2777
2773 2002-12-16 Fernando Perez <fperez@colorado.edu>
2778 2002-12-16 Fernando Perez <fperez@colorado.edu>
2774
2779
2775 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
2780 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
2776 value of exit question to be acknowledged.
2781 value of exit question to be acknowledged.
2777
2782
2778 2002-12-03 Fernando Perez <fperez@colorado.edu>
2783 2002-12-03 Fernando Perez <fperez@colorado.edu>
2779
2784
2780 * IPython/ipmaker.py: removed generators, which had been added
2785 * IPython/ipmaker.py: removed generators, which had been added
2781 by mistake in an earlier debugging run. This was causing trouble
2786 by mistake in an earlier debugging run. This was causing trouble
2782 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
2787 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
2783 for pointing this out.
2788 for pointing this out.
2784
2789
2785 2002-11-17 Fernando Perez <fperez@colorado.edu>
2790 2002-11-17 Fernando Perez <fperez@colorado.edu>
2786
2791
2787 * Manual: updated the Gnuplot section.
2792 * Manual: updated the Gnuplot section.
2788
2793
2789 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
2794 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
2790 a much better split of what goes in Runtime and what goes in
2795 a much better split of what goes in Runtime and what goes in
2791 Interactive.
2796 Interactive.
2792
2797
2793 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
2798 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
2794 being imported from iplib.
2799 being imported from iplib.
2795
2800
2796 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
2801 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
2797 for command-passing. Now the global Gnuplot instance is called
2802 for command-passing. Now the global Gnuplot instance is called
2798 'gp' instead of 'g', which was really a far too fragile and
2803 'gp' instead of 'g', which was really a far too fragile and
2799 common name.
2804 common name.
2800
2805
2801 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
2806 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
2802 bounding boxes generated by Gnuplot for square plots.
2807 bounding boxes generated by Gnuplot for square plots.
2803
2808
2804 * IPython/genutils.py (popkey): new function added. I should
2809 * IPython/genutils.py (popkey): new function added. I should
2805 suggest this on c.l.py as a dict method, it seems useful.
2810 suggest this on c.l.py as a dict method, it seems useful.
2806
2811
2807 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
2812 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
2808 to transparently handle PostScript generation. MUCH better than
2813 to transparently handle PostScript generation. MUCH better than
2809 the previous plot_eps/replot_eps (which I removed now). The code
2814 the previous plot_eps/replot_eps (which I removed now). The code
2810 is also fairly clean and well documented now (including
2815 is also fairly clean and well documented now (including
2811 docstrings).
2816 docstrings).
2812
2817
2813 2002-11-13 Fernando Perez <fperez@colorado.edu>
2818 2002-11-13 Fernando Perez <fperez@colorado.edu>
2814
2819
2815 * IPython/Magic.py (Magic.magic_edit): fixed docstring
2820 * IPython/Magic.py (Magic.magic_edit): fixed docstring
2816 (inconsistent with options).
2821 (inconsistent with options).
2817
2822
2818 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
2823 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
2819 manually disabled, I don't know why. Fixed it.
2824 manually disabled, I don't know why. Fixed it.
2820 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
2825 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
2821 eps output.
2826 eps output.
2822
2827
2823 2002-11-12 Fernando Perez <fperez@colorado.edu>
2828 2002-11-12 Fernando Perez <fperez@colorado.edu>
2824
2829
2825 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
2830 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
2826 don't propagate up to caller. Fixes crash reported by François
2831 don't propagate up to caller. Fixes crash reported by François
2827 Pinard.
2832 Pinard.
2828
2833
2829 2002-11-09 Fernando Perez <fperez@colorado.edu>
2834 2002-11-09 Fernando Perez <fperez@colorado.edu>
2830
2835
2831 * IPython/ipmaker.py (make_IPython): fixed problem with writing
2836 * IPython/ipmaker.py (make_IPython): fixed problem with writing
2832 history file for new users.
2837 history file for new users.
2833 (make_IPython): fixed bug where initial install would leave the
2838 (make_IPython): fixed bug where initial install would leave the
2834 user running in the .ipython dir.
2839 user running in the .ipython dir.
2835 (make_IPython): fixed bug where config dir .ipython would be
2840 (make_IPython): fixed bug where config dir .ipython would be
2836 created regardless of the given -ipythondir option. Thanks to Cory
2841 created regardless of the given -ipythondir option. Thanks to Cory
2837 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
2842 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
2838
2843
2839 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
2844 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
2840 type confirmations. Will need to use it in all of IPython's code
2845 type confirmations. Will need to use it in all of IPython's code
2841 consistently.
2846 consistently.
2842
2847
2843 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
2848 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
2844 context to print 31 lines instead of the default 5. This will make
2849 context to print 31 lines instead of the default 5. This will make
2845 the crash reports extremely detailed in case the problem is in
2850 the crash reports extremely detailed in case the problem is in
2846 libraries I don't have access to.
2851 libraries I don't have access to.
2847
2852
2848 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
2853 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
2849 line of defense' code to still crash, but giving users fair
2854 line of defense' code to still crash, but giving users fair
2850 warning. I don't want internal errors to go unreported: if there's
2855 warning. I don't want internal errors to go unreported: if there's
2851 an internal problem, IPython should crash and generate a full
2856 an internal problem, IPython should crash and generate a full
2852 report.
2857 report.
2853
2858
2854 2002-11-08 Fernando Perez <fperez@colorado.edu>
2859 2002-11-08 Fernando Perez <fperez@colorado.edu>
2855
2860
2856 * IPython/iplib.py (InteractiveShell.interact): added code to trap
2861 * IPython/iplib.py (InteractiveShell.interact): added code to trap
2857 otherwise uncaught exceptions which can appear if people set
2862 otherwise uncaught exceptions which can appear if people set
2858 sys.stdout to something badly broken. Thanks to a crash report
2863 sys.stdout to something badly broken. Thanks to a crash report
2859 from henni-AT-mail.brainbot.com.
2864 from henni-AT-mail.brainbot.com.
2860
2865
2861 2002-11-04 Fernando Perez <fperez@colorado.edu>
2866 2002-11-04 Fernando Perez <fperez@colorado.edu>
2862
2867
2863 * IPython/iplib.py (InteractiveShell.interact): added
2868 * IPython/iplib.py (InteractiveShell.interact): added
2864 __IPYTHON__active to the builtins. It's a flag which goes on when
2869 __IPYTHON__active to the builtins. It's a flag which goes on when
2865 the interaction starts and goes off again when it stops. This
2870 the interaction starts and goes off again when it stops. This
2866 allows embedding code to detect being inside IPython. Before this
2871 allows embedding code to detect being inside IPython. Before this
2867 was done via __IPYTHON__, but that only shows that an IPython
2872 was done via __IPYTHON__, but that only shows that an IPython
2868 instance has been created.
2873 instance has been created.
2869
2874
2870 * IPython/Magic.py (Magic.magic_env): I realized that in a
2875 * IPython/Magic.py (Magic.magic_env): I realized that in a
2871 UserDict, instance.data holds the data as a normal dict. So I
2876 UserDict, instance.data holds the data as a normal dict. So I
2872 modified @env to return os.environ.data instead of rebuilding a
2877 modified @env to return os.environ.data instead of rebuilding a
2873 dict by hand.
2878 dict by hand.
2874
2879
2875 2002-11-02 Fernando Perez <fperez@colorado.edu>
2880 2002-11-02 Fernando Perez <fperez@colorado.edu>
2876
2881
2877 * IPython/genutils.py (warn): changed so that level 1 prints no
2882 * IPython/genutils.py (warn): changed so that level 1 prints no
2878 header. Level 2 is now the default (with 'WARNING' header, as
2883 header. Level 2 is now the default (with 'WARNING' header, as
2879 before). I think I tracked all places where changes were needed in
2884 before). I think I tracked all places where changes were needed in
2880 IPython, but outside code using the old level numbering may have
2885 IPython, but outside code using the old level numbering may have
2881 broken.
2886 broken.
2882
2887
2883 * IPython/iplib.py (InteractiveShell.runcode): added this to
2888 * IPython/iplib.py (InteractiveShell.runcode): added this to
2884 handle the tracebacks in SystemExit traps correctly. The previous
2889 handle the tracebacks in SystemExit traps correctly. The previous
2885 code (through interact) was printing more of the stack than
2890 code (through interact) was printing more of the stack than
2886 necessary, showing IPython internal code to the user.
2891 necessary, showing IPython internal code to the user.
2887
2892
2888 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
2893 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
2889 default. Now that the default at the confirmation prompt is yes,
2894 default. Now that the default at the confirmation prompt is yes,
2890 it's not so intrusive. François' argument that ipython sessions
2895 it's not so intrusive. François' argument that ipython sessions
2891 tend to be complex enough not to lose them from an accidental C-d,
2896 tend to be complex enough not to lose them from an accidental C-d,
2892 is a valid one.
2897 is a valid one.
2893
2898
2894 * IPython/iplib.py (InteractiveShell.interact): added a
2899 * IPython/iplib.py (InteractiveShell.interact): added a
2895 showtraceback() call to the SystemExit trap, and modified the exit
2900 showtraceback() call to the SystemExit trap, and modified the exit
2896 confirmation to have yes as the default.
2901 confirmation to have yes as the default.
2897
2902
2898 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
2903 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
2899 this file. It's been gone from the code for a long time, this was
2904 this file. It's been gone from the code for a long time, this was
2900 simply leftover junk.
2905 simply leftover junk.
2901
2906
2902 2002-11-01 Fernando Perez <fperez@colorado.edu>
2907 2002-11-01 Fernando Perez <fperez@colorado.edu>
2903
2908
2904 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
2909 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
2905 added. If set, IPython now traps EOF and asks for
2910 added. If set, IPython now traps EOF and asks for
2906 confirmation. After a request by François Pinard.
2911 confirmation. After a request by François Pinard.
2907
2912
2908 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
2913 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
2909 of @abort, and with a new (better) mechanism for handling the
2914 of @abort, and with a new (better) mechanism for handling the
2910 exceptions.
2915 exceptions.
2911
2916
2912 2002-10-27 Fernando Perez <fperez@colorado.edu>
2917 2002-10-27 Fernando Perez <fperez@colorado.edu>
2913
2918
2914 * IPython/usage.py (__doc__): updated the --help information and
2919 * IPython/usage.py (__doc__): updated the --help information and
2915 the ipythonrc file to indicate that -log generates
2920 the ipythonrc file to indicate that -log generates
2916 ./ipython.log. Also fixed the corresponding info in @logstart.
2921 ./ipython.log. Also fixed the corresponding info in @logstart.
2917 This and several other fixes in the manuals thanks to reports by
2922 This and several other fixes in the manuals thanks to reports by
2918 François Pinard <pinard-AT-iro.umontreal.ca>.
2923 François Pinard <pinard-AT-iro.umontreal.ca>.
2919
2924
2920 * IPython/Logger.py (Logger.switch_log): Fixed error message to
2925 * IPython/Logger.py (Logger.switch_log): Fixed error message to
2921 refer to @logstart (instead of @log, which doesn't exist).
2926 refer to @logstart (instead of @log, which doesn't exist).
2922
2927
2923 * IPython/iplib.py (InteractiveShell._prefilter): fixed
2928 * IPython/iplib.py (InteractiveShell._prefilter): fixed
2924 AttributeError crash. Thanks to Christopher Armstrong
2929 AttributeError crash. Thanks to Christopher Armstrong
2925 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
2930 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
2926 introduced recently (in 0.2.14pre37) with the fix to the eval
2931 introduced recently (in 0.2.14pre37) with the fix to the eval
2927 problem mentioned below.
2932 problem mentioned below.
2928
2933
2929 2002-10-17 Fernando Perez <fperez@colorado.edu>
2934 2002-10-17 Fernando Perez <fperez@colorado.edu>
2930
2935
2931 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
2936 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
2932 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
2937 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
2933
2938
2934 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
2939 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
2935 this function to fix a problem reported by Alex Schmolck. He saw
2940 this function to fix a problem reported by Alex Schmolck. He saw
2936 it with list comprehensions and generators, which were getting
2941 it with list comprehensions and generators, which were getting
2937 called twice. The real problem was an 'eval' call in testing for
2942 called twice. The real problem was an 'eval' call in testing for
2938 automagic which was evaluating the input line silently.
2943 automagic which was evaluating the input line silently.
2939
2944
2940 This is a potentially very nasty bug, if the input has side
2945 This is a potentially very nasty bug, if the input has side
2941 effects which must not be repeated. The code is much cleaner now,
2946 effects which must not be repeated. The code is much cleaner now,
2942 without any blanket 'except' left and with a regexp test for
2947 without any blanket 'except' left and with a regexp test for
2943 actual function names.
2948 actual function names.
2944
2949
2945 But an eval remains, which I'm not fully comfortable with. I just
2950 But an eval remains, which I'm not fully comfortable with. I just
2946 don't know how to find out if an expression could be a callable in
2951 don't know how to find out if an expression could be a callable in
2947 the user's namespace without doing an eval on the string. However
2952 the user's namespace without doing an eval on the string. However
2948 that string is now much more strictly checked so that no code
2953 that string is now much more strictly checked so that no code
2949 slips by, so the eval should only happen for things that can
2954 slips by, so the eval should only happen for things that can
2950 really be only function/method names.
2955 really be only function/method names.
2951
2956
2952 2002-10-15 Fernando Perez <fperez@colorado.edu>
2957 2002-10-15 Fernando Perez <fperez@colorado.edu>
2953
2958
2954 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
2959 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
2955 OSX information to main manual, removed README_Mac_OSX file from
2960 OSX information to main manual, removed README_Mac_OSX file from
2956 distribution. Also updated credits for recent additions.
2961 distribution. Also updated credits for recent additions.
2957
2962
2958 2002-10-10 Fernando Perez <fperez@colorado.edu>
2963 2002-10-10 Fernando Perez <fperez@colorado.edu>
2959
2964
2960 * README_Mac_OSX: Added a README for Mac OSX users for fixing
2965 * README_Mac_OSX: Added a README for Mac OSX users for fixing
2961 terminal-related issues. Many thanks to Andrea Riciputi
2966 terminal-related issues. Many thanks to Andrea Riciputi
2962 <andrea.riciputi-AT-libero.it> for writing it.
2967 <andrea.riciputi-AT-libero.it> for writing it.
2963
2968
2964 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
2969 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
2965 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2970 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2966
2971
2967 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
2972 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
2968 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
2973 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
2969 <syver-en-AT-online.no> who both submitted patches for this problem.
2974 <syver-en-AT-online.no> who both submitted patches for this problem.
2970
2975
2971 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
2976 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
2972 global embedding to make sure that things don't overwrite user
2977 global embedding to make sure that things don't overwrite user
2973 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
2978 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
2974
2979
2975 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
2980 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
2976 compatibility. Thanks to Hayden Callow
2981 compatibility. Thanks to Hayden Callow
2977 <h.callow-AT-elec.canterbury.ac.nz>
2982 <h.callow-AT-elec.canterbury.ac.nz>
2978
2983
2979 2002-10-04 Fernando Perez <fperez@colorado.edu>
2984 2002-10-04 Fernando Perez <fperez@colorado.edu>
2980
2985
2981 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
2986 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
2982 Gnuplot.File objects.
2987 Gnuplot.File objects.
2983
2988
2984 2002-07-23 Fernando Perez <fperez@colorado.edu>
2989 2002-07-23 Fernando Perez <fperez@colorado.edu>
2985
2990
2986 * IPython/genutils.py (timing): Added timings() and timing() for
2991 * IPython/genutils.py (timing): Added timings() and timing() for
2987 quick access to the most commonly needed data, the execution
2992 quick access to the most commonly needed data, the execution
2988 times. Old timing() renamed to timings_out().
2993 times. Old timing() renamed to timings_out().
2989
2994
2990 2002-07-18 Fernando Perez <fperez@colorado.edu>
2995 2002-07-18 Fernando Perez <fperez@colorado.edu>
2991
2996
2992 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
2997 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
2993 bug with nested instances disrupting the parent's tab completion.
2998 bug with nested instances disrupting the parent's tab completion.
2994
2999
2995 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3000 * IPython/iplib.py (all_completions): Added Alex Schmolck's
2996 all_completions code to begin the emacs integration.
3001 all_completions code to begin the emacs integration.
2997
3002
2998 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3003 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
2999 argument to allow titling individual arrays when plotting.
3004 argument to allow titling individual arrays when plotting.
3000
3005
3001 2002-07-15 Fernando Perez <fperez@colorado.edu>
3006 2002-07-15 Fernando Perez <fperez@colorado.edu>
3002
3007
3003 * setup.py (make_shortcut): changed to retrieve the value of
3008 * setup.py (make_shortcut): changed to retrieve the value of
3004 'Program Files' directory from the registry (this value changes in
3009 'Program Files' directory from the registry (this value changes in
3005 non-english versions of Windows). Thanks to Thomas Fanslau
3010 non-english versions of Windows). Thanks to Thomas Fanslau
3006 <tfanslau-AT-gmx.de> for the report.
3011 <tfanslau-AT-gmx.de> for the report.
3007
3012
3008 2002-07-10 Fernando Perez <fperez@colorado.edu>
3013 2002-07-10 Fernando Perez <fperez@colorado.edu>
3009
3014
3010 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3015 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3011 a bug in pdb, which crashes if a line with only whitespace is
3016 a bug in pdb, which crashes if a line with only whitespace is
3012 entered. Bug report submitted to sourceforge.
3017 entered. Bug report submitted to sourceforge.
3013
3018
3014 2002-07-09 Fernando Perez <fperez@colorado.edu>
3019 2002-07-09 Fernando Perez <fperez@colorado.edu>
3015
3020
3016 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3021 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3017 reporting exceptions (it's a bug in inspect.py, I just set a
3022 reporting exceptions (it's a bug in inspect.py, I just set a
3018 workaround).
3023 workaround).
3019
3024
3020 2002-07-08 Fernando Perez <fperez@colorado.edu>
3025 2002-07-08 Fernando Perez <fperez@colorado.edu>
3021
3026
3022 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3027 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3023 __IPYTHON__ in __builtins__ to show up in user_ns.
3028 __IPYTHON__ in __builtins__ to show up in user_ns.
3024
3029
3025 2002-07-03 Fernando Perez <fperez@colorado.edu>
3030 2002-07-03 Fernando Perez <fperez@colorado.edu>
3026
3031
3027 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3032 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3028 name from @gp_set_instance to @gp_set_default.
3033 name from @gp_set_instance to @gp_set_default.
3029
3034
3030 * IPython/ipmaker.py (make_IPython): default editor value set to
3035 * IPython/ipmaker.py (make_IPython): default editor value set to
3031 '0' (a string), to match the rc file. Otherwise will crash when
3036 '0' (a string), to match the rc file. Otherwise will crash when
3032 .strip() is called on it.
3037 .strip() is called on it.
3033
3038
3034
3039
3035 2002-06-28 Fernando Perez <fperez@colorado.edu>
3040 2002-06-28 Fernando Perez <fperez@colorado.edu>
3036
3041
3037 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3042 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3038 of files in current directory when a file is executed via
3043 of files in current directory when a file is executed via
3039 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3044 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3040
3045
3041 * setup.py (manfiles): fix for rpm builds, submitted by RA
3046 * setup.py (manfiles): fix for rpm builds, submitted by RA
3042 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3047 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3043
3048
3044 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3049 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3045 editor when set to '0'. Problem was, '0' evaluates to True (it's a
3050 editor when set to '0'. Problem was, '0' evaluates to True (it's a
3046 string!). A. Schmolck caught this one.
3051 string!). A. Schmolck caught this one.
3047
3052
3048 2002-06-27 Fernando Perez <fperez@colorado.edu>
3053 2002-06-27 Fernando Perez <fperez@colorado.edu>
3049
3054
3050 * IPython/ipmaker.py (make_IPython): fixed bug when running user
3055 * IPython/ipmaker.py (make_IPython): fixed bug when running user
3051 defined files at the cmd line. __name__ wasn't being set to
3056 defined files at the cmd line. __name__ wasn't being set to
3052 __main__.
3057 __main__.
3053
3058
3054 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
3059 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
3055 regular lists and tuples besides Numeric arrays.
3060 regular lists and tuples besides Numeric arrays.
3056
3061
3057 * IPython/Prompts.py (CachedOutput.__call__): Added output
3062 * IPython/Prompts.py (CachedOutput.__call__): Added output
3058 supression for input ending with ';'. Similar to Mathematica and
3063 supression for input ending with ';'. Similar to Mathematica and
3059 Matlab. The _* vars and Out[] list are still updated, just like
3064 Matlab. The _* vars and Out[] list are still updated, just like
3060 Mathematica behaves.
3065 Mathematica behaves.
3061
3066
3062 2002-06-25 Fernando Perez <fperez@colorado.edu>
3067 2002-06-25 Fernando Perez <fperez@colorado.edu>
3063
3068
3064 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
3069 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
3065 .ini extensions for profiels under Windows.
3070 .ini extensions for profiels under Windows.
3066
3071
3067 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
3072 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
3068 string form. Fix contributed by Alexander Schmolck
3073 string form. Fix contributed by Alexander Schmolck
3069 <a.schmolck-AT-gmx.net>
3074 <a.schmolck-AT-gmx.net>
3070
3075
3071 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
3076 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
3072 pre-configured Gnuplot instance.
3077 pre-configured Gnuplot instance.
3073
3078
3074 2002-06-21 Fernando Perez <fperez@colorado.edu>
3079 2002-06-21 Fernando Perez <fperez@colorado.edu>
3075
3080
3076 * IPython/numutils.py (exp_safe): new function, works around the
3081 * IPython/numutils.py (exp_safe): new function, works around the
3077 underflow problems in Numeric.
3082 underflow problems in Numeric.
3078 (log2): New fn. Safe log in base 2: returns exact integer answer
3083 (log2): New fn. Safe log in base 2: returns exact integer answer
3079 for exact integer powers of 2.
3084 for exact integer powers of 2.
3080
3085
3081 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3086 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3082 properly.
3087 properly.
3083
3088
3084 2002-06-20 Fernando Perez <fperez@colorado.edu>
3089 2002-06-20 Fernando Perez <fperez@colorado.edu>
3085
3090
3086 * IPython/genutils.py (timing): new function like
3091 * IPython/genutils.py (timing): new function like
3087 Mathematica's. Similar to time_test, but returns more info.
3092 Mathematica's. Similar to time_test, but returns more info.
3088
3093
3089 2002-06-18 Fernando Perez <fperez@colorado.edu>
3094 2002-06-18 Fernando Perez <fperez@colorado.edu>
3090
3095
3091 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3096 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3092 according to Mike Heeter's suggestions.
3097 according to Mike Heeter's suggestions.
3093
3098
3094 2002-06-16 Fernando Perez <fperez@colorado.edu>
3099 2002-06-16 Fernando Perez <fperez@colorado.edu>
3095
3100
3096 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3101 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3097 system. GnuplotMagic is gone as a user-directory option. New files
3102 system. GnuplotMagic is gone as a user-directory option. New files
3098 make it easier to use all the gnuplot stuff both from external
3103 make it easier to use all the gnuplot stuff both from external
3099 programs as well as from IPython. Had to rewrite part of
3104 programs as well as from IPython. Had to rewrite part of
3100 hardcopy() b/c of a strange bug: often the ps files simply don't
3105 hardcopy() b/c of a strange bug: often the ps files simply don't
3101 get created, and require a repeat of the command (often several
3106 get created, and require a repeat of the command (often several
3102 times).
3107 times).
3103
3108
3104 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3109 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3105 resolve output channel at call time, so that if sys.stderr has
3110 resolve output channel at call time, so that if sys.stderr has
3106 been redirected by user this gets honored.
3111 been redirected by user this gets honored.
3107
3112
3108 2002-06-13 Fernando Perez <fperez@colorado.edu>
3113 2002-06-13 Fernando Perez <fperez@colorado.edu>
3109
3114
3110 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3115 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3111 IPShell. Kept a copy with the old names to avoid breaking people's
3116 IPShell. Kept a copy with the old names to avoid breaking people's
3112 embedded code.
3117 embedded code.
3113
3118
3114 * IPython/ipython: simplified it to the bare minimum after
3119 * IPython/ipython: simplified it to the bare minimum after
3115 Holger's suggestions. Added info about how to use it in
3120 Holger's suggestions. Added info about how to use it in
3116 PYTHONSTARTUP.
3121 PYTHONSTARTUP.
3117
3122
3118 * IPython/Shell.py (IPythonShell): changed the options passing
3123 * IPython/Shell.py (IPythonShell): changed the options passing
3119 from a string with funky %s replacements to a straight list. Maybe
3124 from a string with funky %s replacements to a straight list. Maybe
3120 a bit more typing, but it follows sys.argv conventions, so there's
3125 a bit more typing, but it follows sys.argv conventions, so there's
3121 less special-casing to remember.
3126 less special-casing to remember.
3122
3127
3123 2002-06-12 Fernando Perez <fperez@colorado.edu>
3128 2002-06-12 Fernando Perez <fperez@colorado.edu>
3124
3129
3125 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3130 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3126 command. Thanks to a suggestion by Mike Heeter.
3131 command. Thanks to a suggestion by Mike Heeter.
3127 (Magic.magic_pfile): added behavior to look at filenames if given
3132 (Magic.magic_pfile): added behavior to look at filenames if given
3128 arg is not a defined object.
3133 arg is not a defined object.
3129 (Magic.magic_save): New @save function to save code snippets. Also
3134 (Magic.magic_save): New @save function to save code snippets. Also
3130 a Mike Heeter idea.
3135 a Mike Heeter idea.
3131
3136
3132 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3137 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3133 plot() and replot(). Much more convenient now, especially for
3138 plot() and replot(). Much more convenient now, especially for
3134 interactive use.
3139 interactive use.
3135
3140
3136 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3141 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3137 filenames.
3142 filenames.
3138
3143
3139 2002-06-02 Fernando Perez <fperez@colorado.edu>
3144 2002-06-02 Fernando Perez <fperez@colorado.edu>
3140
3145
3141 * IPython/Struct.py (Struct.__init__): modified to admit
3146 * IPython/Struct.py (Struct.__init__): modified to admit
3142 initialization via another struct.
3147 initialization via another struct.
3143
3148
3144 * IPython/genutils.py (SystemExec.__init__): New stateful
3149 * IPython/genutils.py (SystemExec.__init__): New stateful
3145 interface to xsys and bq. Useful for writing system scripts.
3150 interface to xsys and bq. Useful for writing system scripts.
3146
3151
3147 2002-05-30 Fernando Perez <fperez@colorado.edu>
3152 2002-05-30 Fernando Perez <fperez@colorado.edu>
3148
3153
3149 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3154 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3150 documents. This will make the user download smaller (it's getting
3155 documents. This will make the user download smaller (it's getting
3151 too big).
3156 too big).
3152
3157
3153 2002-05-29 Fernando Perez <fperez@colorado.edu>
3158 2002-05-29 Fernando Perez <fperez@colorado.edu>
3154
3159
3155 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3160 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3156 fix problems with shelve and pickle. Seems to work, but I don't
3161 fix problems with shelve and pickle. Seems to work, but I don't
3157 know if corner cases break it. Thanks to Mike Heeter
3162 know if corner cases break it. Thanks to Mike Heeter
3158 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3163 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3159
3164
3160 2002-05-24 Fernando Perez <fperez@colorado.edu>
3165 2002-05-24 Fernando Perez <fperez@colorado.edu>
3161
3166
3162 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3167 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3163 macros having broken.
3168 macros having broken.
3164
3169
3165 2002-05-21 Fernando Perez <fperez@colorado.edu>
3170 2002-05-21 Fernando Perez <fperez@colorado.edu>
3166
3171
3167 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3172 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3168 introduced logging bug: all history before logging started was
3173 introduced logging bug: all history before logging started was
3169 being written one character per line! This came from the redesign
3174 being written one character per line! This came from the redesign
3170 of the input history as a special list which slices to strings,
3175 of the input history as a special list which slices to strings,
3171 not to lists.
3176 not to lists.
3172
3177
3173 2002-05-20 Fernando Perez <fperez@colorado.edu>
3178 2002-05-20 Fernando Perez <fperez@colorado.edu>
3174
3179
3175 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3180 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3176 be an attribute of all classes in this module. The design of these
3181 be an attribute of all classes in this module. The design of these
3177 classes needs some serious overhauling.
3182 classes needs some serious overhauling.
3178
3183
3179 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3184 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3180 which was ignoring '_' in option names.
3185 which was ignoring '_' in option names.
3181
3186
3182 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3187 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3183 'Verbose_novars' to 'Context' and made it the new default. It's a
3188 'Verbose_novars' to 'Context' and made it the new default. It's a
3184 bit more readable and also safer than verbose.
3189 bit more readable and also safer than verbose.
3185
3190
3186 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3191 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3187 triple-quoted strings.
3192 triple-quoted strings.
3188
3193
3189 * IPython/OInspect.py (__all__): new module exposing the object
3194 * IPython/OInspect.py (__all__): new module exposing the object
3190 introspection facilities. Now the corresponding magics are dummy
3195 introspection facilities. Now the corresponding magics are dummy
3191 wrappers around this. Having this module will make it much easier
3196 wrappers around this. Having this module will make it much easier
3192 to put these functions into our modified pdb.
3197 to put these functions into our modified pdb.
3193 This new object inspector system uses the new colorizing module,
3198 This new object inspector system uses the new colorizing module,
3194 so source code and other things are nicely syntax highlighted.
3199 so source code and other things are nicely syntax highlighted.
3195
3200
3196 2002-05-18 Fernando Perez <fperez@colorado.edu>
3201 2002-05-18 Fernando Perez <fperez@colorado.edu>
3197
3202
3198 * IPython/ColorANSI.py: Split the coloring tools into a separate
3203 * IPython/ColorANSI.py: Split the coloring tools into a separate
3199 module so I can use them in other code easier (they were part of
3204 module so I can use them in other code easier (they were part of
3200 ultraTB).
3205 ultraTB).
3201
3206
3202 2002-05-17 Fernando Perez <fperez@colorado.edu>
3207 2002-05-17 Fernando Perez <fperez@colorado.edu>
3203
3208
3204 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3209 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3205 fixed it to set the global 'g' also to the called instance, as
3210 fixed it to set the global 'g' also to the called instance, as
3206 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3211 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3207 user's 'g' variables).
3212 user's 'g' variables).
3208
3213
3209 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3214 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3210 global variables (aliases to _ih,_oh) so that users which expect
3215 global variables (aliases to _ih,_oh) so that users which expect
3211 In[5] or Out[7] to work aren't unpleasantly surprised.
3216 In[5] or Out[7] to work aren't unpleasantly surprised.
3212 (InputList.__getslice__): new class to allow executing slices of
3217 (InputList.__getslice__): new class to allow executing slices of
3213 input history directly. Very simple class, complements the use of
3218 input history directly. Very simple class, complements the use of
3214 macros.
3219 macros.
3215
3220
3216 2002-05-16 Fernando Perez <fperez@colorado.edu>
3221 2002-05-16 Fernando Perez <fperez@colorado.edu>
3217
3222
3218 * setup.py (docdirbase): make doc directory be just doc/IPython
3223 * setup.py (docdirbase): make doc directory be just doc/IPython
3219 without version numbers, it will reduce clutter for users.
3224 without version numbers, it will reduce clutter for users.
3220
3225
3221 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3226 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3222 execfile call to prevent possible memory leak. See for details:
3227 execfile call to prevent possible memory leak. See for details:
3223 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3228 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3224
3229
3225 2002-05-15 Fernando Perez <fperez@colorado.edu>
3230 2002-05-15 Fernando Perez <fperez@colorado.edu>
3226
3231
3227 * IPython/Magic.py (Magic.magic_psource): made the object
3232 * IPython/Magic.py (Magic.magic_psource): made the object
3228 introspection names be more standard: pdoc, pdef, pfile and
3233 introspection names be more standard: pdoc, pdef, pfile and
3229 psource. They all print/page their output, and it makes
3234 psource. They all print/page their output, and it makes
3230 remembering them easier. Kept old names for compatibility as
3235 remembering them easier. Kept old names for compatibility as
3231 aliases.
3236 aliases.
3232
3237
3233 2002-05-14 Fernando Perez <fperez@colorado.edu>
3238 2002-05-14 Fernando Perez <fperez@colorado.edu>
3234
3239
3235 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3240 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3236 what the mouse problem was. The trick is to use gnuplot with temp
3241 what the mouse problem was. The trick is to use gnuplot with temp
3237 files and NOT with pipes (for data communication), because having
3242 files and NOT with pipes (for data communication), because having
3238 both pipes and the mouse on is bad news.
3243 both pipes and the mouse on is bad news.
3239
3244
3240 2002-05-13 Fernando Perez <fperez@colorado.edu>
3245 2002-05-13 Fernando Perez <fperez@colorado.edu>
3241
3246
3242 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3247 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3243 bug. Information would be reported about builtins even when
3248 bug. Information would be reported about builtins even when
3244 user-defined functions overrode them.
3249 user-defined functions overrode them.
3245
3250
3246 2002-05-11 Fernando Perez <fperez@colorado.edu>
3251 2002-05-11 Fernando Perez <fperez@colorado.edu>
3247
3252
3248 * IPython/__init__.py (__all__): removed FlexCompleter from
3253 * IPython/__init__.py (__all__): removed FlexCompleter from
3249 __all__ so that things don't fail in platforms without readline.
3254 __all__ so that things don't fail in platforms without readline.
3250
3255
3251 2002-05-10 Fernando Perez <fperez@colorado.edu>
3256 2002-05-10 Fernando Perez <fperez@colorado.edu>
3252
3257
3253 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3258 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3254 it requires Numeric, effectively making Numeric a dependency for
3259 it requires Numeric, effectively making Numeric a dependency for
3255 IPython.
3260 IPython.
3256
3261
3257 * Released 0.2.13
3262 * Released 0.2.13
3258
3263
3259 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3264 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3260 profiler interface. Now all the major options from the profiler
3265 profiler interface. Now all the major options from the profiler
3261 module are directly supported in IPython, both for single
3266 module are directly supported in IPython, both for single
3262 expressions (@prun) and for full programs (@run -p).
3267 expressions (@prun) and for full programs (@run -p).
3263
3268
3264 2002-05-09 Fernando Perez <fperez@colorado.edu>
3269 2002-05-09 Fernando Perez <fperez@colorado.edu>
3265
3270
3266 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3271 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3267 magic properly formatted for screen.
3272 magic properly formatted for screen.
3268
3273
3269 * setup.py (make_shortcut): Changed things to put pdf version in
3274 * setup.py (make_shortcut): Changed things to put pdf version in
3270 doc/ instead of doc/manual (had to change lyxport a bit).
3275 doc/ instead of doc/manual (had to change lyxport a bit).
3271
3276
3272 * IPython/Magic.py (Profile.string_stats): made profile runs go
3277 * IPython/Magic.py (Profile.string_stats): made profile runs go
3273 through pager (they are long and a pager allows searching, saving,
3278 through pager (they are long and a pager allows searching, saving,
3274 etc.)
3279 etc.)
3275
3280
3276 2002-05-08 Fernando Perez <fperez@colorado.edu>
3281 2002-05-08 Fernando Perez <fperez@colorado.edu>
3277
3282
3278 * Released 0.2.12
3283 * Released 0.2.12
3279
3284
3280 2002-05-06 Fernando Perez <fperez@colorado.edu>
3285 2002-05-06 Fernando Perez <fperez@colorado.edu>
3281
3286
3282 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3287 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3283 introduced); 'hist n1 n2' was broken.
3288 introduced); 'hist n1 n2' was broken.
3284 (Magic.magic_pdb): added optional on/off arguments to @pdb
3289 (Magic.magic_pdb): added optional on/off arguments to @pdb
3285 (Magic.magic_run): added option -i to @run, which executes code in
3290 (Magic.magic_run): added option -i to @run, which executes code in
3286 the IPython namespace instead of a clean one. Also added @irun as
3291 the IPython namespace instead of a clean one. Also added @irun as
3287 an alias to @run -i.
3292 an alias to @run -i.
3288
3293
3289 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3294 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3290 fixed (it didn't really do anything, the namespaces were wrong).
3295 fixed (it didn't really do anything, the namespaces were wrong).
3291
3296
3292 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3297 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3293
3298
3294 * IPython/__init__.py (__all__): Fixed package namespace, now
3299 * IPython/__init__.py (__all__): Fixed package namespace, now
3295 'import IPython' does give access to IPython.<all> as
3300 'import IPython' does give access to IPython.<all> as
3296 expected. Also renamed __release__ to Release.
3301 expected. Also renamed __release__ to Release.
3297
3302
3298 * IPython/Debugger.py (__license__): created new Pdb class which
3303 * IPython/Debugger.py (__license__): created new Pdb class which
3299 functions like a drop-in for the normal pdb.Pdb but does NOT
3304 functions like a drop-in for the normal pdb.Pdb but does NOT
3300 import readline by default. This way it doesn't muck up IPython's
3305 import readline by default. This way it doesn't muck up IPython's
3301 readline handling, and now tab-completion finally works in the
3306 readline handling, and now tab-completion finally works in the
3302 debugger -- sort of. It completes things globally visible, but the
3307 debugger -- sort of. It completes things globally visible, but the
3303 completer doesn't track the stack as pdb walks it. That's a bit
3308 completer doesn't track the stack as pdb walks it. That's a bit
3304 tricky, and I'll have to implement it later.
3309 tricky, and I'll have to implement it later.
3305
3310
3306 2002-05-05 Fernando Perez <fperez@colorado.edu>
3311 2002-05-05 Fernando Perez <fperez@colorado.edu>
3307
3312
3308 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3313 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3309 magic docstrings when printed via ? (explicit \'s were being
3314 magic docstrings when printed via ? (explicit \'s were being
3310 printed).
3315 printed).
3311
3316
3312 * IPython/ipmaker.py (make_IPython): fixed namespace
3317 * IPython/ipmaker.py (make_IPython): fixed namespace
3313 identification bug. Now variables loaded via logs or command-line
3318 identification bug. Now variables loaded via logs or command-line
3314 files are recognized in the interactive namespace by @who.
3319 files are recognized in the interactive namespace by @who.
3315
3320
3316 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3321 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3317 log replay system stemming from the string form of Structs.
3322 log replay system stemming from the string form of Structs.
3318
3323
3319 * IPython/Magic.py (Macro.__init__): improved macros to properly
3324 * IPython/Magic.py (Macro.__init__): improved macros to properly
3320 handle magic commands in them.
3325 handle magic commands in them.
3321 (Magic.magic_logstart): usernames are now expanded so 'logstart
3326 (Magic.magic_logstart): usernames are now expanded so 'logstart
3322 ~/mylog' now works.
3327 ~/mylog' now works.
3323
3328
3324 * IPython/iplib.py (complete): fixed bug where paths starting with
3329 * IPython/iplib.py (complete): fixed bug where paths starting with
3325 '/' would be completed as magic names.
3330 '/' would be completed as magic names.
3326
3331
3327 2002-05-04 Fernando Perez <fperez@colorado.edu>
3332 2002-05-04 Fernando Perez <fperez@colorado.edu>
3328
3333
3329 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3334 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3330 allow running full programs under the profiler's control.
3335 allow running full programs under the profiler's control.
3331
3336
3332 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3337 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3333 mode to report exceptions verbosely but without formatting
3338 mode to report exceptions verbosely but without formatting
3334 variables. This addresses the issue of ipython 'freezing' (it's
3339 variables. This addresses the issue of ipython 'freezing' (it's
3335 not frozen, but caught in an expensive formatting loop) when huge
3340 not frozen, but caught in an expensive formatting loop) when huge
3336 variables are in the context of an exception.
3341 variables are in the context of an exception.
3337 (VerboseTB.text): Added '--->' markers at line where exception was
3342 (VerboseTB.text): Added '--->' markers at line where exception was
3338 triggered. Much clearer to read, especially in NoColor modes.
3343 triggered. Much clearer to read, especially in NoColor modes.
3339
3344
3340 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3345 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3341 implemented in reverse when changing to the new parse_options().
3346 implemented in reverse when changing to the new parse_options().
3342
3347
3343 2002-05-03 Fernando Perez <fperez@colorado.edu>
3348 2002-05-03 Fernando Perez <fperez@colorado.edu>
3344
3349
3345 * IPython/Magic.py (Magic.parse_options): new function so that
3350 * IPython/Magic.py (Magic.parse_options): new function so that
3346 magics can parse options easier.
3351 magics can parse options easier.
3347 (Magic.magic_prun): new function similar to profile.run(),
3352 (Magic.magic_prun): new function similar to profile.run(),
3348 suggested by Chris Hart.
3353 suggested by Chris Hart.
3349 (Magic.magic_cd): fixed behavior so that it only changes if
3354 (Magic.magic_cd): fixed behavior so that it only changes if
3350 directory actually is in history.
3355 directory actually is in history.
3351
3356
3352 * IPython/usage.py (__doc__): added information about potential
3357 * IPython/usage.py (__doc__): added information about potential
3353 slowness of Verbose exception mode when there are huge data
3358 slowness of Verbose exception mode when there are huge data
3354 structures to be formatted (thanks to Archie Paulson).
3359 structures to be formatted (thanks to Archie Paulson).
3355
3360
3356 * IPython/ipmaker.py (make_IPython): Changed default logging
3361 * IPython/ipmaker.py (make_IPython): Changed default logging
3357 (when simply called with -log) to use curr_dir/ipython.log in
3362 (when simply called with -log) to use curr_dir/ipython.log in
3358 rotate mode. Fixed crash which was occuring with -log before
3363 rotate mode. Fixed crash which was occuring with -log before
3359 (thanks to Jim Boyle).
3364 (thanks to Jim Boyle).
3360
3365
3361 2002-05-01 Fernando Perez <fperez@colorado.edu>
3366 2002-05-01 Fernando Perez <fperez@colorado.edu>
3362
3367
3363 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3368 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3364 was nasty -- though somewhat of a corner case).
3369 was nasty -- though somewhat of a corner case).
3365
3370
3366 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3371 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3367 text (was a bug).
3372 text (was a bug).
3368
3373
3369 2002-04-30 Fernando Perez <fperez@colorado.edu>
3374 2002-04-30 Fernando Perez <fperez@colorado.edu>
3370
3375
3371 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3376 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3372 a print after ^D or ^C from the user so that the In[] prompt
3377 a print after ^D or ^C from the user so that the In[] prompt
3373 doesn't over-run the gnuplot one.
3378 doesn't over-run the gnuplot one.
3374
3379
3375 2002-04-29 Fernando Perez <fperez@colorado.edu>
3380 2002-04-29 Fernando Perez <fperez@colorado.edu>
3376
3381
3377 * Released 0.2.10
3382 * Released 0.2.10
3378
3383
3379 * IPython/__release__.py (version): get date dynamically.
3384 * IPython/__release__.py (version): get date dynamically.
3380
3385
3381 * Misc. documentation updates thanks to Arnd's comments. Also ran
3386 * Misc. documentation updates thanks to Arnd's comments. Also ran
3382 a full spellcheck on the manual (hadn't been done in a while).
3387 a full spellcheck on the manual (hadn't been done in a while).
3383
3388
3384 2002-04-27 Fernando Perez <fperez@colorado.edu>
3389 2002-04-27 Fernando Perez <fperez@colorado.edu>
3385
3390
3386 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3391 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3387 starting a log in mid-session would reset the input history list.
3392 starting a log in mid-session would reset the input history list.
3388
3393
3389 2002-04-26 Fernando Perez <fperez@colorado.edu>
3394 2002-04-26 Fernando Perez <fperez@colorado.edu>
3390
3395
3391 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3396 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3392 all files were being included in an update. Now anything in
3397 all files were being included in an update. Now anything in
3393 UserConfig that matches [A-Za-z]*.py will go (this excludes
3398 UserConfig that matches [A-Za-z]*.py will go (this excludes
3394 __init__.py)
3399 __init__.py)
3395
3400
3396 2002-04-25 Fernando Perez <fperez@colorado.edu>
3401 2002-04-25 Fernando Perez <fperez@colorado.edu>
3397
3402
3398 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3403 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3399 to __builtins__ so that any form of embedded or imported code can
3404 to __builtins__ so that any form of embedded or imported code can
3400 test for being inside IPython.
3405 test for being inside IPython.
3401
3406
3402 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3407 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3403 changed to GnuplotMagic because it's now an importable module,
3408 changed to GnuplotMagic because it's now an importable module,
3404 this makes the name follow that of the standard Gnuplot module.
3409 this makes the name follow that of the standard Gnuplot module.
3405 GnuplotMagic can now be loaded at any time in mid-session.
3410 GnuplotMagic can now be loaded at any time in mid-session.
3406
3411
3407 2002-04-24 Fernando Perez <fperez@colorado.edu>
3412 2002-04-24 Fernando Perez <fperez@colorado.edu>
3408
3413
3409 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3414 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3410 the globals (IPython has its own namespace) and the
3415 the globals (IPython has its own namespace) and the
3411 PhysicalQuantity stuff is much better anyway.
3416 PhysicalQuantity stuff is much better anyway.
3412
3417
3413 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3418 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3414 embedding example to standard user directory for
3419 embedding example to standard user directory for
3415 distribution. Also put it in the manual.
3420 distribution. Also put it in the manual.
3416
3421
3417 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3422 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3418 instance as first argument (so it doesn't rely on some obscure
3423 instance as first argument (so it doesn't rely on some obscure
3419 hidden global).
3424 hidden global).
3420
3425
3421 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3426 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3422 delimiters. While it prevents ().TAB from working, it allows
3427 delimiters. While it prevents ().TAB from working, it allows
3423 completions in open (... expressions. This is by far a more common
3428 completions in open (... expressions. This is by far a more common
3424 case.
3429 case.
3425
3430
3426 2002-04-23 Fernando Perez <fperez@colorado.edu>
3431 2002-04-23 Fernando Perez <fperez@colorado.edu>
3427
3432
3428 * IPython/Extensions/InterpreterPasteInput.py: new
3433 * IPython/Extensions/InterpreterPasteInput.py: new
3429 syntax-processing module for pasting lines with >>> or ... at the
3434 syntax-processing module for pasting lines with >>> or ... at the
3430 start.
3435 start.
3431
3436
3432 * IPython/Extensions/PhysicalQ_Interactive.py
3437 * IPython/Extensions/PhysicalQ_Interactive.py
3433 (PhysicalQuantityInteractive.__int__): fixed to work with either
3438 (PhysicalQuantityInteractive.__int__): fixed to work with either
3434 Numeric or math.
3439 Numeric or math.
3435
3440
3436 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3441 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3437 provided profiles. Now we have:
3442 provided profiles. Now we have:
3438 -math -> math module as * and cmath with its own namespace.
3443 -math -> math module as * and cmath with its own namespace.
3439 -numeric -> Numeric as *, plus gnuplot & grace
3444 -numeric -> Numeric as *, plus gnuplot & grace
3440 -physics -> same as before
3445 -physics -> same as before
3441
3446
3442 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3447 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3443 user-defined magics wouldn't be found by @magic if they were
3448 user-defined magics wouldn't be found by @magic if they were
3444 defined as class methods. Also cleaned up the namespace search
3449 defined as class methods. Also cleaned up the namespace search
3445 logic and the string building (to use %s instead of many repeated
3450 logic and the string building (to use %s instead of many repeated
3446 string adds).
3451 string adds).
3447
3452
3448 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3453 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3449 of user-defined magics to operate with class methods (cleaner, in
3454 of user-defined magics to operate with class methods (cleaner, in
3450 line with the gnuplot code).
3455 line with the gnuplot code).
3451
3456
3452 2002-04-22 Fernando Perez <fperez@colorado.edu>
3457 2002-04-22 Fernando Perez <fperez@colorado.edu>
3453
3458
3454 * setup.py: updated dependency list so that manual is updated when
3459 * setup.py: updated dependency list so that manual is updated when
3455 all included files change.
3460 all included files change.
3456
3461
3457 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3462 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3458 the delimiter removal option (the fix is ugly right now).
3463 the delimiter removal option (the fix is ugly right now).
3459
3464
3460 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3465 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3461 all of the math profile (quicker loading, no conflict between
3466 all of the math profile (quicker loading, no conflict between
3462 g-9.8 and g-gnuplot).
3467 g-9.8 and g-gnuplot).
3463
3468
3464 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3469 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3465 name of post-mortem files to IPython_crash_report.txt.
3470 name of post-mortem files to IPython_crash_report.txt.
3466
3471
3467 * Cleanup/update of the docs. Added all the new readline info and
3472 * Cleanup/update of the docs. Added all the new readline info and
3468 formatted all lists as 'real lists'.
3473 formatted all lists as 'real lists'.
3469
3474
3470 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3475 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3471 tab-completion options, since the full readline parse_and_bind is
3476 tab-completion options, since the full readline parse_and_bind is
3472 now accessible.
3477 now accessible.
3473
3478
3474 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3479 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3475 handling of readline options. Now users can specify any string to
3480 handling of readline options. Now users can specify any string to
3476 be passed to parse_and_bind(), as well as the delimiters to be
3481 be passed to parse_and_bind(), as well as the delimiters to be
3477 removed.
3482 removed.
3478 (InteractiveShell.__init__): Added __name__ to the global
3483 (InteractiveShell.__init__): Added __name__ to the global
3479 namespace so that things like Itpl which rely on its existence
3484 namespace so that things like Itpl which rely on its existence
3480 don't crash.
3485 don't crash.
3481 (InteractiveShell._prefilter): Defined the default with a _ so
3486 (InteractiveShell._prefilter): Defined the default with a _ so
3482 that prefilter() is easier to override, while the default one
3487 that prefilter() is easier to override, while the default one
3483 remains available.
3488 remains available.
3484
3489
3485 2002-04-18 Fernando Perez <fperez@colorado.edu>
3490 2002-04-18 Fernando Perez <fperez@colorado.edu>
3486
3491
3487 * Added information about pdb in the docs.
3492 * Added information about pdb in the docs.
3488
3493
3489 2002-04-17 Fernando Perez <fperez@colorado.edu>
3494 2002-04-17 Fernando Perez <fperez@colorado.edu>
3490
3495
3491 * IPython/ipmaker.py (make_IPython): added rc_override option to
3496 * IPython/ipmaker.py (make_IPython): added rc_override option to
3492 allow passing config options at creation time which may override
3497 allow passing config options at creation time which may override
3493 anything set in the config files or command line. This is
3498 anything set in the config files or command line. This is
3494 particularly useful for configuring embedded instances.
3499 particularly useful for configuring embedded instances.
3495
3500
3496 2002-04-15 Fernando Perez <fperez@colorado.edu>
3501 2002-04-15 Fernando Perez <fperez@colorado.edu>
3497
3502
3498 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3503 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3499 crash embedded instances because of the input cache falling out of
3504 crash embedded instances because of the input cache falling out of
3500 sync with the output counter.
3505 sync with the output counter.
3501
3506
3502 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3507 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3503 mode which calls pdb after an uncaught exception in IPython itself.
3508 mode which calls pdb after an uncaught exception in IPython itself.
3504
3509
3505 2002-04-14 Fernando Perez <fperez@colorado.edu>
3510 2002-04-14 Fernando Perez <fperez@colorado.edu>
3506
3511
3507 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3512 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3508 readline, fix it back after each call.
3513 readline, fix it back after each call.
3509
3514
3510 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3515 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3511 method to force all access via __call__(), which guarantees that
3516 method to force all access via __call__(), which guarantees that
3512 traceback references are properly deleted.
3517 traceback references are properly deleted.
3513
3518
3514 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3519 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3515 improve printing when pprint is in use.
3520 improve printing when pprint is in use.
3516
3521
3517 2002-04-13 Fernando Perez <fperez@colorado.edu>
3522 2002-04-13 Fernando Perez <fperez@colorado.edu>
3518
3523
3519 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3524 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3520 exceptions aren't caught anymore. If the user triggers one, he
3525 exceptions aren't caught anymore. If the user triggers one, he
3521 should know why he's doing it and it should go all the way up,
3526 should know why he's doing it and it should go all the way up,
3522 just like any other exception. So now @abort will fully kill the
3527 just like any other exception. So now @abort will fully kill the
3523 embedded interpreter and the embedding code (unless that happens
3528 embedded interpreter and the embedding code (unless that happens
3524 to catch SystemExit).
3529 to catch SystemExit).
3525
3530
3526 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
3531 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
3527 and a debugger() method to invoke the interactive pdb debugger
3532 and a debugger() method to invoke the interactive pdb debugger
3528 after printing exception information. Also added the corresponding
3533 after printing exception information. Also added the corresponding
3529 -pdb option and @pdb magic to control this feature, and updated
3534 -pdb option and @pdb magic to control this feature, and updated
3530 the docs. After a suggestion from Christopher Hart
3535 the docs. After a suggestion from Christopher Hart
3531 (hart-AT-caltech.edu).
3536 (hart-AT-caltech.edu).
3532
3537
3533 2002-04-12 Fernando Perez <fperez@colorado.edu>
3538 2002-04-12 Fernando Perez <fperez@colorado.edu>
3534
3539
3535 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
3540 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
3536 the exception handlers defined by the user (not the CrashHandler)
3541 the exception handlers defined by the user (not the CrashHandler)
3537 so that user exceptions don't trigger an ipython bug report.
3542 so that user exceptions don't trigger an ipython bug report.
3538
3543
3539 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
3544 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
3540 configurable (it should have always been so).
3545 configurable (it should have always been so).
3541
3546
3542 2002-03-26 Fernando Perez <fperez@colorado.edu>
3547 2002-03-26 Fernando Perez <fperez@colorado.edu>
3543
3548
3544 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
3549 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
3545 and there to fix embedding namespace issues. This should all be
3550 and there to fix embedding namespace issues. This should all be
3546 done in a more elegant way.
3551 done in a more elegant way.
3547
3552
3548 2002-03-25 Fernando Perez <fperez@colorado.edu>
3553 2002-03-25 Fernando Perez <fperez@colorado.edu>
3549
3554
3550 * IPython/genutils.py (get_home_dir): Try to make it work under
3555 * IPython/genutils.py (get_home_dir): Try to make it work under
3551 win9x also.
3556 win9x also.
3552
3557
3553 2002-03-20 Fernando Perez <fperez@colorado.edu>
3558 2002-03-20 Fernando Perez <fperez@colorado.edu>
3554
3559
3555 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
3560 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
3556 sys.displayhook untouched upon __init__.
3561 sys.displayhook untouched upon __init__.
3557
3562
3558 2002-03-19 Fernando Perez <fperez@colorado.edu>
3563 2002-03-19 Fernando Perez <fperez@colorado.edu>
3559
3564
3560 * Released 0.2.9 (for embedding bug, basically).
3565 * Released 0.2.9 (for embedding bug, basically).
3561
3566
3562 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
3567 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
3563 exceptions so that enclosing shell's state can be restored.
3568 exceptions so that enclosing shell's state can be restored.
3564
3569
3565 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
3570 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
3566 naming conventions in the .ipython/ dir.
3571 naming conventions in the .ipython/ dir.
3567
3572
3568 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
3573 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
3569 from delimiters list so filenames with - in them get expanded.
3574 from delimiters list so filenames with - in them get expanded.
3570
3575
3571 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
3576 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
3572 sys.displayhook not being properly restored after an embedded call.
3577 sys.displayhook not being properly restored after an embedded call.
3573
3578
3574 2002-03-18 Fernando Perez <fperez@colorado.edu>
3579 2002-03-18 Fernando Perez <fperez@colorado.edu>
3575
3580
3576 * Released 0.2.8
3581 * Released 0.2.8
3577
3582
3578 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
3583 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
3579 some files weren't being included in a -upgrade.
3584 some files weren't being included in a -upgrade.
3580 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
3585 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
3581 on' so that the first tab completes.
3586 on' so that the first tab completes.
3582 (InteractiveShell.handle_magic): fixed bug with spaces around
3587 (InteractiveShell.handle_magic): fixed bug with spaces around
3583 quotes breaking many magic commands.
3588 quotes breaking many magic commands.
3584
3589
3585 * setup.py: added note about ignoring the syntax error messages at
3590 * setup.py: added note about ignoring the syntax error messages at
3586 installation.
3591 installation.
3587
3592
3588 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
3593 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
3589 streamlining the gnuplot interface, now there's only one magic @gp.
3594 streamlining the gnuplot interface, now there's only one magic @gp.
3590
3595
3591 2002-03-17 Fernando Perez <fperez@colorado.edu>
3596 2002-03-17 Fernando Perez <fperez@colorado.edu>
3592
3597
3593 * IPython/UserConfig/magic_gnuplot.py: new name for the
3598 * IPython/UserConfig/magic_gnuplot.py: new name for the
3594 example-magic_pm.py file. Much enhanced system, now with a shell
3599 example-magic_pm.py file. Much enhanced system, now with a shell
3595 for communicating directly with gnuplot, one command at a time.
3600 for communicating directly with gnuplot, one command at a time.
3596
3601
3597 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
3602 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
3598 setting __name__=='__main__'.
3603 setting __name__=='__main__'.
3599
3604
3600 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
3605 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
3601 mini-shell for accessing gnuplot from inside ipython. Should
3606 mini-shell for accessing gnuplot from inside ipython. Should
3602 extend it later for grace access too. Inspired by Arnd's
3607 extend it later for grace access too. Inspired by Arnd's
3603 suggestion.
3608 suggestion.
3604
3609
3605 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
3610 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
3606 calling magic functions with () in their arguments. Thanks to Arnd
3611 calling magic functions with () in their arguments. Thanks to Arnd
3607 Baecker for pointing this to me.
3612 Baecker for pointing this to me.
3608
3613
3609 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
3614 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
3610 infinitely for integer or complex arrays (only worked with floats).
3615 infinitely for integer or complex arrays (only worked with floats).
3611
3616
3612 2002-03-16 Fernando Perez <fperez@colorado.edu>
3617 2002-03-16 Fernando Perez <fperez@colorado.edu>
3613
3618
3614 * setup.py: Merged setup and setup_windows into a single script
3619 * setup.py: Merged setup and setup_windows into a single script
3615 which properly handles things for windows users.
3620 which properly handles things for windows users.
3616
3621
3617 2002-03-15 Fernando Perez <fperez@colorado.edu>
3622 2002-03-15 Fernando Perez <fperez@colorado.edu>
3618
3623
3619 * Big change to the manual: now the magics are all automatically
3624 * Big change to the manual: now the magics are all automatically
3620 documented. This information is generated from their docstrings
3625 documented. This information is generated from their docstrings
3621 and put in a latex file included by the manual lyx file. This way
3626 and put in a latex file included by the manual lyx file. This way
3622 we get always up to date information for the magics. The manual
3627 we get always up to date information for the magics. The manual
3623 now also has proper version information, also auto-synced.
3628 now also has proper version information, also auto-synced.
3624
3629
3625 For this to work, an undocumented --magic_docstrings option was added.
3630 For this to work, an undocumented --magic_docstrings option was added.
3626
3631
3627 2002-03-13 Fernando Perez <fperez@colorado.edu>
3632 2002-03-13 Fernando Perez <fperez@colorado.edu>
3628
3633
3629 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
3634 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
3630 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
3635 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
3631
3636
3632 2002-03-12 Fernando Perez <fperez@colorado.edu>
3637 2002-03-12 Fernando Perez <fperez@colorado.edu>
3633
3638
3634 * IPython/ultraTB.py (TermColors): changed color escapes again to
3639 * IPython/ultraTB.py (TermColors): changed color escapes again to
3635 fix the (old, reintroduced) line-wrapping bug. Basically, if
3640 fix the (old, reintroduced) line-wrapping bug. Basically, if
3636 \001..\002 aren't given in the color escapes, lines get wrapped
3641 \001..\002 aren't given in the color escapes, lines get wrapped
3637 weirdly. But giving those screws up old xterms and emacs terms. So
3642 weirdly. But giving those screws up old xterms and emacs terms. So
3638 I added some logic for emacs terms to be ok, but I can't identify old
3643 I added some logic for emacs terms to be ok, but I can't identify old
3639 xterms separately ($TERM=='xterm' for many terminals, like konsole).
3644 xterms separately ($TERM=='xterm' for many terminals, like konsole).
3640
3645
3641 2002-03-10 Fernando Perez <fperez@colorado.edu>
3646 2002-03-10 Fernando Perez <fperez@colorado.edu>
3642
3647
3643 * IPython/usage.py (__doc__): Various documentation cleanups and
3648 * IPython/usage.py (__doc__): Various documentation cleanups and
3644 updates, both in usage docstrings and in the manual.
3649 updates, both in usage docstrings and in the manual.
3645
3650
3646 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
3651 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
3647 handling of caching. Set minimum acceptabe value for having a
3652 handling of caching. Set minimum acceptabe value for having a
3648 cache at 20 values.
3653 cache at 20 values.
3649
3654
3650 * IPython/iplib.py (InteractiveShell.user_setup): moved the
3655 * IPython/iplib.py (InteractiveShell.user_setup): moved the
3651 install_first_time function to a method, renamed it and added an
3656 install_first_time function to a method, renamed it and added an
3652 'upgrade' mode. Now people can update their config directory with
3657 'upgrade' mode. Now people can update their config directory with
3653 a simple command line switch (-upgrade, also new).
3658 a simple command line switch (-upgrade, also new).
3654
3659
3655 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
3660 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
3656 @file (convenient for automagic users under Python >= 2.2).
3661 @file (convenient for automagic users under Python >= 2.2).
3657 Removed @files (it seemed more like a plural than an abbrev. of
3662 Removed @files (it seemed more like a plural than an abbrev. of
3658 'file show').
3663 'file show').
3659
3664
3660 * IPython/iplib.py (install_first_time): Fixed crash if there were
3665 * IPython/iplib.py (install_first_time): Fixed crash if there were
3661 backup files ('~') in .ipython/ install directory.
3666 backup files ('~') in .ipython/ install directory.
3662
3667
3663 * IPython/ipmaker.py (make_IPython): fixes for new prompt
3668 * IPython/ipmaker.py (make_IPython): fixes for new prompt
3664 system. Things look fine, but these changes are fairly
3669 system. Things look fine, but these changes are fairly
3665 intrusive. Test them for a few days.
3670 intrusive. Test them for a few days.
3666
3671
3667 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
3672 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
3668 the prompts system. Now all in/out prompt strings are user
3673 the prompts system. Now all in/out prompt strings are user
3669 controllable. This is particularly useful for embedding, as one
3674 controllable. This is particularly useful for embedding, as one
3670 can tag embedded instances with particular prompts.
3675 can tag embedded instances with particular prompts.
3671
3676
3672 Also removed global use of sys.ps1/2, which now allows nested
3677 Also removed global use of sys.ps1/2, which now allows nested
3673 embeddings without any problems. Added command-line options for
3678 embeddings without any problems. Added command-line options for
3674 the prompt strings.
3679 the prompt strings.
3675
3680
3676 2002-03-08 Fernando Perez <fperez@colorado.edu>
3681 2002-03-08 Fernando Perez <fperez@colorado.edu>
3677
3682
3678 * IPython/UserConfig/example-embed-short.py (ipshell): added
3683 * IPython/UserConfig/example-embed-short.py (ipshell): added
3679 example file with the bare minimum code for embedding.
3684 example file with the bare minimum code for embedding.
3680
3685
3681 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
3686 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
3682 functionality for the embeddable shell to be activated/deactivated
3687 functionality for the embeddable shell to be activated/deactivated
3683 either globally or at each call.
3688 either globally or at each call.
3684
3689
3685 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
3690 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
3686 rewriting the prompt with '--->' for auto-inputs with proper
3691 rewriting the prompt with '--->' for auto-inputs with proper
3687 coloring. Now the previous UGLY hack in handle_auto() is gone, and
3692 coloring. Now the previous UGLY hack in handle_auto() is gone, and
3688 this is handled by the prompts class itself, as it should.
3693 this is handled by the prompts class itself, as it should.
3689
3694
3690 2002-03-05 Fernando Perez <fperez@colorado.edu>
3695 2002-03-05 Fernando Perez <fperez@colorado.edu>
3691
3696
3692 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
3697 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
3693 @logstart to avoid name clashes with the math log function.
3698 @logstart to avoid name clashes with the math log function.
3694
3699
3695 * Big updates to X/Emacs section of the manual.
3700 * Big updates to X/Emacs section of the manual.
3696
3701
3697 * Removed ipython_emacs. Milan explained to me how to pass
3702 * Removed ipython_emacs. Milan explained to me how to pass
3698 arguments to ipython through Emacs. Some day I'm going to end up
3703 arguments to ipython through Emacs. Some day I'm going to end up
3699 learning some lisp...
3704 learning some lisp...
3700
3705
3701 2002-03-04 Fernando Perez <fperez@colorado.edu>
3706 2002-03-04 Fernando Perez <fperez@colorado.edu>
3702
3707
3703 * IPython/ipython_emacs: Created script to be used as the
3708 * IPython/ipython_emacs: Created script to be used as the
3704 py-python-command Emacs variable so we can pass IPython
3709 py-python-command Emacs variable so we can pass IPython
3705 parameters. I can't figure out how to tell Emacs directly to pass
3710 parameters. I can't figure out how to tell Emacs directly to pass
3706 parameters to IPython, so a dummy shell script will do it.
3711 parameters to IPython, so a dummy shell script will do it.
3707
3712
3708 Other enhancements made for things to work better under Emacs'
3713 Other enhancements made for things to work better under Emacs'
3709 various types of terminals. Many thanks to Milan Zamazal
3714 various types of terminals. Many thanks to Milan Zamazal
3710 <pdm-AT-zamazal.org> for all the suggestions and pointers.
3715 <pdm-AT-zamazal.org> for all the suggestions and pointers.
3711
3716
3712 2002-03-01 Fernando Perez <fperez@colorado.edu>
3717 2002-03-01 Fernando Perez <fperez@colorado.edu>
3713
3718
3714 * IPython/ipmaker.py (make_IPython): added a --readline! option so
3719 * IPython/ipmaker.py (make_IPython): added a --readline! option so
3715 that loading of readline is now optional. This gives better
3720 that loading of readline is now optional. This gives better
3716 control to emacs users.
3721 control to emacs users.
3717
3722
3718 * IPython/ultraTB.py (__date__): Modified color escape sequences
3723 * IPython/ultraTB.py (__date__): Modified color escape sequences
3719 and now things work fine under xterm and in Emacs' term buffers
3724 and now things work fine under xterm and in Emacs' term buffers
3720 (though not shell ones). Well, in emacs you get colors, but all
3725 (though not shell ones). Well, in emacs you get colors, but all
3721 seem to be 'light' colors (no difference between dark and light
3726 seem to be 'light' colors (no difference between dark and light
3722 ones). But the garbage chars are gone, and also in xterms. It
3727 ones). But the garbage chars are gone, and also in xterms. It
3723 seems that now I'm using 'cleaner' ansi sequences.
3728 seems that now I'm using 'cleaner' ansi sequences.
3724
3729
3725 2002-02-21 Fernando Perez <fperez@colorado.edu>
3730 2002-02-21 Fernando Perez <fperez@colorado.edu>
3726
3731
3727 * Released 0.2.7 (mainly to publish the scoping fix).
3732 * Released 0.2.7 (mainly to publish the scoping fix).
3728
3733
3729 * IPython/Logger.py (Logger.logstate): added. A corresponding
3734 * IPython/Logger.py (Logger.logstate): added. A corresponding
3730 @logstate magic was created.
3735 @logstate magic was created.
3731
3736
3732 * IPython/Magic.py: fixed nested scoping problem under Python
3737 * IPython/Magic.py: fixed nested scoping problem under Python
3733 2.1.x (automagic wasn't working).
3738 2.1.x (automagic wasn't working).
3734
3739
3735 2002-02-20 Fernando Perez <fperez@colorado.edu>
3740 2002-02-20 Fernando Perez <fperez@colorado.edu>
3736
3741
3737 * Released 0.2.6.
3742 * Released 0.2.6.
3738
3743
3739 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
3744 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
3740 option so that logs can come out without any headers at all.
3745 option so that logs can come out without any headers at all.
3741
3746
3742 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
3747 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
3743 SciPy.
3748 SciPy.
3744
3749
3745 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
3750 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
3746 that embedded IPython calls don't require vars() to be explicitly
3751 that embedded IPython calls don't require vars() to be explicitly
3747 passed. Now they are extracted from the caller's frame (code
3752 passed. Now they are extracted from the caller's frame (code
3748 snatched from Eric Jones' weave). Added better documentation to
3753 snatched from Eric Jones' weave). Added better documentation to
3749 the section on embedding and the example file.
3754 the section on embedding and the example file.
3750
3755
3751 * IPython/genutils.py (page): Changed so that under emacs, it just
3756 * IPython/genutils.py (page): Changed so that under emacs, it just
3752 prints the string. You can then page up and down in the emacs
3757 prints the string. You can then page up and down in the emacs
3753 buffer itself. This is how the builtin help() works.
3758 buffer itself. This is how the builtin help() works.
3754
3759
3755 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
3760 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
3756 macro scoping: macros need to be executed in the user's namespace
3761 macro scoping: macros need to be executed in the user's namespace
3757 to work as if they had been typed by the user.
3762 to work as if they had been typed by the user.
3758
3763
3759 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
3764 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
3760 execute automatically (no need to type 'exec...'). They then
3765 execute automatically (no need to type 'exec...'). They then
3761 behave like 'true macros'. The printing system was also modified
3766 behave like 'true macros'. The printing system was also modified
3762 for this to work.
3767 for this to work.
3763
3768
3764 2002-02-19 Fernando Perez <fperez@colorado.edu>
3769 2002-02-19 Fernando Perez <fperez@colorado.edu>
3765
3770
3766 * IPython/genutils.py (page_file): new function for paging files
3771 * IPython/genutils.py (page_file): new function for paging files
3767 in an OS-independent way. Also necessary for file viewing to work
3772 in an OS-independent way. Also necessary for file viewing to work
3768 well inside Emacs buffers.
3773 well inside Emacs buffers.
3769 (page): Added checks for being in an emacs buffer.
3774 (page): Added checks for being in an emacs buffer.
3770 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
3775 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
3771 same bug in iplib.
3776 same bug in iplib.
3772
3777
3773 2002-02-18 Fernando Perez <fperez@colorado.edu>
3778 2002-02-18 Fernando Perez <fperez@colorado.edu>
3774
3779
3775 * IPython/iplib.py (InteractiveShell.init_readline): modified use
3780 * IPython/iplib.py (InteractiveShell.init_readline): modified use
3776 of readline so that IPython can work inside an Emacs buffer.
3781 of readline so that IPython can work inside an Emacs buffer.
3777
3782
3778 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
3783 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
3779 method signatures (they weren't really bugs, but it looks cleaner
3784 method signatures (they weren't really bugs, but it looks cleaner
3780 and keeps PyChecker happy).
3785 and keeps PyChecker happy).
3781
3786
3782 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
3787 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
3783 for implementing various user-defined hooks. Currently only
3788 for implementing various user-defined hooks. Currently only
3784 display is done.
3789 display is done.
3785
3790
3786 * IPython/Prompts.py (CachedOutput._display): changed display
3791 * IPython/Prompts.py (CachedOutput._display): changed display
3787 functions so that they can be dynamically changed by users easily.
3792 functions so that they can be dynamically changed by users easily.
3788
3793
3789 * IPython/Extensions/numeric_formats.py (num_display): added an
3794 * IPython/Extensions/numeric_formats.py (num_display): added an
3790 extension for printing NumPy arrays in flexible manners. It
3795 extension for printing NumPy arrays in flexible manners. It
3791 doesn't do anything yet, but all the structure is in
3796 doesn't do anything yet, but all the structure is in
3792 place. Ultimately the plan is to implement output format control
3797 place. Ultimately the plan is to implement output format control
3793 like in Octave.
3798 like in Octave.
3794
3799
3795 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
3800 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
3796 methods are found at run-time by all the automatic machinery.
3801 methods are found at run-time by all the automatic machinery.
3797
3802
3798 2002-02-17 Fernando Perez <fperez@colorado.edu>
3803 2002-02-17 Fernando Perez <fperez@colorado.edu>
3799
3804
3800 * setup_Windows.py (make_shortcut): documented. Cleaned up the
3805 * setup_Windows.py (make_shortcut): documented. Cleaned up the
3801 whole file a little.
3806 whole file a little.
3802
3807
3803 * ToDo: closed this document. Now there's a new_design.lyx
3808 * ToDo: closed this document. Now there's a new_design.lyx
3804 document for all new ideas. Added making a pdf of it for the
3809 document for all new ideas. Added making a pdf of it for the
3805 end-user distro.
3810 end-user distro.
3806
3811
3807 * IPython/Logger.py (Logger.switch_log): Created this to replace
3812 * IPython/Logger.py (Logger.switch_log): Created this to replace
3808 logon() and logoff(). It also fixes a nasty crash reported by
3813 logon() and logoff(). It also fixes a nasty crash reported by
3809 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
3814 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
3810
3815
3811 * IPython/iplib.py (complete): got auto-completion to work with
3816 * IPython/iplib.py (complete): got auto-completion to work with
3812 automagic (I had wanted this for a long time).
3817 automagic (I had wanted this for a long time).
3813
3818
3814 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
3819 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
3815 to @file, since file() is now a builtin and clashes with automagic
3820 to @file, since file() is now a builtin and clashes with automagic
3816 for @file.
3821 for @file.
3817
3822
3818 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
3823 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
3819 of this was previously in iplib, which had grown to more than 2000
3824 of this was previously in iplib, which had grown to more than 2000
3820 lines, way too long. No new functionality, but it makes managing
3825 lines, way too long. No new functionality, but it makes managing
3821 the code a bit easier.
3826 the code a bit easier.
3822
3827
3823 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
3828 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
3824 information to crash reports.
3829 information to crash reports.
3825
3830
3826 2002-02-12 Fernando Perez <fperez@colorado.edu>
3831 2002-02-12 Fernando Perez <fperez@colorado.edu>
3827
3832
3828 * Released 0.2.5.
3833 * Released 0.2.5.
3829
3834
3830 2002-02-11 Fernando Perez <fperez@colorado.edu>
3835 2002-02-11 Fernando Perez <fperez@colorado.edu>
3831
3836
3832 * Wrote a relatively complete Windows installer. It puts
3837 * Wrote a relatively complete Windows installer. It puts
3833 everything in place, creates Start Menu entries and fixes the
3838 everything in place, creates Start Menu entries and fixes the
3834 color issues. Nothing fancy, but it works.
3839 color issues. Nothing fancy, but it works.
3835
3840
3836 2002-02-10 Fernando Perez <fperez@colorado.edu>
3841 2002-02-10 Fernando Perez <fperez@colorado.edu>
3837
3842
3838 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
3843 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
3839 os.path.expanduser() call so that we can type @run ~/myfile.py and
3844 os.path.expanduser() call so that we can type @run ~/myfile.py and
3840 have thigs work as expected.
3845 have thigs work as expected.
3841
3846
3842 * IPython/genutils.py (page): fixed exception handling so things
3847 * IPython/genutils.py (page): fixed exception handling so things
3843 work both in Unix and Windows correctly. Quitting a pager triggers
3848 work both in Unix and Windows correctly. Quitting a pager triggers
3844 an IOError/broken pipe in Unix, and in windows not finding a pager
3849 an IOError/broken pipe in Unix, and in windows not finding a pager
3845 is also an IOError, so I had to actually look at the return value
3850 is also an IOError, so I had to actually look at the return value
3846 of the exception, not just the exception itself. Should be ok now.
3851 of the exception, not just the exception itself. Should be ok now.
3847
3852
3848 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
3853 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
3849 modified to allow case-insensitive color scheme changes.
3854 modified to allow case-insensitive color scheme changes.
3850
3855
3851 2002-02-09 Fernando Perez <fperez@colorado.edu>
3856 2002-02-09 Fernando Perez <fperez@colorado.edu>
3852
3857
3853 * IPython/genutils.py (native_line_ends): new function to leave
3858 * IPython/genutils.py (native_line_ends): new function to leave
3854 user config files with os-native line-endings.
3859 user config files with os-native line-endings.
3855
3860
3856 * README and manual updates.
3861 * README and manual updates.
3857
3862
3858 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
3863 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
3859 instead of StringType to catch Unicode strings.
3864 instead of StringType to catch Unicode strings.
3860
3865
3861 * IPython/genutils.py (filefind): fixed bug for paths with
3866 * IPython/genutils.py (filefind): fixed bug for paths with
3862 embedded spaces (very common in Windows).
3867 embedded spaces (very common in Windows).
3863
3868
3864 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
3869 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
3865 files under Windows, so that they get automatically associated
3870 files under Windows, so that they get automatically associated
3866 with a text editor. Windows makes it a pain to handle
3871 with a text editor. Windows makes it a pain to handle
3867 extension-less files.
3872 extension-less files.
3868
3873
3869 * IPython/iplib.py (InteractiveShell.init_readline): Made the
3874 * IPython/iplib.py (InteractiveShell.init_readline): Made the
3870 warning about readline only occur for Posix. In Windows there's no
3875 warning about readline only occur for Posix. In Windows there's no
3871 way to get readline, so why bother with the warning.
3876 way to get readline, so why bother with the warning.
3872
3877
3873 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
3878 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
3874 for __str__ instead of dir(self), since dir() changed in 2.2.
3879 for __str__ instead of dir(self), since dir() changed in 2.2.
3875
3880
3876 * Ported to Windows! Tested on XP, I suspect it should work fine
3881 * Ported to Windows! Tested on XP, I suspect it should work fine
3877 on NT/2000, but I don't think it will work on 98 et al. That
3882 on NT/2000, but I don't think it will work on 98 et al. That
3878 series of Windows is such a piece of junk anyway that I won't try
3883 series of Windows is such a piece of junk anyway that I won't try
3879 porting it there. The XP port was straightforward, showed a few
3884 porting it there. The XP port was straightforward, showed a few
3880 bugs here and there (fixed all), in particular some string
3885 bugs here and there (fixed all), in particular some string
3881 handling stuff which required considering Unicode strings (which
3886 handling stuff which required considering Unicode strings (which
3882 Windows uses). This is good, but hasn't been too tested :) No
3887 Windows uses). This is good, but hasn't been too tested :) No
3883 fancy installer yet, I'll put a note in the manual so people at
3888 fancy installer yet, I'll put a note in the manual so people at
3884 least make manually a shortcut.
3889 least make manually a shortcut.
3885
3890
3886 * IPython/iplib.py (Magic.magic_colors): Unified the color options
3891 * IPython/iplib.py (Magic.magic_colors): Unified the color options
3887 into a single one, "colors". This now controls both prompt and
3892 into a single one, "colors". This now controls both prompt and
3888 exception color schemes, and can be changed both at startup
3893 exception color schemes, and can be changed both at startup
3889 (either via command-line switches or via ipythonrc files) and at
3894 (either via command-line switches or via ipythonrc files) and at
3890 runtime, with @colors.
3895 runtime, with @colors.
3891 (Magic.magic_run): renamed @prun to @run and removed the old
3896 (Magic.magic_run): renamed @prun to @run and removed the old
3892 @run. The two were too similar to warrant keeping both.
3897 @run. The two were too similar to warrant keeping both.
3893
3898
3894 2002-02-03 Fernando Perez <fperez@colorado.edu>
3899 2002-02-03 Fernando Perez <fperez@colorado.edu>
3895
3900
3896 * IPython/iplib.py (install_first_time): Added comment on how to
3901 * IPython/iplib.py (install_first_time): Added comment on how to
3897 configure the color options for first-time users. Put a <return>
3902 configure the color options for first-time users. Put a <return>
3898 request at the end so that small-terminal users get a chance to
3903 request at the end so that small-terminal users get a chance to
3899 read the startup info.
3904 read the startup info.
3900
3905
3901 2002-01-23 Fernando Perez <fperez@colorado.edu>
3906 2002-01-23 Fernando Perez <fperez@colorado.edu>
3902
3907
3903 * IPython/iplib.py (CachedOutput.update): Changed output memory
3908 * IPython/iplib.py (CachedOutput.update): Changed output memory
3904 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
3909 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
3905 input history we still use _i. Did this b/c these variable are
3910 input history we still use _i. Did this b/c these variable are
3906 very commonly used in interactive work, so the less we need to
3911 very commonly used in interactive work, so the less we need to
3907 type the better off we are.
3912 type the better off we are.
3908 (Magic.magic_prun): updated @prun to better handle the namespaces
3913 (Magic.magic_prun): updated @prun to better handle the namespaces
3909 the file will run in, including a fix for __name__ not being set
3914 the file will run in, including a fix for __name__ not being set
3910 before.
3915 before.
3911
3916
3912 2002-01-20 Fernando Perez <fperez@colorado.edu>
3917 2002-01-20 Fernando Perez <fperez@colorado.edu>
3913
3918
3914 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
3919 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
3915 extra garbage for Python 2.2. Need to look more carefully into
3920 extra garbage for Python 2.2. Need to look more carefully into
3916 this later.
3921 this later.
3917
3922
3918 2002-01-19 Fernando Perez <fperez@colorado.edu>
3923 2002-01-19 Fernando Perez <fperez@colorado.edu>
3919
3924
3920 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
3925 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
3921 display SyntaxError exceptions properly formatted when they occur
3926 display SyntaxError exceptions properly formatted when they occur
3922 (they can be triggered by imported code).
3927 (they can be triggered by imported code).
3923
3928
3924 2002-01-18 Fernando Perez <fperez@colorado.edu>
3929 2002-01-18 Fernando Perez <fperez@colorado.edu>
3925
3930
3926 * IPython/iplib.py (InteractiveShell.safe_execfile): now
3931 * IPython/iplib.py (InteractiveShell.safe_execfile): now
3927 SyntaxError exceptions are reported nicely formatted, instead of
3932 SyntaxError exceptions are reported nicely formatted, instead of
3928 spitting out only offset information as before.
3933 spitting out only offset information as before.
3929 (Magic.magic_prun): Added the @prun function for executing
3934 (Magic.magic_prun): Added the @prun function for executing
3930 programs with command line args inside IPython.
3935 programs with command line args inside IPython.
3931
3936
3932 2002-01-16 Fernando Perez <fperez@colorado.edu>
3937 2002-01-16 Fernando Perez <fperez@colorado.edu>
3933
3938
3934 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
3939 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
3935 to *not* include the last item given in a range. This brings their
3940 to *not* include the last item given in a range. This brings their
3936 behavior in line with Python's slicing:
3941 behavior in line with Python's slicing:
3937 a[n1:n2] -> a[n1]...a[n2-1]
3942 a[n1:n2] -> a[n1]...a[n2-1]
3938 It may be a bit less convenient, but I prefer to stick to Python's
3943 It may be a bit less convenient, but I prefer to stick to Python's
3939 conventions *everywhere*, so users never have to wonder.
3944 conventions *everywhere*, so users never have to wonder.
3940 (Magic.magic_macro): Added @macro function to ease the creation of
3945 (Magic.magic_macro): Added @macro function to ease the creation of
3941 macros.
3946 macros.
3942
3947
3943 2002-01-05 Fernando Perez <fperez@colorado.edu>
3948 2002-01-05 Fernando Perez <fperez@colorado.edu>
3944
3949
3945 * Released 0.2.4.
3950 * Released 0.2.4.
3946
3951
3947 * IPython/iplib.py (Magic.magic_pdef):
3952 * IPython/iplib.py (Magic.magic_pdef):
3948 (InteractiveShell.safe_execfile): report magic lines and error
3953 (InteractiveShell.safe_execfile): report magic lines and error
3949 lines without line numbers so one can easily copy/paste them for
3954 lines without line numbers so one can easily copy/paste them for
3950 re-execution.
3955 re-execution.
3951
3956
3952 * Updated manual with recent changes.
3957 * Updated manual with recent changes.
3953
3958
3954 * IPython/iplib.py (Magic.magic_oinfo): added constructor
3959 * IPython/iplib.py (Magic.magic_oinfo): added constructor
3955 docstring printing when class? is called. Very handy for knowing
3960 docstring printing when class? is called. Very handy for knowing
3956 how to create class instances (as long as __init__ is well
3961 how to create class instances (as long as __init__ is well
3957 documented, of course :)
3962 documented, of course :)
3958 (Magic.magic_doc): print both class and constructor docstrings.
3963 (Magic.magic_doc): print both class and constructor docstrings.
3959 (Magic.magic_pdef): give constructor info if passed a class and
3964 (Magic.magic_pdef): give constructor info if passed a class and
3960 __call__ info for callable object instances.
3965 __call__ info for callable object instances.
3961
3966
3962 2002-01-04 Fernando Perez <fperez@colorado.edu>
3967 2002-01-04 Fernando Perez <fperez@colorado.edu>
3963
3968
3964 * Made deep_reload() off by default. It doesn't always work
3969 * Made deep_reload() off by default. It doesn't always work
3965 exactly as intended, so it's probably safer to have it off. It's
3970 exactly as intended, so it's probably safer to have it off. It's
3966 still available as dreload() anyway, so nothing is lost.
3971 still available as dreload() anyway, so nothing is lost.
3967
3972
3968 2002-01-02 Fernando Perez <fperez@colorado.edu>
3973 2002-01-02 Fernando Perez <fperez@colorado.edu>
3969
3974
3970 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
3975 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
3971 so I wanted an updated release).
3976 so I wanted an updated release).
3972
3977
3973 2001-12-27 Fernando Perez <fperez@colorado.edu>
3978 2001-12-27 Fernando Perez <fperez@colorado.edu>
3974
3979
3975 * IPython/iplib.py (InteractiveShell.interact): Added the original
3980 * IPython/iplib.py (InteractiveShell.interact): Added the original
3976 code from 'code.py' for this module in order to change the
3981 code from 'code.py' for this module in order to change the
3977 handling of a KeyboardInterrupt. This was necessary b/c otherwise
3982 handling of a KeyboardInterrupt. This was necessary b/c otherwise
3978 the history cache would break when the user hit Ctrl-C, and
3983 the history cache would break when the user hit Ctrl-C, and
3979 interact() offers no way to add any hooks to it.
3984 interact() offers no way to add any hooks to it.
3980
3985
3981 2001-12-23 Fernando Perez <fperez@colorado.edu>
3986 2001-12-23 Fernando Perez <fperez@colorado.edu>
3982
3987
3983 * setup.py: added check for 'MANIFEST' before trying to remove
3988 * setup.py: added check for 'MANIFEST' before trying to remove
3984 it. Thanks to Sean Reifschneider.
3989 it. Thanks to Sean Reifschneider.
3985
3990
3986 2001-12-22 Fernando Perez <fperez@colorado.edu>
3991 2001-12-22 Fernando Perez <fperez@colorado.edu>
3987
3992
3988 * Released 0.2.2.
3993 * Released 0.2.2.
3989
3994
3990 * Finished (reasonably) writing the manual. Later will add the
3995 * Finished (reasonably) writing the manual. Later will add the
3991 python-standard navigation stylesheets, but for the time being
3996 python-standard navigation stylesheets, but for the time being
3992 it's fairly complete. Distribution will include html and pdf
3997 it's fairly complete. Distribution will include html and pdf
3993 versions.
3998 versions.
3994
3999
3995 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4000 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
3996 (MayaVi author).
4001 (MayaVi author).
3997
4002
3998 2001-12-21 Fernando Perez <fperez@colorado.edu>
4003 2001-12-21 Fernando Perez <fperez@colorado.edu>
3999
4004
4000 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4005 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4001 good public release, I think (with the manual and the distutils
4006 good public release, I think (with the manual and the distutils
4002 installer). The manual can use some work, but that can go
4007 installer). The manual can use some work, but that can go
4003 slowly. Otherwise I think it's quite nice for end users. Next
4008 slowly. Otherwise I think it's quite nice for end users. Next
4004 summer, rewrite the guts of it...
4009 summer, rewrite the guts of it...
4005
4010
4006 * Changed format of ipythonrc files to use whitespace as the
4011 * Changed format of ipythonrc files to use whitespace as the
4007 separator instead of an explicit '='. Cleaner.
4012 separator instead of an explicit '='. Cleaner.
4008
4013
4009 2001-12-20 Fernando Perez <fperez@colorado.edu>
4014 2001-12-20 Fernando Perez <fperez@colorado.edu>
4010
4015
4011 * Started a manual in LyX. For now it's just a quick merge of the
4016 * Started a manual in LyX. For now it's just a quick merge of the
4012 various internal docstrings and READMEs. Later it may grow into a
4017 various internal docstrings and READMEs. Later it may grow into a
4013 nice, full-blown manual.
4018 nice, full-blown manual.
4014
4019
4015 * Set up a distutils based installer. Installation should now be
4020 * Set up a distutils based installer. Installation should now be
4016 trivially simple for end-users.
4021 trivially simple for end-users.
4017
4022
4018 2001-12-11 Fernando Perez <fperez@colorado.edu>
4023 2001-12-11 Fernando Perez <fperez@colorado.edu>
4019
4024
4020 * Released 0.2.0. First public release, announced it at
4025 * Released 0.2.0. First public release, announced it at
4021 comp.lang.python. From now on, just bugfixes...
4026 comp.lang.python. From now on, just bugfixes...
4022
4027
4023 * Went through all the files, set copyright/license notices and
4028 * Went through all the files, set copyright/license notices and
4024 cleaned up things. Ready for release.
4029 cleaned up things. Ready for release.
4025
4030
4026 2001-12-10 Fernando Perez <fperez@colorado.edu>
4031 2001-12-10 Fernando Perez <fperez@colorado.edu>
4027
4032
4028 * Changed the first-time installer not to use tarfiles. It's more
4033 * Changed the first-time installer not to use tarfiles. It's more
4029 robust now and less unix-dependent. Also makes it easier for
4034 robust now and less unix-dependent. Also makes it easier for
4030 people to later upgrade versions.
4035 people to later upgrade versions.
4031
4036
4032 * Changed @exit to @abort to reflect the fact that it's pretty
4037 * Changed @exit to @abort to reflect the fact that it's pretty
4033 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4038 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4034 becomes significant only when IPyhton is embedded: in that case,
4039 becomes significant only when IPyhton is embedded: in that case,
4035 C-D closes IPython only, but @abort kills the enclosing program
4040 C-D closes IPython only, but @abort kills the enclosing program
4036 too (unless it had called IPython inside a try catching
4041 too (unless it had called IPython inside a try catching
4037 SystemExit).
4042 SystemExit).
4038
4043
4039 * Created Shell module which exposes the actuall IPython Shell
4044 * Created Shell module which exposes the actuall IPython Shell
4040 classes, currently the normal and the embeddable one. This at
4045 classes, currently the normal and the embeddable one. This at
4041 least offers a stable interface we won't need to change when
4046 least offers a stable interface we won't need to change when
4042 (later) the internals are rewritten. That rewrite will be confined
4047 (later) the internals are rewritten. That rewrite will be confined
4043 to iplib and ipmaker, but the Shell interface should remain as is.
4048 to iplib and ipmaker, but the Shell interface should remain as is.
4044
4049
4045 * Added embed module which offers an embeddable IPShell object,
4050 * Added embed module which offers an embeddable IPShell object,
4046 useful to fire up IPython *inside* a running program. Great for
4051 useful to fire up IPython *inside* a running program. Great for
4047 debugging or dynamical data analysis.
4052 debugging or dynamical data analysis.
4048
4053
4049 2001-12-08 Fernando Perez <fperez@colorado.edu>
4054 2001-12-08 Fernando Perez <fperez@colorado.edu>
4050
4055
4051 * Fixed small bug preventing seeing info from methods of defined
4056 * Fixed small bug preventing seeing info from methods of defined
4052 objects (incorrect namespace in _ofind()).
4057 objects (incorrect namespace in _ofind()).
4053
4058
4054 * Documentation cleanup. Moved the main usage docstrings to a
4059 * Documentation cleanup. Moved the main usage docstrings to a
4055 separate file, usage.py (cleaner to maintain, and hopefully in the
4060 separate file, usage.py (cleaner to maintain, and hopefully in the
4056 future some perlpod-like way of producing interactive, man and
4061 future some perlpod-like way of producing interactive, man and
4057 html docs out of it will be found).
4062 html docs out of it will be found).
4058
4063
4059 * Added @profile to see your profile at any time.
4064 * Added @profile to see your profile at any time.
4060
4065
4061 * Added @p as an alias for 'print'. It's especially convenient if
4066 * Added @p as an alias for 'print'. It's especially convenient if
4062 using automagic ('p x' prints x).
4067 using automagic ('p x' prints x).
4063
4068
4064 * Small cleanups and fixes after a pychecker run.
4069 * Small cleanups and fixes after a pychecker run.
4065
4070
4066 * Changed the @cd command to handle @cd - and @cd -<n> for
4071 * Changed the @cd command to handle @cd - and @cd -<n> for
4067 visiting any directory in _dh.
4072 visiting any directory in _dh.
4068
4073
4069 * Introduced _dh, a history of visited directories. @dhist prints
4074 * Introduced _dh, a history of visited directories. @dhist prints
4070 it out with numbers.
4075 it out with numbers.
4071
4076
4072 2001-12-07 Fernando Perez <fperez@colorado.edu>
4077 2001-12-07 Fernando Perez <fperez@colorado.edu>
4073
4078
4074 * Released 0.1.22
4079 * Released 0.1.22
4075
4080
4076 * Made initialization a bit more robust against invalid color
4081 * Made initialization a bit more robust against invalid color
4077 options in user input (exit, not traceback-crash).
4082 options in user input (exit, not traceback-crash).
4078
4083
4079 * Changed the bug crash reporter to write the report only in the
4084 * Changed the bug crash reporter to write the report only in the
4080 user's .ipython directory. That way IPython won't litter people's
4085 user's .ipython directory. That way IPython won't litter people's
4081 hard disks with crash files all over the place. Also print on
4086 hard disks with crash files all over the place. Also print on
4082 screen the necessary mail command.
4087 screen the necessary mail command.
4083
4088
4084 * With the new ultraTB, implemented LightBG color scheme for light
4089 * With the new ultraTB, implemented LightBG color scheme for light
4085 background terminals. A lot of people like white backgrounds, so I
4090 background terminals. A lot of people like white backgrounds, so I
4086 guess we should at least give them something readable.
4091 guess we should at least give them something readable.
4087
4092
4088 2001-12-06 Fernando Perez <fperez@colorado.edu>
4093 2001-12-06 Fernando Perez <fperez@colorado.edu>
4089
4094
4090 * Modified the structure of ultraTB. Now there's a proper class
4095 * Modified the structure of ultraTB. Now there's a proper class
4091 for tables of color schemes which allow adding schemes easily and
4096 for tables of color schemes which allow adding schemes easily and
4092 switching the active scheme without creating a new instance every
4097 switching the active scheme without creating a new instance every
4093 time (which was ridiculous). The syntax for creating new schemes
4098 time (which was ridiculous). The syntax for creating new schemes
4094 is also cleaner. I think ultraTB is finally done, with a clean
4099 is also cleaner. I think ultraTB is finally done, with a clean
4095 class structure. Names are also much cleaner (now there's proper
4100 class structure. Names are also much cleaner (now there's proper
4096 color tables, no need for every variable to also have 'color' in
4101 color tables, no need for every variable to also have 'color' in
4097 its name).
4102 its name).
4098
4103
4099 * Broke down genutils into separate files. Now genutils only
4104 * Broke down genutils into separate files. Now genutils only
4100 contains utility functions, and classes have been moved to their
4105 contains utility functions, and classes have been moved to their
4101 own files (they had enough independent functionality to warrant
4106 own files (they had enough independent functionality to warrant
4102 it): ConfigLoader, OutputTrap, Struct.
4107 it): ConfigLoader, OutputTrap, Struct.
4103
4108
4104 2001-12-05 Fernando Perez <fperez@colorado.edu>
4109 2001-12-05 Fernando Perez <fperez@colorado.edu>
4105
4110
4106 * IPython turns 21! Released version 0.1.21, as a candidate for
4111 * IPython turns 21! Released version 0.1.21, as a candidate for
4107 public consumption. If all goes well, release in a few days.
4112 public consumption. If all goes well, release in a few days.
4108
4113
4109 * Fixed path bug (files in Extensions/ directory wouldn't be found
4114 * Fixed path bug (files in Extensions/ directory wouldn't be found
4110 unless IPython/ was explicitly in sys.path).
4115 unless IPython/ was explicitly in sys.path).
4111
4116
4112 * Extended the FlexCompleter class as MagicCompleter to allow
4117 * Extended the FlexCompleter class as MagicCompleter to allow
4113 completion of @-starting lines.
4118 completion of @-starting lines.
4114
4119
4115 * Created __release__.py file as a central repository for release
4120 * Created __release__.py file as a central repository for release
4116 info that other files can read from.
4121 info that other files can read from.
4117
4122
4118 * Fixed small bug in logging: when logging was turned on in
4123 * Fixed small bug in logging: when logging was turned on in
4119 mid-session, old lines with special meanings (!@?) were being
4124 mid-session, old lines with special meanings (!@?) were being
4120 logged without the prepended comment, which is necessary since
4125 logged without the prepended comment, which is necessary since
4121 they are not truly valid python syntax. This should make session
4126 they are not truly valid python syntax. This should make session
4122 restores produce less errors.
4127 restores produce less errors.
4123
4128
4124 * The namespace cleanup forced me to make a FlexCompleter class
4129 * The namespace cleanup forced me to make a FlexCompleter class
4125 which is nothing but a ripoff of rlcompleter, but with selectable
4130 which is nothing but a ripoff of rlcompleter, but with selectable
4126 namespace (rlcompleter only works in __main__.__dict__). I'll try
4131 namespace (rlcompleter only works in __main__.__dict__). I'll try
4127 to submit a note to the authors to see if this change can be
4132 to submit a note to the authors to see if this change can be
4128 incorporated in future rlcompleter releases (Dec.6: done)
4133 incorporated in future rlcompleter releases (Dec.6: done)
4129
4134
4130 * More fixes to namespace handling. It was a mess! Now all
4135 * More fixes to namespace handling. It was a mess! Now all
4131 explicit references to __main__.__dict__ are gone (except when
4136 explicit references to __main__.__dict__ are gone (except when
4132 really needed) and everything is handled through the namespace
4137 really needed) and everything is handled through the namespace
4133 dicts in the IPython instance. We seem to be getting somewhere
4138 dicts in the IPython instance. We seem to be getting somewhere
4134 with this, finally...
4139 with this, finally...
4135
4140
4136 * Small documentation updates.
4141 * Small documentation updates.
4137
4142
4138 * Created the Extensions directory under IPython (with an
4143 * Created the Extensions directory under IPython (with an
4139 __init__.py). Put the PhysicalQ stuff there. This directory should
4144 __init__.py). Put the PhysicalQ stuff there. This directory should
4140 be used for all special-purpose extensions.
4145 be used for all special-purpose extensions.
4141
4146
4142 * File renaming:
4147 * File renaming:
4143 ipythonlib --> ipmaker
4148 ipythonlib --> ipmaker
4144 ipplib --> iplib
4149 ipplib --> iplib
4145 This makes a bit more sense in terms of what these files actually do.
4150 This makes a bit more sense in terms of what these files actually do.
4146
4151
4147 * Moved all the classes and functions in ipythonlib to ipplib, so
4152 * Moved all the classes and functions in ipythonlib to ipplib, so
4148 now ipythonlib only has make_IPython(). This will ease up its
4153 now ipythonlib only has make_IPython(). This will ease up its
4149 splitting in smaller functional chunks later.
4154 splitting in smaller functional chunks later.
4150
4155
4151 * Cleaned up (done, I think) output of @whos. Better column
4156 * Cleaned up (done, I think) output of @whos. Better column
4152 formatting, and now shows str(var) for as much as it can, which is
4157 formatting, and now shows str(var) for as much as it can, which is
4153 typically what one gets with a 'print var'.
4158 typically what one gets with a 'print var'.
4154
4159
4155 2001-12-04 Fernando Perez <fperez@colorado.edu>
4160 2001-12-04 Fernando Perez <fperez@colorado.edu>
4156
4161
4157 * Fixed namespace problems. Now builtin/IPyhton/user names get
4162 * Fixed namespace problems. Now builtin/IPyhton/user names get
4158 properly reported in their namespace. Internal namespace handling
4163 properly reported in their namespace. Internal namespace handling
4159 is finally getting decent (not perfect yet, but much better than
4164 is finally getting decent (not perfect yet, but much better than
4160 the ad-hoc mess we had).
4165 the ad-hoc mess we had).
4161
4166
4162 * Removed -exit option. If people just want to run a python
4167 * Removed -exit option. If people just want to run a python
4163 script, that's what the normal interpreter is for. Less
4168 script, that's what the normal interpreter is for. Less
4164 unnecessary options, less chances for bugs.
4169 unnecessary options, less chances for bugs.
4165
4170
4166 * Added a crash handler which generates a complete post-mortem if
4171 * Added a crash handler which generates a complete post-mortem if
4167 IPython crashes. This will help a lot in tracking bugs down the
4172 IPython crashes. This will help a lot in tracking bugs down the
4168 road.
4173 road.
4169
4174
4170 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4175 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4171 which were boud to functions being reassigned would bypass the
4176 which were boud to functions being reassigned would bypass the
4172 logger, breaking the sync of _il with the prompt counter. This
4177 logger, breaking the sync of _il with the prompt counter. This
4173 would then crash IPython later when a new line was logged.
4178 would then crash IPython later when a new line was logged.
4174
4179
4175 2001-12-02 Fernando Perez <fperez@colorado.edu>
4180 2001-12-02 Fernando Perez <fperez@colorado.edu>
4176
4181
4177 * Made IPython a package. This means people don't have to clutter
4182 * Made IPython a package. This means people don't have to clutter
4178 their sys.path with yet another directory. Changed the INSTALL
4183 their sys.path with yet another directory. Changed the INSTALL
4179 file accordingly.
4184 file accordingly.
4180
4185
4181 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4186 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4182 sorts its output (so @who shows it sorted) and @whos formats the
4187 sorts its output (so @who shows it sorted) and @whos formats the
4183 table according to the width of the first column. Nicer, easier to
4188 table according to the width of the first column. Nicer, easier to
4184 read. Todo: write a generic table_format() which takes a list of
4189 read. Todo: write a generic table_format() which takes a list of
4185 lists and prints it nicely formatted, with optional row/column
4190 lists and prints it nicely formatted, with optional row/column
4186 separators and proper padding and justification.
4191 separators and proper padding and justification.
4187
4192
4188 * Released 0.1.20
4193 * Released 0.1.20
4189
4194
4190 * Fixed bug in @log which would reverse the inputcache list (a
4195 * Fixed bug in @log which would reverse the inputcache list (a
4191 copy operation was missing).
4196 copy operation was missing).
4192
4197
4193 * Code cleanup. @config was changed to use page(). Better, since
4198 * Code cleanup. @config was changed to use page(). Better, since
4194 its output is always quite long.
4199 its output is always quite long.
4195
4200
4196 * Itpl is back as a dependency. I was having too many problems
4201 * Itpl is back as a dependency. I was having too many problems
4197 getting the parametric aliases to work reliably, and it's just
4202 getting the parametric aliases to work reliably, and it's just
4198 easier to code weird string operations with it than playing %()s
4203 easier to code weird string operations with it than playing %()s
4199 games. It's only ~6k, so I don't think it's too big a deal.
4204 games. It's only ~6k, so I don't think it's too big a deal.
4200
4205
4201 * Found (and fixed) a very nasty bug with history. !lines weren't
4206 * Found (and fixed) a very nasty bug with history. !lines weren't
4202 getting cached, and the out of sync caches would crash
4207 getting cached, and the out of sync caches would crash
4203 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4208 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4204 division of labor a bit better. Bug fixed, cleaner structure.
4209 division of labor a bit better. Bug fixed, cleaner structure.
4205
4210
4206 2001-12-01 Fernando Perez <fperez@colorado.edu>
4211 2001-12-01 Fernando Perez <fperez@colorado.edu>
4207
4212
4208 * Released 0.1.19
4213 * Released 0.1.19
4209
4214
4210 * Added option -n to @hist to prevent line number printing. Much
4215 * Added option -n to @hist to prevent line number printing. Much
4211 easier to copy/paste code this way.
4216 easier to copy/paste code this way.
4212
4217
4213 * Created global _il to hold the input list. Allows easy
4218 * Created global _il to hold the input list. Allows easy
4214 re-execution of blocks of code by slicing it (inspired by Janko's
4219 re-execution of blocks of code by slicing it (inspired by Janko's
4215 comment on 'macros').
4220 comment on 'macros').
4216
4221
4217 * Small fixes and doc updates.
4222 * Small fixes and doc updates.
4218
4223
4219 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4224 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4220 much too fragile with automagic. Handles properly multi-line
4225 much too fragile with automagic. Handles properly multi-line
4221 statements and takes parameters.
4226 statements and takes parameters.
4222
4227
4223 2001-11-30 Fernando Perez <fperez@colorado.edu>
4228 2001-11-30 Fernando Perez <fperez@colorado.edu>
4224
4229
4225 * Version 0.1.18 released.
4230 * Version 0.1.18 released.
4226
4231
4227 * Fixed nasty namespace bug in initial module imports.
4232 * Fixed nasty namespace bug in initial module imports.
4228
4233
4229 * Added copyright/license notes to all code files (except
4234 * Added copyright/license notes to all code files (except
4230 DPyGetOpt). For the time being, LGPL. That could change.
4235 DPyGetOpt). For the time being, LGPL. That could change.
4231
4236
4232 * Rewrote a much nicer README, updated INSTALL, cleaned up
4237 * Rewrote a much nicer README, updated INSTALL, cleaned up
4233 ipythonrc-* samples.
4238 ipythonrc-* samples.
4234
4239
4235 * Overall code/documentation cleanup. Basically ready for
4240 * Overall code/documentation cleanup. Basically ready for
4236 release. Only remaining thing: licence decision (LGPL?).
4241 release. Only remaining thing: licence decision (LGPL?).
4237
4242
4238 * Converted load_config to a class, ConfigLoader. Now recursion
4243 * Converted load_config to a class, ConfigLoader. Now recursion
4239 control is better organized. Doesn't include the same file twice.
4244 control is better organized. Doesn't include the same file twice.
4240
4245
4241 2001-11-29 Fernando Perez <fperez@colorado.edu>
4246 2001-11-29 Fernando Perez <fperez@colorado.edu>
4242
4247
4243 * Got input history working. Changed output history variables from
4248 * Got input history working. Changed output history variables from
4244 _p to _o so that _i is for input and _o for output. Just cleaner
4249 _p to _o so that _i is for input and _o for output. Just cleaner
4245 convention.
4250 convention.
4246
4251
4247 * Implemented parametric aliases. This pretty much allows the
4252 * Implemented parametric aliases. This pretty much allows the
4248 alias system to offer full-blown shell convenience, I think.
4253 alias system to offer full-blown shell convenience, I think.
4249
4254
4250 * Version 0.1.17 released, 0.1.18 opened.
4255 * Version 0.1.17 released, 0.1.18 opened.
4251
4256
4252 * dot_ipython/ipythonrc (alias): added documentation.
4257 * dot_ipython/ipythonrc (alias): added documentation.
4253 (xcolor): Fixed small bug (xcolors -> xcolor)
4258 (xcolor): Fixed small bug (xcolors -> xcolor)
4254
4259
4255 * Changed the alias system. Now alias is a magic command to define
4260 * Changed the alias system. Now alias is a magic command to define
4256 aliases just like the shell. Rationale: the builtin magics should
4261 aliases just like the shell. Rationale: the builtin magics should
4257 be there for things deeply connected to IPython's
4262 be there for things deeply connected to IPython's
4258 architecture. And this is a much lighter system for what I think
4263 architecture. And this is a much lighter system for what I think
4259 is the really important feature: allowing users to define quickly
4264 is the really important feature: allowing users to define quickly
4260 magics that will do shell things for them, so they can customize
4265 magics that will do shell things for them, so they can customize
4261 IPython easily to match their work habits. If someone is really
4266 IPython easily to match their work habits. If someone is really
4262 desperate to have another name for a builtin alias, they can
4267 desperate to have another name for a builtin alias, they can
4263 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4268 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4264 works.
4269 works.
4265
4270
4266 2001-11-28 Fernando Perez <fperez@colorado.edu>
4271 2001-11-28 Fernando Perez <fperez@colorado.edu>
4267
4272
4268 * Changed @file so that it opens the source file at the proper
4273 * Changed @file so that it opens the source file at the proper
4269 line. Since it uses less, if your EDITOR environment is
4274 line. Since it uses less, if your EDITOR environment is
4270 configured, typing v will immediately open your editor of choice
4275 configured, typing v will immediately open your editor of choice
4271 right at the line where the object is defined. Not as quick as
4276 right at the line where the object is defined. Not as quick as
4272 having a direct @edit command, but for all intents and purposes it
4277 having a direct @edit command, but for all intents and purposes it
4273 works. And I don't have to worry about writing @edit to deal with
4278 works. And I don't have to worry about writing @edit to deal with
4274 all the editors, less does that.
4279 all the editors, less does that.
4275
4280
4276 * Version 0.1.16 released, 0.1.17 opened.
4281 * Version 0.1.16 released, 0.1.17 opened.
4277
4282
4278 * Fixed some nasty bugs in the page/page_dumb combo that could
4283 * Fixed some nasty bugs in the page/page_dumb combo that could
4279 crash IPython.
4284 crash IPython.
4280
4285
4281 2001-11-27 Fernando Perez <fperez@colorado.edu>
4286 2001-11-27 Fernando Perez <fperez@colorado.edu>
4282
4287
4283 * Version 0.1.15 released, 0.1.16 opened.
4288 * Version 0.1.15 released, 0.1.16 opened.
4284
4289
4285 * Finally got ? and ?? to work for undefined things: now it's
4290 * Finally got ? and ?? to work for undefined things: now it's
4286 possible to type {}.get? and get information about the get method
4291 possible to type {}.get? and get information about the get method
4287 of dicts, or os.path? even if only os is defined (so technically
4292 of dicts, or os.path? even if only os is defined (so technically
4288 os.path isn't). Works at any level. For example, after import os,
4293 os.path isn't). Works at any level. For example, after import os,
4289 os?, os.path?, os.path.abspath? all work. This is great, took some
4294 os?, os.path?, os.path.abspath? all work. This is great, took some
4290 work in _ofind.
4295 work in _ofind.
4291
4296
4292 * Fixed more bugs with logging. The sanest way to do it was to add
4297 * Fixed more bugs with logging. The sanest way to do it was to add
4293 to @log a 'mode' parameter. Killed two in one shot (this mode
4298 to @log a 'mode' parameter. Killed two in one shot (this mode
4294 option was a request of Janko's). I think it's finally clean
4299 option was a request of Janko's). I think it's finally clean
4295 (famous last words).
4300 (famous last words).
4296
4301
4297 * Added a page_dumb() pager which does a decent job of paging on
4302 * Added a page_dumb() pager which does a decent job of paging on
4298 screen, if better things (like less) aren't available. One less
4303 screen, if better things (like less) aren't available. One less
4299 unix dependency (someday maybe somebody will port this to
4304 unix dependency (someday maybe somebody will port this to
4300 windows).
4305 windows).
4301
4306
4302 * Fixed problem in magic_log: would lock of logging out if log
4307 * Fixed problem in magic_log: would lock of logging out if log
4303 creation failed (because it would still think it had succeeded).
4308 creation failed (because it would still think it had succeeded).
4304
4309
4305 * Improved the page() function using curses to auto-detect screen
4310 * Improved the page() function using curses to auto-detect screen
4306 size. Now it can make a much better decision on whether to print
4311 size. Now it can make a much better decision on whether to print
4307 or page a string. Option screen_length was modified: a value 0
4312 or page a string. Option screen_length was modified: a value 0
4308 means auto-detect, and that's the default now.
4313 means auto-detect, and that's the default now.
4309
4314
4310 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4315 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4311 go out. I'll test it for a few days, then talk to Janko about
4316 go out. I'll test it for a few days, then talk to Janko about
4312 licences and announce it.
4317 licences and announce it.
4313
4318
4314 * Fixed the length of the auto-generated ---> prompt which appears
4319 * Fixed the length of the auto-generated ---> prompt which appears
4315 for auto-parens and auto-quotes. Getting this right isn't trivial,
4320 for auto-parens and auto-quotes. Getting this right isn't trivial,
4316 with all the color escapes, different prompt types and optional
4321 with all the color escapes, different prompt types and optional
4317 separators. But it seems to be working in all the combinations.
4322 separators. But it seems to be working in all the combinations.
4318
4323
4319 2001-11-26 Fernando Perez <fperez@colorado.edu>
4324 2001-11-26 Fernando Perez <fperez@colorado.edu>
4320
4325
4321 * Wrote a regexp filter to get option types from the option names
4326 * Wrote a regexp filter to get option types from the option names
4322 string. This eliminates the need to manually keep two duplicate
4327 string. This eliminates the need to manually keep two duplicate
4323 lists.
4328 lists.
4324
4329
4325 * Removed the unneeded check_option_names. Now options are handled
4330 * Removed the unneeded check_option_names. Now options are handled
4326 in a much saner manner and it's easy to visually check that things
4331 in a much saner manner and it's easy to visually check that things
4327 are ok.
4332 are ok.
4328
4333
4329 * Updated version numbers on all files I modified to carry a
4334 * Updated version numbers on all files I modified to carry a
4330 notice so Janko and Nathan have clear version markers.
4335 notice so Janko and Nathan have clear version markers.
4331
4336
4332 * Updated docstring for ultraTB with my changes. I should send
4337 * Updated docstring for ultraTB with my changes. I should send
4333 this to Nathan.
4338 this to Nathan.
4334
4339
4335 * Lots of small fixes. Ran everything through pychecker again.
4340 * Lots of small fixes. Ran everything through pychecker again.
4336
4341
4337 * Made loading of deep_reload an cmd line option. If it's not too
4342 * Made loading of deep_reload an cmd line option. If it's not too
4338 kosher, now people can just disable it. With -nodeep_reload it's
4343 kosher, now people can just disable it. With -nodeep_reload it's
4339 still available as dreload(), it just won't overwrite reload().
4344 still available as dreload(), it just won't overwrite reload().
4340
4345
4341 * Moved many options to the no| form (-opt and -noopt
4346 * Moved many options to the no| form (-opt and -noopt
4342 accepted). Cleaner.
4347 accepted). Cleaner.
4343
4348
4344 * Changed magic_log so that if called with no parameters, it uses
4349 * Changed magic_log so that if called with no parameters, it uses
4345 'rotate' mode. That way auto-generated logs aren't automatically
4350 'rotate' mode. That way auto-generated logs aren't automatically
4346 over-written. For normal logs, now a backup is made if it exists
4351 over-written. For normal logs, now a backup is made if it exists
4347 (only 1 level of backups). A new 'backup' mode was added to the
4352 (only 1 level of backups). A new 'backup' mode was added to the
4348 Logger class to support this. This was a request by Janko.
4353 Logger class to support this. This was a request by Janko.
4349
4354
4350 * Added @logoff/@logon to stop/restart an active log.
4355 * Added @logoff/@logon to stop/restart an active log.
4351
4356
4352 * Fixed a lot of bugs in log saving/replay. It was pretty
4357 * Fixed a lot of bugs in log saving/replay. It was pretty
4353 broken. Now special lines (!@,/) appear properly in the command
4358 broken. Now special lines (!@,/) appear properly in the command
4354 history after a log replay.
4359 history after a log replay.
4355
4360
4356 * Tried and failed to implement full session saving via pickle. My
4361 * Tried and failed to implement full session saving via pickle. My
4357 idea was to pickle __main__.__dict__, but modules can't be
4362 idea was to pickle __main__.__dict__, but modules can't be
4358 pickled. This would be a better alternative to replaying logs, but
4363 pickled. This would be a better alternative to replaying logs, but
4359 seems quite tricky to get to work. Changed -session to be called
4364 seems quite tricky to get to work. Changed -session to be called
4360 -logplay, which more accurately reflects what it does. And if we
4365 -logplay, which more accurately reflects what it does. And if we
4361 ever get real session saving working, -session is now available.
4366 ever get real session saving working, -session is now available.
4362
4367
4363 * Implemented color schemes for prompts also. As for tracebacks,
4368 * Implemented color schemes for prompts also. As for tracebacks,
4364 currently only NoColor and Linux are supported. But now the
4369 currently only NoColor and Linux are supported. But now the
4365 infrastructure is in place, based on a generic ColorScheme
4370 infrastructure is in place, based on a generic ColorScheme
4366 class. So writing and activating new schemes both for the prompts
4371 class. So writing and activating new schemes both for the prompts
4367 and the tracebacks should be straightforward.
4372 and the tracebacks should be straightforward.
4368
4373
4369 * Version 0.1.13 released, 0.1.14 opened.
4374 * Version 0.1.13 released, 0.1.14 opened.
4370
4375
4371 * Changed handling of options for output cache. Now counter is
4376 * Changed handling of options for output cache. Now counter is
4372 hardwired starting at 1 and one specifies the maximum number of
4377 hardwired starting at 1 and one specifies the maximum number of
4373 entries *in the outcache* (not the max prompt counter). This is
4378 entries *in the outcache* (not the max prompt counter). This is
4374 much better, since many statements won't increase the cache
4379 much better, since many statements won't increase the cache
4375 count. It also eliminated some confusing options, now there's only
4380 count. It also eliminated some confusing options, now there's only
4376 one: cache_size.
4381 one: cache_size.
4377
4382
4378 * Added 'alias' magic function and magic_alias option in the
4383 * Added 'alias' magic function and magic_alias option in the
4379 ipythonrc file. Now the user can easily define whatever names he
4384 ipythonrc file. Now the user can easily define whatever names he
4380 wants for the magic functions without having to play weird
4385 wants for the magic functions without having to play weird
4381 namespace games. This gives IPython a real shell-like feel.
4386 namespace games. This gives IPython a real shell-like feel.
4382
4387
4383 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4388 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4384 @ or not).
4389 @ or not).
4385
4390
4386 This was one of the last remaining 'visible' bugs (that I know
4391 This was one of the last remaining 'visible' bugs (that I know
4387 of). I think if I can clean up the session loading so it works
4392 of). I think if I can clean up the session loading so it works
4388 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4393 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4389 about licensing).
4394 about licensing).
4390
4395
4391 2001-11-25 Fernando Perez <fperez@colorado.edu>
4396 2001-11-25 Fernando Perez <fperez@colorado.edu>
4392
4397
4393 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4398 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4394 there's a cleaner distinction between what ? and ?? show.
4399 there's a cleaner distinction between what ? and ?? show.
4395
4400
4396 * Added screen_length option. Now the user can define his own
4401 * Added screen_length option. Now the user can define his own
4397 screen size for page() operations.
4402 screen size for page() operations.
4398
4403
4399 * Implemented magic shell-like functions with automatic code
4404 * Implemented magic shell-like functions with automatic code
4400 generation. Now adding another function is just a matter of adding
4405 generation. Now adding another function is just a matter of adding
4401 an entry to a dict, and the function is dynamically generated at
4406 an entry to a dict, and the function is dynamically generated at
4402 run-time. Python has some really cool features!
4407 run-time. Python has some really cool features!
4403
4408
4404 * Renamed many options to cleanup conventions a little. Now all
4409 * Renamed many options to cleanup conventions a little. Now all
4405 are lowercase, and only underscores where needed. Also in the code
4410 are lowercase, and only underscores where needed. Also in the code
4406 option name tables are clearer.
4411 option name tables are clearer.
4407
4412
4408 * Changed prompts a little. Now input is 'In [n]:' instead of
4413 * Changed prompts a little. Now input is 'In [n]:' instead of
4409 'In[n]:='. This allows it the numbers to be aligned with the
4414 'In[n]:='. This allows it the numbers to be aligned with the
4410 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4415 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4411 Python (it was a Mathematica thing). The '...' continuation prompt
4416 Python (it was a Mathematica thing). The '...' continuation prompt
4412 was also changed a little to align better.
4417 was also changed a little to align better.
4413
4418
4414 * Fixed bug when flushing output cache. Not all _p<n> variables
4419 * Fixed bug when flushing output cache. Not all _p<n> variables
4415 exist, so their deletion needs to be wrapped in a try:
4420 exist, so their deletion needs to be wrapped in a try:
4416
4421
4417 * Figured out how to properly use inspect.formatargspec() (it
4422 * Figured out how to properly use inspect.formatargspec() (it
4418 requires the args preceded by *). So I removed all the code from
4423 requires the args preceded by *). So I removed all the code from
4419 _get_pdef in Magic, which was just replicating that.
4424 _get_pdef in Magic, which was just replicating that.
4420
4425
4421 * Added test to prefilter to allow redefining magic function names
4426 * Added test to prefilter to allow redefining magic function names
4422 as variables. This is ok, since the @ form is always available,
4427 as variables. This is ok, since the @ form is always available,
4423 but whe should allow the user to define a variable called 'ls' if
4428 but whe should allow the user to define a variable called 'ls' if
4424 he needs it.
4429 he needs it.
4425
4430
4426 * Moved the ToDo information from README into a separate ToDo.
4431 * Moved the ToDo information from README into a separate ToDo.
4427
4432
4428 * General code cleanup and small bugfixes. I think it's close to a
4433 * General code cleanup and small bugfixes. I think it's close to a
4429 state where it can be released, obviously with a big 'beta'
4434 state where it can be released, obviously with a big 'beta'
4430 warning on it.
4435 warning on it.
4431
4436
4432 * Got the magic function split to work. Now all magics are defined
4437 * Got the magic function split to work. Now all magics are defined
4433 in a separate class. It just organizes things a bit, and now
4438 in a separate class. It just organizes things a bit, and now
4434 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4439 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4435 was too long).
4440 was too long).
4436
4441
4437 * Changed @clear to @reset to avoid potential confusions with
4442 * Changed @clear to @reset to avoid potential confusions with
4438 the shell command clear. Also renamed @cl to @clear, which does
4443 the shell command clear. Also renamed @cl to @clear, which does
4439 exactly what people expect it to from their shell experience.
4444 exactly what people expect it to from their shell experience.
4440
4445
4441 Added a check to the @reset command (since it's so
4446 Added a check to the @reset command (since it's so
4442 destructive, it's probably a good idea to ask for confirmation).
4447 destructive, it's probably a good idea to ask for confirmation).
4443 But now reset only works for full namespace resetting. Since the
4448 But now reset only works for full namespace resetting. Since the
4444 del keyword is already there for deleting a few specific
4449 del keyword is already there for deleting a few specific
4445 variables, I don't see the point of having a redundant magic
4450 variables, I don't see the point of having a redundant magic
4446 function for the same task.
4451 function for the same task.
4447
4452
4448 2001-11-24 Fernando Perez <fperez@colorado.edu>
4453 2001-11-24 Fernando Perez <fperez@colorado.edu>
4449
4454
4450 * Updated the builtin docs (esp. the ? ones).
4455 * Updated the builtin docs (esp. the ? ones).
4451
4456
4452 * Ran all the code through pychecker. Not terribly impressed with
4457 * Ran all the code through pychecker. Not terribly impressed with
4453 it: lots of spurious warnings and didn't really find anything of
4458 it: lots of spurious warnings and didn't really find anything of
4454 substance (just a few modules being imported and not used).
4459 substance (just a few modules being imported and not used).
4455
4460
4456 * Implemented the new ultraTB functionality into IPython. New
4461 * Implemented the new ultraTB functionality into IPython. New
4457 option: xcolors. This chooses color scheme. xmode now only selects
4462 option: xcolors. This chooses color scheme. xmode now only selects
4458 between Plain and Verbose. Better orthogonality.
4463 between Plain and Verbose. Better orthogonality.
4459
4464
4460 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4465 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4461 mode and color scheme for the exception handlers. Now it's
4466 mode and color scheme for the exception handlers. Now it's
4462 possible to have the verbose traceback with no coloring.
4467 possible to have the verbose traceback with no coloring.
4463
4468
4464 2001-11-23 Fernando Perez <fperez@colorado.edu>
4469 2001-11-23 Fernando Perez <fperez@colorado.edu>
4465
4470
4466 * Version 0.1.12 released, 0.1.13 opened.
4471 * Version 0.1.12 released, 0.1.13 opened.
4467
4472
4468 * Removed option to set auto-quote and auto-paren escapes by
4473 * Removed option to set auto-quote and auto-paren escapes by
4469 user. The chances of breaking valid syntax are just too high. If
4474 user. The chances of breaking valid syntax are just too high. If
4470 someone *really* wants, they can always dig into the code.
4475 someone *really* wants, they can always dig into the code.
4471
4476
4472 * Made prompt separators configurable.
4477 * Made prompt separators configurable.
4473
4478
4474 2001-11-22 Fernando Perez <fperez@colorado.edu>
4479 2001-11-22 Fernando Perez <fperez@colorado.edu>
4475
4480
4476 * Small bugfixes in many places.
4481 * Small bugfixes in many places.
4477
4482
4478 * Removed the MyCompleter class from ipplib. It seemed redundant
4483 * Removed the MyCompleter class from ipplib. It seemed redundant
4479 with the C-p,C-n history search functionality. Less code to
4484 with the C-p,C-n history search functionality. Less code to
4480 maintain.
4485 maintain.
4481
4486
4482 * Moved all the original ipython.py code into ipythonlib.py. Right
4487 * Moved all the original ipython.py code into ipythonlib.py. Right
4483 now it's just one big dump into a function called make_IPython, so
4488 now it's just one big dump into a function called make_IPython, so
4484 no real modularity has been gained. But at least it makes the
4489 no real modularity has been gained. But at least it makes the
4485 wrapper script tiny, and since ipythonlib is a module, it gets
4490 wrapper script tiny, and since ipythonlib is a module, it gets
4486 compiled and startup is much faster.
4491 compiled and startup is much faster.
4487
4492
4488 This is a reasobably 'deep' change, so we should test it for a
4493 This is a reasobably 'deep' change, so we should test it for a
4489 while without messing too much more with the code.
4494 while without messing too much more with the code.
4490
4495
4491 2001-11-21 Fernando Perez <fperez@colorado.edu>
4496 2001-11-21 Fernando Perez <fperez@colorado.edu>
4492
4497
4493 * Version 0.1.11 released, 0.1.12 opened for further work.
4498 * Version 0.1.11 released, 0.1.12 opened for further work.
4494
4499
4495 * Removed dependency on Itpl. It was only needed in one place. It
4500 * Removed dependency on Itpl. It was only needed in one place. It
4496 would be nice if this became part of python, though. It makes life
4501 would be nice if this became part of python, though. It makes life
4497 *a lot* easier in some cases.
4502 *a lot* easier in some cases.
4498
4503
4499 * Simplified the prefilter code a bit. Now all handlers are
4504 * Simplified the prefilter code a bit. Now all handlers are
4500 expected to explicitly return a value (at least a blank string).
4505 expected to explicitly return a value (at least a blank string).
4501
4506
4502 * Heavy edits in ipplib. Removed the help system altogether. Now
4507 * Heavy edits in ipplib. Removed the help system altogether. Now
4503 obj?/?? is used for inspecting objects, a magic @doc prints
4508 obj?/?? is used for inspecting objects, a magic @doc prints
4504 docstrings, and full-blown Python help is accessed via the 'help'
4509 docstrings, and full-blown Python help is accessed via the 'help'
4505 keyword. This cleans up a lot of code (less to maintain) and does
4510 keyword. This cleans up a lot of code (less to maintain) and does
4506 the job. Since 'help' is now a standard Python component, might as
4511 the job. Since 'help' is now a standard Python component, might as
4507 well use it and remove duplicate functionality.
4512 well use it and remove duplicate functionality.
4508
4513
4509 Also removed the option to use ipplib as a standalone program. By
4514 Also removed the option to use ipplib as a standalone program. By
4510 now it's too dependent on other parts of IPython to function alone.
4515 now it's too dependent on other parts of IPython to function alone.
4511
4516
4512 * Fixed bug in genutils.pager. It would crash if the pager was
4517 * Fixed bug in genutils.pager. It would crash if the pager was
4513 exited immediately after opening (broken pipe).
4518 exited immediately after opening (broken pipe).
4514
4519
4515 * Trimmed down the VerboseTB reporting a little. The header is
4520 * Trimmed down the VerboseTB reporting a little. The header is
4516 much shorter now and the repeated exception arguments at the end
4521 much shorter now and the repeated exception arguments at the end
4517 have been removed. For interactive use the old header seemed a bit
4522 have been removed. For interactive use the old header seemed a bit
4518 excessive.
4523 excessive.
4519
4524
4520 * Fixed small bug in output of @whos for variables with multi-word
4525 * Fixed small bug in output of @whos for variables with multi-word
4521 types (only first word was displayed).
4526 types (only first word was displayed).
4522
4527
4523 2001-11-17 Fernando Perez <fperez@colorado.edu>
4528 2001-11-17 Fernando Perez <fperez@colorado.edu>
4524
4529
4525 * Version 0.1.10 released, 0.1.11 opened for further work.
4530 * Version 0.1.10 released, 0.1.11 opened for further work.
4526
4531
4527 * Modified dirs and friends. dirs now *returns* the stack (not
4532 * Modified dirs and friends. dirs now *returns* the stack (not
4528 prints), so one can manipulate it as a variable. Convenient to
4533 prints), so one can manipulate it as a variable. Convenient to
4529 travel along many directories.
4534 travel along many directories.
4530
4535
4531 * Fixed bug in magic_pdef: would only work with functions with
4536 * Fixed bug in magic_pdef: would only work with functions with
4532 arguments with default values.
4537 arguments with default values.
4533
4538
4534 2001-11-14 Fernando Perez <fperez@colorado.edu>
4539 2001-11-14 Fernando Perez <fperez@colorado.edu>
4535
4540
4536 * Added the PhysicsInput stuff to dot_ipython so it ships as an
4541 * Added the PhysicsInput stuff to dot_ipython so it ships as an
4537 example with IPython. Various other minor fixes and cleanups.
4542 example with IPython. Various other minor fixes and cleanups.
4538
4543
4539 * Version 0.1.9 released, 0.1.10 opened for further work.
4544 * Version 0.1.9 released, 0.1.10 opened for further work.
4540
4545
4541 * Added sys.path to the list of directories searched in the
4546 * Added sys.path to the list of directories searched in the
4542 execfile= option. It used to be the current directory and the
4547 execfile= option. It used to be the current directory and the
4543 user's IPYTHONDIR only.
4548 user's IPYTHONDIR only.
4544
4549
4545 2001-11-13 Fernando Perez <fperez@colorado.edu>
4550 2001-11-13 Fernando Perez <fperez@colorado.edu>
4546
4551
4547 * Reinstated the raw_input/prefilter separation that Janko had
4552 * Reinstated the raw_input/prefilter separation that Janko had
4548 initially. This gives a more convenient setup for extending the
4553 initially. This gives a more convenient setup for extending the
4549 pre-processor from the outside: raw_input always gets a string,
4554 pre-processor from the outside: raw_input always gets a string,
4550 and prefilter has to process it. We can then redefine prefilter
4555 and prefilter has to process it. We can then redefine prefilter
4551 from the outside and implement extensions for special
4556 from the outside and implement extensions for special
4552 purposes.
4557 purposes.
4553
4558
4554 Today I got one for inputting PhysicalQuantity objects
4559 Today I got one for inputting PhysicalQuantity objects
4555 (from Scientific) without needing any function calls at
4560 (from Scientific) without needing any function calls at
4556 all. Extremely convenient, and it's all done as a user-level
4561 all. Extremely convenient, and it's all done as a user-level
4557 extension (no IPython code was touched). Now instead of:
4562 extension (no IPython code was touched). Now instead of:
4558 a = PhysicalQuantity(4.2,'m/s**2')
4563 a = PhysicalQuantity(4.2,'m/s**2')
4559 one can simply say
4564 one can simply say
4560 a = 4.2 m/s**2
4565 a = 4.2 m/s**2
4561 or even
4566 or even
4562 a = 4.2 m/s^2
4567 a = 4.2 m/s^2
4563
4568
4564 I use this, but it's also a proof of concept: IPython really is
4569 I use this, but it's also a proof of concept: IPython really is
4565 fully user-extensible, even at the level of the parsing of the
4570 fully user-extensible, even at the level of the parsing of the
4566 command line. It's not trivial, but it's perfectly doable.
4571 command line. It's not trivial, but it's perfectly doable.
4567
4572
4568 * Added 'add_flip' method to inclusion conflict resolver. Fixes
4573 * Added 'add_flip' method to inclusion conflict resolver. Fixes
4569 the problem of modules being loaded in the inverse order in which
4574 the problem of modules being loaded in the inverse order in which
4570 they were defined in
4575 they were defined in
4571
4576
4572 * Version 0.1.8 released, 0.1.9 opened for further work.
4577 * Version 0.1.8 released, 0.1.9 opened for further work.
4573
4578
4574 * Added magics pdef, source and file. They respectively show the
4579 * Added magics pdef, source and file. They respectively show the
4575 definition line ('prototype' in C), source code and full python
4580 definition line ('prototype' in C), source code and full python
4576 file for any callable object. The object inspector oinfo uses
4581 file for any callable object. The object inspector oinfo uses
4577 these to show the same information.
4582 these to show the same information.
4578
4583
4579 * Version 0.1.7 released, 0.1.8 opened for further work.
4584 * Version 0.1.7 released, 0.1.8 opened for further work.
4580
4585
4581 * Separated all the magic functions into a class called Magic. The
4586 * Separated all the magic functions into a class called Magic. The
4582 InteractiveShell class was becoming too big for Xemacs to handle
4587 InteractiveShell class was becoming too big for Xemacs to handle
4583 (de-indenting a line would lock it up for 10 seconds while it
4588 (de-indenting a line would lock it up for 10 seconds while it
4584 backtracked on the whole class!)
4589 backtracked on the whole class!)
4585
4590
4586 FIXME: didn't work. It can be done, but right now namespaces are
4591 FIXME: didn't work. It can be done, but right now namespaces are
4587 all messed up. Do it later (reverted it for now, so at least
4592 all messed up. Do it later (reverted it for now, so at least
4588 everything works as before).
4593 everything works as before).
4589
4594
4590 * Got the object introspection system (magic_oinfo) working! I
4595 * Got the object introspection system (magic_oinfo) working! I
4591 think this is pretty much ready for release to Janko, so he can
4596 think this is pretty much ready for release to Janko, so he can
4592 test it for a while and then announce it. Pretty much 100% of what
4597 test it for a while and then announce it. Pretty much 100% of what
4593 I wanted for the 'phase 1' release is ready. Happy, tired.
4598 I wanted for the 'phase 1' release is ready. Happy, tired.
4594
4599
4595 2001-11-12 Fernando Perez <fperez@colorado.edu>
4600 2001-11-12 Fernando Perez <fperez@colorado.edu>
4596
4601
4597 * Version 0.1.6 released, 0.1.7 opened for further work.
4602 * Version 0.1.6 released, 0.1.7 opened for further work.
4598
4603
4599 * Fixed bug in printing: it used to test for truth before
4604 * Fixed bug in printing: it used to test for truth before
4600 printing, so 0 wouldn't print. Now checks for None.
4605 printing, so 0 wouldn't print. Now checks for None.
4601
4606
4602 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
4607 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
4603 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
4608 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
4604 reaches by hand into the outputcache. Think of a better way to do
4609 reaches by hand into the outputcache. Think of a better way to do
4605 this later.
4610 this later.
4606
4611
4607 * Various small fixes thanks to Nathan's comments.
4612 * Various small fixes thanks to Nathan's comments.
4608
4613
4609 * Changed magic_pprint to magic_Pprint. This way it doesn't
4614 * Changed magic_pprint to magic_Pprint. This way it doesn't
4610 collide with pprint() and the name is consistent with the command
4615 collide with pprint() and the name is consistent with the command
4611 line option.
4616 line option.
4612
4617
4613 * Changed prompt counter behavior to be fully like
4618 * Changed prompt counter behavior to be fully like
4614 Mathematica's. That is, even input that doesn't return a result
4619 Mathematica's. That is, even input that doesn't return a result
4615 raises the prompt counter. The old behavior was kind of confusing
4620 raises the prompt counter. The old behavior was kind of confusing
4616 (getting the same prompt number several times if the operation
4621 (getting the same prompt number several times if the operation
4617 didn't return a result).
4622 didn't return a result).
4618
4623
4619 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
4624 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
4620
4625
4621 * Fixed -Classic mode (wasn't working anymore).
4626 * Fixed -Classic mode (wasn't working anymore).
4622
4627
4623 * Added colored prompts using Nathan's new code. Colors are
4628 * Added colored prompts using Nathan's new code. Colors are
4624 currently hardwired, they can be user-configurable. For
4629 currently hardwired, they can be user-configurable. For
4625 developers, they can be chosen in file ipythonlib.py, at the
4630 developers, they can be chosen in file ipythonlib.py, at the
4626 beginning of the CachedOutput class def.
4631 beginning of the CachedOutput class def.
4627
4632
4628 2001-11-11 Fernando Perez <fperez@colorado.edu>
4633 2001-11-11 Fernando Perez <fperez@colorado.edu>
4629
4634
4630 * Version 0.1.5 released, 0.1.6 opened for further work.
4635 * Version 0.1.5 released, 0.1.6 opened for further work.
4631
4636
4632 * Changed magic_env to *return* the environment as a dict (not to
4637 * Changed magic_env to *return* the environment as a dict (not to
4633 print it). This way it prints, but it can also be processed.
4638 print it). This way it prints, but it can also be processed.
4634
4639
4635 * Added Verbose exception reporting to interactive
4640 * Added Verbose exception reporting to interactive
4636 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
4641 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
4637 traceback. Had to make some changes to the ultraTB file. This is
4642 traceback. Had to make some changes to the ultraTB file. This is
4638 probably the last 'big' thing in my mental todo list. This ties
4643 probably the last 'big' thing in my mental todo list. This ties
4639 in with the next entry:
4644 in with the next entry:
4640
4645
4641 * Changed -Xi and -Xf to a single -xmode option. Now all the user
4646 * Changed -Xi and -Xf to a single -xmode option. Now all the user
4642 has to specify is Plain, Color or Verbose for all exception
4647 has to specify is Plain, Color or Verbose for all exception
4643 handling.
4648 handling.
4644
4649
4645 * Removed ShellServices option. All this can really be done via
4650 * Removed ShellServices option. All this can really be done via
4646 the magic system. It's easier to extend, cleaner and has automatic
4651 the magic system. It's easier to extend, cleaner and has automatic
4647 namespace protection and documentation.
4652 namespace protection and documentation.
4648
4653
4649 2001-11-09 Fernando Perez <fperez@colorado.edu>
4654 2001-11-09 Fernando Perez <fperez@colorado.edu>
4650
4655
4651 * Fixed bug in output cache flushing (missing parameter to
4656 * Fixed bug in output cache flushing (missing parameter to
4652 __init__). Other small bugs fixed (found using pychecker).
4657 __init__). Other small bugs fixed (found using pychecker).
4653
4658
4654 * Version 0.1.4 opened for bugfixing.
4659 * Version 0.1.4 opened for bugfixing.
4655
4660
4656 2001-11-07 Fernando Perez <fperez@colorado.edu>
4661 2001-11-07 Fernando Perez <fperez@colorado.edu>
4657
4662
4658 * Version 0.1.3 released, mainly because of the raw_input bug.
4663 * Version 0.1.3 released, mainly because of the raw_input bug.
4659
4664
4660 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
4665 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
4661 and when testing for whether things were callable, a call could
4666 and when testing for whether things were callable, a call could
4662 actually be made to certain functions. They would get called again
4667 actually be made to certain functions. They would get called again
4663 once 'really' executed, with a resulting double call. A disaster
4668 once 'really' executed, with a resulting double call. A disaster
4664 in many cases (list.reverse() would never work!).
4669 in many cases (list.reverse() would never work!).
4665
4670
4666 * Removed prefilter() function, moved its code to raw_input (which
4671 * Removed prefilter() function, moved its code to raw_input (which
4667 after all was just a near-empty caller for prefilter). This saves
4672 after all was just a near-empty caller for prefilter). This saves
4668 a function call on every prompt, and simplifies the class a tiny bit.
4673 a function call on every prompt, and simplifies the class a tiny bit.
4669
4674
4670 * Fix _ip to __ip name in magic example file.
4675 * Fix _ip to __ip name in magic example file.
4671
4676
4672 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
4677 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
4673 work with non-gnu versions of tar.
4678 work with non-gnu versions of tar.
4674
4679
4675 2001-11-06 Fernando Perez <fperez@colorado.edu>
4680 2001-11-06 Fernando Perez <fperez@colorado.edu>
4676
4681
4677 * Version 0.1.2. Just to keep track of the recent changes.
4682 * Version 0.1.2. Just to keep track of the recent changes.
4678
4683
4679 * Fixed nasty bug in output prompt routine. It used to check 'if
4684 * Fixed nasty bug in output prompt routine. It used to check 'if
4680 arg != None...'. Problem is, this fails if arg implements a
4685 arg != None...'. Problem is, this fails if arg implements a
4681 special comparison (__cmp__) which disallows comparing to
4686 special comparison (__cmp__) which disallows comparing to
4682 None. Found it when trying to use the PhysicalQuantity module from
4687 None. Found it when trying to use the PhysicalQuantity module from
4683 ScientificPython.
4688 ScientificPython.
4684
4689
4685 2001-11-05 Fernando Perez <fperez@colorado.edu>
4690 2001-11-05 Fernando Perez <fperez@colorado.edu>
4686
4691
4687 * Also added dirs. Now the pushd/popd/dirs family functions
4692 * Also added dirs. Now the pushd/popd/dirs family functions
4688 basically like the shell, with the added convenience of going home
4693 basically like the shell, with the added convenience of going home
4689 when called with no args.
4694 when called with no args.
4690
4695
4691 * pushd/popd slightly modified to mimic shell behavior more
4696 * pushd/popd slightly modified to mimic shell behavior more
4692 closely.
4697 closely.
4693
4698
4694 * Added env,pushd,popd from ShellServices as magic functions. I
4699 * Added env,pushd,popd from ShellServices as magic functions. I
4695 think the cleanest will be to port all desired functions from
4700 think the cleanest will be to port all desired functions from
4696 ShellServices as magics and remove ShellServices altogether. This
4701 ShellServices as magics and remove ShellServices altogether. This
4697 will provide a single, clean way of adding functionality
4702 will provide a single, clean way of adding functionality
4698 (shell-type or otherwise) to IP.
4703 (shell-type or otherwise) to IP.
4699
4704
4700 2001-11-04 Fernando Perez <fperez@colorado.edu>
4705 2001-11-04 Fernando Perez <fperez@colorado.edu>
4701
4706
4702 * Added .ipython/ directory to sys.path. This way users can keep
4707 * Added .ipython/ directory to sys.path. This way users can keep
4703 customizations there and access them via import.
4708 customizations there and access them via import.
4704
4709
4705 2001-11-03 Fernando Perez <fperez@colorado.edu>
4710 2001-11-03 Fernando Perez <fperez@colorado.edu>
4706
4711
4707 * Opened version 0.1.1 for new changes.
4712 * Opened version 0.1.1 for new changes.
4708
4713
4709 * Changed version number to 0.1.0: first 'public' release, sent to
4714 * Changed version number to 0.1.0: first 'public' release, sent to
4710 Nathan and Janko.
4715 Nathan and Janko.
4711
4716
4712 * Lots of small fixes and tweaks.
4717 * Lots of small fixes and tweaks.
4713
4718
4714 * Minor changes to whos format. Now strings are shown, snipped if
4719 * Minor changes to whos format. Now strings are shown, snipped if
4715 too long.
4720 too long.
4716
4721
4717 * Changed ShellServices to work on __main__ so they show up in @who
4722 * Changed ShellServices to work on __main__ so they show up in @who
4718
4723
4719 * Help also works with ? at the end of a line:
4724 * Help also works with ? at the end of a line:
4720 ?sin and sin?
4725 ?sin and sin?
4721 both produce the same effect. This is nice, as often I use the
4726 both produce the same effect. This is nice, as often I use the
4722 tab-complete to find the name of a method, but I used to then have
4727 tab-complete to find the name of a method, but I used to then have
4723 to go to the beginning of the line to put a ? if I wanted more
4728 to go to the beginning of the line to put a ? if I wanted more
4724 info. Now I can just add the ? and hit return. Convenient.
4729 info. Now I can just add the ? and hit return. Convenient.
4725
4730
4726 2001-11-02 Fernando Perez <fperez@colorado.edu>
4731 2001-11-02 Fernando Perez <fperez@colorado.edu>
4727
4732
4728 * Python version check (>=2.1) added.
4733 * Python version check (>=2.1) added.
4729
4734
4730 * Added LazyPython documentation. At this point the docs are quite
4735 * Added LazyPython documentation. At this point the docs are quite
4731 a mess. A cleanup is in order.
4736 a mess. A cleanup is in order.
4732
4737
4733 * Auto-installer created. For some bizarre reason, the zipfiles
4738 * Auto-installer created. For some bizarre reason, the zipfiles
4734 module isn't working on my system. So I made a tar version
4739 module isn't working on my system. So I made a tar version
4735 (hopefully the command line options in various systems won't kill
4740 (hopefully the command line options in various systems won't kill
4736 me).
4741 me).
4737
4742
4738 * Fixes to Struct in genutils. Now all dictionary-like methods are
4743 * Fixes to Struct in genutils. Now all dictionary-like methods are
4739 protected (reasonably).
4744 protected (reasonably).
4740
4745
4741 * Added pager function to genutils and changed ? to print usage
4746 * Added pager function to genutils and changed ? to print usage
4742 note through it (it was too long).
4747 note through it (it was too long).
4743
4748
4744 * Added the LazyPython functionality. Works great! I changed the
4749 * Added the LazyPython functionality. Works great! I changed the
4745 auto-quote escape to ';', it's on home row and next to '. But
4750 auto-quote escape to ';', it's on home row and next to '. But
4746 both auto-quote and auto-paren (still /) escapes are command-line
4751 both auto-quote and auto-paren (still /) escapes are command-line
4747 parameters.
4752 parameters.
4748
4753
4749
4754
4750 2001-11-01 Fernando Perez <fperez@colorado.edu>
4755 2001-11-01 Fernando Perez <fperez@colorado.edu>
4751
4756
4752 * Version changed to 0.0.7. Fairly large change: configuration now
4757 * Version changed to 0.0.7. Fairly large change: configuration now
4753 is all stored in a directory, by default .ipython. There, all
4758 is all stored in a directory, by default .ipython. There, all
4754 config files have normal looking names (not .names)
4759 config files have normal looking names (not .names)
4755
4760
4756 * Version 0.0.6 Released first to Lucas and Archie as a test
4761 * Version 0.0.6 Released first to Lucas and Archie as a test
4757 run. Since it's the first 'semi-public' release, change version to
4762 run. Since it's the first 'semi-public' release, change version to
4758 > 0.0.6 for any changes now.
4763 > 0.0.6 for any changes now.
4759
4764
4760 * Stuff I had put in the ipplib.py changelog:
4765 * Stuff I had put in the ipplib.py changelog:
4761
4766
4762 Changes to InteractiveShell:
4767 Changes to InteractiveShell:
4763
4768
4764 - Made the usage message a parameter.
4769 - Made the usage message a parameter.
4765
4770
4766 - Require the name of the shell variable to be given. It's a bit
4771 - Require the name of the shell variable to be given. It's a bit
4767 of a hack, but allows the name 'shell' not to be hardwire in the
4772 of a hack, but allows the name 'shell' not to be hardwire in the
4768 magic (@) handler, which is problematic b/c it requires
4773 magic (@) handler, which is problematic b/c it requires
4769 polluting the global namespace with 'shell'. This in turn is
4774 polluting the global namespace with 'shell'. This in turn is
4770 fragile: if a user redefines a variable called shell, things
4775 fragile: if a user redefines a variable called shell, things
4771 break.
4776 break.
4772
4777
4773 - magic @: all functions available through @ need to be defined
4778 - magic @: all functions available through @ need to be defined
4774 as magic_<name>, even though they can be called simply as
4779 as magic_<name>, even though they can be called simply as
4775 @<name>. This allows the special command @magic to gather
4780 @<name>. This allows the special command @magic to gather
4776 information automatically about all existing magic functions,
4781 information automatically about all existing magic functions,
4777 even if they are run-time user extensions, by parsing the shell
4782 even if they are run-time user extensions, by parsing the shell
4778 instance __dict__ looking for special magic_ names.
4783 instance __dict__ looking for special magic_ names.
4779
4784
4780 - mainloop: added *two* local namespace parameters. This allows
4785 - mainloop: added *two* local namespace parameters. This allows
4781 the class to differentiate between parameters which were there
4786 the class to differentiate between parameters which were there
4782 before and after command line initialization was processed. This
4787 before and after command line initialization was processed. This
4783 way, later @who can show things loaded at startup by the
4788 way, later @who can show things loaded at startup by the
4784 user. This trick was necessary to make session saving/reloading
4789 user. This trick was necessary to make session saving/reloading
4785 really work: ideally after saving/exiting/reloading a session,
4790 really work: ideally after saving/exiting/reloading a session,
4786 *everythin* should look the same, including the output of @who. I
4791 *everythin* should look the same, including the output of @who. I
4787 was only able to make this work with this double namespace
4792 was only able to make this work with this double namespace
4788 trick.
4793 trick.
4789
4794
4790 - added a header to the logfile which allows (almost) full
4795 - added a header to the logfile which allows (almost) full
4791 session restoring.
4796 session restoring.
4792
4797
4793 - prepend lines beginning with @ or !, with a and log
4798 - prepend lines beginning with @ or !, with a and log
4794 them. Why? !lines: may be useful to know what you did @lines:
4799 them. Why? !lines: may be useful to know what you did @lines:
4795 they may affect session state. So when restoring a session, at
4800 they may affect session state. So when restoring a session, at
4796 least inform the user of their presence. I couldn't quite get
4801 least inform the user of their presence. I couldn't quite get
4797 them to properly re-execute, but at least the user is warned.
4802 them to properly re-execute, but at least the user is warned.
4798
4803
4799 * Started ChangeLog.
4804 * Started ChangeLog.
@@ -1,9259 +1,9307 b''
1 #LyX 1.3 created this file. For more info see http://www.lyx.org/
1 #LyX 1.3 created this file. For more info see http://www.lyx.org/
2 \lyxformat 221
2 \lyxformat 221
3 \textclass article
3 \textclass article
4 \begin_preamble
4 \begin_preamble
5 %\usepackage{ae,aecompl}
5 %\usepackage{ae,aecompl}
6 \usepackage{color}
6 \usepackage{color}
7
7
8 % A few colors to replace the defaults for certain link types
8 % A few colors to replace the defaults for certain link types
9 \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
9 \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
10 \definecolor{darkorange}{rgb}{.71,0.21,0.01}
10 \definecolor{darkorange}{rgb}{.71,0.21,0.01}
11 \definecolor{darkred}{rgb}{.52,0.08,0.01}
11 \definecolor{darkred}{rgb}{.52,0.08,0.01}
12 \definecolor{darkgreen}{rgb}{.12,.54,.11}
12 \definecolor{darkgreen}{rgb}{.12,.54,.11}
13
13
14 % Use and configure listings package for nicely formatted code
14 % Use and configure listings package for nicely formatted code
15 \usepackage{listings}
15 \usepackage{listings}
16 \lstset{
16 \lstset{
17 language=Python,
17 language=Python,
18 basicstyle=\small\ttfamily,
18 basicstyle=\small\ttfamily,
19 commentstyle=\ttfamily\color{blue},
19 commentstyle=\ttfamily\color{blue},
20 stringstyle=\ttfamily\color{darkorange},
20 stringstyle=\ttfamily\color{darkorange},
21 showstringspaces=false,
21 showstringspaces=false,
22 breaklines=true,
22 breaklines=true,
23 postbreak = \space\dots
23 postbreak = \space\dots
24 }
24 }
25
25
26 \usepackage[%pdftex, % needed for pdflatex
26 \usepackage[%pdftex, % needed for pdflatex
27 breaklinks=true, % so long urls are correctly broken across lines
27 breaklinks=true, % so long urls are correctly broken across lines
28 colorlinks=true,
28 colorlinks=true,
29 urlcolor=blue,
29 urlcolor=blue,
30 linkcolor=darkred,
30 linkcolor=darkred,
31 citecolor=darkgreen,
31 citecolor=darkgreen,
32 ]{hyperref}
32 ]{hyperref}
33
33
34 \usepackage{html}
34 \usepackage{html}
35
35
36 % This helps prevent overly long lines that stretch beyond the margins
36 % This helps prevent overly long lines that stretch beyond the margins
37 \sloppy
37 \sloppy
38
38
39 % Define a \codelist command which either uses listings for latex, or
39 % Define a \codelist command which either uses listings for latex, or
40 % plain verbatim for html (since latex2html doesn't understand the
40 % plain verbatim for html (since latex2html doesn't understand the
41 % listings package).
41 % listings package).
42 \usepackage{verbatim}
42 \usepackage{verbatim}
43 \newcommand{\codelist}[1] {
43 \newcommand{\codelist}[1] {
44 \latex{\lstinputlisting{#1}}
44 \latex{\lstinputlisting{#1}}
45 \html{\verbatiminput{#1}}
45 \html{\verbatiminput{#1}}
46 }
46 }
47 \end_preamble
47 \end_preamble
48 \language english
48 \language english
49 \inputencoding latin1
49 \inputencoding latin1
50 \fontscheme palatino
50 \fontscheme palatino
51 \graphics default
51 \graphics default
52 \paperfontsize 10
52 \paperfontsize 10
53 \spacing single
53 \spacing single
54 \papersize Default
54 \papersize Default
55 \paperpackage a4
55 \paperpackage a4
56 \use_geometry 1
56 \use_geometry 1
57 \use_amsmath 0
57 \use_amsmath 0
58 \use_natbib 0
58 \use_natbib 0
59 \use_numerical_citations 0
59 \use_numerical_citations 0
60 \paperorientation portrait
60 \paperorientation portrait
61 \leftmargin 1.1in
61 \leftmargin 1.1in
62 \topmargin 1in
62 \topmargin 1in
63 \rightmargin 1.1in
63 \rightmargin 1.1in
64 \bottommargin 1in
64 \bottommargin 1in
65 \secnumdepth 3
65 \secnumdepth 3
66 \tocdepth 3
66 \tocdepth 3
67 \paragraph_separation skip
67 \paragraph_separation skip
68 \defskip medskip
68 \defskip medskip
69 \quotes_language english
69 \quotes_language english
70 \quotes_times 2
70 \quotes_times 2
71 \papercolumns 1
71 \papercolumns 1
72 \papersides 1
72 \papersides 1
73 \paperpagestyle fancy
73 \paperpagestyle fancy
74
74
75 \layout Title
75 \layout Title
76
76
77 IPython
77 IPython
78 \newline
78 \newline
79
79
80 \size larger
80 \size larger
81 An enhanced Interactive Python
81 An enhanced Interactive Python
82 \size large
82 \size large
83
83
84 \newline
84 \newline
85 User Manual, v.
85 User Manual, v.
86 __version__
86 __version__
87 \layout Author
87 \layout Author
88
88
89 Fernando P�rez
89 Fernando P�rez
90 \layout Standard
90 \layout Standard
91
91
92
92
93 \begin_inset ERT
93 \begin_inset ERT
94 status Collapsed
94 status Collapsed
95
95
96 \layout Standard
96 \layout Standard
97
97
98 \backslash
98 \backslash
99 latex{
99 latex{
100 \end_inset
100 \end_inset
101
101
102
102
103 \begin_inset LatexCommand \tableofcontents{}
103 \begin_inset LatexCommand \tableofcontents{}
104
104
105 \end_inset
105 \end_inset
106
106
107
107
108 \begin_inset ERT
108 \begin_inset ERT
109 status Collapsed
109 status Collapsed
110
110
111 \layout Standard
111 \layout Standard
112 }
112 }
113 \end_inset
113 \end_inset
114
114
115
115
116 \layout Standard
116 \layout Standard
117
117
118
118
119 \begin_inset ERT
119 \begin_inset ERT
120 status Open
120 status Open
121
121
122 \layout Standard
122 \layout Standard
123
123
124 \backslash
124 \backslash
125 html{
125 html{
126 \backslash
126 \backslash
127 bodytext{bgcolor=#ffffff}}
127 bodytext{bgcolor=#ffffff}}
128 \end_inset
128 \end_inset
129
129
130
130
131 \layout Section
131 \layout Section
132 \pagebreak_top
132 \pagebreak_top
133 Overview
133 Overview
134 \layout Standard
134 \layout Standard
135
135
136 One of Python's most useful features is its interactive interpreter.
136 One of Python's most useful features is its interactive interpreter.
137 This system allows very fast testing of ideas without the overhead of creating
137 This system allows very fast testing of ideas without the overhead of creating
138 test files as is typical in most programming languages.
138 test files as is typical in most programming languages.
139 However, the interpreter supplied with the standard Python distribution
139 However, the interpreter supplied with the standard Python distribution
140 is somewhat limited for extended interactive use.
140 is somewhat limited for extended interactive use.
141 \layout Standard
141 \layout Standard
142
142
143 IPython is a free software project (released under the BSD license) which
143 IPython is a free software project (released under the BSD license) which
144 tries to:
144 tries to:
145 \layout Enumerate
145 \layout Enumerate
146
146
147 Provide an interactive shell superior to Python's default.
147 Provide an interactive shell superior to Python's default.
148 IPython has many features for object introspection, system shell access,
148 IPython has many features for object introspection, system shell access,
149 and its own special command system for adding functionality when working
149 and its own special command system for adding functionality when working
150 interactively.
150 interactively.
151 It tries to be a very efficient environment both for Python code development
151 It tries to be a very efficient environment both for Python code development
152 and for exploration of problems using Python objects (in situations like
152 and for exploration of problems using Python objects (in situations like
153 data analysis).
153 data analysis).
154 \layout Enumerate
154 \layout Enumerate
155
155
156 Serve as an embeddable, ready to use interpreter for your own programs.
156 Serve as an embeddable, ready to use interpreter for your own programs.
157 IPython can be started with a single call from inside another program,
157 IPython can be started with a single call from inside another program,
158 providing access to the current namespace.
158 providing access to the current namespace.
159 This can be very useful both for debugging purposes and for situations
159 This can be very useful both for debugging purposes and for situations
160 where a blend of batch-processing and interactive exploration are needed.
160 where a blend of batch-processing and interactive exploration are needed.
161 \layout Enumerate
161 \layout Enumerate
162
162
163 Offer a flexible framework which can be used as the base environment for
163 Offer a flexible framework which can be used as the base environment for
164 other systems with Python as the underlying language.
164 other systems with Python as the underlying language.
165 Specifically scientific environments like Mathematica, IDL and Matlab inspired
165 Specifically scientific environments like Mathematica, IDL and Matlab inspired
166 its design, but similar ideas can be useful in many fields.
166 its design, but similar ideas can be useful in many fields.
167 \layout Enumerate
167 \layout Enumerate
168
168
169 Allow interactive testing of threaded graphical toolkits.
169 Allow interactive testing of threaded graphical toolkits.
170 IPython has support for interactive, non-blocking control of GTK, Qt and
170 IPython has support for interactive, non-blocking control of GTK, Qt and
171 WX applications via special threading flags.
171 WX applications via special threading flags.
172 The normal Python shell can only do this for Tkinter applications.
172 The normal Python shell can only do this for Tkinter applications.
173 \layout Subsection
173 \layout Subsection
174
174
175 Main features
175 Main features
176 \layout Itemize
176 \layout Itemize
177
177
178 Dynamic object introspection.
178 Dynamic object introspection.
179 One can access docstrings, function definition prototypes, source code,
179 One can access docstrings, function definition prototypes, source code,
180 source files and other details of any object accessible to the interpreter
180 source files and other details of any object accessible to the interpreter
181 with a single keystroke (`
181 with a single keystroke (`
182 \family typewriter
182 \family typewriter
183 ?
183 ?
184 \family default
184 \family default
185 ', and using `
185 ', and using `
186 \family typewriter
186 \family typewriter
187 ??
187 ??
188 \family default
188 \family default
189 ' provides additional detail).
189 ' provides additional detail).
190 \layout Itemize
190 \layout Itemize
191
191
192 Searching through modules and namespaces with `
192 Searching through modules and namespaces with `
193 \family typewriter
193 \family typewriter
194 *
194 *
195 \family default
195 \family default
196 ' wildcards, both when using the `
196 ' wildcards, both when using the `
197 \family typewriter
197 \family typewriter
198 ?
198 ?
199 \family default
199 \family default
200 ' system and via the
200 ' system and via the
201 \family typewriter
201 \family typewriter
202 %psearch
202 %psearch
203 \family default
203 \family default
204 command.
204 command.
205 \layout Itemize
205 \layout Itemize
206
206
207 Completion in the local namespace, by typing TAB at the prompt.
207 Completion in the local namespace, by typing TAB at the prompt.
208 This works for keywords, methods, variables and files in the current directory.
208 This works for keywords, methods, variables and files in the current directory.
209 This is supported via the readline library, and full access to configuring
209 This is supported via the readline library, and full access to configuring
210 readline's behavior is provided.
210 readline's behavior is provided.
211 \layout Itemize
211 \layout Itemize
212
212
213 Numbered input/output prompts with command history (persistent across sessions
213 Numbered input/output prompts with command history (persistent across sessions
214 and tied to each profile), full searching in this history and caching of
214 and tied to each profile), full searching in this history and caching of
215 all input and output.
215 all input and output.
216 \layout Itemize
216 \layout Itemize
217
217
218 User-extensible `magic' commands.
218 User-extensible `magic' commands.
219 A set of commands prefixed with
219 A set of commands prefixed with
220 \family typewriter
220 \family typewriter
221 %
221 %
222 \family default
222 \family default
223 is available for controlling IPython itself and provides directory control,
223 is available for controlling IPython itself and provides directory control,
224 namespace information and many aliases to common system shell commands.
224 namespace information and many aliases to common system shell commands.
225 \layout Itemize
225 \layout Itemize
226
226
227 Alias facility for defining your own system aliases.
227 Alias facility for defining your own system aliases.
228 \layout Itemize
228 \layout Itemize
229
229
230 Complete system shell access.
230 Complete system shell access.
231 Lines starting with ! are passed directly to the system shell, and using
231 Lines starting with ! are passed directly to the system shell, and using
232 !! captures shell output into python variables for further use.
232 !! captures shell output into python variables for further use.
233 \layout Itemize
233 \layout Itemize
234
234
235 Background execution of Python commands in a separate thread.
235 Background execution of Python commands in a separate thread.
236 IPython has an internal job manager called
236 IPython has an internal job manager called
237 \family typewriter
237 \family typewriter
238 jobs
238 jobs
239 \family default
239 \family default
240 , and a conveninence backgrounding magic function called
240 , and a conveninence backgrounding magic function called
241 \family typewriter
241 \family typewriter
242 %bg
242 %bg
243 \family default
243 \family default
244 .
244 .
245 \layout Itemize
245 \layout Itemize
246
246
247 The ability to expand python variables when calling the system shell.
247 The ability to expand python variables when calling the system shell.
248 In a shell command, any python variable prefixed with
248 In a shell command, any python variable prefixed with
249 \family typewriter
249 \family typewriter
250 $
250 $
251 \family default
251 \family default
252 is expanded.
252 is expanded.
253 A double
253 A double
254 \family typewriter
254 \family typewriter
255 $$
255 $$
256 \family default
256 \family default
257 allows passing a literal
257 allows passing a literal
258 \family typewriter
258 \family typewriter
259 $
259 $
260 \family default
260 \family default
261 to the shell (for access to shell and environment variables like
261 to the shell (for access to shell and environment variables like
262 \family typewriter
262 \family typewriter
263 $PATH
263 $PATH
264 \family default
264 \family default
265 ).
265 ).
266 \layout Itemize
266 \layout Itemize
267
267
268 Filesystem navigation, via a magic
268 Filesystem navigation, via a magic
269 \family typewriter
269 \family typewriter
270 %cd
270 %cd
271 \family default
271 \family default
272 command, along with a persistent bookmark system (using
272 command, along with a persistent bookmark system (using
273 \family typewriter
273 \family typewriter
274 %bookmark
274 %bookmark
275 \family default
275 \family default
276 ) for fast access to frequently visited directories.
276 ) for fast access to frequently visited directories.
277 \layout Itemize
277 \layout Itemize
278
278
279 A lightweight persistence framework via the
279 A lightweight persistence framework via the
280 \family typewriter
280 \family typewriter
281 %store
281 %store
282 \family default
282 \family default
283 command, which allows you to save arbitrary Python variables.
283 command, which allows you to save arbitrary Python variables.
284 These get restored automatically when your session restarts.
284 These get restored automatically when your session restarts.
285 \layout Itemize
285 \layout Itemize
286
286
287 Automatic indentation (optional) of code as you type (through the readline
287 Automatic indentation (optional) of code as you type (through the readline
288 library).
288 library).
289 \layout Itemize
289 \layout Itemize
290
290
291 Macro system for quickly re-executing multiple lines of previous input with
291 Macro system for quickly re-executing multiple lines of previous input with
292 a single name.
292 a single name.
293 Macros can be stored persistently via
293 Macros can be stored persistently via
294 \family typewriter
294 \family typewriter
295 %store
295 %store
296 \family default
296 \family default
297 and edited via
297 and edited via
298 \family typewriter
298 \family typewriter
299 %edit
299 %edit
300 \family default
300 \family default
301 .
301 .
302
302
303 \layout Itemize
303 \layout Itemize
304
304
305 Session logging (you can then later use these logs as code in your programs).
305 Session logging (you can then later use these logs as code in your programs).
306 Logs can optionally timestamp all input, and also store session output
306 Logs can optionally timestamp all input, and also store session output
307 (marked as comments, so the log remains valid Python source code).
307 (marked as comments, so the log remains valid Python source code).
308 \layout Itemize
308 \layout Itemize
309
309
310 Session restoring: logs can be replayed to restore a previous session to
310 Session restoring: logs can be replayed to restore a previous session to
311 the state where you left it.
311 the state where you left it.
312 \layout Itemize
312 \layout Itemize
313
313
314 Verbose and colored exception traceback printouts.
314 Verbose and colored exception traceback printouts.
315 Easier to parse visually, and in verbose mode they produce a lot of useful
315 Easier to parse visually, and in verbose mode they produce a lot of useful
316 debugging information (basically a terminal version of the cgitb module).
316 debugging information (basically a terminal version of the cgitb module).
317 \layout Itemize
317 \layout Itemize
318
318
319 Auto-parentheses: callable objects can be executed without parentheses:
319 Auto-parentheses: callable objects can be executed without parentheses:
320
320
321 \family typewriter
321 \family typewriter
322 `sin 3'
322 `sin 3'
323 \family default
323 \family default
324 is automatically converted to
324 is automatically converted to
325 \family typewriter
325 \family typewriter
326 `sin(3)
326 `sin(3)
327 \family default
327 \family default
328 '.
328 '.
329 \layout Itemize
329 \layout Itemize
330
330
331 Auto-quoting: using `
331 Auto-quoting: using `
332 \family typewriter
332 \family typewriter
333 ,
333 ,
334 \family default
334 \family default
335 ' or `
335 ' or `
336 \family typewriter
336 \family typewriter
337 ;
337 ;
338 \family default
338 \family default
339 ' as the first character forces auto-quoting of the rest of the line:
339 ' as the first character forces auto-quoting of the rest of the line:
340 \family typewriter
340 \family typewriter
341 `,my_function a\SpecialChar ~
341 `,my_function a\SpecialChar ~
342 b'
342 b'
343 \family default
343 \family default
344 becomes automatically
344 becomes automatically
345 \family typewriter
345 \family typewriter
346 `my_function("a","b")'
346 `my_function("a","b")'
347 \family default
347 \family default
348 , while
348 , while
349 \family typewriter
349 \family typewriter
350 `;my_function a\SpecialChar ~
350 `;my_function a\SpecialChar ~
351 b'
351 b'
352 \family default
352 \family default
353 becomes
353 becomes
354 \family typewriter
354 \family typewriter
355 `my_function("a b")'
355 `my_function("a b")'
356 \family default
356 \family default
357 .
357 .
358 \layout Itemize
358 \layout Itemize
359
359
360 Extensible input syntax.
360 Extensible input syntax.
361 You can define filters that pre-process user input to simplify input in
361 You can define filters that pre-process user input to simplify input in
362 special situations.
362 special situations.
363 This allows for example pasting multi-line code fragments which start with
363 This allows for example pasting multi-line code fragments which start with
364
364
365 \family typewriter
365 \family typewriter
366 `>>>'
366 `>>>'
367 \family default
367 \family default
368 or
368 or
369 \family typewriter
369 \family typewriter
370 `...'
370 `...'
371 \family default
371 \family default
372 such as those from other python sessions or the standard Python documentation.
372 such as those from other python sessions or the standard Python documentation.
373 \layout Itemize
373 \layout Itemize
374
374
375 Flexible configuration system.
375 Flexible configuration system.
376 It uses a configuration file which allows permanent setting of all command-line
376 It uses a configuration file which allows permanent setting of all command-line
377 options, module loading, code and file execution.
377 options, module loading, code and file execution.
378 The system allows recursive file inclusion, so you can have a base file
378 The system allows recursive file inclusion, so you can have a base file
379 with defaults and layers which load other customizations for particular
379 with defaults and layers which load other customizations for particular
380 projects.
380 projects.
381 \layout Itemize
381 \layout Itemize
382
382
383 Embeddable.
383 Embeddable.
384 You can call IPython as a python shell inside your own python programs.
384 You can call IPython as a python shell inside your own python programs.
385 This can be used both for debugging code or for providing interactive abilities
385 This can be used both for debugging code or for providing interactive abilities
386 to your programs with knowledge about the local namespaces (very useful
386 to your programs with knowledge about the local namespaces (very useful
387 in debugging and data analysis situations).
387 in debugging and data analysis situations).
388 \layout Itemize
388 \layout Itemize
389
389
390 Easy debugger access.
390 Easy debugger access.
391 You can set IPython to call up an enhanced version of the Python debugger
391 You can set IPython to call up an enhanced version of the Python debugger
392 (
392 (
393 \family typewriter
393 \family typewriter
394 pdb
394 pdb
395 \family default
395 \family default
396 ) every time there is an uncaught exception.
396 ) every time there is an uncaught exception.
397 This drops you inside the code which triggered the exception with all the
397 This drops you inside the code which triggered the exception with all the
398 data live and it is possible to navigate the stack to rapidly isolate the
398 data live and it is possible to navigate the stack to rapidly isolate the
399 source of a bug.
399 source of a bug.
400 The
400 The
401 \family typewriter
401 \family typewriter
402 %run
402 %run
403 \family default
403 \family default
404 magic command --with the
404 magic command --with the
405 \family typewriter
405 \family typewriter
406 -d
406 -d
407 \family default
407 \family default
408 option-- can run any script under
408 option-- can run any script under
409 \family typewriter
409 \family typewriter
410 pdb
410 pdb
411 \family default
411 \family default
412 's control, automatically setting initial breakpoints for you.
412 's control, automatically setting initial breakpoints for you.
413 This version of
413 This version of
414 \family typewriter
414 \family typewriter
415 pdb
415 pdb
416 \family default
416 \family default
417 has IPython-specific improvements, including tab-completion and traceback
417 has IPython-specific improvements, including tab-completion and traceback
418 coloring support.
418 coloring support.
419 \layout Itemize
419 \layout Itemize
420
420
421 Profiler support.
421 Profiler support.
422 You can run single statements (similar to
422 You can run single statements (similar to
423 \family typewriter
423 \family typewriter
424 profile.run()
424 profile.run()
425 \family default
425 \family default
426 ) or complete programs under the profiler's control.
426 ) or complete programs under the profiler's control.
427 While this is possible with the standard
427 While this is possible with the standard
428 \family typewriter
428 \family typewriter
429 profile
429 profile
430 \family default
430 \family default
431 module, IPython wraps this functionality with magic commands (see
431 module, IPython wraps this functionality with magic commands (see
432 \family typewriter
432 \family typewriter
433 `%prun'
433 `%prun'
434 \family default
434 \family default
435 and
435 and
436 \family typewriter
436 \family typewriter
437 `%run -p
437 `%run -p
438 \family default
438 \family default
439 ') convenient for rapid interactive work.
439 ') convenient for rapid interactive work.
440 \layout Subsection
440 \layout Subsection
441
441
442 Portability and Python requirements
442 Portability and Python requirements
443 \layout Standard
443 \layout Standard
444
444
445
445
446 \series bold
446 \series bold
447 Python requirements:
447 Python requirements:
448 \series default
448 \series default
449 IPython requires with Python version 2.3 or newer.
449 IPython requires with Python version 2.3 or newer.
450 If you are still using Python 2.2 and can not upgrade, the last version
450 If you are still using Python 2.2 and can not upgrade, the last version
451 of IPython which worked with Python 2.2 was 0.6.15, so you will have to use
451 of IPython which worked with Python 2.2 was 0.6.15, so you will have to use
452 that.
452 that.
453 \layout Standard
453 \layout Standard
454
454
455 IPython is developed under
455 IPython is developed under
456 \series bold
456 \series bold
457 Linux
457 Linux
458 \series default
458 \series default
459 , but it should work in any reasonable Unix-type system (tested OK under
459 , but it should work in any reasonable Unix-type system (tested OK under
460 Solaris and the *BSD family, for which a port exists thanks to Dryice Liu).
460 Solaris and the *BSD family, for which a port exists thanks to Dryice Liu).
461 \layout Standard
461 \layout Standard
462
462
463
463
464 \series bold
464 \series bold
465 Mac OS X
465 Mac OS X
466 \series default
466 \series default
467 : it works, apparently without any problems (thanks to Jim Boyle at Lawrence
467 : it works, apparently without any problems (thanks to Jim Boyle at Lawrence
468 Livermore for the information).
468 Livermore for the information).
469 Thanks to Andrea Riciputi, Fink support is available.
469 Thanks to Andrea Riciputi, Fink support is available.
470 \layout Standard
470 \layout Standard
471
471
472
472
473 \series bold
473 \series bold
474 CygWin
474 CygWin
475 \series default
475 \series default
476 : it works mostly OK, though some users have reported problems with prompt
476 : it works mostly OK, though some users have reported problems with prompt
477 coloring.
477 coloring.
478 No satisfactory solution to this has been found so far, you may want to
478 No satisfactory solution to this has been found so far, you may want to
479 disable colors permanently in the
479 disable colors permanently in the
480 \family typewriter
480 \family typewriter
481 ipythonrc
481 ipythonrc
482 \family default
482 \family default
483 configuration file if you experience problems.
483 configuration file if you experience problems.
484 If you have proper color support under cygwin, please post to the IPython
484 If you have proper color support under cygwin, please post to the IPython
485 mailing list so this issue can be resolved for all users.
485 mailing list so this issue can be resolved for all users.
486 \layout Standard
486 \layout Standard
487
487
488
488
489 \series bold
489 \series bold
490 Windows
490 Windows
491 \series default
491 \series default
492 : it works well under Windows XP/2k, and I suspect NT should behave similarly.
492 : it works well under Windows XP/2k, and I suspect NT should behave similarly.
493 Section\SpecialChar ~
493 Section\SpecialChar ~
494
494
495 \begin_inset LatexCommand \ref{sub:Under-Windows}
495 \begin_inset LatexCommand \ref{sub:Under-Windows}
496
496
497 \end_inset
497 \end_inset
498
498
499 describes installation details for Windows, including some additional tools
499 describes installation details for Windows, including some additional tools
500 needed on this platform.
500 needed on this platform.
501 \layout Standard
501 \layout Standard
502
502
503 Windows 9x support is present, and has been reported to work fine (at least
503 Windows 9x support is present, and has been reported to work fine (at least
504 on WinME).
504 on WinME).
505 \layout Standard
505 \layout Standard
506
506
507 Note, that I have very little access to and experience with Windows development.
507 Note, that I have very little access to and experience with Windows development.
508 However, an excellent group of Win32 users (led by Ville Vainio), consistenly
508 However, an excellent group of Win32 users (led by Ville Vainio), consistenly
509 contribute bugfixes and platform-specific enhancements, so they more than
509 contribute bugfixes and platform-specific enhancements, so they more than
510 make up for my deficiencies on that front.
510 make up for my deficiencies on that front.
511 In fact, Win32 users report using IPython as a system shell (see Sec.\SpecialChar ~
511 In fact, Win32 users report using IPython as a system shell (see Sec.\SpecialChar ~
512
512
513 \begin_inset LatexCommand \ref{sec:IPython-as-shell}
513 \begin_inset LatexCommand \ref{sec:IPython-as-shell}
514
514
515 \end_inset
515 \end_inset
516
516
517 for details), as it offers a level of control and features which the default
517 for details), as it offers a level of control and features which the default
518
518
519 \family typewriter
519 \family typewriter
520 cmd.exe
520 cmd.exe
521 \family default
521 \family default
522 doesn't provide.
522 doesn't provide.
523 \layout Subsection
523 \layout Subsection
524
524
525 Location
525 Location
526 \layout Standard
526 \layout Standard
527
527
528 IPython is generously hosted at
528 IPython is generously hosted at
529 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
529 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
530
530
531 \end_inset
531 \end_inset
532
532
533 by the Enthought, Inc and the SciPy project.
533 by the Enthought, Inc and the SciPy project.
534 This site offers downloads, subversion access, mailing lists and a bug
534 This site offers downloads, subversion access, mailing lists and a bug
535 tracking system.
535 tracking system.
536 I am very grateful to Enthought (
536 I am very grateful to Enthought (
537 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
537 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
538
538
539 \end_inset
539 \end_inset
540
540
541 ) and all of the SciPy team for their contribution.
541 ) and all of the SciPy team for their contribution.
542 \layout Section
542 \layout Section
543
543
544
544
545 \begin_inset LatexCommand \label{sec:install}
545 \begin_inset LatexCommand \label{sec:install}
546
546
547 \end_inset
547 \end_inset
548
548
549 Installation
549 Installation
550 \layout Subsection
550 \layout Subsection
551
551
552 Instant instructions
552 Instant instructions
553 \layout Standard
553 \layout Standard
554
554
555 If you are of the impatient kind, under Linux/Unix simply untar/unzip the
555 If you are of the impatient kind, under Linux/Unix simply untar/unzip the
556 download, then install with
556 download, then install with
557 \family typewriter
557 \family typewriter
558 `python setup.py install'
558 `python setup.py install'
559 \family default
559 \family default
560 .
560 .
561 Under Windows, double-click on the provided
561 Under Windows, double-click on the provided
562 \family typewriter
562 \family typewriter
563 .exe
563 .exe
564 \family default
564 \family default
565 binary installer.
565 binary installer.
566 \layout Standard
566 \layout Standard
567
567
568 Then, take a look at Sections
568 Then, take a look at Sections
569 \begin_inset LatexCommand \ref{sec:good_config}
569 \begin_inset LatexCommand \ref{sec:good_config}
570
570
571 \end_inset
571 \end_inset
572
572
573 for configuring things optimally and
573 for configuring things optimally and
574 \begin_inset LatexCommand \ref{sec:quick_tips}
574 \begin_inset LatexCommand \ref{sec:quick_tips}
575
575
576 \end_inset
576 \end_inset
577
577
578 for quick tips on efficient use of IPython.
578 for quick tips on efficient use of IPython.
579 You can later refer to the rest of the manual for all the gory details.
579 You can later refer to the rest of the manual for all the gory details.
580 \layout Standard
580 \layout Standard
581
581
582 See the notes in sec.
582 See the notes in sec.
583
583
584 \begin_inset LatexCommand \ref{sec:upgrade}
584 \begin_inset LatexCommand \ref{sec:upgrade}
585
585
586 \end_inset
586 \end_inset
587
587
588 for upgrading IPython versions.
588 for upgrading IPython versions.
589 \layout Subsection
589 \layout Subsection
590
590
591 Detailed Unix instructions (Linux, Mac OS X, etc.)
591 Detailed Unix instructions (Linux, Mac OS X, etc.)
592 \layout Standard
592 \layout Standard
593
593
594 For RPM based systems, simply install the supplied package in the usual
594 For RPM based systems, simply install the supplied package in the usual
595 manner.
595 manner.
596 If you download the tar archive, the process is:
596 If you download the tar archive, the process is:
597 \layout Enumerate
597 \layout Enumerate
598
598
599 Unzip/untar the
599 Unzip/untar the
600 \family typewriter
600 \family typewriter
601 ipython-XXX.tar.gz
601 ipython-XXX.tar.gz
602 \family default
602 \family default
603 file wherever you want (
603 file wherever you want (
604 \family typewriter
604 \family typewriter
605 XXX
605 XXX
606 \family default
606 \family default
607 is the version number).
607 is the version number).
608 It will make a directory called
608 It will make a directory called
609 \family typewriter
609 \family typewriter
610 ipython-XXX.
610 ipython-XXX.
611
611
612 \family default
612 \family default
613 Change into that directory where you will find the files
613 Change into that directory where you will find the files
614 \family typewriter
614 \family typewriter
615 README
615 README
616 \family default
616 \family default
617 and
617 and
618 \family typewriter
618 \family typewriter
619 setup.py
619 setup.py
620 \family default
620 \family default
621 .
621 .
622
622
623 \family typewriter
623 \family typewriter
624 O
624 O
625 \family default
625 \family default
626 nce you've completed the installation, you can safely remove this directory.
626 nce you've completed the installation, you can safely remove this directory.
627
627
628 \layout Enumerate
628 \layout Enumerate
629
629
630 If you are installing over a previous installation of version 0.2.0 or earlier,
630 If you are installing over a previous installation of version 0.2.0 or earlier,
631 first remove your
631 first remove your
632 \family typewriter
632 \family typewriter
633 $HOME/.ipython
633 $HOME/.ipython
634 \family default
634 \family default
635 directory, since the configuration file format has changed somewhat (the
635 directory, since the configuration file format has changed somewhat (the
636 '=' were removed from all option specifications).
636 '=' were removed from all option specifications).
637 Or you can call ipython with the
637 Or you can call ipython with the
638 \family typewriter
638 \family typewriter
639 -upgrade
639 -upgrade
640 \family default
640 \family default
641 option and it will do this automatically for you.
641 option and it will do this automatically for you.
642 \layout Enumerate
642 \layout Enumerate
643
643
644 IPython uses distutils, so you can install it by simply typing at the system
644 IPython uses distutils, so you can install it by simply typing at the system
645 prompt (don't type the
645 prompt (don't type the
646 \family typewriter
646 \family typewriter
647 $
647 $
648 \family default
648 \family default
649 )
649 )
650 \newline
650 \newline
651
651
652 \family typewriter
652 \family typewriter
653 $ python setup.py install
653 $ python setup.py install
654 \family default
654 \family default
655
655
656 \newline
656 \newline
657 Note that this assumes you have root access to your machine.
657 Note that this assumes you have root access to your machine.
658 If you don't have root access or don't want IPython to go in the default
658 If you don't have root access or don't want IPython to go in the default
659 python directories, you'll need to use the
659 python directories, you'll need to use the
660 \begin_inset ERT
660 \begin_inset ERT
661 status Collapsed
661 status Collapsed
662
662
663 \layout Standard
663 \layout Standard
664
664
665 \backslash
665 \backslash
666 verb|--home|
666 verb|--home|
667 \end_inset
667 \end_inset
668
668
669 option (or
669 option (or
670 \begin_inset ERT
670 \begin_inset ERT
671 status Collapsed
671 status Collapsed
672
672
673 \layout Standard
673 \layout Standard
674
674
675 \backslash
675 \backslash
676 verb|--prefix|
676 verb|--prefix|
677 \end_inset
677 \end_inset
678
678
679 ).
679 ).
680 For example:
680 For example:
681 \newline
681 \newline
682
682
683 \begin_inset ERT
683 \begin_inset ERT
684 status Collapsed
684 status Collapsed
685
685
686 \layout Standard
686 \layout Standard
687
687
688 \backslash
688 \backslash
689 verb|$ python setup.py install --home $HOME/local|
689 verb|$ python setup.py install --home $HOME/local|
690 \end_inset
690 \end_inset
691
691
692
692
693 \newline
693 \newline
694 will install IPython into
694 will install IPython into
695 \family typewriter
695 \family typewriter
696 $HOME/local
696 $HOME/local
697 \family default
697 \family default
698 and its subdirectories (creating them if necessary).
698 and its subdirectories (creating them if necessary).
699 \newline
699 \newline
700 You can type
700 You can type
701 \newline
701 \newline
702
702
703 \begin_inset ERT
703 \begin_inset ERT
704 status Collapsed
704 status Collapsed
705
705
706 \layout Standard
706 \layout Standard
707
707
708 \backslash
708 \backslash
709 verb|$ python setup.py --help|
709 verb|$ python setup.py --help|
710 \end_inset
710 \end_inset
711
711
712
712
713 \newline
713 \newline
714 for more details.
714 for more details.
715 \newline
715 \newline
716 Note that if you change the default location for
716 Note that if you change the default location for
717 \begin_inset ERT
717 \begin_inset ERT
718 status Collapsed
718 status Collapsed
719
719
720 \layout Standard
720 \layout Standard
721
721
722 \backslash
722 \backslash
723 verb|--home|
723 verb|--home|
724 \end_inset
724 \end_inset
725
725
726 at installation, IPython may end up installed at a location which is not
726 at installation, IPython may end up installed at a location which is not
727 part of your
727 part of your
728 \family typewriter
728 \family typewriter
729 $PYTHONPATH
729 $PYTHONPATH
730 \family default
730 \family default
731 environment variable.
731 environment variable.
732 In this case, you'll need to configure this variable to include the actual
732 In this case, you'll need to configure this variable to include the actual
733 directory where the
733 directory where the
734 \family typewriter
734 \family typewriter
735 IPython/
735 IPython/
736 \family default
736 \family default
737 directory ended (typically the value you give to
737 directory ended (typically the value you give to
738 \begin_inset ERT
738 \begin_inset ERT
739 status Collapsed
739 status Collapsed
740
740
741 \layout Standard
741 \layout Standard
742
742
743 \backslash
743 \backslash
744 verb|--home|
744 verb|--home|
745 \end_inset
745 \end_inset
746
746
747 plus
747 plus
748 \family typewriter
748 \family typewriter
749 /lib/python
749 /lib/python
750 \family default
750 \family default
751 ).
751 ).
752 \layout Subsubsection
752 \layout Subsubsection
753
753
754 Mac OSX information
754 Mac OSX information
755 \layout Standard
755 \layout Standard
756
756
757 Under OSX, there is a choice you need to make.
757 Under OSX, there is a choice you need to make.
758 Apple ships its own build of Python, which lives in the core OSX filesystem
758 Apple ships its own build of Python, which lives in the core OSX filesystem
759 hierarchy.
759 hierarchy.
760 You can also manually install a separate Python, either purely by hand
760 You can also manually install a separate Python, either purely by hand
761 (typically in
761 (typically in
762 \family typewriter
762 \family typewriter
763 /usr/local
763 /usr/local
764 \family default
764 \family default
765 ) or by using Fink, which puts everything under
765 ) or by using Fink, which puts everything under
766 \family typewriter
766 \family typewriter
767 /sw
767 /sw
768 \family default
768 \family default
769 .
769 .
770 Which route to follow is a matter of personal preference, as I've seen
770 Which route to follow is a matter of personal preference, as I've seen
771 users who favor each of the approaches.
771 users who favor each of the approaches.
772 Here I will simply list the known installation issues under OSX, along
772 Here I will simply list the known installation issues under OSX, along
773 with their solutions.
773 with their solutions.
774 \layout Standard
774 \layout Standard
775
775
776 This page:
776 This page:
777 \begin_inset LatexCommand \htmlurl{http://geosci.uchicago.edu/~tobis/pylab.html}
777 \begin_inset LatexCommand \htmlurl{http://geosci.uchicago.edu/~tobis/pylab.html}
778
778
779 \end_inset
779 \end_inset
780
780
781 contains information on this topic, with additional details on how to make
781 contains information on this topic, with additional details on how to make
782 IPython and matplotlib play nicely under OSX.
782 IPython and matplotlib play nicely under OSX.
783 \layout Subsubsection*
783 \layout Subsubsection*
784
784
785 GUI problems
785 GUI problems
786 \layout Standard
786 \layout Standard
787
787
788 The following instructions apply to an install of IPython under OSX from
788 The following instructions apply to an install of IPython under OSX from
789 unpacking the
789 unpacking the
790 \family typewriter
790 \family typewriter
791 .tar.gz
791 .tar.gz
792 \family default
792 \family default
793 distribution and installing it for the default Python interpreter shipped
793 distribution and installing it for the default Python interpreter shipped
794 by Apple.
794 by Apple.
795 If you are using a fink install, fink will take care of these details for
795 If you are using a fink install, fink will take care of these details for
796 you, by installing IPython against fink's Python.
796 you, by installing IPython against fink's Python.
797 \layout Standard
797 \layout Standard
798
798
799 IPython offers various forms of support for interacting with graphical applicati
799 IPython offers various forms of support for interacting with graphical applicati
800 ons from the command line, from simple Tk apps (which are in principle always
800 ons from the command line, from simple Tk apps (which are in principle always
801 supported by Python) to interactive control of WX, Qt and GTK apps.
801 supported by Python) to interactive control of WX, Qt and GTK apps.
802 Under OSX, however, this requires that ipython is installed by calling
802 Under OSX, however, this requires that ipython is installed by calling
803 the special
803 the special
804 \family typewriter
804 \family typewriter
805 pythonw
805 pythonw
806 \family default
806 \family default
807 script at installation time, which takes care of coordinating things with
807 script at installation time, which takes care of coordinating things with
808 Apple's graphical environment.
808 Apple's graphical environment.
809 \layout Standard
809 \layout Standard
810
810
811 So when installing under OSX, it is best to use the following command:
811 So when installing under OSX, it is best to use the following command:
812 \family typewriter
812 \family typewriter
813
813
814 \newline
814 \newline
815
815
816 \family default
816 \family default
817
817
818 \begin_inset ERT
818 \begin_inset ERT
819 status Collapsed
819 status Collapsed
820
820
821 \layout Standard
821 \layout Standard
822
822
823 \backslash
823 \backslash
824 verb| $ sudo pythonw setup.py install --install-scripts=/usr/local/bin|
824 verb| $ sudo pythonw setup.py install --install-scripts=/usr/local/bin|
825 \end_inset
825 \end_inset
826
826
827
827
828 \newline
828 \newline
829 or
829 or
830 \newline
830 \newline
831
831
832 \begin_inset ERT
832 \begin_inset ERT
833 status Open
833 status Collapsed
834
834
835 \layout Standard
835 \layout Standard
836
836
837 \backslash
837 \backslash
838 verb| $ sudo pythonw setup.py install --install-scripts=/usr/bin|
838 verb| $ sudo pythonw setup.py install --install-scripts=/usr/bin|
839 \end_inset
839 \end_inset
840
840
841
841
842 \newline
842 \newline
843 depending on where you like to keep hand-installed executables.
843 depending on where you like to keep hand-installed executables.
844 \layout Standard
844 \layout Standard
845
845
846 The resulting script will have an appropriate shebang line (the first line
846 The resulting script will have an appropriate shebang line (the first line
847 in the script whic begins with
847 in the script whic begins with
848 \family typewriter
848 \family typewriter
849 #!...
849 #!...
850 \family default
850 \family default
851 ) such that the ipython interpreter can interact with the OS X GUI.
851 ) such that the ipython interpreter can interact with the OS X GUI.
852 If the installed version does not work and has a shebang line that points
852 If the installed version does not work and has a shebang line that points
853 to, for example, just
853 to, for example, just
854 \family typewriter
854 \family typewriter
855 /usr/bin/python
855 /usr/bin/python
856 \family default
856 \family default
857 , then you might have a stale, cached version in your
857 , then you might have a stale, cached version in your
858 \family typewriter
858 \family typewriter
859 build/scripts-<python-version>
859 build/scripts-<python-version>
860 \family default
860 \family default
861 directory.
861 directory.
862 Delete that directory and rerun the
862 Delete that directory and rerun the
863 \family typewriter
863 \family typewriter
864 setup.py
864 setup.py
865 \family default
865 \family default
866 .
866 .
867
867
868 \layout Standard
868 \layout Standard
869
869
870 It is also a good idea to use the special flag
870 It is also a good idea to use the special flag
871 \begin_inset ERT
871 \begin_inset ERT
872 status Collapsed
872 status Collapsed
873
873
874 \layout Standard
874 \layout Standard
875
875
876 \backslash
876 \backslash
877 verb|--install-scripts|
877 verb|--install-scripts|
878 \end_inset
878 \end_inset
879
879
880 as indicated above, to ensure that the ipython scripts end up in a location
880 as indicated above, to ensure that the ipython scripts end up in a location
881 which is part of your
881 which is part of your
882 \family typewriter
882 \family typewriter
883 $PATH
883 $PATH
884 \family default
884 \family default
885 .
885 .
886 Otherwise Apple's Python will put the scripts in an internal directory
886 Otherwise Apple's Python will put the scripts in an internal directory
887 not available by default at the command line (if you use
887 not available by default at the command line (if you use
888 \family typewriter
888 \family typewriter
889 /usr/local/bin
889 /usr/local/bin
890 \family default
890 \family default
891 , you need to make sure this is in your
891 , you need to make sure this is in your
892 \family typewriter
892 \family typewriter
893 $PATH
893 $PATH
894 \family default
894 \family default
895 , which may not be true by default).
895 , which may not be true by default).
896 \layout Subsubsection*
896 \layout Subsubsection*
897
897
898 Readline problems
898 Readline problems
899 \layout Standard
899 \layout Standard
900
900
901 By default, the Python version shipped by Apple does
901 By default, the Python version shipped by Apple does
902 \emph on
902 \emph on
903 not
903 not
904 \emph default
904 \emph default
905 include the readline library, so central to IPython's behavior.
905 include the readline library, so central to IPython's behavior.
906 If you install IPython against Apple's Python, you will not have arrow
906 If you install IPython against Apple's Python, you will not have arrow
907 keys, tab completion, etc.
907 keys, tab completion, etc.
908 For Mac OSX 10.3 (Panther), you can find a prebuilt readline library here:
908 For Mac OSX 10.3 (Panther), you can find a prebuilt readline library here:
909 \newline
909 \newline
910
910
911 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip}
911 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip}
912
912
913 \end_inset
913 \end_inset
914
914
915
915
916 \layout Standard
916 \layout Standard
917
917
918 If you are using OSX 10.4 (Tiger), after installing this package you need
918 If you are using OSX 10.4 (Tiger), after installing this package you need
919 to either:
919 to either:
920 \layout Enumerate
920 \layout Enumerate
921
921
922 move
922 move
923 \family typewriter
923 \family typewriter
924 readline.so
924 readline.so
925 \family default
925 \family default
926 from
926 from
927 \family typewriter
927 \family typewriter
928 /Library/Python/2.3
928 /Library/Python/2.3
929 \family default
929 \family default
930 to
930 to
931 \family typewriter
931 \family typewriter
932 /Library/Python/2.3/site-packages
932 /Library/Python/2.3/site-packages
933 \family default
933 \family default
934 , or
934 , or
935 \layout Enumerate
935 \layout Enumerate
936
936
937 install
937 install
938 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/TigerPython23Compat.pkg.zip}
938 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/TigerPython23Compat.pkg.zip}
939
939
940 \end_inset
940 \end_inset
941
941
942
942
943 \layout Standard
943 \layout Standard
944
944
945 Users installing against Fink's Python or a properly hand-built one should
945 Users installing against Fink's Python or a properly hand-built one should
946 not have this problem.
946 not have this problem.
947 \layout Subsubsection*
947 \layout Subsubsection*
948
948
949 DarwinPorts
949 DarwinPorts
950 \layout Standard
950 \layout Standard
951
951
952 I report here a message from an OSX user, who suggests an alternative means
952 I report here a message from an OSX user, who suggests an alternative means
953 of using IPython under this operating system with good results.
953 of using IPython under this operating system with good results.
954 Please let me know of any updates that may be useful for this section.
954 Please let me know of any updates that may be useful for this section.
955 His message is reproduced verbatim below:
955 His message is reproduced verbatim below:
956 \layout Quote
956 \layout Quote
957
957
958 From: Markus Banfi
958 From: Markus Banfi
959 \family typewriter
959 \family typewriter
960 <markus.banfi-AT-mospheira.net>
960 <markus.banfi-AT-mospheira.net>
961 \layout Quote
961 \layout Quote
962
962
963 As a MacOS X (10.4.2) user I prefer to install software using DawinPorts instead
963 As a MacOS X (10.4.2) user I prefer to install software using DawinPorts instead
964 of Fink.
964 of Fink.
965 I had no problems installing ipython with DarwinPorts.
965 I had no problems installing ipython with DarwinPorts.
966 It's just:
966 It's just:
967 \layout Quote
967 \layout Quote
968
968
969
969
970 \family typewriter
970 \family typewriter
971 sudo port install py-ipython
971 sudo port install py-ipython
972 \layout Quote
972 \layout Quote
973
973
974 It automatically resolved all dependencies (python24, readline, py-readline).
974 It automatically resolved all dependencies (python24, readline, py-readline).
975 So far I did not encounter any problems with the DarwinPorts port of ipython.
975 So far I did not encounter any problems with the DarwinPorts port of ipython.
976
976
977 \layout Subsection
977 \layout Subsection
978
978
979
979
980 \begin_inset LatexCommand \label{sub:Under-Windows}
980 \begin_inset LatexCommand \label{sub:Under-Windows}
981
981
982 \end_inset
982 \end_inset
983
983
984 Windows instructions
984 Windows instructions
985 \layout Standard
985 \layout Standard
986
986
987 Some of IPython's very useful features are:
987 Some of IPython's very useful features are:
988 \layout Itemize
988 \layout Itemize
989
989
990 Integrated readline support (Tab-based file, object and attribute completion,
990 Integrated readline support (Tab-based file, object and attribute completion,
991 input history across sessions, editable command line, etc.)
991 input history across sessions, editable command line, etc.)
992 \layout Itemize
992 \layout Itemize
993
993
994 Coloring of prompts, code and tracebacks.
994 Coloring of prompts, code and tracebacks.
995 \layout Standard
995 \layout Standard
996
996
997 These, by default, are only available under Unix-like operating systems.
997 These, by default, are only available under Unix-like operating systems.
998 However, thanks to Gary Bishop's work, Windows XP/2k users can also benefit
998 However, thanks to Gary Bishop's work, Windows XP/2k users can also benefit
999 from them.
999 from them.
1000 His readline library implements both GNU readline functionality and color
1000 His readline library implements both GNU readline functionality and color
1001 support, so that IPython under Windows XP/2k can be as friendly and powerful
1001 support, so that IPython under Windows XP/2k can be as friendly and powerful
1002 as under Unix-like environments.
1002 as under Unix-like environments.
1003 \layout Standard
1003 \layout Standard
1004
1004
1005 The
1005 The
1006 \family typewriter
1006 \family typewriter
1007 readline
1007 readline
1008 \family default
1008 \family default
1009 extension needs two other libraries to work, so in all you need:
1009 extension needs two other libraries to work, so in all you need:
1010 \layout Enumerate
1010 \layout Enumerate
1011
1011
1012
1012
1013 \family typewriter
1013 \family typewriter
1014 PyWin32
1014 PyWin32
1015 \family default
1015 \family default
1016 from
1016 from
1017 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/mhammond}
1017 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/mhammond}
1018
1018
1019 \end_inset
1019 \end_inset
1020
1020
1021 .
1021 .
1022 \layout Enumerate
1022 \layout Enumerate
1023
1023
1024
1024
1025 \family typewriter
1025 \family typewriter
1026 CTypes
1026 CTypes
1027 \family default
1027 \family default
1028 from
1028 from
1029 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/theller/ctypes}
1029 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/theller/ctypes}
1030
1030
1031 \end_inset
1031 \end_inset
1032
1032
1033 (you
1033 (you
1034 \emph on
1034 \emph on
1035 must
1035 must
1036 \emph default
1036 \emph default
1037 use version 0.9.1 or newer).
1037 use version 0.9.1 or newer).
1038 \layout Enumerate
1038 \layout Enumerate
1039
1039
1040
1040
1041 \family typewriter
1041 \family typewriter
1042 Readline
1042 Readline
1043 \family default
1043 \family default
1044 for Windows from
1044 for Windows from
1045 \begin_inset LatexCommand \htmlurl{http://sourceforge.net/projects/uncpythontools}
1045 \begin_inset LatexCommand \htmlurl{http://sourceforge.net/projects/uncpythontools}
1046
1046
1047 \end_inset
1047 \end_inset
1048
1048
1049 .
1049 .
1050 \layout Standard
1050 \layout Standard
1051
1051
1052
1052
1053 \series bold
1053 \series bold
1054 Warning about a broken readline-like library:
1054 Warning about a broken readline-like library:
1055 \series default
1055 \series default
1056 several users have reported problems stemming from using the pseudo-readline
1056 several users have reported problems stemming from using the pseudo-readline
1057 library at
1057 library at
1058 \begin_inset LatexCommand \htmlurl{http://newcenturycomputers.net/projects/readline.html}
1058 \begin_inset LatexCommand \htmlurl{http://newcenturycomputers.net/projects/readline.html}
1059
1059
1060 \end_inset
1060 \end_inset
1061
1061
1062 .
1062 .
1063 This is a broken library which, while called readline, only implements
1063 This is a broken library which, while called readline, only implements
1064 an incomplete subset of the readline API.
1064 an incomplete subset of the readline API.
1065 Since it is still called readline, it fools IPython's detection mechanisms
1065 Since it is still called readline, it fools IPython's detection mechanisms
1066 and causes unpredictable crashes later.
1066 and causes unpredictable crashes later.
1067 If you wish to use IPython under Windows, you must NOT use this library,
1067 If you wish to use IPython under Windows, you must NOT use this library,
1068 which for all purposes is (at least as of version 1.6) terminally broken.
1068 which for all purposes is (at least as of version 1.6) terminally broken.
1069 \layout Subsubsection
1069 \layout Subsubsection
1070
1070
1071 Installation procedure
1071 Installation procedure
1072 \layout Standard
1072 \layout Standard
1073
1073
1074 Once you have the above installed, from the IPython download directory grab
1074 Once you have the above installed, from the IPython download directory grab
1075 the
1075 the
1076 \family typewriter
1076 \family typewriter
1077 ipython-XXX.win32.exe
1077 ipython-XXX.win32.exe
1078 \family default
1078 \family default
1079 file, where
1079 file, where
1080 \family typewriter
1080 \family typewriter
1081 XXX
1081 XXX
1082 \family default
1082 \family default
1083 represents the version number.
1083 represents the version number.
1084 This is a regular windows executable installer, which you can simply double-cli
1084 This is a regular windows executable installer, which you can simply double-cli
1085 ck to install.
1085 ck to install.
1086 It will add an entry for IPython to your Start Menu, as well as registering
1086 It will add an entry for IPython to your Start Menu, as well as registering
1087 IPython in the Windows list of applications, so you can later uninstall
1087 IPython in the Windows list of applications, so you can later uninstall
1088 it from the Control Panel.
1088 it from the Control Panel.
1089
1089
1090 \layout Standard
1090 \layout Standard
1091
1091
1092 IPython tries to install the configuration information in a directory named
1092 IPython tries to install the configuration information in a directory named
1093
1093
1094 \family typewriter
1094 \family typewriter
1095 .ipython
1095 .ipython
1096 \family default
1096 \family default
1097 (
1097 (
1098 \family typewriter
1098 \family typewriter
1099 _ipython
1099 _ipython
1100 \family default
1100 \family default
1101 under Windows) located in your `home' directory.
1101 under Windows) located in your `home' directory.
1102 IPython sets this directory by looking for a
1102 IPython sets this directory by looking for a
1103 \family typewriter
1103 \family typewriter
1104 HOME
1104 HOME
1105 \family default
1105 \family default
1106 environment variable; if such a variable does not exist, it uses
1106 environment variable; if such a variable does not exist, it uses
1107 \family typewriter
1107 \family typewriter
1108 HOMEDRIVE
1108 HOMEDRIVE
1109 \backslash
1109 \backslash
1110 HOMEPATH
1110 HOMEPATH
1111 \family default
1111 \family default
1112 (these are always defined by Windows).
1112 (these are always defined by Windows).
1113 This typically gives something like
1113 This typically gives something like
1114 \family typewriter
1114 \family typewriter
1115 C:
1115 C:
1116 \backslash
1116 \backslash
1117 Documents and Settings
1117 Documents and Settings
1118 \backslash
1118 \backslash
1119 YourUserName
1119 YourUserName
1120 \family default
1120 \family default
1121 , but your local details may vary.
1121 , but your local details may vary.
1122 In this directory you will find all the files that configure IPython's
1122 In this directory you will find all the files that configure IPython's
1123 defaults, and you can put there your profiles and extensions.
1123 defaults, and you can put there your profiles and extensions.
1124 This directory is automatically added by IPython to
1124 This directory is automatically added by IPython to
1125 \family typewriter
1125 \family typewriter
1126 sys.path
1126 sys.path
1127 \family default
1127 \family default
1128 , so anything you place there can be found by
1128 , so anything you place there can be found by
1129 \family typewriter
1129 \family typewriter
1130 import
1130 import
1131 \family default
1131 \family default
1132 statements.
1132 statements.
1133 \layout Paragraph
1133 \layout Paragraph
1134
1134
1135 Upgrading
1135 Upgrading
1136 \layout Standard
1136 \layout Standard
1137
1137
1138 For an IPython upgrade, you should first uninstall the previous version.
1138 For an IPython upgrade, you should first uninstall the previous version.
1139 This will ensure that all files and directories (such as the documentation)
1139 This will ensure that all files and directories (such as the documentation)
1140 which carry embedded version strings in their names are properly removed.
1140 which carry embedded version strings in their names are properly removed.
1141 \layout Paragraph
1141 \layout Paragraph
1142
1142
1143 Manual installation under Win32
1143 Manual installation under Win32
1144 \layout Standard
1144 \layout Standard
1145
1145
1146 In case the automatic installer does not work for some reason, you can download
1146 In case the automatic installer does not work for some reason, you can download
1147 the
1147 the
1148 \family typewriter
1148 \family typewriter
1149 ipython-XXX.tar.gz
1149 ipython-XXX.tar.gz
1150 \family default
1150 \family default
1151 file, which contains the full IPython source distribution (the popular
1151 file, which contains the full IPython source distribution (the popular
1152 WinZip can read
1152 WinZip can read
1153 \family typewriter
1153 \family typewriter
1154 .tar.gz
1154 .tar.gz
1155 \family default
1155 \family default
1156 files).
1156 files).
1157 After uncompressing the archive, you can install it at a command terminal
1157 After uncompressing the archive, you can install it at a command terminal
1158 just like any other Python module, by using
1158 just like any other Python module, by using
1159 \family typewriter
1159 \family typewriter
1160 `python setup.py install'
1160 `python setup.py install'
1161 \family default
1161 \family default
1162 .
1162 .
1163
1163
1164 \layout Standard
1164 \layout Standard
1165
1165
1166 After the installation, run the supplied
1166 After the installation, run the supplied
1167 \family typewriter
1167 \family typewriter
1168 win32_manual_post_install.py
1168 win32_manual_post_install.py
1169 \family default
1169 \family default
1170 script, which creates the necessary Start Menu shortcuts for you.
1170 script, which creates the necessary Start Menu shortcuts for you.
1171 \layout Subsection
1171 \layout Subsection
1172
1172
1173
1173
1174 \begin_inset LatexCommand \label{sec:upgrade}
1174 \begin_inset LatexCommand \label{sec:upgrade}
1175
1175
1176 \end_inset
1176 \end_inset
1177
1177
1178 Upgrading from a previous version
1178 Upgrading from a previous version
1179 \layout Standard
1179 \layout Standard
1180
1180
1181 If you are upgrading from a previous version of IPython, after doing the
1181 If you are upgrading from a previous version of IPython, after doing the
1182 routine installation described above, you should call IPython with the
1182 routine installation described above, you should call IPython with the
1183
1183
1184 \family typewriter
1184 \family typewriter
1185 -upgrade
1185 -upgrade
1186 \family default
1186 \family default
1187 option the first time you run your new copy.
1187 option the first time you run your new copy.
1188 This will automatically update your configuration directory while preserving
1188 This will automatically update your configuration directory while preserving
1189 copies of your old files.
1189 copies of your old files.
1190 You can then later merge back any personal customizations you may have
1190 You can then later merge back any personal customizations you may have
1191 made into the new files.
1191 made into the new files.
1192 It is a good idea to do this as there may be new options available in the
1192 It is a good idea to do this as there may be new options available in the
1193 new configuration files which you will not have.
1193 new configuration files which you will not have.
1194 \layout Standard
1194 \layout Standard
1195
1195
1196 Under Windows, if you don't know how to call python scripts with arguments
1196 Under Windows, if you don't know how to call python scripts with arguments
1197 from a command line, simply delete the old config directory and IPython
1197 from a command line, simply delete the old config directory and IPython
1198 will make a new one.
1198 will make a new one.
1199 Win2k and WinXP users will find it in
1199 Win2k and WinXP users will find it in
1200 \family typewriter
1200 \family typewriter
1201 C:
1201 C:
1202 \backslash
1202 \backslash
1203 Documents and Settings
1203 Documents and Settings
1204 \backslash
1204 \backslash
1205 YourUserName
1205 YourUserName
1206 \backslash
1206 \backslash
1207 _ipython
1207 _ipython
1208 \family default
1208 \family default
1209 , and Win 9x users under
1209 , and Win 9x users under
1210 \family typewriter
1210 \family typewriter
1211 C:
1211 C:
1212 \backslash
1212 \backslash
1213 Program Files
1213 Program Files
1214 \backslash
1214 \backslash
1215 IPython
1215 IPython
1216 \backslash
1216 \backslash
1217 _ipython.
1217 _ipython.
1218 \layout Section
1218 \layout Section
1219
1219
1220
1220
1221 \begin_inset LatexCommand \label{sec:good_config}
1221 \begin_inset LatexCommand \label{sec:good_config}
1222
1222
1223 \end_inset
1223 \end_inset
1224
1224
1225
1225
1226 \begin_inset OptArg
1226 \begin_inset OptArg
1227 collapsed true
1227 collapsed true
1228
1228
1229 \layout Standard
1229 \layout Standard
1230
1230
1231 Initial configuration
1231 Initial configuration
1232 \begin_inset ERT
1232 \begin_inset ERT
1233 status Collapsed
1233 status Collapsed
1234
1234
1235 \layout Standard
1235 \layout Standard
1236
1236
1237 \backslash
1237 \backslash
1238 ldots
1238 ldots
1239 \end_inset
1239 \end_inset
1240
1240
1241
1241
1242 \end_inset
1242 \end_inset
1243
1243
1244 Initial configuration of your environment
1244 Initial configuration of your environment
1245 \layout Standard
1245 \layout Standard
1246
1246
1247 This section will help you set various things in your environment for your
1247 This section will help you set various things in your environment for your
1248 IPython sessions to be as efficient as possible.
1248 IPython sessions to be as efficient as possible.
1249 All of IPython's configuration information, along with several example
1249 All of IPython's configuration information, along with several example
1250 files, is stored in a directory named by default
1250 files, is stored in a directory named by default
1251 \family typewriter
1251 \family typewriter
1252 $HOME/.ipython
1252 $HOME/.ipython
1253 \family default
1253 \family default
1254 .
1254 .
1255 You can change this by defining the environment variable
1255 You can change this by defining the environment variable
1256 \family typewriter
1256 \family typewriter
1257 IPYTHONDIR
1257 IPYTHONDIR
1258 \family default
1258 \family default
1259 , or at runtime with the command line option
1259 , or at runtime with the command line option
1260 \family typewriter
1260 \family typewriter
1261 -ipythondir
1261 -ipythondir
1262 \family default
1262 \family default
1263 .
1263 .
1264 \layout Standard
1264 \layout Standard
1265
1265
1266 If all goes well, the first time you run IPython it should automatically
1266 If all goes well, the first time you run IPython it should automatically
1267 create a user copy of the config directory for you, based on its builtin
1267 create a user copy of the config directory for you, based on its builtin
1268 defaults.
1268 defaults.
1269 You can look at the files it creates to learn more about configuring the
1269 You can look at the files it creates to learn more about configuring the
1270 system.
1270 system.
1271 The main file you will modify to configure IPython's behavior is called
1271 The main file you will modify to configure IPython's behavior is called
1272
1272
1273 \family typewriter
1273 \family typewriter
1274 ipythonrc
1274 ipythonrc
1275 \family default
1275 \family default
1276 (with a
1276 (with a
1277 \family typewriter
1277 \family typewriter
1278 .ini
1278 .ini
1279 \family default
1279 \family default
1280 extension under Windows), included for reference in Sec.
1280 extension under Windows), included for reference in Sec.
1281
1281
1282 \begin_inset LatexCommand \ref{sec:ipytonrc-sample}
1282 \begin_inset LatexCommand \ref{sec:ipytonrc-sample}
1283
1283
1284 \end_inset
1284 \end_inset
1285
1285
1286 .
1286 .
1287 This file is very commented and has many variables you can change to suit
1287 This file is very commented and has many variables you can change to suit
1288 your taste, you can find more details in Sec.
1288 your taste, you can find more details in Sec.
1289
1289
1290 \begin_inset LatexCommand \ref{sec:customization}
1290 \begin_inset LatexCommand \ref{sec:customization}
1291
1291
1292 \end_inset
1292 \end_inset
1293
1293
1294 .
1294 .
1295 Here we discuss the basic things you will want to make sure things are
1295 Here we discuss the basic things you will want to make sure things are
1296 working properly from the beginning.
1296 working properly from the beginning.
1297 \layout Subsection
1297 \layout Subsection
1298
1298
1299
1299
1300 \begin_inset LatexCommand \label{sec:help-access}
1300 \begin_inset LatexCommand \label{sec:help-access}
1301
1301
1302 \end_inset
1302 \end_inset
1303
1303
1304 Access to the Python help system
1304 Access to the Python help system
1305 \layout Standard
1305 \layout Standard
1306
1306
1307 This is true for Python in general (not just for IPython): you should have
1307 This is true for Python in general (not just for IPython): you should have
1308 an environment variable called
1308 an environment variable called
1309 \family typewriter
1309 \family typewriter
1310 PYTHONDOCS
1310 PYTHONDOCS
1311 \family default
1311 \family default
1312 pointing to the directory where your HTML Python documentation lives.
1312 pointing to the directory where your HTML Python documentation lives.
1313 In my system it's
1313 In my system it's
1314 \family typewriter
1314 \family typewriter
1315 /usr/share/doc/python-docs-2.3.4/html
1315 /usr/share/doc/python-docs-2.3.4/html
1316 \family default
1316 \family default
1317 , check your local details or ask your systems administrator.
1317 , check your local details or ask your systems administrator.
1318
1318
1319 \layout Standard
1319 \layout Standard
1320
1320
1321 This is the directory which holds the HTML version of the Python manuals.
1321 This is the directory which holds the HTML version of the Python manuals.
1322 Unfortunately it seems that different Linux distributions package these
1322 Unfortunately it seems that different Linux distributions package these
1323 files differently, so you may have to look around a bit.
1323 files differently, so you may have to look around a bit.
1324 Below I show the contents of this directory on my system for reference:
1324 Below I show the contents of this directory on my system for reference:
1325 \layout Standard
1325 \layout Standard
1326
1326
1327
1327
1328 \family typewriter
1328 \family typewriter
1329 [html]> ls
1329 [html]> ls
1330 \newline
1330 \newline
1331 about.dat acks.html dist/ ext/ index.html lib/ modindex.html stdabout.dat tut/
1331 about.dat acks.html dist/ ext/ index.html lib/ modindex.html stdabout.dat tut/
1332 about.html api/ doc/ icons/ inst/ mac/ ref/ style.css
1332 about.html api/ doc/ icons/ inst/ mac/ ref/ style.css
1333 \layout Standard
1333 \layout Standard
1334
1334
1335 You should really make sure this variable is correctly set so that Python's
1335 You should really make sure this variable is correctly set so that Python's
1336 pydoc-based help system works.
1336 pydoc-based help system works.
1337 It is a powerful and convenient system with full access to the Python manuals
1337 It is a powerful and convenient system with full access to the Python manuals
1338 and all modules accessible to you.
1338 and all modules accessible to you.
1339 \layout Standard
1339 \layout Standard
1340
1340
1341 Under Windows it seems that pydoc finds the documentation automatically,
1341 Under Windows it seems that pydoc finds the documentation automatically,
1342 so no extra setup appears necessary.
1342 so no extra setup appears necessary.
1343 \layout Subsection
1343 \layout Subsection
1344
1344
1345 Editor
1345 Editor
1346 \layout Standard
1346 \layout Standard
1347
1347
1348 The
1348 The
1349 \family typewriter
1349 \family typewriter
1350 %edit
1350 %edit
1351 \family default
1351 \family default
1352 command (and its alias
1352 command (and its alias
1353 \family typewriter
1353 \family typewriter
1354 %ed
1354 %ed
1355 \family default
1355 \family default
1356 ) will invoke the editor set in your environment as
1356 ) will invoke the editor set in your environment as
1357 \family typewriter
1357 \family typewriter
1358 EDITOR
1358 EDITOR
1359 \family default
1359 \family default
1360 .
1360 .
1361 If this variable is not set, it will default to
1361 If this variable is not set, it will default to
1362 \family typewriter
1362 \family typewriter
1363 vi
1363 vi
1364 \family default
1364 \family default
1365 under Linux/Unix and to
1365 under Linux/Unix and to
1366 \family typewriter
1366 \family typewriter
1367 notepad
1367 notepad
1368 \family default
1368 \family default
1369 under Windows.
1369 under Windows.
1370 You may want to set this variable properly and to a lightweight editor
1370 You may want to set this variable properly and to a lightweight editor
1371 which doesn't take too long to start (that is, something other than a new
1371 which doesn't take too long to start (that is, something other than a new
1372 instance of
1372 instance of
1373 \family typewriter
1373 \family typewriter
1374 Emacs
1374 Emacs
1375 \family default
1375 \family default
1376 ).
1376 ).
1377 This way you can edit multi-line code quickly and with the power of a real
1377 This way you can edit multi-line code quickly and with the power of a real
1378 editor right inside IPython.
1378 editor right inside IPython.
1379
1379
1380 \layout Standard
1380 \layout Standard
1381
1381
1382 If you are a dedicated
1382 If you are a dedicated
1383 \family typewriter
1383 \family typewriter
1384 Emacs
1384 Emacs
1385 \family default
1385 \family default
1386 user, you should set up the
1386 user, you should set up the
1387 \family typewriter
1387 \family typewriter
1388 Emacs
1388 Emacs
1389 \family default
1389 \family default
1390 server so that new requests are handled by the original process.
1390 server so that new requests are handled by the original process.
1391 This means that almost no time is spent in handling the request (assuming
1391 This means that almost no time is spent in handling the request (assuming
1392 an
1392 an
1393 \family typewriter
1393 \family typewriter
1394 Emacs
1394 Emacs
1395 \family default
1395 \family default
1396 process is already running).
1396 process is already running).
1397 For this to work, you need to set your
1397 For this to work, you need to set your
1398 \family typewriter
1398 \family typewriter
1399 EDITOR
1399 EDITOR
1400 \family default
1400 \family default
1401 environment variable to
1401 environment variable to
1402 \family typewriter
1402 \family typewriter
1403 'emacsclient'
1403 'emacsclient'
1404 \family default
1404 \family default
1405 .
1405 .
1406
1406
1407 \family typewriter
1407 \family typewriter
1408
1408
1409 \family default
1409 \family default
1410 The code below, supplied by Francois Pinard, can then be used in your
1410 The code below, supplied by Francois Pinard, can then be used in your
1411 \family typewriter
1411 \family typewriter
1412 .emacs
1412 .emacs
1413 \family default
1413 \family default
1414 file to enable the server:
1414 file to enable the server:
1415 \layout Standard
1415 \layout Standard
1416
1416
1417
1417
1418 \family typewriter
1418 \family typewriter
1419 (defvar server-buffer-clients)
1419 (defvar server-buffer-clients)
1420 \newline
1420 \newline
1421 (when (and (fboundp 'server-start) (string-equal (getenv "TERM") 'xterm))
1421 (when (and (fboundp 'server-start) (string-equal (getenv "TERM") 'xterm))
1422 \newline
1422 \newline
1423
1423
1424 \begin_inset ERT
1424 \begin_inset ERT
1425 status Collapsed
1425 status Collapsed
1426
1426
1427 \layout Standard
1427 \layout Standard
1428
1428
1429 \backslash
1429 \backslash
1430 hspace*{0mm}
1430 hspace*{0mm}
1431 \end_inset
1431 \end_inset
1432
1432
1433 \SpecialChar ~
1433 \SpecialChar ~
1434 \SpecialChar ~
1434 \SpecialChar ~
1435 (server-start)
1435 (server-start)
1436 \newline
1436 \newline
1437
1437
1438 \begin_inset ERT
1438 \begin_inset ERT
1439 status Collapsed
1439 status Collapsed
1440
1440
1441 \layout Standard
1441 \layout Standard
1442
1442
1443 \backslash
1443 \backslash
1444 hspace*{0mm}
1444 hspace*{0mm}
1445 \end_inset
1445 \end_inset
1446
1446
1447 \SpecialChar ~
1447 \SpecialChar ~
1448 \SpecialChar ~
1448 \SpecialChar ~
1449 (defun fp-kill-server-with-buffer-routine ()
1449 (defun fp-kill-server-with-buffer-routine ()
1450 \newline
1450 \newline
1451
1451
1452 \begin_inset ERT
1452 \begin_inset ERT
1453 status Collapsed
1453 status Collapsed
1454
1454
1455 \layout Standard
1455 \layout Standard
1456
1456
1457 \backslash
1457 \backslash
1458 hspace*{0mm}
1458 hspace*{0mm}
1459 \end_inset
1459 \end_inset
1460
1460
1461 \SpecialChar ~
1461 \SpecialChar ~
1462 \SpecialChar ~
1462 \SpecialChar ~
1463 \SpecialChar ~
1463 \SpecialChar ~
1464 \SpecialChar ~
1464 \SpecialChar ~
1465 (and server-buffer-clients (server-done)))
1465 (and server-buffer-clients (server-done)))
1466 \newline
1466 \newline
1467
1467
1468 \begin_inset ERT
1468 \begin_inset ERT
1469 status Collapsed
1469 status Collapsed
1470
1470
1471 \layout Standard
1471 \layout Standard
1472
1472
1473 \backslash
1473 \backslash
1474 hspace*{0mm}
1474 hspace*{0mm}
1475 \end_inset
1475 \end_inset
1476
1476
1477 \SpecialChar ~
1477 \SpecialChar ~
1478 \SpecialChar ~
1478 \SpecialChar ~
1479 (add-hook 'kill-buffer-hook 'fp-kill-server-with-buffer-routine))
1479 (add-hook 'kill-buffer-hook 'fp-kill-server-with-buffer-routine))
1480 \layout Standard
1480 \layout Standard
1481
1481
1482 You can also set the value of this editor via the commmand-line option '-
1482 You can also set the value of this editor via the commmand-line option '-
1483 \family typewriter
1483 \family typewriter
1484 editor'
1484 editor'
1485 \family default
1485 \family default
1486 or in your
1486 or in your
1487 \family typewriter
1487 \family typewriter
1488 ipythonrc
1488 ipythonrc
1489 \family default
1489 \family default
1490 file.
1490 file.
1491 This is useful if you wish to use specifically for IPython an editor different
1491 This is useful if you wish to use specifically for IPython an editor different
1492 from your typical default (and for Windows users who tend to use fewer
1492 from your typical default (and for Windows users who tend to use fewer
1493 environment variables).
1493 environment variables).
1494 \layout Subsection
1494 \layout Subsection
1495
1495
1496 Color
1496 Color
1497 \layout Standard
1497 \layout Standard
1498
1498
1499 The default IPython configuration has most bells and whistles turned on
1499 The default IPython configuration has most bells and whistles turned on
1500 (they're pretty safe).
1500 (they're pretty safe).
1501 But there's one that
1501 But there's one that
1502 \emph on
1502 \emph on
1503 may
1503 may
1504 \emph default
1504 \emph default
1505 cause problems on some systems: the use of color on screen for displaying
1505 cause problems on some systems: the use of color on screen for displaying
1506 information.
1506 information.
1507 This is very useful, since IPython can show prompts and exception tracebacks
1507 This is very useful, since IPython can show prompts and exception tracebacks
1508 with various colors, display syntax-highlighted source code, and in general
1508 with various colors, display syntax-highlighted source code, and in general
1509 make it easier to visually parse information.
1509 make it easier to visually parse information.
1510 \layout Standard
1510 \layout Standard
1511
1511
1512 The following terminals seem to handle the color sequences fine:
1512 The following terminals seem to handle the color sequences fine:
1513 \layout Itemize
1513 \layout Itemize
1514
1514
1515 Linux main text console, KDE Konsole, Gnome Terminal, E-term, rxvt, xterm.
1515 Linux main text console, KDE Konsole, Gnome Terminal, E-term, rxvt, xterm.
1516 \layout Itemize
1516 \layout Itemize
1517
1517
1518 CDE terminal (tested under Solaris).
1518 CDE terminal (tested under Solaris).
1519 This one boldfaces light colors.
1519 This one boldfaces light colors.
1520 \layout Itemize
1520 \layout Itemize
1521
1521
1522 (X)Emacs buffers.
1522 (X)Emacs buffers.
1523 See sec.
1523 See sec.
1524 \begin_inset LatexCommand \ref{sec:emacs}
1524 \begin_inset LatexCommand \ref{sec:emacs}
1525
1525
1526 \end_inset
1526 \end_inset
1527
1527
1528 for more details on using IPython with (X)Emacs.
1528 for more details on using IPython with (X)Emacs.
1529 \layout Itemize
1529 \layout Itemize
1530
1530
1531 A Windows (XP/2k) command prompt
1531 A Windows (XP/2k) command prompt
1532 \emph on
1532 \emph on
1533 with Gary Bishop's support extensions
1533 with Gary Bishop's support extensions
1534 \emph default
1534 \emph default
1535 .
1535 .
1536 Gary's extensions are discussed in Sec.\SpecialChar ~
1536 Gary's extensions are discussed in Sec.\SpecialChar ~
1537
1537
1538 \begin_inset LatexCommand \ref{sub:Under-Windows}
1538 \begin_inset LatexCommand \ref{sub:Under-Windows}
1539
1539
1540 \end_inset
1540 \end_inset
1541
1541
1542 .
1542 .
1543 \layout Itemize
1543 \layout Itemize
1544
1544
1545 A Windows (XP/2k) CygWin shell.
1545 A Windows (XP/2k) CygWin shell.
1546 Although some users have reported problems; it is not clear whether there
1546 Although some users have reported problems; it is not clear whether there
1547 is an issue for everyone or only under specific configurations.
1547 is an issue for everyone or only under specific configurations.
1548 If you have full color support under cygwin, please post to the IPython
1548 If you have full color support under cygwin, please post to the IPython
1549 mailing list so this issue can be resolved for all users.
1549 mailing list so this issue can be resolved for all users.
1550 \layout Standard
1550 \layout Standard
1551
1551
1552 These have shown problems:
1552 These have shown problems:
1553 \layout Itemize
1553 \layout Itemize
1554
1554
1555 Windows command prompt in WinXP/2k logged into a Linux machine via telnet
1555 Windows command prompt in WinXP/2k logged into a Linux machine via telnet
1556 or ssh.
1556 or ssh.
1557 \layout Itemize
1557 \layout Itemize
1558
1558
1559 Windows native command prompt in WinXP/2k,
1559 Windows native command prompt in WinXP/2k,
1560 \emph on
1560 \emph on
1561 without
1561 without
1562 \emph default
1562 \emph default
1563 Gary Bishop's extensions.
1563 Gary Bishop's extensions.
1564 Once Gary's readline library is installed, the normal WinXP/2k command
1564 Once Gary's readline library is installed, the normal WinXP/2k command
1565 prompt works perfectly.
1565 prompt works perfectly.
1566 \layout Standard
1566 \layout Standard
1567
1567
1568 Currently the following color schemes are available:
1568 Currently the following color schemes are available:
1569 \layout Itemize
1569 \layout Itemize
1570
1570
1571
1571
1572 \family typewriter
1572 \family typewriter
1573 NoColor
1573 NoColor
1574 \family default
1574 \family default
1575 : uses no color escapes at all (all escapes are empty
1575 : uses no color escapes at all (all escapes are empty
1576 \begin_inset Quotes eld
1576 \begin_inset Quotes eld
1577 \end_inset
1577 \end_inset
1578
1578
1579
1579
1580 \begin_inset Quotes eld
1580 \begin_inset Quotes eld
1581 \end_inset
1581 \end_inset
1582
1582
1583 strings).
1583 strings).
1584 This 'scheme' is thus fully safe to use in any terminal.
1584 This 'scheme' is thus fully safe to use in any terminal.
1585 \layout Itemize
1585 \layout Itemize
1586
1586
1587
1587
1588 \family typewriter
1588 \family typewriter
1589 Linux
1589 Linux
1590 \family default
1590 \family default
1591 : works well in Linux console type environments: dark background with light
1591 : works well in Linux console type environments: dark background with light
1592 fonts.
1592 fonts.
1593 It uses bright colors for information, so it is difficult to read if you
1593 It uses bright colors for information, so it is difficult to read if you
1594 have a light colored background.
1594 have a light colored background.
1595 \layout Itemize
1595 \layout Itemize
1596
1596
1597
1597
1598 \family typewriter
1598 \family typewriter
1599 LightBG
1599 LightBG
1600 \family default
1600 \family default
1601 : the basic colors are similar to those in the
1601 : the basic colors are similar to those in the
1602 \family typewriter
1602 \family typewriter
1603 Linux
1603 Linux
1604 \family default
1604 \family default
1605 scheme but darker.
1605 scheme but darker.
1606 It is easy to read in terminals with light backgrounds.
1606 It is easy to read in terminals with light backgrounds.
1607 \layout Standard
1607 \layout Standard
1608
1608
1609 IPython uses colors for two main groups of things: prompts and tracebacks
1609 IPython uses colors for two main groups of things: prompts and tracebacks
1610 which are directly printed to the terminal, and the object introspection
1610 which are directly printed to the terminal, and the object introspection
1611 system which passes large sets of data through a pager.
1611 system which passes large sets of data through a pager.
1612 \layout Subsubsection
1612 \layout Subsubsection
1613
1613
1614 Input/Output prompts and exception tracebacks
1614 Input/Output prompts and exception tracebacks
1615 \layout Standard
1615 \layout Standard
1616
1616
1617 You can test whether the colored prompts and tracebacks work on your system
1617 You can test whether the colored prompts and tracebacks work on your system
1618 interactively by typing
1618 interactively by typing
1619 \family typewriter
1619 \family typewriter
1620 '%colors Linux'
1620 '%colors Linux'
1621 \family default
1621 \family default
1622 at the prompt (use '
1622 at the prompt (use '
1623 \family typewriter
1623 \family typewriter
1624 %colors LightBG'
1624 %colors LightBG'
1625 \family default
1625 \family default
1626 if your terminal has a light background).
1626 if your terminal has a light background).
1627 If the input prompt shows garbage like:
1627 If the input prompt shows garbage like:
1628 \newline
1628 \newline
1629
1629
1630 \family typewriter
1630 \family typewriter
1631 [0;32mIn [[1;32m1[0;32m]: [0;00m
1631 [0;32mIn [[1;32m1[0;32m]: [0;00m
1632 \family default
1632 \family default
1633
1633
1634 \newline
1634 \newline
1635 instead of (in color) something like:
1635 instead of (in color) something like:
1636 \newline
1636 \newline
1637
1637
1638 \family typewriter
1638 \family typewriter
1639 In [1]:
1639 In [1]:
1640 \family default
1640 \family default
1641
1641
1642 \newline
1642 \newline
1643 this means that your terminal doesn't properly handle color escape sequences.
1643 this means that your terminal doesn't properly handle color escape sequences.
1644 You can go to a 'no color' mode by typing '
1644 You can go to a 'no color' mode by typing '
1645 \family typewriter
1645 \family typewriter
1646 %colors NoColor
1646 %colors NoColor
1647 \family default
1647 \family default
1648 '.
1648 '.
1649
1649
1650 \layout Standard
1650 \layout Standard
1651
1651
1652 You can try using a different terminal emulator program.
1652 You can try using a different terminal emulator program.
1653 To permanently set your color preferences, edit the file
1653 To permanently set your color preferences, edit the file
1654 \family typewriter
1654 \family typewriter
1655 $HOME/.ipython/ipythonrc
1655 $HOME/.ipython/ipythonrc
1656 \family default
1656 \family default
1657 and set the
1657 and set the
1658 \family typewriter
1658 \family typewriter
1659 colors
1659 colors
1660 \family default
1660 \family default
1661 option to the desired value.
1661 option to the desired value.
1662 \layout Subsubsection
1662 \layout Subsubsection
1663
1663
1664 Object details (types, docstrings, source code, etc.)
1664 Object details (types, docstrings, source code, etc.)
1665 \layout Standard
1665 \layout Standard
1666
1666
1667 IPython has a set of special functions for studying the objects you are
1667 IPython has a set of special functions for studying the objects you are
1668 working with, discussed in detail in Sec.
1668 working with, discussed in detail in Sec.
1669
1669
1670 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1670 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1671
1671
1672 \end_inset
1672 \end_inset
1673
1673
1674 .
1674 .
1675 But this system relies on passing information which is longer than your
1675 But this system relies on passing information which is longer than your
1676 screen through a data pager, such as the common Unix
1676 screen through a data pager, such as the common Unix
1677 \family typewriter
1677 \family typewriter
1678 less
1678 less
1679 \family default
1679 \family default
1680 and
1680 and
1681 \family typewriter
1681 \family typewriter
1682 more
1682 more
1683 \family default
1683 \family default
1684 programs.
1684 programs.
1685 In order to be able to see this information in color, your pager needs
1685 In order to be able to see this information in color, your pager needs
1686 to be properly configured.
1686 to be properly configured.
1687 I strongly recommend using
1687 I strongly recommend using
1688 \family typewriter
1688 \family typewriter
1689 less
1689 less
1690 \family default
1690 \family default
1691 instead of
1691 instead of
1692 \family typewriter
1692 \family typewriter
1693 more
1693 more
1694 \family default
1694 \family default
1695 , as it seems that
1695 , as it seems that
1696 \family typewriter
1696 \family typewriter
1697 more
1697 more
1698 \family default
1698 \family default
1699 simply can not understand colored text correctly.
1699 simply can not understand colored text correctly.
1700 \layout Standard
1700 \layout Standard
1701
1701
1702 In order to configure
1702 In order to configure
1703 \family typewriter
1703 \family typewriter
1704 less
1704 less
1705 \family default
1705 \family default
1706 as your default pager, do the following:
1706 as your default pager, do the following:
1707 \layout Enumerate
1707 \layout Enumerate
1708
1708
1709 Set the environment
1709 Set the environment
1710 \family typewriter
1710 \family typewriter
1711 PAGER
1711 PAGER
1712 \family default
1712 \family default
1713 variable to
1713 variable to
1714 \family typewriter
1714 \family typewriter
1715 less
1715 less
1716 \family default
1716 \family default
1717 .
1717 .
1718 \layout Enumerate
1718 \layout Enumerate
1719
1719
1720 Set the environment
1720 Set the environment
1721 \family typewriter
1721 \family typewriter
1722 LESS
1722 LESS
1723 \family default
1723 \family default
1724 variable to
1724 variable to
1725 \family typewriter
1725 \family typewriter
1726 -r
1726 -r
1727 \family default
1727 \family default
1728 (plus any other options you always want to pass to
1728 (plus any other options you always want to pass to
1729 \family typewriter
1729 \family typewriter
1730 less
1730 less
1731 \family default
1731 \family default
1732 by default).
1732 by default).
1733 This tells
1733 This tells
1734 \family typewriter
1734 \family typewriter
1735 less
1735 less
1736 \family default
1736 \family default
1737 to properly interpret control sequences, which is how color information
1737 to properly interpret control sequences, which is how color information
1738 is given to your terminal.
1738 is given to your terminal.
1739 \layout Standard
1739 \layout Standard
1740
1740
1741 For the
1741 For the
1742 \family typewriter
1742 \family typewriter
1743 csh
1743 csh
1744 \family default
1744 \family default
1745 or
1745 or
1746 \family typewriter
1746 \family typewriter
1747 tcsh
1747 tcsh
1748 \family default
1748 \family default
1749 shells, add to your
1749 shells, add to your
1750 \family typewriter
1750 \family typewriter
1751 ~/.cshrc
1751 ~/.cshrc
1752 \family default
1752 \family default
1753 file the lines:
1753 file the lines:
1754 \layout Standard
1754 \layout Standard
1755
1755
1756
1756
1757 \family typewriter
1757 \family typewriter
1758 setenv PAGER less
1758 setenv PAGER less
1759 \newline
1759 \newline
1760 setenv LESS -r
1760 setenv LESS -r
1761 \layout Standard
1761 \layout Standard
1762
1762
1763 There is similar syntax for other Unix shells, look at your system documentation
1763 There is similar syntax for other Unix shells, look at your system documentation
1764 for details.
1764 for details.
1765 \layout Standard
1765 \layout Standard
1766
1766
1767 If you are on a system which lacks proper data pagers (such as Windows),
1767 If you are on a system which lacks proper data pagers (such as Windows),
1768 IPython will use a very limited builtin pager.
1768 IPython will use a very limited builtin pager.
1769 \layout Subsection
1769 \layout Subsection
1770
1770
1771
1771
1772 \begin_inset LatexCommand \label{sec:emacs}
1772 \begin_inset LatexCommand \label{sec:emacs}
1773
1773
1774 \end_inset
1774 \end_inset
1775
1775
1776 (X)Emacs configuration
1776 (X)Emacs configuration
1777 \layout Standard
1777 \layout Standard
1778
1778
1779 Thanks to the work of Alexander Schmolck and Prabhu Ramachandran, currently
1779 Thanks to the work of Alexander Schmolck and Prabhu Ramachandran, currently
1780 (X)Emacs and IPython get along very well.
1780 (X)Emacs and IPython get along very well.
1781
1781
1782 \layout Standard
1782 \layout Standard
1783
1783
1784
1784
1785 \series bold
1785 \series bold
1786 Important note:
1786 Important note:
1787 \series default
1787 \series default
1788 You will need to use a recent enough version of
1788 You will need to use a recent enough version of
1789 \family typewriter
1789 \family typewriter
1790 python-mode.el
1790 python-mode.el
1791 \family default
1791 \family default
1792 , along with the file
1792 , along with the file
1793 \family typewriter
1793 \family typewriter
1794 ipython.el
1794 ipython.el
1795 \family default
1795 \family default
1796 .
1796 .
1797 You can check that the version you have of
1797 You can check that the version you have of
1798 \family typewriter
1798 \family typewriter
1799 python-mode.el
1799 python-mode.el
1800 \family default
1800 \family default
1801 is new enough by either looking at the revision number in the file itself,
1801 is new enough by either looking at the revision number in the file itself,
1802 or asking for it in (X)Emacs via
1802 or asking for it in (X)Emacs via
1803 \family typewriter
1803 \family typewriter
1804 M-x py-version
1804 M-x py-version
1805 \family default
1805 \family default
1806 .
1806 .
1807 Versions 4.68 and newer contain the necessary fixes for proper IPython support.
1807 Versions 4.68 and newer contain the necessary fixes for proper IPython support.
1808 \layout Standard
1808 \layout Standard
1809
1809
1810 The file
1810 The file
1811 \family typewriter
1811 \family typewriter
1812 ipython.el
1812 ipython.el
1813 \family default
1813 \family default
1814 is included with the IPython distribution, in the documentation directory
1814 is included with the IPython distribution, in the documentation directory
1815 (where this manual resides in PDF and HTML formats).
1815 (where this manual resides in PDF and HTML formats).
1816 \layout Standard
1816 \layout Standard
1817
1817
1818 Once you put these files in your Emacs path, all you need in your
1818 Once you put these files in your Emacs path, all you need in your
1819 \family typewriter
1819 \family typewriter
1820 .emacs
1820 .emacs
1821 \family default
1821 \family default
1822 file is:
1822 file is:
1823 \layout Standard
1823 \layout Standard
1824
1824
1825
1825
1826 \family typewriter
1826 \family typewriter
1827 (require 'ipython)
1827 (require 'ipython)
1828 \layout Standard
1828 \layout Standard
1829
1829
1830 This should give you full support for executing code snippets via IPython,
1830 This should give you full support for executing code snippets via IPython,
1831 opening IPython as your Python shell via
1831 opening IPython as your Python shell via
1832 \family typewriter
1832 \family typewriter
1833 C-c\SpecialChar ~
1833 C-c\SpecialChar ~
1834 !
1834 !
1835 \family default
1835 \family default
1836 , etc.
1836 , etc.
1837
1837
1838 \layout Subsubsection*
1838 \layout Subsubsection*
1839
1839
1840 Notes
1840 Notes
1841 \layout Itemize
1841 \layout Itemize
1842
1842
1843 There is one caveat you should be aware of: you must start the IPython shell
1843 There is one caveat you should be aware of: you must start the IPython shell
1844
1844
1845 \emph on
1845 \emph on
1846 before
1846 before
1847 \emph default
1847 \emph default
1848 attempting to execute any code regions via
1848 attempting to execute any code regions via
1849 \family typewriter
1849 \family typewriter
1850 C-c\SpecialChar ~
1850 C-c\SpecialChar ~
1851 |
1851 |
1852 \family default
1852 \family default
1853 .
1853 .
1854 Simply type
1854 Simply type
1855 \family typewriter
1855 \family typewriter
1856 C-c\SpecialChar ~
1856 C-c\SpecialChar ~
1857 !
1857 !
1858 \family default
1858 \family default
1859 to start IPython before passing any code regions to the interpreter, and
1859 to start IPython before passing any code regions to the interpreter, and
1860 you shouldn't experience any problems.
1860 you shouldn't experience any problems.
1861 \newline
1861 \newline
1862 This is due to a bug in Python itself, which has been fixed for Python 2.3,
1862 This is due to a bug in Python itself, which has been fixed for Python 2.3,
1863 but exists as of Python 2.2.2 (reported as SF bug [ 737947 ]).
1863 but exists as of Python 2.2.2 (reported as SF bug [ 737947 ]).
1864 \layout Itemize
1864 \layout Itemize
1865
1865
1866 The (X)Emacs support is maintained by Alexander Schmolck, so all comments/reques
1866 The (X)Emacs support is maintained by Alexander Schmolck, so all comments/reques
1867 ts should be directed to him through the IPython mailing lists.
1867 ts should be directed to him through the IPython mailing lists.
1868
1868
1869 \layout Itemize
1869 \layout Itemize
1870
1870
1871 This code is still somewhat experimental so it's a bit rough around the
1871 This code is still somewhat experimental so it's a bit rough around the
1872 edges (although in practice, it works quite well).
1872 edges (although in practice, it works quite well).
1873 \layout Itemize
1873 \layout Itemize
1874
1874
1875 Be aware that if you customize
1875 Be aware that if you customize
1876 \family typewriter
1876 \family typewriter
1877 py-python-command
1877 py-python-command
1878 \family default
1878 \family default
1879 previously, this value will override what
1879 previously, this value will override what
1880 \family typewriter
1880 \family typewriter
1881 ipython.el
1881 ipython.el
1882 \family default
1882 \family default
1883 does (because loading the customization variables comes later).
1883 does (because loading the customization variables comes later).
1884 \layout Section
1884 \layout Section
1885
1885
1886
1886
1887 \begin_inset LatexCommand \label{sec:quick_tips}
1887 \begin_inset LatexCommand \label{sec:quick_tips}
1888
1888
1889 \end_inset
1889 \end_inset
1890
1890
1891 Quick tips
1891 Quick tips
1892 \layout Standard
1892 \layout Standard
1893
1893
1894 IPython can be used as an improved replacement for the Python prompt, and
1894 IPython can be used as an improved replacement for the Python prompt, and
1895 for that you don't really need to read any more of this manual.
1895 for that you don't really need to read any more of this manual.
1896 But in this section we'll try to summarize a few tips on how to make the
1896 But in this section we'll try to summarize a few tips on how to make the
1897 most effective use of it for everyday Python development, highlighting
1897 most effective use of it for everyday Python development, highlighting
1898 things you might miss in the rest of the manual (which is getting long).
1898 things you might miss in the rest of the manual (which is getting long).
1899 We'll give references to parts in the manual which provide more detail
1899 We'll give references to parts in the manual which provide more detail
1900 when appropriate.
1900 when appropriate.
1901 \layout Standard
1901 \layout Standard
1902
1902
1903 The following article by Jeremy Jones provides an introductory tutorial
1903 The following article by Jeremy Jones provides an introductory tutorial
1904 about IPython:
1904 about IPython:
1905 \newline
1905 \newline
1906
1906
1907 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html}
1907 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html}
1908
1908
1909 \end_inset
1909 \end_inset
1910
1910
1911
1911
1912 \layout Itemize
1912 \layout Itemize
1913
1913
1914 The TAB key.
1914 The TAB key.
1915 TAB-completion, especially for attributes, is a convenient way to explore
1915 TAB-completion, especially for attributes, is a convenient way to explore
1916 the structure of any object you're dealing with.
1916 the structure of any object you're dealing with.
1917 Simply type
1917 Simply type
1918 \family typewriter
1918 \family typewriter
1919 object_name.<TAB>
1919 object_name.<TAB>
1920 \family default
1920 \family default
1921 and a list of the object's attributes will be printed (see sec.
1921 and a list of the object's attributes will be printed (see sec.
1922
1922
1923 \begin_inset LatexCommand \ref{sec:readline}
1923 \begin_inset LatexCommand \ref{sec:readline}
1924
1924
1925 \end_inset
1925 \end_inset
1926
1926
1927 for more).
1927 for more).
1928 Tab completion also works on file and directory names, which combined with
1928 Tab completion also works on file and directory names, which combined with
1929 IPython's alias system allows you to do from within IPython many of the
1929 IPython's alias system allows you to do from within IPython many of the
1930 things you normally would need the system shell for.
1930 things you normally would need the system shell for.
1931
1931
1932 \layout Itemize
1932 \layout Itemize
1933
1933
1934 Explore your objects.
1934 Explore your objects.
1935 Typing
1935 Typing
1936 \family typewriter
1936 \family typewriter
1937 object_name?
1937 object_name?
1938 \family default
1938 \family default
1939 will print all sorts of details about any object, including docstrings,
1939 will print all sorts of details about any object, including docstrings,
1940 function definition lines (for call arguments) and constructor details
1940 function definition lines (for call arguments) and constructor details
1941 for classes.
1941 for classes.
1942 The magic commands
1942 The magic commands
1943 \family typewriter
1943 \family typewriter
1944 %pdoc
1944 %pdoc
1945 \family default
1945 \family default
1946 ,
1946 ,
1947 \family typewriter
1947 \family typewriter
1948 %pdef
1948 %pdef
1949 \family default
1949 \family default
1950 ,
1950 ,
1951 \family typewriter
1951 \family typewriter
1952 %psource
1952 %psource
1953 \family default
1953 \family default
1954 and
1954 and
1955 \family typewriter
1955 \family typewriter
1956 %pfile
1956 %pfile
1957 \family default
1957 \family default
1958 will respectively print the docstring, function definition line, full source
1958 will respectively print the docstring, function definition line, full source
1959 code and the complete file for any object (when they can be found).
1959 code and the complete file for any object (when they can be found).
1960 If automagic is on (it is by default), you don't need to type the '
1960 If automagic is on (it is by default), you don't need to type the '
1961 \family typewriter
1961 \family typewriter
1962 %
1962 %
1963 \family default
1963 \family default
1964 ' explicitly.
1964 ' explicitly.
1965 See sec.
1965 See sec.
1966
1966
1967 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1967 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1968
1968
1969 \end_inset
1969 \end_inset
1970
1970
1971 for more.
1971 for more.
1972 \layout Itemize
1972 \layout Itemize
1973
1973
1974 The
1974 The
1975 \family typewriter
1975 \family typewriter
1976 %run
1976 %run
1977 \family default
1977 \family default
1978 magic command allows you to run any python script and load all of its data
1978 magic command allows you to run any python script and load all of its data
1979 directly into the interactive namespace.
1979 directly into the interactive namespace.
1980 Since the file is re-read from disk each time, changes you make to it are
1980 Since the file is re-read from disk each time, changes you make to it are
1981 reflected immediately (in contrast to the behavior of
1981 reflected immediately (in contrast to the behavior of
1982 \family typewriter
1982 \family typewriter
1983 import
1983 import
1984 \family default
1984 \family default
1985 ).
1985 ).
1986 I rarely use
1986 I rarely use
1987 \family typewriter
1987 \family typewriter
1988 import
1988 import
1989 \family default
1989 \family default
1990 for code I am testing, relying on
1990 for code I am testing, relying on
1991 \family typewriter
1991 \family typewriter
1992 %run
1992 %run
1993 \family default
1993 \family default
1994 instead.
1994 instead.
1995 See sec.
1995 See sec.
1996
1996
1997 \begin_inset LatexCommand \ref{sec:magic}
1997 \begin_inset LatexCommand \ref{sec:magic}
1998
1998
1999 \end_inset
1999 \end_inset
2000
2000
2001 for more on this and other magic commands, or type the name of any magic
2001 for more on this and other magic commands, or type the name of any magic
2002 command and ? to get details on it.
2002 command and ? to get details on it.
2003 See also sec.
2003 See also sec.
2004
2004
2005 \begin_inset LatexCommand \ref{sec:dreload}
2005 \begin_inset LatexCommand \ref{sec:dreload}
2006
2006
2007 \end_inset
2007 \end_inset
2008
2008
2009 for a recursive reload command.
2009 for a recursive reload command.
2010 \newline
2010 \newline
2011
2011
2012 \family typewriter
2012 \family typewriter
2013 %run
2013 %run
2014 \family default
2014 \family default
2015 also has special flags for timing the execution of your scripts (
2015 also has special flags for timing the execution of your scripts (
2016 \family typewriter
2016 \family typewriter
2017 -t
2017 -t
2018 \family default
2018 \family default
2019 ) and for executing them under the control of either Python's
2019 ) and for executing them under the control of either Python's
2020 \family typewriter
2020 \family typewriter
2021 pdb
2021 pdb
2022 \family default
2022 \family default
2023 debugger (
2023 debugger (
2024 \family typewriter
2024 \family typewriter
2025 -d
2025 -d
2026 \family default
2026 \family default
2027 ) or profiler (
2027 ) or profiler (
2028 \family typewriter
2028 \family typewriter
2029 -p
2029 -p
2030 \family default
2030 \family default
2031 ).
2031 ).
2032 With all of these,
2032 With all of these,
2033 \family typewriter
2033 \family typewriter
2034 %run
2034 %run
2035 \family default
2035 \family default
2036 can be used as the main tool for efficient interactive development of code
2036 can be used as the main tool for efficient interactive development of code
2037 which you write in your editor of choice.
2037 which you write in your editor of choice.
2038 \layout Itemize
2038 \layout Itemize
2039
2039
2040 Use the Python debugger,
2040 Use the Python debugger,
2041 \family typewriter
2041 \family typewriter
2042 pdb
2042 pdb
2043 \family default
2043 \family default
2044
2044
2045 \begin_inset Foot
2045 \begin_inset Foot
2046 collapsed true
2046 collapsed true
2047
2047
2048 \layout Standard
2048 \layout Standard
2049
2049
2050 Thanks to Christian Hart and Matthew Arnison for the suggestions leading
2050 Thanks to Christian Hart and Matthew Arnison for the suggestions leading
2051 to IPython's improved debugger and profiler support.
2051 to IPython's improved debugger and profiler support.
2052 \end_inset
2052 \end_inset
2053
2053
2054 .
2054 .
2055 The
2055 The
2056 \family typewriter
2056 \family typewriter
2057 %pdb
2057 %pdb
2058 \family default
2058 \family default
2059 command allows you to toggle on and off the automatic invocation of an
2059 command allows you to toggle on and off the automatic invocation of an
2060 IPython-enhanced
2060 IPython-enhanced
2061 \family typewriter
2061 \family typewriter
2062 pdb
2062 pdb
2063 \family default
2063 \family default
2064 debugger (with coloring, tab completion and more) at any uncaught exception.
2064 debugger (with coloring, tab completion and more) at any uncaught exception.
2065 The advantage of this is that
2065 The advantage of this is that
2066 \family typewriter
2066 \family typewriter
2067 pdb
2067 pdb
2068 \family default
2068 \family default
2069 starts
2069 starts
2070 \emph on
2070 \emph on
2071 inside
2071 inside
2072 \emph default
2072 \emph default
2073 the function where the exception occurred, with all data still available.
2073 the function where the exception occurred, with all data still available.
2074 You can print variables, see code, execute statements and even walk up
2074 You can print variables, see code, execute statements and even walk up
2075 and down the call stack to track down the true source of the problem (which
2075 and down the call stack to track down the true source of the problem (which
2076 often is many layers in the stack above where the exception gets triggered).
2076 often is many layers in the stack above where the exception gets triggered).
2077 \newline
2077 \newline
2078 Running programs with
2078 Running programs with
2079 \family typewriter
2079 \family typewriter
2080 %run
2080 %run
2081 \family default
2081 \family default
2082 and pdb active can be an efficient to develop and debug code, in many cases
2082 and pdb active can be an efficient to develop and debug code, in many cases
2083 eliminating the need for
2083 eliminating the need for
2084 \family typewriter
2084 \family typewriter
2085 print
2085 print
2086 \family default
2086 \family default
2087 statements or external debugging tools.
2087 statements or external debugging tools.
2088 I often simply put a
2088 I often simply put a
2089 \family typewriter
2089 \family typewriter
2090 1/0
2090 1/0
2091 \family default
2091 \family default
2092 in a place where I want to take a look so that pdb gets called, quickly
2092 in a place where I want to take a look so that pdb gets called, quickly
2093 view whatever variables I need to or test various pieces of code and then
2093 view whatever variables I need to or test various pieces of code and then
2094 remove the
2094 remove the
2095 \family typewriter
2095 \family typewriter
2096 1/0
2096 1/0
2097 \family default
2097 \family default
2098 .
2098 .
2099 \newline
2099 \newline
2100 Note also that `
2100 Note also that `
2101 \family typewriter
2101 \family typewriter
2102 %run -d
2102 %run -d
2103 \family default
2103 \family default
2104 ' activates
2104 ' activates
2105 \family typewriter
2105 \family typewriter
2106 pdb
2106 pdb
2107 \family default
2107 \family default
2108 and automatically sets initial breakpoints for you to step through your
2108 and automatically sets initial breakpoints for you to step through your
2109 code, watch variables, etc.
2109 code, watch variables, etc.
2110 See Sec.\SpecialChar ~
2110 See Sec.\SpecialChar ~
2111
2111
2112 \begin_inset LatexCommand \ref{sec:cache_output}
2112 \begin_inset LatexCommand \ref{sec:cache_output}
2113
2113
2114 \end_inset
2114 \end_inset
2115
2115
2116 for details.
2116 for details.
2117 \layout Itemize
2117 \layout Itemize
2118
2118
2119 Use the output cache.
2119 Use the output cache.
2120 All output results are automatically stored in a global dictionary named
2120 All output results are automatically stored in a global dictionary named
2121
2121
2122 \family typewriter
2122 \family typewriter
2123 Out
2123 Out
2124 \family default
2124 \family default
2125 and variables named
2125 and variables named
2126 \family typewriter
2126 \family typewriter
2127 _1
2127 _1
2128 \family default
2128 \family default
2129 ,
2129 ,
2130 \family typewriter
2130 \family typewriter
2131 _2
2131 _2
2132 \family default
2132 \family default
2133 , etc.
2133 , etc.
2134 alias them.
2134 alias them.
2135 For example, the result of input line 4 is available either as
2135 For example, the result of input line 4 is available either as
2136 \family typewriter
2136 \family typewriter
2137 Out[4]
2137 Out[4]
2138 \family default
2138 \family default
2139 or as
2139 or as
2140 \family typewriter
2140 \family typewriter
2141 _4
2141 _4
2142 \family default
2142 \family default
2143 .
2143 .
2144 Additionally, three variables named
2144 Additionally, three variables named
2145 \family typewriter
2145 \family typewriter
2146 _
2146 _
2147 \family default
2147 \family default
2148 ,
2148 ,
2149 \family typewriter
2149 \family typewriter
2150 __
2150 __
2151 \family default
2151 \family default
2152 and
2152 and
2153 \family typewriter
2153 \family typewriter
2154 ___
2154 ___
2155 \family default
2155 \family default
2156 are always kept updated with the for the last three results.
2156 are always kept updated with the for the last three results.
2157 This allows you to recall any previous result and further use it for new
2157 This allows you to recall any previous result and further use it for new
2158 calculations.
2158 calculations.
2159 See Sec.\SpecialChar ~
2159 See Sec.\SpecialChar ~
2160
2160
2161 \begin_inset LatexCommand \ref{sec:cache_output}
2161 \begin_inset LatexCommand \ref{sec:cache_output}
2162
2162
2163 \end_inset
2163 \end_inset
2164
2164
2165 for more.
2165 for more.
2166 \layout Itemize
2166 \layout Itemize
2167
2167
2168 Put a '
2168 Put a '
2169 \family typewriter
2169 \family typewriter
2170 ;
2170 ;
2171 \family default
2171 \family default
2172 ' at the end of a line to supress the printing of output.
2172 ' at the end of a line to supress the printing of output.
2173 This is useful when doing calculations which generate long output you are
2173 This is useful when doing calculations which generate long output you are
2174 not interested in seeing.
2174 not interested in seeing.
2175 The
2175 The
2176 \family typewriter
2176 \family typewriter
2177 _*
2177 _*
2178 \family default
2178 \family default
2179 variables and the
2179 variables and the
2180 \family typewriter
2180 \family typewriter
2181 Out[]
2181 Out[]
2182 \family default
2182 \family default
2183 list do get updated with the contents of the output, even if it is not
2183 list do get updated with the contents of the output, even if it is not
2184 printed.
2184 printed.
2185 You can thus still access the generated results this way for further processing.
2185 You can thus still access the generated results this way for further processing.
2186 \layout Itemize
2186 \layout Itemize
2187
2187
2188 A similar system exists for caching input.
2188 A similar system exists for caching input.
2189 All input is stored in a global list called
2189 All input is stored in a global list called
2190 \family typewriter
2190 \family typewriter
2191 In
2191 In
2192 \family default
2192 \family default
2193 , so you can re-execute lines 22 through 28 plus line 34 by typing
2193 , so you can re-execute lines 22 through 28 plus line 34 by typing
2194 \family typewriter
2194 \family typewriter
2195 'exec In[22:29]+In[34]'
2195 'exec In[22:29]+In[34]'
2196 \family default
2196 \family default
2197 (using Python slicing notation).
2197 (using Python slicing notation).
2198 If you need to execute the same set of lines often, you can assign them
2198 If you need to execute the same set of lines often, you can assign them
2199 to a macro with the
2199 to a macro with the
2200 \family typewriter
2200 \family typewriter
2201 %macro
2201 %macro
2202 \family default
2202 \family default
2203
2203
2204 \family typewriter
2204 \family typewriter
2205 function.
2205 function.
2206
2206
2207 \family default
2207 \family default
2208 See sec.
2208 See sec.
2209
2209
2210 \begin_inset LatexCommand \ref{sec:cache_input}
2210 \begin_inset LatexCommand \ref{sec:cache_input}
2211
2211
2212 \end_inset
2212 \end_inset
2213
2213
2214 for more.
2214 for more.
2215 \layout Itemize
2215 \layout Itemize
2216
2216
2217 Use your input history.
2217 Use your input history.
2218 The
2218 The
2219 \family typewriter
2219 \family typewriter
2220 %hist
2220 %hist
2221 \family default
2221 \family default
2222 command can show you all previous input, without line numbers if desired
2222 command can show you all previous input, without line numbers if desired
2223 (option
2223 (option
2224 \family typewriter
2224 \family typewriter
2225 -n
2225 -n
2226 \family default
2226 \family default
2227 ) so you can directly copy and paste code either back in IPython or in a
2227 ) so you can directly copy and paste code either back in IPython or in a
2228 text editor.
2228 text editor.
2229 You can also save all your history by turning on logging via
2229 You can also save all your history by turning on logging via
2230 \family typewriter
2230 \family typewriter
2231 %logstart
2231 %logstart
2232 \family default
2232 \family default
2233 ; these logs can later be either reloaded as IPython sessions or used as
2233 ; these logs can later be either reloaded as IPython sessions or used as
2234 code for your programs.
2234 code for your programs.
2235 \layout Itemize
2235 \layout Itemize
2236
2236
2237 Define your own macros with
2237 Define your own macros with
2238 \family typewriter
2238 \family typewriter
2239 %macro
2239 %macro
2240 \family default
2240 \family default
2241 .
2241 .
2242 This can be useful for automating sequences of expressions when working
2242 This can be useful for automating sequences of expressions when working
2243 interactively.
2243 interactively.
2244 You can edit a macro (they are just Python variables holding your input
2245 as a string) by simply typing `
2246 \family typewriter
2247 %edit macroname
2248 \family default
2249 ', and macros can be stored persistently across session with `
2250 \family typewriter
2251 %store macroname
2252 \family default
2253 ' (the storage system is per-profile).
2254 The combination of quick macros, persistent storage and editing, allows
2255 you to easily refine quick-and-dirty interactive input into permanent utilities
2256 , always available both in IPython and as files for general reuse.
2257 \layout Itemize
2258
2259 While
2260 \family typewriter
2261 %macro
2262 \family default
2263 saves input lines into memory for interactive re-execution, sometimes you'd
2264 like to save your input directly to a file.
2265 The
2266 \family typewriter
2267 %save
2268 \family default
2269 magic does this: its input sytnax is the same as
2270 \family typewriter
2271 %macro
2272 \family default
2273 , but it saves your input directly to a Python file.
2274 Note that the
2275 \family typewriter
2276 %logstart
2277 \family default
2278 command also saves input, but it logs
2279 \emph on
2280 all
2281 \emph default
2282 input to disk (though you can temporarily suspend it and reactivate it
2283 with
2284 \family typewriter
2285 %logoff/%logon
2286 \family default
2287 );
2288 \family typewriter
2289 %save
2290 \family default
2291 allows you to select which lines of input you need to save.
2244 \layout Itemize
2292 \layout Itemize
2245
2293
2246 Define your own system aliases.
2294 Define your own system aliases.
2247 Even though IPython gives you access to your system shell via the
2295 Even though IPython gives you access to your system shell via the
2248 \family typewriter
2296 \family typewriter
2249 !
2297 !
2250 \family default
2298 \family default
2251 prefix, it is convenient to have aliases to the system commands you use
2299 prefix, it is convenient to have aliases to the system commands you use
2252 most often.
2300 most often.
2253 This allows you to work seamlessly from inside IPython with the same commands
2301 This allows you to work seamlessly from inside IPython with the same commands
2254 you are used to in your system shell.
2302 you are used to in your system shell.
2255 \newline
2303 \newline
2256 IPython comes with some pre-defined aliases and a complete system for changing
2304 IPython comes with some pre-defined aliases and a complete system for changing
2257 directories, both via a stack (see
2305 directories, both via a stack (see
2258 \family typewriter
2306 \family typewriter
2259 %pushd
2307 %pushd
2260 \family default
2308 \family default
2261 ,
2309 ,
2262 \family typewriter
2310 \family typewriter
2263 %popd
2311 %popd
2264 \family default
2312 \family default
2265 and
2313 and
2266 \family typewriter
2314 \family typewriter
2267 %ds
2315 %ds
2268 \family default
2316 \family default
2269 ) and via direct
2317 ) and via direct
2270 \family typewriter
2318 \family typewriter
2271 %cd
2319 %cd
2272 \family default
2320 \family default
2273 .
2321 .
2274 The latter keeps a history of visited directories and allows you to go
2322 The latter keeps a history of visited directories and allows you to go
2275 to any previously visited one.
2323 to any previously visited one.
2276 \layout Itemize
2324 \layout Itemize
2277
2325
2278 Use Python to manipulate the results of system commands.
2326 Use Python to manipulate the results of system commands.
2279 The `
2327 The `
2280 \family typewriter
2328 \family typewriter
2281 !!
2329 !!
2282 \family default
2330 \family default
2283 ' special syntax, and the
2331 ' special syntax, and the
2284 \family typewriter
2332 \family typewriter
2285 %sc
2333 %sc
2286 \family default
2334 \family default
2287 and
2335 and
2288 \family typewriter
2336 \family typewriter
2289 %sx
2337 %sx
2290 \family default
2338 \family default
2291 magic commands allow you to capture system output into Python variables.
2339 magic commands allow you to capture system output into Python variables.
2292 \layout Itemize
2340 \layout Itemize
2293
2341
2294 Expand python variables when calling the shell (either via
2342 Expand python variables when calling the shell (either via
2295 \family typewriter
2343 \family typewriter
2296 `!'
2344 `!'
2297 \family default
2345 \family default
2298 and
2346 and
2299 \family typewriter
2347 \family typewriter
2300 `!!'
2348 `!!'
2301 \family default
2349 \family default
2302 or via aliases) by prepending a
2350 or via aliases) by prepending a
2303 \family typewriter
2351 \family typewriter
2304 $
2352 $
2305 \family default
2353 \family default
2306 in front of them.
2354 in front of them.
2307 You can also expand complete python expressions.
2355 You can also expand complete python expressions.
2308 See sec.\SpecialChar ~
2356 See sec.\SpecialChar ~
2309
2357
2310 \begin_inset LatexCommand \ref{sub:System-shell-access}
2358 \begin_inset LatexCommand \ref{sub:System-shell-access}
2311
2359
2312 \end_inset
2360 \end_inset
2313
2361
2314 for more.
2362 for more.
2315 \layout Itemize
2363 \layout Itemize
2316
2364
2317 Use profiles to maintain different configurations (modules to load, function
2365 Use profiles to maintain different configurations (modules to load, function
2318 definitions, option settings) for particular tasks.
2366 definitions, option settings) for particular tasks.
2319 You can then have customized versions of IPython for specific purposes.
2367 You can then have customized versions of IPython for specific purposes.
2320 See sec.\SpecialChar ~
2368 See sec.\SpecialChar ~
2321
2369
2322 \begin_inset LatexCommand \ref{sec:profiles}
2370 \begin_inset LatexCommand \ref{sec:profiles}
2323
2371
2324 \end_inset
2372 \end_inset
2325
2373
2326 for more.
2374 for more.
2327 \layout Itemize
2375 \layout Itemize
2328
2376
2329 Embed IPython in your programs.
2377 Embed IPython in your programs.
2330 A few lines of code are enough to load a complete IPython inside your own
2378 A few lines of code are enough to load a complete IPython inside your own
2331 programs, giving you the ability to work with your data interactively after
2379 programs, giving you the ability to work with your data interactively after
2332 automatic processing has been completed.
2380 automatic processing has been completed.
2333 See sec.\SpecialChar ~
2381 See sec.\SpecialChar ~
2334
2382
2335 \begin_inset LatexCommand \ref{sec:embed}
2383 \begin_inset LatexCommand \ref{sec:embed}
2336
2384
2337 \end_inset
2385 \end_inset
2338
2386
2339 for more.
2387 for more.
2340 \layout Itemize
2388 \layout Itemize
2341
2389
2342 Use the Python profiler.
2390 Use the Python profiler.
2343 When dealing with performance issues, the
2391 When dealing with performance issues, the
2344 \family typewriter
2392 \family typewriter
2345 %run
2393 %run
2346 \family default
2394 \family default
2347 command with a
2395 command with a
2348 \family typewriter
2396 \family typewriter
2349 -p
2397 -p
2350 \family default
2398 \family default
2351 option allows you to run complete programs under the control of the Python
2399 option allows you to run complete programs under the control of the Python
2352 profiler.
2400 profiler.
2353 The
2401 The
2354 \family typewriter
2402 \family typewriter
2355 %prun
2403 %prun
2356 \family default
2404 \family default
2357 command does a similar job for single Python expressions (like function
2405 command does a similar job for single Python expressions (like function
2358 calls).
2406 calls).
2359 \layout Itemize
2407 \layout Itemize
2360
2408
2361 Use
2409 Use
2362 \family typewriter
2410 \family typewriter
2363 %edit
2411 %edit
2364 \family default
2412 \family default
2365 to have almost multiline editing.
2413 to have almost multiline editing.
2366 While IPython doesn't support true multiline editing, this command allows
2414 While IPython doesn't support true multiline editing, this command allows
2367 you to call an editor on the spot, and IPython will execute the code you
2415 you to call an editor on the spot, and IPython will execute the code you
2368 type in there as if it were typed interactively.
2416 type in there as if it were typed interactively.
2369 \layout Itemize
2417 \layout Itemize
2370
2418
2371 Use the IPython.demo.Demo class to load any Python script as an interactive
2419 Use the IPython.demo.Demo class to load any Python script as an interactive
2372 demo.
2420 demo.
2373 With a minimal amount of simple markup, you can control the execution of
2421 With a minimal amount of simple markup, you can control the execution of
2374 the script, stopping as needed.
2422 the script, stopping as needed.
2375 See sec.\SpecialChar ~
2423 See sec.\SpecialChar ~
2376
2424
2377 \begin_inset LatexCommand \ref{sec:interactive-demos}
2425 \begin_inset LatexCommand \ref{sec:interactive-demos}
2378
2426
2379 \end_inset
2427 \end_inset
2380
2428
2381 for more.
2429 for more.
2382 \layout Standard
2430 \layout Standard
2383
2431
2384
2432
2385 \series bold
2433 \series bold
2386 Effective logging:
2434 Effective logging:
2387 \series default
2435 \series default
2388 a very useful suggestion sent in by Robert Kern follows
2436 a very useful suggestion sent in by Robert Kern follows
2389 \layout Standard
2437 \layout Standard
2390
2438
2391 I recently happened on a nifty way to keep tidy per-project log files.
2439 I recently happened on a nifty way to keep tidy per-project log files.
2392 I made a profile for my project (which is called "parkfield").
2440 I made a profile for my project (which is called "parkfield").
2393 \layout LyX-Code
2441 \layout LyX-Code
2394
2442
2395 include ipythonrc
2443 include ipythonrc
2396 \layout LyX-Code
2444 \layout LyX-Code
2397
2445
2398 logfile '' # cancel earlier logfile invocation
2446 logfile '' # cancel earlier logfile invocation
2399 \layout LyX-Code
2447 \layout LyX-Code
2400
2448
2401 execute import time
2449 execute import time
2402 \layout LyX-Code
2450 \layout LyX-Code
2403
2451
2404 execute __cmd = '/Users/kern/research/logfiles/parkfield-%s.log rotate'
2452 execute __cmd = '/Users/kern/research/logfiles/parkfield-%s.log rotate'
2405 \layout LyX-Code
2453 \layout LyX-Code
2406
2454
2407 execute __IP.magic_logstart(__cmd % time.strftime('%Y-%m-%d'))
2455 execute __IP.magic_logstart(__cmd % time.strftime('%Y-%m-%d'))
2408 \layout Standard
2456 \layout Standard
2409
2457
2410 I also added a shell alias for convenience:
2458 I also added a shell alias for convenience:
2411 \layout LyX-Code
2459 \layout LyX-Code
2412
2460
2413 alias parkfield="ipython -pylab -profile parkfield"
2461 alias parkfield="ipython -pylab -profile parkfield"
2414 \layout Standard
2462 \layout Standard
2415
2463
2416 Now I have a nice little directory with everything I ever type in, organized
2464 Now I have a nice little directory with everything I ever type in, organized
2417 by project and date.
2465 by project and date.
2418 \layout Standard
2466 \layout Standard
2419
2467
2420
2468
2421 \series bold
2469 \series bold
2422 Contribute your own:
2470 Contribute your own:
2423 \series default
2471 \series default
2424 If you have your own favorite tip on using IPython efficiently for a certain
2472 If you have your own favorite tip on using IPython efficiently for a certain
2425 task (especially things which can't be done in the normal Python interpreter),
2473 task (especially things which can't be done in the normal Python interpreter),
2426 don't hesitate to send it!
2474 don't hesitate to send it!
2427 \layout Section
2475 \layout Section
2428
2476
2429 Command-line use
2477 Command-line use
2430 \layout Standard
2478 \layout Standard
2431
2479
2432 You start IPython with the command:
2480 You start IPython with the command:
2433 \layout Standard
2481 \layout Standard
2434
2482
2435
2483
2436 \family typewriter
2484 \family typewriter
2437 $ ipython [options] files
2485 $ ipython [options] files
2438 \layout Standard
2486 \layout Standard
2439
2487
2440 If invoked with no options, it executes all the files listed in sequence
2488 If invoked with no options, it executes all the files listed in sequence
2441 and drops you into the interpreter while still acknowledging any options
2489 and drops you into the interpreter while still acknowledging any options
2442 you may have set in your ipythonrc file.
2490 you may have set in your ipythonrc file.
2443 This behavior is different from standard Python, which when called as
2491 This behavior is different from standard Python, which when called as
2444 \family typewriter
2492 \family typewriter
2445 python -i
2493 python -i
2446 \family default
2494 \family default
2447 will only execute one file and ignore your configuration setup.
2495 will only execute one file and ignore your configuration setup.
2448 \layout Standard
2496 \layout Standard
2449
2497
2450 Please note that some of the configuration options are not available at
2498 Please note that some of the configuration options are not available at
2451 the command line, simply because they are not practical here.
2499 the command line, simply because they are not practical here.
2452 Look into your ipythonrc configuration file for details on those.
2500 Look into your ipythonrc configuration file for details on those.
2453 This file typically installed in the
2501 This file typically installed in the
2454 \family typewriter
2502 \family typewriter
2455 $HOME/.ipython
2503 $HOME/.ipython
2456 \family default
2504 \family default
2457 directory.
2505 directory.
2458 For Windows users,
2506 For Windows users,
2459 \family typewriter
2507 \family typewriter
2460 $HOME
2508 $HOME
2461 \family default
2509 \family default
2462 resolves to
2510 resolves to
2463 \family typewriter
2511 \family typewriter
2464 C:
2512 C:
2465 \backslash
2513 \backslash
2466
2514
2467 \backslash
2515 \backslash
2468 Documents and Settings
2516 Documents and Settings
2469 \backslash
2517 \backslash
2470
2518
2471 \backslash
2519 \backslash
2472 YourUserName
2520 YourUserName
2473 \family default
2521 \family default
2474 in most instances.
2522 in most instances.
2475 In the rest of this text, we will refer to this directory as
2523 In the rest of this text, we will refer to this directory as
2476 \family typewriter
2524 \family typewriter
2477 IPYTHONDIR
2525 IPYTHONDIR
2478 \family default
2526 \family default
2479 .
2527 .
2480 \layout Subsection
2528 \layout Subsection
2481
2529
2482
2530
2483 \begin_inset LatexCommand \label{sec:threading-opts}
2531 \begin_inset LatexCommand \label{sec:threading-opts}
2484
2532
2485 \end_inset
2533 \end_inset
2486
2534
2487 Special Threading Options
2535 Special Threading Options
2488 \layout Standard
2536 \layout Standard
2489
2537
2490 The following special options are ONLY valid at the beginning of the command
2538 The following special options are ONLY valid at the beginning of the command
2491 line, and not later.
2539 line, and not later.
2492 This is because they control the initial- ization of ipython itself, before
2540 This is because they control the initial- ization of ipython itself, before
2493 the normal option-handling mechanism is active.
2541 the normal option-handling mechanism is active.
2494 \layout List
2542 \layout List
2495 \labelwidthstring 00.00.0000
2543 \labelwidthstring 00.00.0000
2496
2544
2497
2545
2498 \family typewriter
2546 \family typewriter
2499 \series bold
2547 \series bold
2500 -gthread,\SpecialChar ~
2548 -gthread,\SpecialChar ~
2501 -qthread,\SpecialChar ~
2549 -qthread,\SpecialChar ~
2502 -wthread,\SpecialChar ~
2550 -wthread,\SpecialChar ~
2503 -pylab:
2551 -pylab:
2504 \family default
2552 \family default
2505 \series default
2553 \series default
2506 Only
2554 Only
2507 \emph on
2555 \emph on
2508 one
2556 one
2509 \emph default
2557 \emph default
2510 of these can be given, and it can only be given as the first option passed
2558 of these can be given, and it can only be given as the first option passed
2511 to IPython (it will have no effect in any other position).
2559 to IPython (it will have no effect in any other position).
2512 They provide threading support for the GTK Qt and WXPython toolkits, and
2560 They provide threading support for the GTK Qt and WXPython toolkits, and
2513 for the matplotlib library.
2561 for the matplotlib library.
2514 \layout List
2562 \layout List
2515 \labelwidthstring 00.00.0000
2563 \labelwidthstring 00.00.0000
2516
2564
2517 \SpecialChar ~
2565 \SpecialChar ~
2518 With any of the first three options, IPython starts running a separate
2566 With any of the first three options, IPython starts running a separate
2519 thread for the graphical toolkit's operation, so that you can open and
2567 thread for the graphical toolkit's operation, so that you can open and
2520 control graphical elements from within an IPython command line, without
2568 control graphical elements from within an IPython command line, without
2521 blocking.
2569 blocking.
2522 All three provide essentially the same functionality, respectively for
2570 All three provide essentially the same functionality, respectively for
2523 GTK, QT and WXWidgets (via their Python interfaces).
2571 GTK, QT and WXWidgets (via their Python interfaces).
2524 \layout List
2572 \layout List
2525 \labelwidthstring 00.00.0000
2573 \labelwidthstring 00.00.0000
2526
2574
2527 \SpecialChar ~
2575 \SpecialChar ~
2528 Note that with
2576 Note that with
2529 \family typewriter
2577 \family typewriter
2530 -wthread
2578 -wthread
2531 \family default
2579 \family default
2532 , you can additionally use the -wxversion option to request a specific version
2580 , you can additionally use the -wxversion option to request a specific version
2533 of wx to be used.
2581 of wx to be used.
2534 This requires that you have the
2582 This requires that you have the
2535 \family typewriter
2583 \family typewriter
2536 wxversion
2584 wxversion
2537 \family default
2585 \family default
2538 Python module installed, which is part of recent wxPython distributions.
2586 Python module installed, which is part of recent wxPython distributions.
2539 \layout List
2587 \layout List
2540 \labelwidthstring 00.00.0000
2588 \labelwidthstring 00.00.0000
2541
2589
2542 \SpecialChar ~
2590 \SpecialChar ~
2543 If
2591 If
2544 \family typewriter
2592 \family typewriter
2545 -pylab
2593 -pylab
2546 \family default
2594 \family default
2547 is given, IPython loads special support for the mat plotlib library (
2595 is given, IPython loads special support for the mat plotlib library (
2548 \begin_inset LatexCommand \htmlurl{http://matplotlib.sourceforge.net}
2596 \begin_inset LatexCommand \htmlurl{http://matplotlib.sourceforge.net}
2549
2597
2550 \end_inset
2598 \end_inset
2551
2599
2552 ), allowing interactive usage of any of its backends as defined in the user's
2600 ), allowing interactive usage of any of its backends as defined in the user's
2553
2601
2554 \family typewriter
2602 \family typewriter
2555 ~/.matplotlib/matplotlibrc
2603 ~/.matplotlib/matplotlibrc
2556 \family default
2604 \family default
2557 file.
2605 file.
2558 It automatically activates GTK, Qt or WX threading for IPyhton if the choice
2606 It automatically activates GTK, Qt or WX threading for IPyhton if the choice
2559 of matplotlib backend requires it.
2607 of matplotlib backend requires it.
2560 It also modifies the
2608 It also modifies the
2561 \family typewriter
2609 \family typewriter
2562 %run
2610 %run
2563 \family default
2611 \family default
2564 command to correctly execute (without blocking) any matplotlib-based script
2612 command to correctly execute (without blocking) any matplotlib-based script
2565 which calls
2613 which calls
2566 \family typewriter
2614 \family typewriter
2567 show()
2615 show()
2568 \family default
2616 \family default
2569 at the end.
2617 at the end.
2570
2618
2571 \layout List
2619 \layout List
2572 \labelwidthstring 00.00.0000
2620 \labelwidthstring 00.00.0000
2573
2621
2574
2622
2575 \family typewriter
2623 \family typewriter
2576 \series bold
2624 \series bold
2577 -tk
2625 -tk
2578 \family default
2626 \family default
2579 \series default
2627 \series default
2580 The
2628 The
2581 \family typewriter
2629 \family typewriter
2582 -g/q/wthread
2630 -g/q/wthread
2583 \family default
2631 \family default
2584 options, and
2632 options, and
2585 \family typewriter
2633 \family typewriter
2586 -pylab
2634 -pylab
2587 \family default
2635 \family default
2588 (if matplotlib is configured to use GTK, Qt or WX), will normally block
2636 (if matplotlib is configured to use GTK, Qt or WX), will normally block
2589 Tk graphical interfaces.
2637 Tk graphical interfaces.
2590 This means that when either GTK, Qt or WX threading is active, any attempt
2638 This means that when either GTK, Qt or WX threading is active, any attempt
2591 to open a Tk GUI will result in a dead window, and possibly cause the Python
2639 to open a Tk GUI will result in a dead window, and possibly cause the Python
2592 interpreter to crash.
2640 interpreter to crash.
2593 An extra option,
2641 An extra option,
2594 \family typewriter
2642 \family typewriter
2595 -tk
2643 -tk
2596 \family default
2644 \family default
2597 , is available to address this issue.
2645 , is available to address this issue.
2598 It can
2646 It can
2599 \emph on
2647 \emph on
2600 only
2648 only
2601 \emph default
2649 \emph default
2602 be given as a
2650 be given as a
2603 \emph on
2651 \emph on
2604 second
2652 second
2605 \emph default
2653 \emph default
2606 option after any of the above (
2654 option after any of the above (
2607 \family typewriter
2655 \family typewriter
2608 -gthread
2656 -gthread
2609 \family default
2657 \family default
2610 ,
2658 ,
2611 \family typewriter
2659 \family typewriter
2612 -wthread
2660 -wthread
2613 \family default
2661 \family default
2614 or
2662 or
2615 \family typewriter
2663 \family typewriter
2616 -pylab
2664 -pylab
2617 \family default
2665 \family default
2618 ).
2666 ).
2619 \layout List
2667 \layout List
2620 \labelwidthstring 00.00.0000
2668 \labelwidthstring 00.00.0000
2621
2669
2622 \SpecialChar ~
2670 \SpecialChar ~
2623 If
2671 If
2624 \family typewriter
2672 \family typewriter
2625 -tk
2673 -tk
2626 \family default
2674 \family default
2627 is given, IPython will try to coordinate Tk threading with GTK, Qt or WX.
2675 is given, IPython will try to coordinate Tk threading with GTK, Qt or WX.
2628 This is however potentially unreliable, and you will have to test on your
2676 This is however potentially unreliable, and you will have to test on your
2629 platform and Python configuration to determine whether it works for you.
2677 platform and Python configuration to determine whether it works for you.
2630 Debian users have reported success, apparently due to the fact that Debian
2678 Debian users have reported success, apparently due to the fact that Debian
2631 builds all of Tcl, Tk, Tkinter and Python with pthreads support.
2679 builds all of Tcl, Tk, Tkinter and Python with pthreads support.
2632 Under other Linux environments (such as Fedora Core 2/3), this option has
2680 Under other Linux environments (such as Fedora Core 2/3), this option has
2633 caused random crashes and lockups of the Python interpreter.
2681 caused random crashes and lockups of the Python interpreter.
2634 Under other operating systems (Mac OSX and Windows), you'll need to try
2682 Under other operating systems (Mac OSX and Windows), you'll need to try
2635 it to find out, since currently no user reports are available.
2683 it to find out, since currently no user reports are available.
2636 \layout List
2684 \layout List
2637 \labelwidthstring 00.00.0000
2685 \labelwidthstring 00.00.0000
2638
2686
2639 \SpecialChar ~
2687 \SpecialChar ~
2640 There is unfortunately no way for IPython to determine at run time whether
2688 There is unfortunately no way for IPython to determine at run time whether
2641
2689
2642 \family typewriter
2690 \family typewriter
2643 -tk
2691 -tk
2644 \family default
2692 \family default
2645 will work reliably or not, so you will need to do some experiments before
2693 will work reliably or not, so you will need to do some experiments before
2646 relying on it for regular work.
2694 relying on it for regular work.
2647
2695
2648 \layout Subsection
2696 \layout Subsection
2649
2697
2650
2698
2651 \begin_inset LatexCommand \label{sec:cmd-line-opts}
2699 \begin_inset LatexCommand \label{sec:cmd-line-opts}
2652
2700
2653 \end_inset
2701 \end_inset
2654
2702
2655 Regular Options
2703 Regular Options
2656 \layout Standard
2704 \layout Standard
2657
2705
2658 After the above threading options have been given, regular options can follow
2706 After the above threading options have been given, regular options can follow
2659 in any order.
2707 in any order.
2660 All options can be abbreviated to their shortest non-ambiguous form and
2708 All options can be abbreviated to their shortest non-ambiguous form and
2661 are case-sensitive.
2709 are case-sensitive.
2662 One or two dashes can be used.
2710 One or two dashes can be used.
2663 Some options have an alternate short form, indicated after a
2711 Some options have an alternate short form, indicated after a
2664 \family typewriter
2712 \family typewriter
2665 |
2713 |
2666 \family default
2714 \family default
2667 .
2715 .
2668 \layout Standard
2716 \layout Standard
2669
2717
2670 Most options can also be set from your ipythonrc configuration file.
2718 Most options can also be set from your ipythonrc configuration file.
2671 See the provided example for more details on what the options do.
2719 See the provided example for more details on what the options do.
2672 Options given at the command line override the values set in the ipythonrc
2720 Options given at the command line override the values set in the ipythonrc
2673 file.
2721 file.
2674 \layout Standard
2722 \layout Standard
2675
2723
2676 All options with a
2724 All options with a
2677 \family typewriter
2725 \family typewriter
2678 [no]
2726 [no]
2679 \family default
2727 \family default
2680 prepended can be specified in negated form (
2728 prepended can be specified in negated form (
2681 \family typewriter
2729 \family typewriter
2682 -nooption
2730 -nooption
2683 \family default
2731 \family default
2684 instead of
2732 instead of
2685 \family typewriter
2733 \family typewriter
2686 -option
2734 -option
2687 \family default
2735 \family default
2688 ) to turn the feature off.
2736 ) to turn the feature off.
2689 \layout List
2737 \layout List
2690 \labelwidthstring 00.00.0000
2738 \labelwidthstring 00.00.0000
2691
2739
2692
2740
2693 \family typewriter
2741 \family typewriter
2694 \series bold
2742 \series bold
2695 -help
2743 -help
2696 \family default
2744 \family default
2697 \series default
2745 \series default
2698 : print a help message and exit.
2746 : print a help message and exit.
2699 \layout List
2747 \layout List
2700 \labelwidthstring 00.00.0000
2748 \labelwidthstring 00.00.0000
2701
2749
2702
2750
2703 \family typewriter
2751 \family typewriter
2704 \series bold
2752 \series bold
2705 -pylab:
2753 -pylab:
2706 \family default
2754 \family default
2707 \series default
2755 \series default
2708 this can
2756 this can
2709 \emph on
2757 \emph on
2710 only
2758 only
2711 \emph default
2759 \emph default
2712 be given as the
2760 be given as the
2713 \emph on
2761 \emph on
2714 first
2762 first
2715 \emph default
2763 \emph default
2716 option passed to IPython (it will have no effect in any other position).
2764 option passed to IPython (it will have no effect in any other position).
2717 It adds special support for the matplotlib library (
2765 It adds special support for the matplotlib library (
2718 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
2766 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
2719
2767
2720 \end_inset
2768 \end_inset
2721
2769
2722 ), allowing interactive usage of any of its backends as defined in the user's
2770 ), allowing interactive usage of any of its backends as defined in the user's
2723
2771
2724 \family typewriter
2772 \family typewriter
2725 .matplotlibrc
2773 .matplotlibrc
2726 \family default
2774 \family default
2727 file.
2775 file.
2728 It automatically activates GTK or WX threading for IPyhton if the choice
2776 It automatically activates GTK or WX threading for IPyhton if the choice
2729 of matplotlib backend requires it.
2777 of matplotlib backend requires it.
2730 It also modifies the
2778 It also modifies the
2731 \family typewriter
2779 \family typewriter
2732 %run
2780 %run
2733 \family default
2781 \family default
2734 command to correctly execute (without blocking) any matplotlib-based script
2782 command to correctly execute (without blocking) any matplotlib-based script
2735 which calls
2783 which calls
2736 \family typewriter
2784 \family typewriter
2737 show()
2785 show()
2738 \family default
2786 \family default
2739 at the end.
2787 at the end.
2740 See Sec.\SpecialChar ~
2788 See Sec.\SpecialChar ~
2741
2789
2742 \begin_inset LatexCommand \ref{sec:matplotlib-support}
2790 \begin_inset LatexCommand \ref{sec:matplotlib-support}
2743
2791
2744 \end_inset
2792 \end_inset
2745
2793
2746 for more details.
2794 for more details.
2747 \layout List
2795 \layout List
2748 \labelwidthstring 00.00.0000
2796 \labelwidthstring 00.00.0000
2749
2797
2750
2798
2751 \family typewriter
2799 \family typewriter
2752 \series bold
2800 \series bold
2753 -autocall <val>:
2801 -autocall <val>:
2754 \family default
2802 \family default
2755 \series default
2803 \series default
2756 Make IPython automatically call any callable object even if you didn't
2804 Make IPython automatically call any callable object even if you didn't
2757 type explicit parentheses.
2805 type explicit parentheses.
2758 For example, `str 43' becomes `str(43)' automatically.
2806 For example, `str 43' becomes `str(43)' automatically.
2759 The value can be `0' to disable the feature, `1' for
2807 The value can be `0' to disable the feature, `1' for
2760 \emph on
2808 \emph on
2761 smart
2809 smart
2762 \emph default
2810 \emph default
2763 autocall, where it is not applied if there are no more arguments on the
2811 autocall, where it is not applied if there are no more arguments on the
2764 line, and `2' for
2812 line, and `2' for
2765 \emph on
2813 \emph on
2766 full
2814 full
2767 \emph default
2815 \emph default
2768 autocall, where all callable objects are automatically called (even if
2816 autocall, where all callable objects are automatically called (even if
2769 no arguments are present).
2817 no arguments are present).
2770 The default is `1'.
2818 The default is `1'.
2771 \layout List
2819 \layout List
2772 \labelwidthstring 00.00.0000
2820 \labelwidthstring 00.00.0000
2773
2821
2774
2822
2775 \family typewriter
2823 \family typewriter
2776 \series bold
2824 \series bold
2777 -[no]autoindent:
2825 -[no]autoindent:
2778 \family default
2826 \family default
2779 \series default
2827 \series default
2780 Turn automatic indentation on/off.
2828 Turn automatic indentation on/off.
2781 \layout List
2829 \layout List
2782 \labelwidthstring 00.00.0000
2830 \labelwidthstring 00.00.0000
2783
2831
2784
2832
2785 \family typewriter
2833 \family typewriter
2786 \series bold
2834 \series bold
2787 -[no]automagic
2835 -[no]automagic
2788 \series default
2836 \series default
2789 :
2837 :
2790 \family default
2838 \family default
2791 make magic commands automatic (without needing their first character to
2839 make magic commands automatic (without needing their first character to
2792 be
2840 be
2793 \family typewriter
2841 \family typewriter
2794 %
2842 %
2795 \family default
2843 \family default
2796 ).
2844 ).
2797 Type
2845 Type
2798 \family typewriter
2846 \family typewriter
2799 %magic
2847 %magic
2800 \family default
2848 \family default
2801 at the IPython prompt for more information.
2849 at the IPython prompt for more information.
2802 \layout List
2850 \layout List
2803 \labelwidthstring 00.00.0000
2851 \labelwidthstring 00.00.0000
2804
2852
2805
2853
2806 \family typewriter
2854 \family typewriter
2807 \series bold
2855 \series bold
2808 -[no]autoedit_syntax:
2856 -[no]autoedit_syntax:
2809 \family default
2857 \family default
2810 \series default
2858 \series default
2811 When a syntax error occurs after editing a file, automatically open the
2859 When a syntax error occurs after editing a file, automatically open the
2812 file to the trouble causing line for convenient fixing.
2860 file to the trouble causing line for convenient fixing.
2813
2861
2814 \layout List
2862 \layout List
2815 \labelwidthstring 00.00.0000
2863 \labelwidthstring 00.00.0000
2816
2864
2817
2865
2818 \family typewriter
2866 \family typewriter
2819 \series bold
2867 \series bold
2820 -[no]banner
2868 -[no]banner
2821 \series default
2869 \series default
2822 :
2870 :
2823 \family default
2871 \family default
2824 Print the initial information banner (default on).
2872 Print the initial information banner (default on).
2825 \layout List
2873 \layout List
2826 \labelwidthstring 00.00.0000
2874 \labelwidthstring 00.00.0000
2827
2875
2828
2876
2829 \family typewriter
2877 \family typewriter
2830 \series bold
2878 \series bold
2831 -c\SpecialChar ~
2879 -c\SpecialChar ~
2832 <command>:
2880 <command>:
2833 \family default
2881 \family default
2834 \series default
2882 \series default
2835 execute the given command string, and set sys.argv to
2883 execute the given command string, and set sys.argv to
2836 \family typewriter
2884 \family typewriter
2837 ['c']
2885 ['c']
2838 \family default
2886 \family default
2839 .
2887 .
2840 This is similar to the
2888 This is similar to the
2841 \family typewriter
2889 \family typewriter
2842 -c
2890 -c
2843 \family default
2891 \family default
2844 option in the normal Python interpreter.
2892 option in the normal Python interpreter.
2845
2893
2846 \layout List
2894 \layout List
2847 \labelwidthstring 00.00.0000
2895 \labelwidthstring 00.00.0000
2848
2896
2849
2897
2850 \family typewriter
2898 \family typewriter
2851 \series bold
2899 \series bold
2852 -cache_size|cs\SpecialChar ~
2900 -cache_size|cs\SpecialChar ~
2853 <n>
2901 <n>
2854 \series default
2902 \series default
2855 :
2903 :
2856 \family default
2904 \family default
2857 size of the output cache (maximum number of entries to hold in memory).
2905 size of the output cache (maximum number of entries to hold in memory).
2858 The default is 1000, you can change it permanently in your config file.
2906 The default is 1000, you can change it permanently in your config file.
2859 Setting it to 0 completely disables the caching system, and the minimum
2907 Setting it to 0 completely disables the caching system, and the minimum
2860 value accepted is 20 (if you provide a value less than 20, it is reset
2908 value accepted is 20 (if you provide a value less than 20, it is reset
2861 to 0 and a warning is issued) This limit is defined because otherwise you'll
2909 to 0 and a warning is issued) This limit is defined because otherwise you'll
2862 spend more time re-flushing a too small cache than working.
2910 spend more time re-flushing a too small cache than working.
2863 \layout List
2911 \layout List
2864 \labelwidthstring 00.00.0000
2912 \labelwidthstring 00.00.0000
2865
2913
2866
2914
2867 \family typewriter
2915 \family typewriter
2868 \series bold
2916 \series bold
2869 -classic|cl
2917 -classic|cl
2870 \series default
2918 \series default
2871 :
2919 :
2872 \family default
2920 \family default
2873 Gives IPython a similar feel to the classic Python prompt.
2921 Gives IPython a similar feel to the classic Python prompt.
2874 \layout List
2922 \layout List
2875 \labelwidthstring 00.00.0000
2923 \labelwidthstring 00.00.0000
2876
2924
2877
2925
2878 \family typewriter
2926 \family typewriter
2879 \series bold
2927 \series bold
2880 -colors\SpecialChar ~
2928 -colors\SpecialChar ~
2881 <scheme>:
2929 <scheme>:
2882 \family default
2930 \family default
2883 \series default
2931 \series default
2884 Color scheme for prompts and exception reporting.
2932 Color scheme for prompts and exception reporting.
2885 Currently implemented: NoColor, Linux and LightBG.
2933 Currently implemented: NoColor, Linux and LightBG.
2886 \layout List
2934 \layout List
2887 \labelwidthstring 00.00.0000
2935 \labelwidthstring 00.00.0000
2888
2936
2889
2937
2890 \family typewriter
2938 \family typewriter
2891 \series bold
2939 \series bold
2892 -[no]color_info:
2940 -[no]color_info:
2893 \family default
2941 \family default
2894 \series default
2942 \series default
2895 IPython can display information about objects via a set of functions, and
2943 IPython can display information about objects via a set of functions, and
2896 optionally can use colors for this, syntax highlighting source code and
2944 optionally can use colors for this, syntax highlighting source code and
2897 various other elements.
2945 various other elements.
2898 However, because this information is passed through a pager (like 'less')
2946 However, because this information is passed through a pager (like 'less')
2899 and many pagers get confused with color codes, this option is off by default.
2947 and many pagers get confused with color codes, this option is off by default.
2900 You can test it and turn it on permanently in your ipythonrc file if it
2948 You can test it and turn it on permanently in your ipythonrc file if it
2901 works for you.
2949 works for you.
2902 As a reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
2950 As a reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
2903 that in RedHat 7.2 doesn't.
2951 that in RedHat 7.2 doesn't.
2904 \layout List
2952 \layout List
2905 \labelwidthstring 00.00.0000
2953 \labelwidthstring 00.00.0000
2906
2954
2907 \SpecialChar ~
2955 \SpecialChar ~
2908 Test it and turn it on permanently if it works with your system.
2956 Test it and turn it on permanently if it works with your system.
2909 The magic function
2957 The magic function
2910 \family typewriter
2958 \family typewriter
2911 %color_info
2959 %color_info
2912 \family default
2960 \family default
2913 allows you to toggle this interactively for testing.
2961 allows you to toggle this interactively for testing.
2914 \layout List
2962 \layout List
2915 \labelwidthstring 00.00.0000
2963 \labelwidthstring 00.00.0000
2916
2964
2917
2965
2918 \family typewriter
2966 \family typewriter
2919 \series bold
2967 \series bold
2920 -[no]debug
2968 -[no]debug
2921 \family default
2969 \family default
2922 \series default
2970 \series default
2923 : Show information about the loading process.
2971 : Show information about the loading process.
2924 Very useful to pin down problems with your configuration files or to get
2972 Very useful to pin down problems with your configuration files or to get
2925 details about session restores.
2973 details about session restores.
2926 \layout List
2974 \layout List
2927 \labelwidthstring 00.00.0000
2975 \labelwidthstring 00.00.0000
2928
2976
2929
2977
2930 \family typewriter
2978 \family typewriter
2931 \series bold
2979 \series bold
2932 -[no]deep_reload
2980 -[no]deep_reload
2933 \series default
2981 \series default
2934 :
2982 :
2935 \family default
2983 \family default
2936 IPython can use the
2984 IPython can use the
2937 \family typewriter
2985 \family typewriter
2938 deep_reload
2986 deep_reload
2939 \family default
2987 \family default
2940 module which reloads changes in modules recursively (it replaces the
2988 module which reloads changes in modules recursively (it replaces the
2941 \family typewriter
2989 \family typewriter
2942 reload()
2990 reload()
2943 \family default
2991 \family default
2944 function, so you don't need to change anything to use it).
2992 function, so you don't need to change anything to use it).
2945
2993
2946 \family typewriter
2994 \family typewriter
2947 deep_reload()
2995 deep_reload()
2948 \family default
2996 \family default
2949 forces a full reload of modules whose code may have changed, which the
2997 forces a full reload of modules whose code may have changed, which the
2950 default
2998 default
2951 \family typewriter
2999 \family typewriter
2952 reload()
3000 reload()
2953 \family default
3001 \family default
2954 function does not.
3002 function does not.
2955 \layout List
3003 \layout List
2956 \labelwidthstring 00.00.0000
3004 \labelwidthstring 00.00.0000
2957
3005
2958 \SpecialChar ~
3006 \SpecialChar ~
2959 When deep_reload is off, IPython will use the normal
3007 When deep_reload is off, IPython will use the normal
2960 \family typewriter
3008 \family typewriter
2961 reload()
3009 reload()
2962 \family default
3010 \family default
2963 , but deep_reload will still be available as
3011 , but deep_reload will still be available as
2964 \family typewriter
3012 \family typewriter
2965 dreload()
3013 dreload()
2966 \family default
3014 \family default
2967 .
3015 .
2968 This feature is off by default [which means that you have both normal
3016 This feature is off by default [which means that you have both normal
2969 \family typewriter
3017 \family typewriter
2970 reload()
3018 reload()
2971 \family default
3019 \family default
2972 and
3020 and
2973 \family typewriter
3021 \family typewriter
2974 dreload()
3022 dreload()
2975 \family default
3023 \family default
2976 ].
3024 ].
2977 \layout List
3025 \layout List
2978 \labelwidthstring 00.00.0000
3026 \labelwidthstring 00.00.0000
2979
3027
2980
3028
2981 \family typewriter
3029 \family typewriter
2982 \series bold
3030 \series bold
2983 -editor\SpecialChar ~
3031 -editor\SpecialChar ~
2984 <name>
3032 <name>
2985 \family default
3033 \family default
2986 \series default
3034 \series default
2987 : Which editor to use with the
3035 : Which editor to use with the
2988 \family typewriter
3036 \family typewriter
2989 %edit
3037 %edit
2990 \family default
3038 \family default
2991 command.
3039 command.
2992 By default, IPython will honor your
3040 By default, IPython will honor your
2993 \family typewriter
3041 \family typewriter
2994 EDITOR
3042 EDITOR
2995 \family default
3043 \family default
2996 environment variable (if not set, vi is the Unix default and notepad the
3044 environment variable (if not set, vi is the Unix default and notepad the
2997 Windows one).
3045 Windows one).
2998 Since this editor is invoked on the fly by IPython and is meant for editing
3046 Since this editor is invoked on the fly by IPython and is meant for editing
2999 small code snippets, you may want to use a small, lightweight editor here
3047 small code snippets, you may want to use a small, lightweight editor here
3000 (in case your default
3048 (in case your default
3001 \family typewriter
3049 \family typewriter
3002 EDITOR
3050 EDITOR
3003 \family default
3051 \family default
3004 is something like Emacs).
3052 is something like Emacs).
3005 \layout List
3053 \layout List
3006 \labelwidthstring 00.00.0000
3054 \labelwidthstring 00.00.0000
3007
3055
3008
3056
3009 \family typewriter
3057 \family typewriter
3010 \series bold
3058 \series bold
3011 -ipythondir\SpecialChar ~
3059 -ipythondir\SpecialChar ~
3012 <name>
3060 <name>
3013 \series default
3061 \series default
3014 :
3062 :
3015 \family default
3063 \family default
3016 name of your IPython configuration directory
3064 name of your IPython configuration directory
3017 \family typewriter
3065 \family typewriter
3018 IPYTHONDIR
3066 IPYTHONDIR
3019 \family default
3067 \family default
3020 .
3068 .
3021 This can also be specified through the environment variable
3069 This can also be specified through the environment variable
3022 \family typewriter
3070 \family typewriter
3023 IPYTHONDIR
3071 IPYTHONDIR
3024 \family default
3072 \family default
3025 .
3073 .
3026 \layout List
3074 \layout List
3027 \labelwidthstring 00.00.0000
3075 \labelwidthstring 00.00.0000
3028
3076
3029
3077
3030 \family typewriter
3078 \family typewriter
3031 \series bold
3079 \series bold
3032 -log|l
3080 -log|l
3033 \family default
3081 \family default
3034 \series default
3082 \series default
3035 : generate a log file of all input.
3083 : generate a log file of all input.
3036 The file is named
3084 The file is named
3037 \family typewriter
3085 \family typewriter
3038 ipython_log.py
3086 ipython_log.py
3039 \family default
3087 \family default
3040 in your current directory (which prevents logs from multiple IPython sessions
3088 in your current directory (which prevents logs from multiple IPython sessions
3041 from trampling each other).
3089 from trampling each other).
3042 You can use this to later restore a session by loading your logfile as
3090 You can use this to later restore a session by loading your logfile as
3043 a file to be executed with option
3091 a file to be executed with option
3044 \family typewriter
3092 \family typewriter
3045 -logplay
3093 -logplay
3046 \family default
3094 \family default
3047 (see below).
3095 (see below).
3048 \layout List
3096 \layout List
3049 \labelwidthstring 00.00.0000
3097 \labelwidthstring 00.00.0000
3050
3098
3051
3099
3052 \family typewriter
3100 \family typewriter
3053 \series bold
3101 \series bold
3054 -logfile|lf\SpecialChar ~
3102 -logfile|lf\SpecialChar ~
3055 <name>
3103 <name>
3056 \series default
3104 \series default
3057 :
3105 :
3058 \family default
3106 \family default
3059 specify the name of your logfile.
3107 specify the name of your logfile.
3060 \layout List
3108 \layout List
3061 \labelwidthstring 00.00.0000
3109 \labelwidthstring 00.00.0000
3062
3110
3063
3111
3064 \family typewriter
3112 \family typewriter
3065 \series bold
3113 \series bold
3066 -logplay|lp\SpecialChar ~
3114 -logplay|lp\SpecialChar ~
3067 <name>
3115 <name>
3068 \series default
3116 \series default
3069 :
3117 :
3070 \family default
3118 \family default
3071 you can replay a previous log.
3119 you can replay a previous log.
3072 For restoring a session as close as possible to the state you left it in,
3120 For restoring a session as close as possible to the state you left it in,
3073 use this option (don't just run the logfile).
3121 use this option (don't just run the logfile).
3074 With
3122 With
3075 \family typewriter
3123 \family typewriter
3076 -logplay
3124 -logplay
3077 \family default
3125 \family default
3078 , IPython will try to reconstruct the previous working environment in full,
3126 , IPython will try to reconstruct the previous working environment in full,
3079 not just execute the commands in the logfile.
3127 not just execute the commands in the logfile.
3080 \layout List
3128 \layout List
3081 \labelwidthstring 00.00.0000
3129 \labelwidthstring 00.00.0000
3082
3130
3083 \SpecialChar ~
3131 \SpecialChar ~
3084 When a session is restored, logging is automatically turned on again with
3132 When a session is restored, logging is automatically turned on again with
3085 the name of the logfile it was invoked with (it is read from the log header).
3133 the name of the logfile it was invoked with (it is read from the log header).
3086 So once you've turned logging on for a session, you can quit IPython and
3134 So once you've turned logging on for a session, you can quit IPython and
3087 reload it as many times as you want and it will continue to log its history
3135 reload it as many times as you want and it will continue to log its history
3088 and restore from the beginning every time.
3136 and restore from the beginning every time.
3089 \layout List
3137 \layout List
3090 \labelwidthstring 00.00.0000
3138 \labelwidthstring 00.00.0000
3091
3139
3092 \SpecialChar ~
3140 \SpecialChar ~
3093 Caveats: there are limitations in this option.
3141 Caveats: there are limitations in this option.
3094 The history variables
3142 The history variables
3095 \family typewriter
3143 \family typewriter
3096 _i*
3144 _i*
3097 \family default
3145 \family default
3098 ,
3146 ,
3099 \family typewriter
3147 \family typewriter
3100 _*
3148 _*
3101 \family default
3149 \family default
3102 and
3150 and
3103 \family typewriter
3151 \family typewriter
3104 _dh
3152 _dh
3105 \family default
3153 \family default
3106 don't get restored properly.
3154 don't get restored properly.
3107 In the future we will try to implement full session saving by writing and
3155 In the future we will try to implement full session saving by writing and
3108 retrieving a 'snapshot' of the memory state of IPython.
3156 retrieving a 'snapshot' of the memory state of IPython.
3109 But our first attempts failed because of inherent limitations of Python's
3157 But our first attempts failed because of inherent limitations of Python's
3110 Pickle module, so this may have to wait.
3158 Pickle module, so this may have to wait.
3111 \layout List
3159 \layout List
3112 \labelwidthstring 00.00.0000
3160 \labelwidthstring 00.00.0000
3113
3161
3114
3162
3115 \family typewriter
3163 \family typewriter
3116 \series bold
3164 \series bold
3117 -[no]messages
3165 -[no]messages
3118 \series default
3166 \series default
3119 :
3167 :
3120 \family default
3168 \family default
3121 Print messages which IPython collects about its startup process (default
3169 Print messages which IPython collects about its startup process (default
3122 on).
3170 on).
3123 \layout List
3171 \layout List
3124 \labelwidthstring 00.00.0000
3172 \labelwidthstring 00.00.0000
3125
3173
3126
3174
3127 \family typewriter
3175 \family typewriter
3128 \series bold
3176 \series bold
3129 -[no]pdb
3177 -[no]pdb
3130 \family default
3178 \family default
3131 \series default
3179 \series default
3132 : Automatically call the pdb debugger after every uncaught exception.
3180 : Automatically call the pdb debugger after every uncaught exception.
3133 If you are used to debugging using pdb, this puts you automatically inside
3181 If you are used to debugging using pdb, this puts you automatically inside
3134 of it after any call (either in IPython or in code called by it) which
3182 of it after any call (either in IPython or in code called by it) which
3135 triggers an exception which goes uncaught.
3183 triggers an exception which goes uncaught.
3136 \layout List
3184 \layout List
3137 \labelwidthstring 00.00.0000
3185 \labelwidthstring 00.00.0000
3138
3186
3139
3187
3140 \family typewriter
3188 \family typewriter
3141 \series bold
3189 \series bold
3142 -[no]pprint
3190 -[no]pprint
3143 \series default
3191 \series default
3144 :
3192 :
3145 \family default
3193 \family default
3146 ipython can optionally use the pprint (pretty printer) module for displaying
3194 ipython can optionally use the pprint (pretty printer) module for displaying
3147 results.
3195 results.
3148 pprint tends to give a nicer display of nested data structures.
3196 pprint tends to give a nicer display of nested data structures.
3149 If you like it, you can turn it on permanently in your config file (default
3197 If you like it, you can turn it on permanently in your config file (default
3150 off).
3198 off).
3151 \layout List
3199 \layout List
3152 \labelwidthstring 00.00.0000
3200 \labelwidthstring 00.00.0000
3153
3201
3154
3202
3155 \family typewriter
3203 \family typewriter
3156 \series bold
3204 \series bold
3157 -profile|p <name>
3205 -profile|p <name>
3158 \series default
3206 \series default
3159 :
3207 :
3160 \family default
3208 \family default
3161 assume that your config file is
3209 assume that your config file is
3162 \family typewriter
3210 \family typewriter
3163 ipythonrc-<name>
3211 ipythonrc-<name>
3164 \family default
3212 \family default
3165 (looks in current dir first, then in
3213 (looks in current dir first, then in
3166 \family typewriter
3214 \family typewriter
3167 IPYTHONDIR
3215 IPYTHONDIR
3168 \family default
3216 \family default
3169 ).
3217 ).
3170 This is a quick way to keep and load multiple config files for different
3218 This is a quick way to keep and load multiple config files for different
3171 tasks, especially if you use the include option of config files.
3219 tasks, especially if you use the include option of config files.
3172 You can keep a basic
3220 You can keep a basic
3173 \family typewriter
3221 \family typewriter
3174 IPYTHONDIR/ipythonrc
3222 IPYTHONDIR/ipythonrc
3175 \family default
3223 \family default
3176 file and then have other 'profiles' which include this one and load extra
3224 file and then have other 'profiles' which include this one and load extra
3177 things for particular tasks.
3225 things for particular tasks.
3178 For example:
3226 For example:
3179 \layout List
3227 \layout List
3180 \labelwidthstring 00.00.0000
3228 \labelwidthstring 00.00.0000
3181
3229
3182
3230
3183 \family typewriter
3231 \family typewriter
3184 \SpecialChar ~
3232 \SpecialChar ~
3185
3233
3186 \family default
3234 \family default
3187 1.
3235 1.
3188
3236
3189 \family typewriter
3237 \family typewriter
3190 $HOME/.ipython/ipythonrc
3238 $HOME/.ipython/ipythonrc
3191 \family default
3239 \family default
3192 : load basic things you always want.
3240 : load basic things you always want.
3193 \layout List
3241 \layout List
3194 \labelwidthstring 00.00.0000
3242 \labelwidthstring 00.00.0000
3195
3243
3196
3244
3197 \family typewriter
3245 \family typewriter
3198 \SpecialChar ~
3246 \SpecialChar ~
3199
3247
3200 \family default
3248 \family default
3201 2.
3249 2.
3202
3250
3203 \family typewriter
3251 \family typewriter
3204 $HOME/.ipython/ipythonrc-math
3252 $HOME/.ipython/ipythonrc-math
3205 \family default
3253 \family default
3206 : load (1) and basic math-related modules.
3254 : load (1) and basic math-related modules.
3207
3255
3208 \layout List
3256 \layout List
3209 \labelwidthstring 00.00.0000
3257 \labelwidthstring 00.00.0000
3210
3258
3211
3259
3212 \family typewriter
3260 \family typewriter
3213 \SpecialChar ~
3261 \SpecialChar ~
3214
3262
3215 \family default
3263 \family default
3216 3.
3264 3.
3217
3265
3218 \family typewriter
3266 \family typewriter
3219 $HOME/.ipython/ipythonrc-numeric
3267 $HOME/.ipython/ipythonrc-numeric
3220 \family default
3268 \family default
3221 : load (1) and Numeric and plotting modules.
3269 : load (1) and Numeric and plotting modules.
3222 \layout List
3270 \layout List
3223 \labelwidthstring 00.00.0000
3271 \labelwidthstring 00.00.0000
3224
3272
3225 \SpecialChar ~
3273 \SpecialChar ~
3226 Since it is possible to create an endless loop by having circular file
3274 Since it is possible to create an endless loop by having circular file
3227 inclusions, IPython will stop if it reaches 15 recursive inclusions.
3275 inclusions, IPython will stop if it reaches 15 recursive inclusions.
3228 \layout List
3276 \layout List
3229 \labelwidthstring 00.00.0000
3277 \labelwidthstring 00.00.0000
3230
3278
3231
3279
3232 \family typewriter
3280 \family typewriter
3233 \series bold
3281 \series bold
3234 -prompt_in1|pi1\SpecialChar ~
3282 -prompt_in1|pi1\SpecialChar ~
3235 <string>:
3283 <string>:
3236 \family default
3284 \family default
3237 \series default
3285 \series default
3238 Specify the string used for input prompts.
3286 Specify the string used for input prompts.
3239 Note that if you are using numbered prompts, the number is represented
3287 Note that if you are using numbered prompts, the number is represented
3240 with a '
3288 with a '
3241 \backslash
3289 \backslash
3242 #' in the string.
3290 #' in the string.
3243 Don't forget to quote strings with spaces embedded in them.
3291 Don't forget to quote strings with spaces embedded in them.
3244 Default: '
3292 Default: '
3245 \family typewriter
3293 \family typewriter
3246 In\SpecialChar ~
3294 In\SpecialChar ~
3247 [
3295 [
3248 \backslash
3296 \backslash
3249 #]:
3297 #]:
3250 \family default
3298 \family default
3251 '.
3299 '.
3252 Sec.\SpecialChar ~
3300 Sec.\SpecialChar ~
3253
3301
3254 \begin_inset LatexCommand \ref{sec:prompts}
3302 \begin_inset LatexCommand \ref{sec:prompts}
3255
3303
3256 \end_inset
3304 \end_inset
3257
3305
3258 discusses in detail all the available escapes to customize your prompts.
3306 discusses in detail all the available escapes to customize your prompts.
3259 \layout List
3307 \layout List
3260 \labelwidthstring 00.00.0000
3308 \labelwidthstring 00.00.0000
3261
3309
3262
3310
3263 \family typewriter
3311 \family typewriter
3264 \series bold
3312 \series bold
3265 -prompt_in2|pi2\SpecialChar ~
3313 -prompt_in2|pi2\SpecialChar ~
3266 <string>:
3314 <string>:
3267 \family default
3315 \family default
3268 \series default
3316 \series default
3269 Similar to the previous option, but used for the continuation prompts.
3317 Similar to the previous option, but used for the continuation prompts.
3270 The special sequence '
3318 The special sequence '
3271 \family typewriter
3319 \family typewriter
3272
3320
3273 \backslash
3321 \backslash
3274 D
3322 D
3275 \family default
3323 \family default
3276 ' is similar to '
3324 ' is similar to '
3277 \family typewriter
3325 \family typewriter
3278
3326
3279 \backslash
3327 \backslash
3280 #
3328 #
3281 \family default
3329 \family default
3282 ', but with all digits replaced dots (so you can have your continuation
3330 ', but with all digits replaced dots (so you can have your continuation
3283 prompt aligned with your input prompt).
3331 prompt aligned with your input prompt).
3284 Default: '
3332 Default: '
3285 \family typewriter
3333 \family typewriter
3286 \SpecialChar ~
3334 \SpecialChar ~
3287 \SpecialChar ~
3335 \SpecialChar ~
3288 \SpecialChar ~
3336 \SpecialChar ~
3289 .
3337 .
3290 \backslash
3338 \backslash
3291 D.:
3339 D.:
3292 \family default
3340 \family default
3293 ' (note three spaces at the start for alignment with '
3341 ' (note three spaces at the start for alignment with '
3294 \family typewriter
3342 \family typewriter
3295 In\SpecialChar ~
3343 In\SpecialChar ~
3296 [
3344 [
3297 \backslash
3345 \backslash
3298 #]
3346 #]
3299 \family default
3347 \family default
3300 ').
3348 ').
3301 \layout List
3349 \layout List
3302 \labelwidthstring 00.00.0000
3350 \labelwidthstring 00.00.0000
3303
3351
3304
3352
3305 \family typewriter
3353 \family typewriter
3306 \series bold
3354 \series bold
3307 -prompt_out|po\SpecialChar ~
3355 -prompt_out|po\SpecialChar ~
3308 <string>:
3356 <string>:
3309 \family default
3357 \family default
3310 \series default
3358 \series default
3311 String used for output prompts, also uses numbers like
3359 String used for output prompts, also uses numbers like
3312 \family typewriter
3360 \family typewriter
3313 prompt_in1
3361 prompt_in1
3314 \family default
3362 \family default
3315 .
3363 .
3316 Default: '
3364 Default: '
3317 \family typewriter
3365 \family typewriter
3318 Out[
3366 Out[
3319 \backslash
3367 \backslash
3320 #]:
3368 #]:
3321 \family default
3369 \family default
3322 '
3370 '
3323 \layout List
3371 \layout List
3324 \labelwidthstring 00.00.0000
3372 \labelwidthstring 00.00.0000
3325
3373
3326
3374
3327 \family typewriter
3375 \family typewriter
3328 \series bold
3376 \series bold
3329 -quick
3377 -quick
3330 \family default
3378 \family default
3331 \series default
3379 \series default
3332 : start in bare bones mode (no config file loaded).
3380 : start in bare bones mode (no config file loaded).
3333 \layout List
3381 \layout List
3334 \labelwidthstring 00.00.0000
3382 \labelwidthstring 00.00.0000
3335
3383
3336
3384
3337 \family typewriter
3385 \family typewriter
3338 \series bold
3386 \series bold
3339 -rcfile\SpecialChar ~
3387 -rcfile\SpecialChar ~
3340 <name>
3388 <name>
3341 \series default
3389 \series default
3342 :
3390 :
3343 \family default
3391 \family default
3344 name of your IPython resource configuration file.
3392 name of your IPython resource configuration file.
3345 Normally IPython loads ipythonrc (from current directory) or
3393 Normally IPython loads ipythonrc (from current directory) or
3346 \family typewriter
3394 \family typewriter
3347 IPYTHONDIR/ipythonrc
3395 IPYTHONDIR/ipythonrc
3348 \family default
3396 \family default
3349 .
3397 .
3350 \layout List
3398 \layout List
3351 \labelwidthstring 00.00.0000
3399 \labelwidthstring 00.00.0000
3352
3400
3353 \SpecialChar ~
3401 \SpecialChar ~
3354 If the loading of your config file fails, IPython starts with a bare bones
3402 If the loading of your config file fails, IPython starts with a bare bones
3355 configuration (no modules loaded at all).
3403 configuration (no modules loaded at all).
3356 \layout List
3404 \layout List
3357 \labelwidthstring 00.00.0000
3405 \labelwidthstring 00.00.0000
3358
3406
3359
3407
3360 \family typewriter
3408 \family typewriter
3361 \series bold
3409 \series bold
3362 -[no]readline
3410 -[no]readline
3363 \family default
3411 \family default
3364 \series default
3412 \series default
3365 : use the readline library, which is needed to support name completion and
3413 : use the readline library, which is needed to support name completion and
3366 command history, among other things.
3414 command history, among other things.
3367 It is enabled by default, but may cause problems for users of X/Emacs in
3415 It is enabled by default, but may cause problems for users of X/Emacs in
3368 Python comint or shell buffers.
3416 Python comint or shell buffers.
3369 \layout List
3417 \layout List
3370 \labelwidthstring 00.00.0000
3418 \labelwidthstring 00.00.0000
3371
3419
3372 \SpecialChar ~
3420 \SpecialChar ~
3373 Note that X/Emacs 'eterm' buffers (opened with
3421 Note that X/Emacs 'eterm' buffers (opened with
3374 \family typewriter
3422 \family typewriter
3375 M-x\SpecialChar ~
3423 M-x\SpecialChar ~
3376 term
3424 term
3377 \family default
3425 \family default
3378 ) support IPython's readline and syntax coloring fine, only 'emacs' (
3426 ) support IPython's readline and syntax coloring fine, only 'emacs' (
3379 \family typewriter
3427 \family typewriter
3380 M-x\SpecialChar ~
3428 M-x\SpecialChar ~
3381 shell
3429 shell
3382 \family default
3430 \family default
3383 and
3431 and
3384 \family typewriter
3432 \family typewriter
3385 C-c\SpecialChar ~
3433 C-c\SpecialChar ~
3386 !
3434 !
3387 \family default
3435 \family default
3388 ) buffers do not.
3436 ) buffers do not.
3389 \layout List
3437 \layout List
3390 \labelwidthstring 00.00.0000
3438 \labelwidthstring 00.00.0000
3391
3439
3392
3440
3393 \family typewriter
3441 \family typewriter
3394 \series bold
3442 \series bold
3395 -screen_length|sl\SpecialChar ~
3443 -screen_length|sl\SpecialChar ~
3396 <n>
3444 <n>
3397 \series default
3445 \series default
3398 :
3446 :
3399 \family default
3447 \family default
3400 number of lines of your screen.
3448 number of lines of your screen.
3401 This is used to control printing of very long strings.
3449 This is used to control printing of very long strings.
3402 Strings longer than this number of lines will be sent through a pager instead
3450 Strings longer than this number of lines will be sent through a pager instead
3403 of directly printed.
3451 of directly printed.
3404 \layout List
3452 \layout List
3405 \labelwidthstring 00.00.0000
3453 \labelwidthstring 00.00.0000
3406
3454
3407 \SpecialChar ~
3455 \SpecialChar ~
3408 The default value for this is 0, which means IPython will auto-detect your
3456 The default value for this is 0, which means IPython will auto-detect your
3409 screen size every time it needs to print certain potentially long strings
3457 screen size every time it needs to print certain potentially long strings
3410 (this doesn't change the behavior of the 'print' keyword, it's only triggered
3458 (this doesn't change the behavior of the 'print' keyword, it's only triggered
3411 internally).
3459 internally).
3412 If for some reason this isn't working well (it needs curses support), specify
3460 If for some reason this isn't working well (it needs curses support), specify
3413 it yourself.
3461 it yourself.
3414 Otherwise don't change the default.
3462 Otherwise don't change the default.
3415 \layout List
3463 \layout List
3416 \labelwidthstring 00.00.0000
3464 \labelwidthstring 00.00.0000
3417
3465
3418
3466
3419 \family typewriter
3467 \family typewriter
3420 \series bold
3468 \series bold
3421 -separate_in|si\SpecialChar ~
3469 -separate_in|si\SpecialChar ~
3422 <string>
3470 <string>
3423 \series default
3471 \series default
3424 :
3472 :
3425 \family default
3473 \family default
3426 separator before input prompts.
3474 separator before input prompts.
3427 Default: '
3475 Default: '
3428 \family typewriter
3476 \family typewriter
3429
3477
3430 \backslash
3478 \backslash
3431 n
3479 n
3432 \family default
3480 \family default
3433 '
3481 '
3434 \layout List
3482 \layout List
3435 \labelwidthstring 00.00.0000
3483 \labelwidthstring 00.00.0000
3436
3484
3437
3485
3438 \family typewriter
3486 \family typewriter
3439 \series bold
3487 \series bold
3440 -separate_out|so\SpecialChar ~
3488 -separate_out|so\SpecialChar ~
3441 <string>
3489 <string>
3442 \family default
3490 \family default
3443 \series default
3491 \series default
3444 : separator before output prompts.
3492 : separator before output prompts.
3445 Default: nothing.
3493 Default: nothing.
3446 \layout List
3494 \layout List
3447 \labelwidthstring 00.00.0000
3495 \labelwidthstring 00.00.0000
3448
3496
3449
3497
3450 \family typewriter
3498 \family typewriter
3451 \series bold
3499 \series bold
3452 -separate_out2|so2\SpecialChar ~
3500 -separate_out2|so2\SpecialChar ~
3453 <string>
3501 <string>
3454 \series default
3502 \series default
3455 :
3503 :
3456 \family default
3504 \family default
3457 separator after output prompts.
3505 separator after output prompts.
3458 Default: nothing.
3506 Default: nothing.
3459 \layout List
3507 \layout List
3460 \labelwidthstring 00.00.0000
3508 \labelwidthstring 00.00.0000
3461
3509
3462 \SpecialChar ~
3510 \SpecialChar ~
3463 For these three options, use the value 0 to specify no separator.
3511 For these three options, use the value 0 to specify no separator.
3464 \layout List
3512 \layout List
3465 \labelwidthstring 00.00.0000
3513 \labelwidthstring 00.00.0000
3466
3514
3467
3515
3468 \family typewriter
3516 \family typewriter
3469 \series bold
3517 \series bold
3470 -nosep
3518 -nosep
3471 \series default
3519 \series default
3472 :
3520 :
3473 \family default
3521 \family default
3474 shorthand for
3522 shorthand for
3475 \family typewriter
3523 \family typewriter
3476 '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'
3524 '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'
3477 \family default
3525 \family default
3478 .
3526 .
3479 Simply removes all input/output separators.
3527 Simply removes all input/output separators.
3480 \layout List
3528 \layout List
3481 \labelwidthstring 00.00.0000
3529 \labelwidthstring 00.00.0000
3482
3530
3483
3531
3484 \family typewriter
3532 \family typewriter
3485 \series bold
3533 \series bold
3486 -upgrade
3534 -upgrade
3487 \family default
3535 \family default
3488 \series default
3536 \series default
3489 : allows you to upgrade your
3537 : allows you to upgrade your
3490 \family typewriter
3538 \family typewriter
3491 IPYTHONDIR
3539 IPYTHONDIR
3492 \family default
3540 \family default
3493 configuration when you install a new version of IPython.
3541 configuration when you install a new version of IPython.
3494 Since new versions may include new command line options or example files,
3542 Since new versions may include new command line options or example files,
3495 this copies updated ipythonrc-type files.
3543 this copies updated ipythonrc-type files.
3496 However, it backs up (with a
3544 However, it backs up (with a
3497 \family typewriter
3545 \family typewriter
3498 .old
3546 .old
3499 \family default
3547 \family default
3500 extension) all files which it overwrites so that you can merge back any
3548 extension) all files which it overwrites so that you can merge back any
3501 customizations you might have in your personal files.
3549 customizations you might have in your personal files.
3502 \layout List
3550 \layout List
3503 \labelwidthstring 00.00.0000
3551 \labelwidthstring 00.00.0000
3504
3552
3505
3553
3506 \family typewriter
3554 \family typewriter
3507 \series bold
3555 \series bold
3508 -Version
3556 -Version
3509 \series default
3557 \series default
3510 :
3558 :
3511 \family default
3559 \family default
3512 print version information and exit.
3560 print version information and exit.
3513 \layout List
3561 \layout List
3514 \labelwidthstring 00.00.0000
3562 \labelwidthstring 00.00.0000
3515
3563
3516
3564
3517 \family typewriter
3565 \family typewriter
3518 \series bold
3566 \series bold
3519 -wxversion\SpecialChar ~
3567 -wxversion\SpecialChar ~
3520 <string>:
3568 <string>:
3521 \family default
3569 \family default
3522 \series default
3570 \series default
3523 Select a specific version of wxPython (used in conjunction with
3571 Select a specific version of wxPython (used in conjunction with
3524 \family typewriter
3572 \family typewriter
3525 -wthread
3573 -wthread
3526 \family default
3574 \family default
3527 ).
3575 ).
3528 Requires the wxversion module, part of recent wxPython distributions
3576 Requires the wxversion module, part of recent wxPython distributions
3529 \layout List
3577 \layout List
3530 \labelwidthstring 00.00.0000
3578 \labelwidthstring 00.00.0000
3531
3579
3532
3580
3533 \family typewriter
3581 \family typewriter
3534 \series bold
3582 \series bold
3535 -xmode\SpecialChar ~
3583 -xmode\SpecialChar ~
3536 <modename>
3584 <modename>
3537 \series default
3585 \series default
3538 :
3586 :
3539 \family default
3587 \family default
3540 Mode for exception reporting.
3588 Mode for exception reporting.
3541 \layout List
3589 \layout List
3542 \labelwidthstring 00.00.0000
3590 \labelwidthstring 00.00.0000
3543
3591
3544 \SpecialChar ~
3592 \SpecialChar ~
3545 Valid modes: Plain, Context and Verbose.
3593 Valid modes: Plain, Context and Verbose.
3546 \layout List
3594 \layout List
3547 \labelwidthstring 00.00.0000
3595 \labelwidthstring 00.00.0000
3548
3596
3549 \SpecialChar ~
3597 \SpecialChar ~
3550 Plain: similar to python's normal traceback printing.
3598 Plain: similar to python's normal traceback printing.
3551 \layout List
3599 \layout List
3552 \labelwidthstring 00.00.0000
3600 \labelwidthstring 00.00.0000
3553
3601
3554 \SpecialChar ~
3602 \SpecialChar ~
3555 Context: prints 5 lines of context source code around each line in the
3603 Context: prints 5 lines of context source code around each line in the
3556 traceback.
3604 traceback.
3557 \layout List
3605 \layout List
3558 \labelwidthstring 00.00.0000
3606 \labelwidthstring 00.00.0000
3559
3607
3560 \SpecialChar ~
3608 \SpecialChar ~
3561 Verbose: similar to Context, but additionally prints the variables currently
3609 Verbose: similar to Context, but additionally prints the variables currently
3562 visible where the exception happened (shortening their strings if too long).
3610 visible where the exception happened (shortening their strings if too long).
3563 This can potentially be very slow, if you happen to have a huge data structure
3611 This can potentially be very slow, if you happen to have a huge data structure
3564 whose string representation is complex to compute.
3612 whose string representation is complex to compute.
3565 Your computer may appear to freeze for a while with cpu usage at 100%.
3613 Your computer may appear to freeze for a while with cpu usage at 100%.
3566 If this occurs, you can cancel the traceback with Ctrl-C (maybe hitting
3614 If this occurs, you can cancel the traceback with Ctrl-C (maybe hitting
3567 it more than once).
3615 it more than once).
3568 \layout Section
3616 \layout Section
3569
3617
3570 Interactive use
3618 Interactive use
3571 \layout Standard
3619 \layout Standard
3572
3620
3573
3621
3574 \series bold
3622 \series bold
3575 Warning
3623 Warning
3576 \series default
3624 \series default
3577 : IPython relies on the existence of a global variable called
3625 : IPython relies on the existence of a global variable called
3578 \family typewriter
3626 \family typewriter
3579 __IP
3627 __IP
3580 \family default
3628 \family default
3581 which controls the shell itself.
3629 which controls the shell itself.
3582 If you redefine
3630 If you redefine
3583 \family typewriter
3631 \family typewriter
3584 __IP
3632 __IP
3585 \family default
3633 \family default
3586 to anything, bizarre behavior will quickly occur.
3634 to anything, bizarre behavior will quickly occur.
3587 \layout Standard
3635 \layout Standard
3588
3636
3589 Other than the above warning, IPython is meant to work as a drop-in replacement
3637 Other than the above warning, IPython is meant to work as a drop-in replacement
3590 for the standard interactive interpreter.
3638 for the standard interactive interpreter.
3591 As such, any code which is valid python should execute normally under IPython
3639 As such, any code which is valid python should execute normally under IPython
3592 (cases where this is not true should be reported as bugs).
3640 (cases where this is not true should be reported as bugs).
3593 It does, however, offer many features which are not available at a standard
3641 It does, however, offer many features which are not available at a standard
3594 python prompt.
3642 python prompt.
3595 What follows is a list of these.
3643 What follows is a list of these.
3596 \layout Subsection
3644 \layout Subsection
3597
3645
3598 Caution for Windows users
3646 Caution for Windows users
3599 \layout Standard
3647 \layout Standard
3600
3648
3601 Windows, unfortunately, uses the `
3649 Windows, unfortunately, uses the `
3602 \family typewriter
3650 \family typewriter
3603
3651
3604 \backslash
3652 \backslash
3605
3653
3606 \family default
3654 \family default
3607 ' character as a path separator.
3655 ' character as a path separator.
3608 This is a terrible choice, because `
3656 This is a terrible choice, because `
3609 \family typewriter
3657 \family typewriter
3610
3658
3611 \backslash
3659 \backslash
3612
3660
3613 \family default
3661 \family default
3614 ' also represents the escape character in most modern programming languages,
3662 ' also represents the escape character in most modern programming languages,
3615 including Python.
3663 including Python.
3616 For this reason, issuing many of the commands discussed below (especially
3664 For this reason, issuing many of the commands discussed below (especially
3617 magics which affect the filesystem) with `
3665 magics which affect the filesystem) with `
3618 \family typewriter
3666 \family typewriter
3619
3667
3620 \backslash
3668 \backslash
3621
3669
3622 \family default
3670 \family default
3623 ' in them will cause strange errors.
3671 ' in them will cause strange errors.
3624 \layout Standard
3672 \layout Standard
3625
3673
3626 A partial solution is to use instead the `
3674 A partial solution is to use instead the `
3627 \family typewriter
3675 \family typewriter
3628 /
3676 /
3629 \family default
3677 \family default
3630 ' character as a path separator, which Windows recognizes in
3678 ' character as a path separator, which Windows recognizes in
3631 \emph on
3679 \emph on
3632 most
3680 most
3633 \emph default
3681 \emph default
3634 situations.
3682 situations.
3635 However, in Windows commands `
3683 However, in Windows commands `
3636 \family typewriter
3684 \family typewriter
3637 /
3685 /
3638 \family default
3686 \family default
3639 ' flags options, so you can not use it for the root directory.
3687 ' flags options, so you can not use it for the root directory.
3640 This means that paths beginning at the root must be typed in a contrived
3688 This means that paths beginning at the root must be typed in a contrived
3641 manner like:
3689 manner like:
3642 \newline
3690 \newline
3643
3691
3644 \family typewriter
3692 \family typewriter
3645 %copy
3693 %copy
3646 \backslash
3694 \backslash
3647 opt/foo/bar.txt
3695 opt/foo/bar.txt
3648 \backslash
3696 \backslash
3649 tmp
3697 tmp
3650 \layout Standard
3698 \layout Standard
3651
3699
3652 There is no sensible thing IPython can do to truly work around this flaw
3700 There is no sensible thing IPython can do to truly work around this flaw
3653 in Windows
3701 in Windows
3654 \begin_inset Foot
3702 \begin_inset Foot
3655 collapsed true
3703 collapsed true
3656
3704
3657 \layout Standard
3705 \layout Standard
3658
3706
3659 If anyone comes up with a
3707 If anyone comes up with a
3660 \emph on
3708 \emph on
3661 clean
3709 clean
3662 \emph default
3710 \emph default
3663 solution which works consistently and does not negatively impact other
3711 solution which works consistently and does not negatively impact other
3664 platforms at all, I'll gladly accept a patch.
3712 platforms at all, I'll gladly accept a patch.
3665 \end_inset
3713 \end_inset
3666
3714
3667 .
3715 .
3668 \layout Subsection
3716 \layout Subsection
3669
3717
3670
3718
3671 \begin_inset LatexCommand \label{sec:magic}
3719 \begin_inset LatexCommand \label{sec:magic}
3672
3720
3673 \end_inset
3721 \end_inset
3674
3722
3675 Magic command system
3723 Magic command system
3676 \layout Standard
3724 \layout Standard
3677
3725
3678 IPython will treat any line whose first character is a
3726 IPython will treat any line whose first character is a
3679 \family typewriter
3727 \family typewriter
3680 %
3728 %
3681 \family default
3729 \family default
3682 as a special call to a 'magic' function.
3730 as a special call to a 'magic' function.
3683 These allow you to control the behavior of IPython itself, plus a lot of
3731 These allow you to control the behavior of IPython itself, plus a lot of
3684 system-type features.
3732 system-type features.
3685 They are all prefixed with a
3733 They are all prefixed with a
3686 \family typewriter
3734 \family typewriter
3687 %
3735 %
3688 \family default
3736 \family default
3689 character, but parameters are given without parentheses or quotes.
3737 character, but parameters are given without parentheses or quotes.
3690 \layout Standard
3738 \layout Standard
3691
3739
3692 Example: typing
3740 Example: typing
3693 \family typewriter
3741 \family typewriter
3694 '%cd mydir'
3742 '%cd mydir'
3695 \family default
3743 \family default
3696 (without the quotes) changes you working directory to
3744 (without the quotes) changes you working directory to
3697 \family typewriter
3745 \family typewriter
3698 'mydir'
3746 'mydir'
3699 \family default
3747 \family default
3700 , if it exists.
3748 , if it exists.
3701 \layout Standard
3749 \layout Standard
3702
3750
3703 If you have 'automagic' enabled (in your
3751 If you have 'automagic' enabled (in your
3704 \family typewriter
3752 \family typewriter
3705 ipythonrc
3753 ipythonrc
3706 \family default
3754 \family default
3707 file, via the command line option
3755 file, via the command line option
3708 \family typewriter
3756 \family typewriter
3709 -automagic
3757 -automagic
3710 \family default
3758 \family default
3711 or with the
3759 or with the
3712 \family typewriter
3760 \family typewriter
3713 %automagic
3761 %automagic
3714 \family default
3762 \family default
3715 function), you don't need to type in the
3763 function), you don't need to type in the
3716 \family typewriter
3764 \family typewriter
3717 %
3765 %
3718 \family default
3766 \family default
3719 explicitly.
3767 explicitly.
3720 IPython will scan its internal list of magic functions and call one if
3768 IPython will scan its internal list of magic functions and call one if
3721 it exists.
3769 it exists.
3722 With automagic on you can then just type '
3770 With automagic on you can then just type '
3723 \family typewriter
3771 \family typewriter
3724 cd mydir
3772 cd mydir
3725 \family default
3773 \family default
3726 ' to go to directory '
3774 ' to go to directory '
3727 \family typewriter
3775 \family typewriter
3728 mydir
3776 mydir
3729 \family default
3777 \family default
3730 '.
3778 '.
3731 The automagic system has the lowest possible precedence in name searches,
3779 The automagic system has the lowest possible precedence in name searches,
3732 so defining an identifier with the same name as an existing magic function
3780 so defining an identifier with the same name as an existing magic function
3733 will shadow it for automagic use.
3781 will shadow it for automagic use.
3734 You can still access the shadowed magic function by explicitly using the
3782 You can still access the shadowed magic function by explicitly using the
3735
3783
3736 \family typewriter
3784 \family typewriter
3737 %
3785 %
3738 \family default
3786 \family default
3739 character at the beginning of the line.
3787 character at the beginning of the line.
3740 \layout Standard
3788 \layout Standard
3741
3789
3742 An example (with automagic on) should clarify all this:
3790 An example (with automagic on) should clarify all this:
3743 \layout LyX-Code
3791 \layout LyX-Code
3744
3792
3745 In [1]: cd ipython # %cd is called by automagic
3793 In [1]: cd ipython # %cd is called by automagic
3746 \layout LyX-Code
3794 \layout LyX-Code
3747
3795
3748 /home/fperez/ipython
3796 /home/fperez/ipython
3749 \layout LyX-Code
3797 \layout LyX-Code
3750
3798
3751 In [2]: cd=1 # now cd is just a variable
3799 In [2]: cd=1 # now cd is just a variable
3752 \layout LyX-Code
3800 \layout LyX-Code
3753
3801
3754 In [3]: cd ..
3802 In [3]: cd ..
3755 # and doesn't work as a function anymore
3803 # and doesn't work as a function anymore
3756 \layout LyX-Code
3804 \layout LyX-Code
3757
3805
3758 ------------------------------------------------------------
3806 ------------------------------------------------------------
3759 \layout LyX-Code
3807 \layout LyX-Code
3760
3808
3761 File "<console>", line 1
3809 File "<console>", line 1
3762 \layout LyX-Code
3810 \layout LyX-Code
3763
3811
3764 cd ..
3812 cd ..
3765 \layout LyX-Code
3813 \layout LyX-Code
3766
3814
3767 ^
3815 ^
3768 \layout LyX-Code
3816 \layout LyX-Code
3769
3817
3770 SyntaxError: invalid syntax
3818 SyntaxError: invalid syntax
3771 \layout LyX-Code
3819 \layout LyX-Code
3772
3820
3773 \layout LyX-Code
3821 \layout LyX-Code
3774
3822
3775 In [4]: %cd ..
3823 In [4]: %cd ..
3776 # but %cd always works
3824 # but %cd always works
3777 \layout LyX-Code
3825 \layout LyX-Code
3778
3826
3779 /home/fperez
3827 /home/fperez
3780 \layout LyX-Code
3828 \layout LyX-Code
3781
3829
3782 In [5]: del cd # if you remove the cd variable
3830 In [5]: del cd # if you remove the cd variable
3783 \layout LyX-Code
3831 \layout LyX-Code
3784
3832
3785 In [6]: cd ipython # automagic can work again
3833 In [6]: cd ipython # automagic can work again
3786 \layout LyX-Code
3834 \layout LyX-Code
3787
3835
3788 /home/fperez/ipython
3836 /home/fperez/ipython
3789 \layout Standard
3837 \layout Standard
3790
3838
3791 You can define your own magic functions to extend the system.
3839 You can define your own magic functions to extend the system.
3792 The following is a snippet of code which shows how to do it.
3840 The following is a snippet of code which shows how to do it.
3793 It is provided as file
3841 It is provided as file
3794 \family typewriter
3842 \family typewriter
3795 example-magic.py
3843 example-magic.py
3796 \family default
3844 \family default
3797 in the examples directory:
3845 in the examples directory:
3798 \layout Standard
3846 \layout Standard
3799
3847
3800
3848
3801 \begin_inset ERT
3849 \begin_inset ERT
3802 status Open
3850 status Open
3803
3851
3804 \layout Standard
3852 \layout Standard
3805
3853
3806 \backslash
3854 \backslash
3807 codelist{examples/example-magic.py}
3855 codelist{examples/example-magic.py}
3808 \end_inset
3856 \end_inset
3809
3857
3810
3858
3811 \layout Standard
3859 \layout Standard
3812
3860
3813 You can also define your own aliased names for magic functions.
3861 You can also define your own aliased names for magic functions.
3814 In your
3862 In your
3815 \family typewriter
3863 \family typewriter
3816 ipythonrc
3864 ipythonrc
3817 \family default
3865 \family default
3818 file, placing a line like:
3866 file, placing a line like:
3819 \layout Standard
3867 \layout Standard
3820
3868
3821
3869
3822 \family typewriter
3870 \family typewriter
3823 execute __IP.magic_cl = __IP.magic_clear
3871 execute __IP.magic_cl = __IP.magic_clear
3824 \layout Standard
3872 \layout Standard
3825
3873
3826 will define
3874 will define
3827 \family typewriter
3875 \family typewriter
3828 %cl
3876 %cl
3829 \family default
3877 \family default
3830 as a new name for
3878 as a new name for
3831 \family typewriter
3879 \family typewriter
3832 %clear
3880 %clear
3833 \family default
3881 \family default
3834 .
3882 .
3835 \layout Standard
3883 \layout Standard
3836
3884
3837 Type
3885 Type
3838 \family typewriter
3886 \family typewriter
3839 %magic
3887 %magic
3840 \family default
3888 \family default
3841 for more information, including a list of all available magic functions
3889 for more information, including a list of all available magic functions
3842 at any time and their docstrings.
3890 at any time and their docstrings.
3843 You can also type
3891 You can also type
3844 \family typewriter
3892 \family typewriter
3845 %magic_function_name?
3893 %magic_function_name?
3846 \family default
3894 \family default
3847 (see sec.
3895 (see sec.
3848
3896
3849 \begin_inset LatexCommand \ref{sec:dyn-object-info}
3897 \begin_inset LatexCommand \ref{sec:dyn-object-info}
3850
3898
3851 \end_inset
3899 \end_inset
3852
3900
3853 for information on the
3901 for information on the
3854 \family typewriter
3902 \family typewriter
3855 '?'
3903 '?'
3856 \family default
3904 \family default
3857 system) to get information about any particular magic function you are
3905 system) to get information about any particular magic function you are
3858 interested in.
3906 interested in.
3859 \layout Subsubsection
3907 \layout Subsubsection
3860
3908
3861 Magic commands
3909 Magic commands
3862 \layout Standard
3910 \layout Standard
3863
3911
3864 The rest of this section is automatically generated for each release from
3912 The rest of this section is automatically generated for each release from
3865 the docstrings in the IPython code.
3913 the docstrings in the IPython code.
3866 Therefore the formatting is somewhat minimal, but this method has the advantage
3914 Therefore the formatting is somewhat minimal, but this method has the advantage
3867 of having information always in sync with the code.
3915 of having information always in sync with the code.
3868 \layout Standard
3916 \layout Standard
3869
3917
3870 A list of all the magic commands available in IPython's
3918 A list of all the magic commands available in IPython's
3871 \emph on
3919 \emph on
3872 default
3920 default
3873 \emph default
3921 \emph default
3874 installation follows.
3922 installation follows.
3875 This is similar to what you'll see by simply typing
3923 This is similar to what you'll see by simply typing
3876 \family typewriter
3924 \family typewriter
3877 %magic
3925 %magic
3878 \family default
3926 \family default
3879 at the prompt, but that will also give you information about magic commands
3927 at the prompt, but that will also give you information about magic commands
3880 you may have added as part of your personal customizations.
3928 you may have added as part of your personal customizations.
3881 \layout Standard
3929 \layout Standard
3882
3930
3883
3931
3884 \begin_inset Include \input{magic.tex}
3932 \begin_inset Include \input{magic.tex}
3885 preview false
3933 preview false
3886
3934
3887 \end_inset
3935 \end_inset
3888
3936
3889
3937
3890 \layout Subsection
3938 \layout Subsection
3891
3939
3892 Access to the standard Python help
3940 Access to the standard Python help
3893 \layout Standard
3941 \layout Standard
3894
3942
3895 As of Python 2.1, a help system is available with access to object docstrings
3943 As of Python 2.1, a help system is available with access to object docstrings
3896 and the Python manuals.
3944 and the Python manuals.
3897 Simply type
3945 Simply type
3898 \family typewriter
3946 \family typewriter
3899 'help'
3947 'help'
3900 \family default
3948 \family default
3901 (no quotes) to access it.
3949 (no quotes) to access it.
3902 You can also type
3950 You can also type
3903 \family typewriter
3951 \family typewriter
3904 help(object)
3952 help(object)
3905 \family default
3953 \family default
3906 to obtain information about a given object, and
3954 to obtain information about a given object, and
3907 \family typewriter
3955 \family typewriter
3908 help('keyword')
3956 help('keyword')
3909 \family default
3957 \family default
3910 for information on a keyword.
3958 for information on a keyword.
3911 As noted in sec.
3959 As noted in sec.
3912
3960
3913 \begin_inset LatexCommand \ref{sec:help-access}
3961 \begin_inset LatexCommand \ref{sec:help-access}
3914
3962
3915 \end_inset
3963 \end_inset
3916
3964
3917 , you need to properly configure your environment variable
3965 , you need to properly configure your environment variable
3918 \family typewriter
3966 \family typewriter
3919 PYTHONDOCS
3967 PYTHONDOCS
3920 \family default
3968 \family default
3921 for this feature to work correctly.
3969 for this feature to work correctly.
3922 \layout Subsection
3970 \layout Subsection
3923
3971
3924
3972
3925 \begin_inset LatexCommand \label{sec:dyn-object-info}
3973 \begin_inset LatexCommand \label{sec:dyn-object-info}
3926
3974
3927 \end_inset
3975 \end_inset
3928
3976
3929 Dynamic object information
3977 Dynamic object information
3930 \layout Standard
3978 \layout Standard
3931
3979
3932 Typing
3980 Typing
3933 \family typewriter
3981 \family typewriter
3934 ?word
3982 ?word
3935 \family default
3983 \family default
3936 or
3984 or
3937 \family typewriter
3985 \family typewriter
3938 word?
3986 word?
3939 \family default
3987 \family default
3940 prints detailed information about an object.
3988 prints detailed information about an object.
3941 If certain strings in the object are too long (docstrings, code, etc.) they
3989 If certain strings in the object are too long (docstrings, code, etc.) they
3942 get snipped in the center for brevity.
3990 get snipped in the center for brevity.
3943 This system gives access variable types and values, full source code for
3991 This system gives access variable types and values, full source code for
3944 any object (if available), function prototypes and other useful information.
3992 any object (if available), function prototypes and other useful information.
3945 \layout Standard
3993 \layout Standard
3946
3994
3947 Typing
3995 Typing
3948 \family typewriter
3996 \family typewriter
3949 ??word
3997 ??word
3950 \family default
3998 \family default
3951 or
3999 or
3952 \family typewriter
4000 \family typewriter
3953 word??
4001 word??
3954 \family default
4002 \family default
3955 gives access to the full information without snipping long strings.
4003 gives access to the full information without snipping long strings.
3956 Long strings are sent to the screen through the
4004 Long strings are sent to the screen through the
3957 \family typewriter
4005 \family typewriter
3958 less
4006 less
3959 \family default
4007 \family default
3960 pager if longer than the screen and printed otherwise.
4008 pager if longer than the screen and printed otherwise.
3961 On systems lacking the
4009 On systems lacking the
3962 \family typewriter
4010 \family typewriter
3963 less
4011 less
3964 \family default
4012 \family default
3965 command, IPython uses a very basic internal pager.
4013 command, IPython uses a very basic internal pager.
3966 \layout Standard
4014 \layout Standard
3967
4015
3968 The following magic functions are particularly useful for gathering information
4016 The following magic functions are particularly useful for gathering information
3969 about your working environment.
4017 about your working environment.
3970 You can get more details by typing
4018 You can get more details by typing
3971 \family typewriter
4019 \family typewriter
3972 %magic
4020 %magic
3973 \family default
4021 \family default
3974 or querying them individually (use
4022 or querying them individually (use
3975 \family typewriter
4023 \family typewriter
3976 %function_name?
4024 %function_name?
3977 \family default
4025 \family default
3978 with or without the
4026 with or without the
3979 \family typewriter
4027 \family typewriter
3980 %
4028 %
3981 \family default
4029 \family default
3982 ), this is just a summary:
4030 ), this is just a summary:
3983 \layout List
4031 \layout List
3984 \labelwidthstring 00.00.0000
4032 \labelwidthstring 00.00.0000
3985
4033
3986
4034
3987 \family typewriter
4035 \family typewriter
3988 \series bold
4036 \series bold
3989 %pdoc\SpecialChar ~
4037 %pdoc\SpecialChar ~
3990 <object>
4038 <object>
3991 \family default
4039 \family default
3992 \series default
4040 \series default
3993 : Print (or run through a pager if too long) the docstring for an object.
4041 : Print (or run through a pager if too long) the docstring for an object.
3994 If the given object is a class, it will print both the class and the constructo
4042 If the given object is a class, it will print both the class and the constructo
3995 r docstrings.
4043 r docstrings.
3996 \layout List
4044 \layout List
3997 \labelwidthstring 00.00.0000
4045 \labelwidthstring 00.00.0000
3998
4046
3999
4047
4000 \family typewriter
4048 \family typewriter
4001 \series bold
4049 \series bold
4002 %pdef\SpecialChar ~
4050 %pdef\SpecialChar ~
4003 <object>
4051 <object>
4004 \family default
4052 \family default
4005 \series default
4053 \series default
4006 : Print the definition header for any callable object.
4054 : Print the definition header for any callable object.
4007 If the object is a class, print the constructor information.
4055 If the object is a class, print the constructor information.
4008 \layout List
4056 \layout List
4009 \labelwidthstring 00.00.0000
4057 \labelwidthstring 00.00.0000
4010
4058
4011
4059
4012 \family typewriter
4060 \family typewriter
4013 \series bold
4061 \series bold
4014 %psource\SpecialChar ~
4062 %psource\SpecialChar ~
4015 <object>
4063 <object>
4016 \family default
4064 \family default
4017 \series default
4065 \series default
4018 : Print (or run through a pager if too long) the source code for an object.
4066 : Print (or run through a pager if too long) the source code for an object.
4019 \layout List
4067 \layout List
4020 \labelwidthstring 00.00.0000
4068 \labelwidthstring 00.00.0000
4021
4069
4022
4070
4023 \family typewriter
4071 \family typewriter
4024 \series bold
4072 \series bold
4025 %pfile\SpecialChar ~
4073 %pfile\SpecialChar ~
4026 <object>
4074 <object>
4027 \family default
4075 \family default
4028 \series default
4076 \series default
4029 : Show the entire source file where an object was defined via a pager, opening
4077 : Show the entire source file where an object was defined via a pager, opening
4030 it at the line where the object definition begins.
4078 it at the line where the object definition begins.
4031 \layout List
4079 \layout List
4032 \labelwidthstring 00.00.0000
4080 \labelwidthstring 00.00.0000
4033
4081
4034
4082
4035 \family typewriter
4083 \family typewriter
4036 \series bold
4084 \series bold
4037 %who/%whos
4085 %who/%whos
4038 \family default
4086 \family default
4039 \series default
4087 \series default
4040 : These functions give information about identifiers you have defined interactiv
4088 : These functions give information about identifiers you have defined interactiv
4041 ely (not things you loaded or defined in your configuration files).
4089 ely (not things you loaded or defined in your configuration files).
4042
4090
4043 \family typewriter
4091 \family typewriter
4044 %who
4092 %who
4045 \family default
4093 \family default
4046 just prints a list of identifiers and
4094 just prints a list of identifiers and
4047 \family typewriter
4095 \family typewriter
4048 %whos
4096 %whos
4049 \family default
4097 \family default
4050 prints a table with some basic details about each identifier.
4098 prints a table with some basic details about each identifier.
4051 \layout Standard
4099 \layout Standard
4052
4100
4053 Note that the dynamic object information functions (
4101 Note that the dynamic object information functions (
4054 \family typewriter
4102 \family typewriter
4055 ?/??, %pdoc, %pfile, %pdef, %psource
4103 ?/??, %pdoc, %pfile, %pdef, %psource
4056 \family default
4104 \family default
4057 ) give you access to documentation even on things which are not really defined
4105 ) give you access to documentation even on things which are not really defined
4058 as separate identifiers.
4106 as separate identifiers.
4059 Try for example typing
4107 Try for example typing
4060 \family typewriter
4108 \family typewriter
4061 {}.get?
4109 {}.get?
4062 \family default
4110 \family default
4063 or after doing
4111 or after doing
4064 \family typewriter
4112 \family typewriter
4065 import os
4113 import os
4066 \family default
4114 \family default
4067 , type
4115 , type
4068 \family typewriter
4116 \family typewriter
4069 os.path.abspath??
4117 os.path.abspath??
4070 \family default
4118 \family default
4071 .
4119 .
4072 \layout Subsection
4120 \layout Subsection
4073
4121
4074
4122
4075 \begin_inset LatexCommand \label{sec:readline}
4123 \begin_inset LatexCommand \label{sec:readline}
4076
4124
4077 \end_inset
4125 \end_inset
4078
4126
4079 Readline-based features
4127 Readline-based features
4080 \layout Standard
4128 \layout Standard
4081
4129
4082 These features require the GNU readline library, so they won't work if your
4130 These features require the GNU readline library, so they won't work if your
4083 Python installation lacks readline support.
4131 Python installation lacks readline support.
4084 We will first describe the default behavior IPython uses, and then how
4132 We will first describe the default behavior IPython uses, and then how
4085 to change it to suit your preferences.
4133 to change it to suit your preferences.
4086 \layout Subsubsection
4134 \layout Subsubsection
4087
4135
4088 Command line completion
4136 Command line completion
4089 \layout Standard
4137 \layout Standard
4090
4138
4091 At any time, hitting TAB will complete any available python commands or
4139 At any time, hitting TAB will complete any available python commands or
4092 variable names, and show you a list of the possible completions if there's
4140 variable names, and show you a list of the possible completions if there's
4093 no unambiguous one.
4141 no unambiguous one.
4094 It will also complete filenames in the current directory if no python names
4142 It will also complete filenames in the current directory if no python names
4095 match what you've typed so far.
4143 match what you've typed so far.
4096 \layout Subsubsection
4144 \layout Subsubsection
4097
4145
4098 Search command history
4146 Search command history
4099 \layout Standard
4147 \layout Standard
4100
4148
4101 IPython provides two ways for searching through previous input and thus
4149 IPython provides two ways for searching through previous input and thus
4102 reduce the need for repetitive typing:
4150 reduce the need for repetitive typing:
4103 \layout Enumerate
4151 \layout Enumerate
4104
4152
4105 Start typing, and then use
4153 Start typing, and then use
4106 \family typewriter
4154 \family typewriter
4107 Ctrl-p
4155 Ctrl-p
4108 \family default
4156 \family default
4109 (previous,up) and
4157 (previous,up) and
4110 \family typewriter
4158 \family typewriter
4111 Ctrl-n
4159 Ctrl-n
4112 \family default
4160 \family default
4113 (next,down) to search through only the history items that match what you've
4161 (next,down) to search through only the history items that match what you've
4114 typed so far.
4162 typed so far.
4115 If you use
4163 If you use
4116 \family typewriter
4164 \family typewriter
4117 Ctrl-p/Ctrl-n
4165 Ctrl-p/Ctrl-n
4118 \family default
4166 \family default
4119 at a blank prompt, they just behave like normal arrow keys.
4167 at a blank prompt, they just behave like normal arrow keys.
4120 \layout Enumerate
4168 \layout Enumerate
4121
4169
4122 Hit
4170 Hit
4123 \family typewriter
4171 \family typewriter
4124 Ctrl-r
4172 Ctrl-r
4125 \family default
4173 \family default
4126 : opens a search prompt.
4174 : opens a search prompt.
4127 Begin typing and the system searches your history for lines that contain
4175 Begin typing and the system searches your history for lines that contain
4128 what you've typed so far, completing as much as it can.
4176 what you've typed so far, completing as much as it can.
4129 \layout Subsubsection
4177 \layout Subsubsection
4130
4178
4131 Persistent command history across sessions
4179 Persistent command history across sessions
4132 \layout Standard
4180 \layout Standard
4133
4181
4134 IPython will save your input history when it leaves and reload it next time
4182 IPython will save your input history when it leaves and reload it next time
4135 you restart it.
4183 you restart it.
4136 By default, the history file is named
4184 By default, the history file is named
4137 \family typewriter
4185 \family typewriter
4138 $IPYTHONDIR/history
4186 $IPYTHONDIR/history
4139 \family default
4187 \family default
4140 , but if you've loaded a named profile, '
4188 , but if you've loaded a named profile, '
4141 \family typewriter
4189 \family typewriter
4142 -PROFILE_NAME
4190 -PROFILE_NAME
4143 \family default
4191 \family default
4144 ' is appended to the name.
4192 ' is appended to the name.
4145 This allows you to keep separate histories related to various tasks: commands
4193 This allows you to keep separate histories related to various tasks: commands
4146 related to numerical work will not be clobbered by a system shell history,
4194 related to numerical work will not be clobbered by a system shell history,
4147 for example.
4195 for example.
4148 \layout Subsubsection
4196 \layout Subsubsection
4149
4197
4150 Autoindent
4198 Autoindent
4151 \layout Standard
4199 \layout Standard
4152
4200
4153 IPython can recognize lines ending in ':' and indent the next line, while
4201 IPython can recognize lines ending in ':' and indent the next line, while
4154 also un-indenting automatically after 'raise' or 'return'.
4202 also un-indenting automatically after 'raise' or 'return'.
4155
4203
4156 \layout Standard
4204 \layout Standard
4157
4205
4158 This feature uses the readline library, so it will honor your
4206 This feature uses the readline library, so it will honor your
4159 \family typewriter
4207 \family typewriter
4160 ~/.inputrc
4208 ~/.inputrc
4161 \family default
4209 \family default
4162 configuration (or whatever file your
4210 configuration (or whatever file your
4163 \family typewriter
4211 \family typewriter
4164 INPUTRC
4212 INPUTRC
4165 \family default
4213 \family default
4166 variable points to).
4214 variable points to).
4167 Adding the following lines to your
4215 Adding the following lines to your
4168 \family typewriter
4216 \family typewriter
4169 .inputrc
4217 .inputrc
4170 \family default
4218 \family default
4171 file can make indenting/unindenting more convenient (
4219 file can make indenting/unindenting more convenient (
4172 \family typewriter
4220 \family typewriter
4173 M-i
4221 M-i
4174 \family default
4222 \family default
4175 indents,
4223 indents,
4176 \family typewriter
4224 \family typewriter
4177 M-u
4225 M-u
4178 \family default
4226 \family default
4179 unindents):
4227 unindents):
4180 \layout Standard
4228 \layout Standard
4181
4229
4182
4230
4183 \family typewriter
4231 \family typewriter
4184 $if Python
4232 $if Python
4185 \newline
4233 \newline
4186 "
4234 "
4187 \backslash
4235 \backslash
4188 M-i": "\SpecialChar ~
4236 M-i": "\SpecialChar ~
4189 \SpecialChar ~
4237 \SpecialChar ~
4190 \SpecialChar ~
4238 \SpecialChar ~
4191 \SpecialChar ~
4239 \SpecialChar ~
4192 "
4240 "
4193 \newline
4241 \newline
4194 "
4242 "
4195 \backslash
4243 \backslash
4196 M-u": "
4244 M-u": "
4197 \backslash
4245 \backslash
4198 d
4246 d
4199 \backslash
4247 \backslash
4200 d
4248 d
4201 \backslash
4249 \backslash
4202 d
4250 d
4203 \backslash
4251 \backslash
4204 d"
4252 d"
4205 \newline
4253 \newline
4206 $endif
4254 $endif
4207 \layout Standard
4255 \layout Standard
4208
4256
4209 Note that there are 4 spaces between the quote marks after
4257 Note that there are 4 spaces between the quote marks after
4210 \family typewriter
4258 \family typewriter
4211 "M-i"
4259 "M-i"
4212 \family default
4260 \family default
4213 above.
4261 above.
4214 \layout Standard
4262 \layout Standard
4215
4263
4216
4264
4217 \series bold
4265 \series bold
4218 Warning:
4266 Warning:
4219 \series default
4267 \series default
4220 this feature is ON by default, but it can cause problems with the pasting
4268 this feature is ON by default, but it can cause problems with the pasting
4221 of multi-line indented code (the pasted code gets re-indented on each line).
4269 of multi-line indented code (the pasted code gets re-indented on each line).
4222 A magic function
4270 A magic function
4223 \family typewriter
4271 \family typewriter
4224 %autoindent
4272 %autoindent
4225 \family default
4273 \family default
4226 allows you to toggle it on/off at runtime.
4274 allows you to toggle it on/off at runtime.
4227 You can also disable it permanently on in your
4275 You can also disable it permanently on in your
4228 \family typewriter
4276 \family typewriter
4229 ipythonrc
4277 ipythonrc
4230 \family default
4278 \family default
4231 file (set
4279 file (set
4232 \family typewriter
4280 \family typewriter
4233 autoindent 0
4281 autoindent 0
4234 \family default
4282 \family default
4235 ).
4283 ).
4236 \layout Subsubsection
4284 \layout Subsubsection
4237
4285
4238 Customizing readline behavior
4286 Customizing readline behavior
4239 \layout Standard
4287 \layout Standard
4240
4288
4241 All these features are based on the GNU readline library, which has an extremely
4289 All these features are based on the GNU readline library, which has an extremely
4242 customizable interface.
4290 customizable interface.
4243 Normally, readline is configured via a file which defines the behavior
4291 Normally, readline is configured via a file which defines the behavior
4244 of the library; the details of the syntax for this can be found in the
4292 of the library; the details of the syntax for this can be found in the
4245 readline documentation available with your system or on the Internet.
4293 readline documentation available with your system or on the Internet.
4246 IPython doesn't read this file (if it exists) directly, but it does support
4294 IPython doesn't read this file (if it exists) directly, but it does support
4247 passing to readline valid options via a simple interface.
4295 passing to readline valid options via a simple interface.
4248 In brief, you can customize readline by setting the following options in
4296 In brief, you can customize readline by setting the following options in
4249 your
4297 your
4250 \family typewriter
4298 \family typewriter
4251 ipythonrc
4299 ipythonrc
4252 \family default
4300 \family default
4253 configuration file (note that these options can
4301 configuration file (note that these options can
4254 \emph on
4302 \emph on
4255 not
4303 not
4256 \emph default
4304 \emph default
4257 be specified at the command line):
4305 be specified at the command line):
4258 \layout List
4306 \layout List
4259 \labelwidthstring 00.00.0000
4307 \labelwidthstring 00.00.0000
4260
4308
4261
4309
4262 \family typewriter
4310 \family typewriter
4263 \series bold
4311 \series bold
4264 readline_parse_and_bind:
4312 readline_parse_and_bind:
4265 \family default
4313 \family default
4266 \series default
4314 \series default
4267 this option can appear as many times as you want, each time defining a
4315 this option can appear as many times as you want, each time defining a
4268 string to be executed via a
4316 string to be executed via a
4269 \family typewriter
4317 \family typewriter
4270 readline.parse_and_bind()
4318 readline.parse_and_bind()
4271 \family default
4319 \family default
4272 command.
4320 command.
4273 The syntax for valid commands of this kind can be found by reading the
4321 The syntax for valid commands of this kind can be found by reading the
4274 documentation for the GNU readline library, as these commands are of the
4322 documentation for the GNU readline library, as these commands are of the
4275 kind which readline accepts in its configuration file.
4323 kind which readline accepts in its configuration file.
4276 \layout List
4324 \layout List
4277 \labelwidthstring 00.00.0000
4325 \labelwidthstring 00.00.0000
4278
4326
4279
4327
4280 \family typewriter
4328 \family typewriter
4281 \series bold
4329 \series bold
4282 readline_remove_delims:
4330 readline_remove_delims:
4283 \family default
4331 \family default
4284 \series default
4332 \series default
4285 a string of characters to be removed from the default word-delimiters list
4333 a string of characters to be removed from the default word-delimiters list
4286 used by readline, so that completions may be performed on strings which
4334 used by readline, so that completions may be performed on strings which
4287 contain them.
4335 contain them.
4288 Do not change the default value unless you know what you're doing.
4336 Do not change the default value unless you know what you're doing.
4289 \layout List
4337 \layout List
4290 \labelwidthstring 00.00.0000
4338 \labelwidthstring 00.00.0000
4291
4339
4292
4340
4293 \family typewriter
4341 \family typewriter
4294 \series bold
4342 \series bold
4295 readline_omit__names
4343 readline_omit__names
4296 \family default
4344 \family default
4297 \series default
4345 \series default
4298 : when tab-completion is enabled, hitting
4346 : when tab-completion is enabled, hitting
4299 \family typewriter
4347 \family typewriter
4300 <tab>
4348 <tab>
4301 \family default
4349 \family default
4302 after a '
4350 after a '
4303 \family typewriter
4351 \family typewriter
4304 .
4352 .
4305 \family default
4353 \family default
4306 ' in a name will complete all attributes of an object, including all the
4354 ' in a name will complete all attributes of an object, including all the
4307 special methods whose names include double underscores (like
4355 special methods whose names include double underscores (like
4308 \family typewriter
4356 \family typewriter
4309 __getitem__
4357 __getitem__
4310 \family default
4358 \family default
4311 or
4359 or
4312 \family typewriter
4360 \family typewriter
4313 __class__
4361 __class__
4314 \family default
4362 \family default
4315 ).
4363 ).
4316 If you'd rather not see these names by default, you can set this option
4364 If you'd rather not see these names by default, you can set this option
4317 to 1.
4365 to 1.
4318 Note that even when this option is set, you can still see those names by
4366 Note that even when this option is set, you can still see those names by
4319 explicitly typing a
4367 explicitly typing a
4320 \family typewriter
4368 \family typewriter
4321 _
4369 _
4322 \family default
4370 \family default
4323 after the period and hitting
4371 after the period and hitting
4324 \family typewriter
4372 \family typewriter
4325 <tab>
4373 <tab>
4326 \family default
4374 \family default
4327 : '
4375 : '
4328 \family typewriter
4376 \family typewriter
4329 name._<tab>
4377 name._<tab>
4330 \family default
4378 \family default
4331 ' will always complete attribute names starting with '
4379 ' will always complete attribute names starting with '
4332 \family typewriter
4380 \family typewriter
4333 _
4381 _
4334 \family default
4382 \family default
4335 '.
4383 '.
4336 \layout List
4384 \layout List
4337 \labelwidthstring 00.00.0000
4385 \labelwidthstring 00.00.0000
4338
4386
4339 \SpecialChar ~
4387 \SpecialChar ~
4340 This option is off by default so that new users see all attributes of any
4388 This option is off by default so that new users see all attributes of any
4341 objects they are dealing with.
4389 objects they are dealing with.
4342 \layout Standard
4390 \layout Standard
4343
4391
4344 You will find the default values along with a corresponding detailed explanation
4392 You will find the default values along with a corresponding detailed explanation
4345 in your
4393 in your
4346 \family typewriter
4394 \family typewriter
4347 ipythonrc
4395 ipythonrc
4348 \family default
4396 \family default
4349 file.
4397 file.
4350 \layout Subsection
4398 \layout Subsection
4351
4399
4352 Session logging and restoring
4400 Session logging and restoring
4353 \layout Standard
4401 \layout Standard
4354
4402
4355 You can log all input from a session either by starting IPython with the
4403 You can log all input from a session either by starting IPython with the
4356 command line switches
4404 command line switches
4357 \family typewriter
4405 \family typewriter
4358 -log
4406 -log
4359 \family default
4407 \family default
4360 or
4408 or
4361 \family typewriter
4409 \family typewriter
4362 -logfile
4410 -logfile
4363 \family default
4411 \family default
4364 (see sec.
4412 (see sec.
4365
4413
4366 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
4414 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
4367
4415
4368 \end_inset
4416 \end_inset
4369
4417
4370 )or by activating the logging at any moment with the magic function
4418 )or by activating the logging at any moment with the magic function
4371 \family typewriter
4419 \family typewriter
4372 %logstart
4420 %logstart
4373 \family default
4421 \family default
4374 .
4422 .
4375
4423
4376 \layout Standard
4424 \layout Standard
4377
4425
4378 Log files can later be reloaded with the
4426 Log files can later be reloaded with the
4379 \family typewriter
4427 \family typewriter
4380 -logplay
4428 -logplay
4381 \family default
4429 \family default
4382 option and IPython will attempt to 'replay' the log by executing all the
4430 option and IPython will attempt to 'replay' the log by executing all the
4383 lines in it, thus restoring the state of a previous session.
4431 lines in it, thus restoring the state of a previous session.
4384 This feature is not quite perfect, but can still be useful in many cases.
4432 This feature is not quite perfect, but can still be useful in many cases.
4385 \layout Standard
4433 \layout Standard
4386
4434
4387 The log files can also be used as a way to have a permanent record of any
4435 The log files can also be used as a way to have a permanent record of any
4388 code you wrote while experimenting.
4436 code you wrote while experimenting.
4389 Log files are regular text files which you can later open in your favorite
4437 Log files are regular text files which you can later open in your favorite
4390 text editor to extract code or to 'clean them up' before using them to
4438 text editor to extract code or to 'clean them up' before using them to
4391 replay a session.
4439 replay a session.
4392 \layout Standard
4440 \layout Standard
4393
4441
4394 The
4442 The
4395 \family typewriter
4443 \family typewriter
4396 %logstart
4444 %logstart
4397 \family default
4445 \family default
4398 function for activating logging in mid-session is used as follows:
4446 function for activating logging in mid-session is used as follows:
4399 \layout Standard
4447 \layout Standard
4400
4448
4401
4449
4402 \family typewriter
4450 \family typewriter
4403 %logstart [log_name [log_mode]]
4451 %logstart [log_name [log_mode]]
4404 \layout Standard
4452 \layout Standard
4405
4453
4406 If no name is given, it defaults to a file named
4454 If no name is given, it defaults to a file named
4407 \family typewriter
4455 \family typewriter
4408 'log'
4456 'log'
4409 \family default
4457 \family default
4410 in your IPYTHONDIR directory, in
4458 in your IPYTHONDIR directory, in
4411 \family typewriter
4459 \family typewriter
4412 'rotate'
4460 'rotate'
4413 \family default
4461 \family default
4414 mode (see below).
4462 mode (see below).
4415 \layout Standard
4463 \layout Standard
4416
4464
4417 '
4465 '
4418 \family typewriter
4466 \family typewriter
4419 %logstart name
4467 %logstart name
4420 \family default
4468 \family default
4421 ' saves to file
4469 ' saves to file
4422 \family typewriter
4470 \family typewriter
4423 'name'
4471 'name'
4424 \family default
4472 \family default
4425 in
4473 in
4426 \family typewriter
4474 \family typewriter
4427 'backup'
4475 'backup'
4428 \family default
4476 \family default
4429 mode.
4477 mode.
4430 It saves your history up to that point and then continues logging.
4478 It saves your history up to that point and then continues logging.
4431 \layout Standard
4479 \layout Standard
4432
4480
4433
4481
4434 \family typewriter
4482 \family typewriter
4435 %logstart
4483 %logstart
4436 \family default
4484 \family default
4437 takes a second optional parameter: logging mode.
4485 takes a second optional parameter: logging mode.
4438 This can be one of (note that the modes are given unquoted):
4486 This can be one of (note that the modes are given unquoted):
4439 \layout List
4487 \layout List
4440 \labelwidthstring 00.00.0000
4488 \labelwidthstring 00.00.0000
4441
4489
4442
4490
4443 \family typewriter
4491 \family typewriter
4444 over
4492 over
4445 \family default
4493 \family default
4446 : overwrite existing
4494 : overwrite existing
4447 \family typewriter
4495 \family typewriter
4448 log_name
4496 log_name
4449 \family default
4497 \family default
4450 .
4498 .
4451 \layout List
4499 \layout List
4452 \labelwidthstring 00.00.0000
4500 \labelwidthstring 00.00.0000
4453
4501
4454
4502
4455 \family typewriter
4503 \family typewriter
4456 backup
4504 backup
4457 \family default
4505 \family default
4458 : rename (if exists) to
4506 : rename (if exists) to
4459 \family typewriter
4507 \family typewriter
4460 log_name~
4508 log_name~
4461 \family default
4509 \family default
4462 and start
4510 and start
4463 \family typewriter
4511 \family typewriter
4464 log_name
4512 log_name
4465 \family default
4513 \family default
4466 .
4514 .
4467 \layout List
4515 \layout List
4468 \labelwidthstring 00.00.0000
4516 \labelwidthstring 00.00.0000
4469
4517
4470
4518
4471 \family typewriter
4519 \family typewriter
4472 append
4520 append
4473 \family default
4521 \family default
4474 : well, that says it.
4522 : well, that says it.
4475 \layout List
4523 \layout List
4476 \labelwidthstring 00.00.0000
4524 \labelwidthstring 00.00.0000
4477
4525
4478
4526
4479 \family typewriter
4527 \family typewriter
4480 rotate
4528 rotate
4481 \family default
4529 \family default
4482 : create rotating logs
4530 : create rotating logs
4483 \family typewriter
4531 \family typewriter
4484 log_name
4532 log_name
4485 \family default
4533 \family default
4486 .
4534 .
4487 \family typewriter
4535 \family typewriter
4488 1~
4536 1~
4489 \family default
4537 \family default
4490 ,
4538 ,
4491 \family typewriter
4539 \family typewriter
4492 log_name.2~
4540 log_name.2~
4493 \family default
4541 \family default
4494 , etc.
4542 , etc.
4495 \layout Standard
4543 \layout Standard
4496
4544
4497 The
4545 The
4498 \family typewriter
4546 \family typewriter
4499 %logoff
4547 %logoff
4500 \family default
4548 \family default
4501 and
4549 and
4502 \family typewriter
4550 \family typewriter
4503 %logon
4551 %logon
4504 \family default
4552 \family default
4505 functions allow you to temporarily stop and resume logging to a file which
4553 functions allow you to temporarily stop and resume logging to a file which
4506 had previously been started with
4554 had previously been started with
4507 \family typewriter
4555 \family typewriter
4508 %logstart
4556 %logstart
4509 \family default
4557 \family default
4510 .
4558 .
4511 They will fail (with an explanation) if you try to use them before logging
4559 They will fail (with an explanation) if you try to use them before logging
4512 has been started.
4560 has been started.
4513 \layout Subsection
4561 \layout Subsection
4514
4562
4515
4563
4516 \begin_inset LatexCommand \label{sub:System-shell-access}
4564 \begin_inset LatexCommand \label{sub:System-shell-access}
4517
4565
4518 \end_inset
4566 \end_inset
4519
4567
4520 System shell access
4568 System shell access
4521 \layout Standard
4569 \layout Standard
4522
4570
4523 Any input line beginning with a
4571 Any input line beginning with a
4524 \family typewriter
4572 \family typewriter
4525 !
4573 !
4526 \family default
4574 \family default
4527 character is passed verbatim (minus the
4575 character is passed verbatim (minus the
4528 \family typewriter
4576 \family typewriter
4529 !
4577 !
4530 \family default
4578 \family default
4531 , of course) to the underlying operating system.
4579 , of course) to the underlying operating system.
4532 For example, typing
4580 For example, typing
4533 \family typewriter
4581 \family typewriter
4534 !ls
4582 !ls
4535 \family default
4583 \family default
4536 will run
4584 will run
4537 \family typewriter
4585 \family typewriter
4538 'ls'
4586 'ls'
4539 \family default
4587 \family default
4540 in the current directory.
4588 in the current directory.
4541 \layout Subsubsection
4589 \layout Subsubsection
4542
4590
4543 Manual capture of command output
4591 Manual capture of command output
4544 \layout Standard
4592 \layout Standard
4545
4593
4546 If the input line begins with
4594 If the input line begins with
4547 \emph on
4595 \emph on
4548 two
4596 two
4549 \emph default
4597 \emph default
4550 exclamation marks,
4598 exclamation marks,
4551 \family typewriter
4599 \family typewriter
4552 !!
4600 !!
4553 \family default
4601 \family default
4554 , the command is executed but its output is captured and returned as a python
4602 , the command is executed but its output is captured and returned as a python
4555 list, split on newlines.
4603 list, split on newlines.
4556 Any output sent by the subprocess to standard error is printed separately,
4604 Any output sent by the subprocess to standard error is printed separately,
4557 so that the resulting list only captures standard output.
4605 so that the resulting list only captures standard output.
4558 The
4606 The
4559 \family typewriter
4607 \family typewriter
4560 !!
4608 !!
4561 \family default
4609 \family default
4562 syntax is a shorthand for the
4610 syntax is a shorthand for the
4563 \family typewriter
4611 \family typewriter
4564 %sx
4612 %sx
4565 \family default
4613 \family default
4566 magic command.
4614 magic command.
4567 \layout Standard
4615 \layout Standard
4568
4616
4569 Finally, the
4617 Finally, the
4570 \family typewriter
4618 \family typewriter
4571 %sc
4619 %sc
4572 \family default
4620 \family default
4573 magic (short for `shell capture') is similar to
4621 magic (short for `shell capture') is similar to
4574 \family typewriter
4622 \family typewriter
4575 %sx
4623 %sx
4576 \family default
4624 \family default
4577 , but allowing more fine-grained control of the capture details, and storing
4625 , but allowing more fine-grained control of the capture details, and storing
4578 the result directly into a named variable.
4626 the result directly into a named variable.
4579 \layout Standard
4627 \layout Standard
4580
4628
4581 See Sec.\SpecialChar ~
4629 See Sec.\SpecialChar ~
4582
4630
4583 \begin_inset LatexCommand \ref{sec:magic}
4631 \begin_inset LatexCommand \ref{sec:magic}
4584
4632
4585 \end_inset
4633 \end_inset
4586
4634
4587 for details on the magics
4635 for details on the magics
4588 \family typewriter
4636 \family typewriter
4589 %sc
4637 %sc
4590 \family default
4638 \family default
4591 and
4639 and
4592 \family typewriter
4640 \family typewriter
4593 %sx
4641 %sx
4594 \family default
4642 \family default
4595 , or use IPython's own help (
4643 , or use IPython's own help (
4596 \family typewriter
4644 \family typewriter
4597 sc?
4645 sc?
4598 \family default
4646 \family default
4599 and
4647 and
4600 \family typewriter
4648 \family typewriter
4601 sx?
4649 sx?
4602 \family default
4650 \family default
4603 ) for further details.
4651 ) for further details.
4604 \layout Standard
4652 \layout Standard
4605
4653
4606 IPython also allows you to expand the value of python variables when making
4654 IPython also allows you to expand the value of python variables when making
4607 system calls.
4655 system calls.
4608 Any python variable or expression which you prepend with
4656 Any python variable or expression which you prepend with
4609 \family typewriter
4657 \family typewriter
4610 $
4658 $
4611 \family default
4659 \family default
4612 will get expanded before the system call is made.
4660 will get expanded before the system call is made.
4613
4661
4614 \layout Standard
4662 \layout Standard
4615
4663
4616
4664
4617 \family typewriter
4665 \family typewriter
4618 In [1]: pyvar='Hello world'
4666 In [1]: pyvar='Hello world'
4619 \newline
4667 \newline
4620 In [2]: !echo "A python variable: $pyvar"
4668 In [2]: !echo "A python variable: $pyvar"
4621 \newline
4669 \newline
4622 A python variable: Hello world
4670 A python variable: Hello world
4623 \layout Standard
4671 \layout Standard
4624
4672
4625 If you want the shell to actually see a literal
4673 If you want the shell to actually see a literal
4626 \family typewriter
4674 \family typewriter
4627 $
4675 $
4628 \family default
4676 \family default
4629 , you need to type it twice:
4677 , you need to type it twice:
4630 \layout Standard
4678 \layout Standard
4631
4679
4632
4680
4633 \family typewriter
4681 \family typewriter
4634 In [3]: !echo "A system variable: $$HOME"
4682 In [3]: !echo "A system variable: $$HOME"
4635 \newline
4683 \newline
4636 A system variable: /home/fperez
4684 A system variable: /home/fperez
4637 \layout Standard
4685 \layout Standard
4638
4686
4639 You can pass arbitrary expressions, though you'll need to delimit them with
4687 You can pass arbitrary expressions, though you'll need to delimit them with
4640
4688
4641 \family typewriter
4689 \family typewriter
4642 {}
4690 {}
4643 \family default
4691 \family default
4644 if there is ambiguity as to the extent of the expression:
4692 if there is ambiguity as to the extent of the expression:
4645 \layout Standard
4693 \layout Standard
4646
4694
4647
4695
4648 \family typewriter
4696 \family typewriter
4649 In [5]: x=10
4697 In [5]: x=10
4650 \newline
4698 \newline
4651 In [6]: y=20
4699 In [6]: y=20
4652 \newline
4700 \newline
4653 In [13]: !echo $x+y
4701 In [13]: !echo $x+y
4654 \newline
4702 \newline
4655 10+y
4703 10+y
4656 \newline
4704 \newline
4657 In [7]: !echo ${x+y}
4705 In [7]: !echo ${x+y}
4658 \newline
4706 \newline
4659 30
4707 30
4660 \layout Standard
4708 \layout Standard
4661
4709
4662 Even object attributes can be expanded:
4710 Even object attributes can be expanded:
4663 \layout Standard
4711 \layout Standard
4664
4712
4665
4713
4666 \family typewriter
4714 \family typewriter
4667 In [12]: !echo $sys.argv
4715 In [12]: !echo $sys.argv
4668 \newline
4716 \newline
4669 [/home/fperez/usr/bin/ipython]
4717 [/home/fperez/usr/bin/ipython]
4670 \layout Subsection
4718 \layout Subsection
4671
4719
4672 System command aliases
4720 System command aliases
4673 \layout Standard
4721 \layout Standard
4674
4722
4675 The
4723 The
4676 \family typewriter
4724 \family typewriter
4677 %alias
4725 %alias
4678 \family default
4726 \family default
4679 magic function and the
4727 magic function and the
4680 \family typewriter
4728 \family typewriter
4681 alias
4729 alias
4682 \family default
4730 \family default
4683 option in the
4731 option in the
4684 \family typewriter
4732 \family typewriter
4685 ipythonrc
4733 ipythonrc
4686 \family default
4734 \family default
4687 configuration file allow you to define magic functions which are in fact
4735 configuration file allow you to define magic functions which are in fact
4688 system shell commands.
4736 system shell commands.
4689 These aliases can have parameters.
4737 These aliases can have parameters.
4690
4738
4691 \layout Standard
4739 \layout Standard
4692
4740
4693 '
4741 '
4694 \family typewriter
4742 \family typewriter
4695 %alias alias_name cmd
4743 %alias alias_name cmd
4696 \family default
4744 \family default
4697 ' defines '
4745 ' defines '
4698 \family typewriter
4746 \family typewriter
4699 alias_name
4747 alias_name
4700 \family default
4748 \family default
4701 ' as an alias for '
4749 ' as an alias for '
4702 \family typewriter
4750 \family typewriter
4703 cmd
4751 cmd
4704 \family default
4752 \family default
4705 '
4753 '
4706 \layout Standard
4754 \layout Standard
4707
4755
4708 Then, typing '
4756 Then, typing '
4709 \family typewriter
4757 \family typewriter
4710 %alias_name params
4758 %alias_name params
4711 \family default
4759 \family default
4712 ' will execute the system command '
4760 ' will execute the system command '
4713 \family typewriter
4761 \family typewriter
4714 cmd params
4762 cmd params
4715 \family default
4763 \family default
4716 ' (from your underlying operating system).
4764 ' (from your underlying operating system).
4717
4765
4718 \layout Standard
4766 \layout Standard
4719
4767
4720 You can also define aliases with parameters using
4768 You can also define aliases with parameters using
4721 \family typewriter
4769 \family typewriter
4722 %s
4770 %s
4723 \family default
4771 \family default
4724 specifiers (one per parameter).
4772 specifiers (one per parameter).
4725 The following example defines the
4773 The following example defines the
4726 \family typewriter
4774 \family typewriter
4727 %parts
4775 %parts
4728 \family default
4776 \family default
4729 function as an alias to the command '
4777 function as an alias to the command '
4730 \family typewriter
4778 \family typewriter
4731 echo first %s second %s
4779 echo first %s second %s
4732 \family default
4780 \family default
4733 ' where each
4781 ' where each
4734 \family typewriter
4782 \family typewriter
4735 %s
4783 %s
4736 \family default
4784 \family default
4737 will be replaced by a positional parameter to the call to
4785 will be replaced by a positional parameter to the call to
4738 \family typewriter
4786 \family typewriter
4739 %parts:
4787 %parts:
4740 \layout Standard
4788 \layout Standard
4741
4789
4742
4790
4743 \family typewriter
4791 \family typewriter
4744 In [1]: alias parts echo first %s second %s
4792 In [1]: alias parts echo first %s second %s
4745 \newline
4793 \newline
4746 In [2]: %parts A B
4794 In [2]: %parts A B
4747 \newline
4795 \newline
4748 first A second B
4796 first A second B
4749 \newline
4797 \newline
4750 In [3]: %parts A
4798 In [3]: %parts A
4751 \newline
4799 \newline
4752 Incorrect number of arguments: 2 expected.
4800 Incorrect number of arguments: 2 expected.
4753
4801
4754 \newline
4802 \newline
4755 parts is an alias to: 'echo first %s second %s'
4803 parts is an alias to: 'echo first %s second %s'
4756 \layout Standard
4804 \layout Standard
4757
4805
4758 If called with no parameters,
4806 If called with no parameters,
4759 \family typewriter
4807 \family typewriter
4760 %alias
4808 %alias
4761 \family default
4809 \family default
4762 prints the table of currently defined aliases.
4810 prints the table of currently defined aliases.
4763 \layout Standard
4811 \layout Standard
4764
4812
4765 The
4813 The
4766 \family typewriter
4814 \family typewriter
4767 %rehash/rehashx
4815 %rehash/rehashx
4768 \family default
4816 \family default
4769 magics allow you to load your entire
4817 magics allow you to load your entire
4770 \family typewriter
4818 \family typewriter
4771 $PATH
4819 $PATH
4772 \family default
4820 \family default
4773 as ipython aliases.
4821 as ipython aliases.
4774 See their respective docstrings (or sec.\SpecialChar ~
4822 See their respective docstrings (or sec.\SpecialChar ~
4775
4823
4776 \begin_inset LatexCommand \ref{sec:magic}
4824 \begin_inset LatexCommand \ref{sec:magic}
4777
4825
4778 \end_inset
4826 \end_inset
4779
4827
4780 for further details).
4828 for further details).
4781 \layout Subsection
4829 \layout Subsection
4782
4830
4783
4831
4784 \begin_inset LatexCommand \label{sec:dreload}
4832 \begin_inset LatexCommand \label{sec:dreload}
4785
4833
4786 \end_inset
4834 \end_inset
4787
4835
4788 Recursive reload
4836 Recursive reload
4789 \layout Standard
4837 \layout Standard
4790
4838
4791 The
4839 The
4792 \family typewriter
4840 \family typewriter
4793 %dreload
4841 %dreload
4794 \family default
4842 \family default
4795 command does a recursive reload of a module: changes made to the module
4843 command does a recursive reload of a module: changes made to the module
4796 since you imported will actually be available without having to exit.
4844 since you imported will actually be available without having to exit.
4797 \layout Subsection
4845 \layout Subsection
4798
4846
4799 Verbose and colored exception traceback printouts
4847 Verbose and colored exception traceback printouts
4800 \layout Standard
4848 \layout Standard
4801
4849
4802 IPython provides the option to see very detailed exception tracebacks, which
4850 IPython provides the option to see very detailed exception tracebacks, which
4803 can be especially useful when debugging large programs.
4851 can be especially useful when debugging large programs.
4804 You can run any Python file with the
4852 You can run any Python file with the
4805 \family typewriter
4853 \family typewriter
4806 %run
4854 %run
4807 \family default
4855 \family default
4808 function to benefit from these detailed tracebacks.
4856 function to benefit from these detailed tracebacks.
4809 Furthermore, both normal and verbose tracebacks can be colored (if your
4857 Furthermore, both normal and verbose tracebacks can be colored (if your
4810 terminal supports it) which makes them much easier to parse visually.
4858 terminal supports it) which makes them much easier to parse visually.
4811 \layout Standard
4859 \layout Standard
4812
4860
4813 See the magic
4861 See the magic
4814 \family typewriter
4862 \family typewriter
4815 xmode
4863 xmode
4816 \family default
4864 \family default
4817 and
4865 and
4818 \family typewriter
4866 \family typewriter
4819 colors
4867 colors
4820 \family default
4868 \family default
4821 functions for details (just type
4869 functions for details (just type
4822 \family typewriter
4870 \family typewriter
4823 %magic
4871 %magic
4824 \family default
4872 \family default
4825 ).
4873 ).
4826 \layout Standard
4874 \layout Standard
4827
4875
4828 These features are basically a terminal version of Ka-Ping Yee's
4876 These features are basically a terminal version of Ka-Ping Yee's
4829 \family typewriter
4877 \family typewriter
4830 cgitb
4878 cgitb
4831 \family default
4879 \family default
4832 module, now part of the standard Python library.
4880 module, now part of the standard Python library.
4833 \layout Subsection
4881 \layout Subsection
4834
4882
4835
4883
4836 \begin_inset LatexCommand \label{sec:cache_input}
4884 \begin_inset LatexCommand \label{sec:cache_input}
4837
4885
4838 \end_inset
4886 \end_inset
4839
4887
4840 Input caching system
4888 Input caching system
4841 \layout Standard
4889 \layout Standard
4842
4890
4843 IPython offers numbered prompts (In/Out) with input and output caching.
4891 IPython offers numbered prompts (In/Out) with input and output caching.
4844 All input is saved and can be retrieved as variables (besides the usual
4892 All input is saved and can be retrieved as variables (besides the usual
4845 arrow key recall).
4893 arrow key recall).
4846 \layout Standard
4894 \layout Standard
4847
4895
4848 The following GLOBAL variables always exist (so don't overwrite them!):
4896 The following GLOBAL variables always exist (so don't overwrite them!):
4849
4897
4850 \family typewriter
4898 \family typewriter
4851 _i
4899 _i
4852 \family default
4900 \family default
4853 : stores previous input.
4901 : stores previous input.
4854
4902
4855 \family typewriter
4903 \family typewriter
4856 _ii
4904 _ii
4857 \family default
4905 \family default
4858 : next previous.
4906 : next previous.
4859
4907
4860 \family typewriter
4908 \family typewriter
4861 _iii
4909 _iii
4862 \family default
4910 \family default
4863 : next-next previous.
4911 : next-next previous.
4864
4912
4865 \family typewriter
4913 \family typewriter
4866 _ih
4914 _ih
4867 \family default
4915 \family default
4868 : a list of all input
4916 : a list of all input
4869 \family typewriter
4917 \family typewriter
4870 _ih[n]
4918 _ih[n]
4871 \family default
4919 \family default
4872 is the input from line
4920 is the input from line
4873 \family typewriter
4921 \family typewriter
4874 n
4922 n
4875 \family default
4923 \family default
4876 and this list is aliased to the global variable
4924 and this list is aliased to the global variable
4877 \family typewriter
4925 \family typewriter
4878 In
4926 In
4879 \family default
4927 \family default
4880 .
4928 .
4881 If you overwrite
4929 If you overwrite
4882 \family typewriter
4930 \family typewriter
4883 In
4931 In
4884 \family default
4932 \family default
4885 with a variable of your own, you can remake the assignment to the internal
4933 with a variable of your own, you can remake the assignment to the internal
4886 list with a simple
4934 list with a simple
4887 \family typewriter
4935 \family typewriter
4888 'In=_ih'
4936 'In=_ih'
4889 \family default
4937 \family default
4890 .
4938 .
4891 \layout Standard
4939 \layout Standard
4892
4940
4893 Additionally, global variables named
4941 Additionally, global variables named
4894 \family typewriter
4942 \family typewriter
4895 _i<n>
4943 _i<n>
4896 \family default
4944 \family default
4897 are dynamically created (
4945 are dynamically created (
4898 \family typewriter
4946 \family typewriter
4899 <n>
4947 <n>
4900 \family default
4948 \family default
4901 being the prompt counter), such that
4949 being the prompt counter), such that
4902 \newline
4950 \newline
4903
4951
4904 \family typewriter
4952 \family typewriter
4905 _i<n> == _ih[<n>] == In[<n>].
4953 _i<n> == _ih[<n>] == In[<n>].
4906 \layout Standard
4954 \layout Standard
4907
4955
4908 For example, what you typed at prompt 14 is available as
4956 For example, what you typed at prompt 14 is available as
4909 \family typewriter
4957 \family typewriter
4910 _i14,
4958 _i14,
4911 \family default
4959 \family default
4912
4960
4913 \family typewriter
4961 \family typewriter
4914 _ih[14]
4962 _ih[14]
4915 \family default
4963 \family default
4916 and
4964 and
4917 \family typewriter
4965 \family typewriter
4918 In[14]
4966 In[14]
4919 \family default
4967 \family default
4920 .
4968 .
4921 \layout Standard
4969 \layout Standard
4922
4970
4923 This allows you to easily cut and paste multi line interactive prompts by
4971 This allows you to easily cut and paste multi line interactive prompts by
4924 printing them out: they print like a clean string, without prompt characters.
4972 printing them out: they print like a clean string, without prompt characters.
4925 You can also manipulate them like regular variables (they are strings),
4973 You can also manipulate them like regular variables (they are strings),
4926 modify or exec them (typing
4974 modify or exec them (typing
4927 \family typewriter
4975 \family typewriter
4928 'exec _i9'
4976 'exec _i9'
4929 \family default
4977 \family default
4930 will re-execute the contents of input prompt 9, '
4978 will re-execute the contents of input prompt 9, '
4931 \family typewriter
4979 \family typewriter
4932 exec In[9:14]+In[18]
4980 exec In[9:14]+In[18]
4933 \family default
4981 \family default
4934 ' will re-execute lines 9 through 13 and line 18).
4982 ' will re-execute lines 9 through 13 and line 18).
4935 \layout Standard
4983 \layout Standard
4936
4984
4937 You can also re-execute multiple lines of input easily by using the magic
4985 You can also re-execute multiple lines of input easily by using the magic
4938
4986
4939 \family typewriter
4987 \family typewriter
4940 %macro
4988 %macro
4941 \family default
4989 \family default
4942 function (which automates the process and allows re-execution without having
4990 function (which automates the process and allows re-execution without having
4943 to type '
4991 to type '
4944 \family typewriter
4992 \family typewriter
4945 exec
4993 exec
4946 \family default
4994 \family default
4947 ' every time).
4995 ' every time).
4948 The macro system also allows you to re-execute previous lines which include
4996 The macro system also allows you to re-execute previous lines which include
4949 magic function calls (which require special processing).
4997 magic function calls (which require special processing).
4950 Type
4998 Type
4951 \family typewriter
4999 \family typewriter
4952 %macro?
5000 %macro?
4953 \family default
5001 \family default
4954 or see sec.
5002 or see sec.
4955
5003
4956 \begin_inset LatexCommand \ref{sec:magic}
5004 \begin_inset LatexCommand \ref{sec:magic}
4957
5005
4958 \end_inset
5006 \end_inset
4959
5007
4960 for more details on the macro system.
5008 for more details on the macro system.
4961 \layout Standard
5009 \layout Standard
4962
5010
4963 A history function
5011 A history function
4964 \family typewriter
5012 \family typewriter
4965 %hist
5013 %hist
4966 \family default
5014 \family default
4967 allows you to see any part of your input history by printing a range of
5015 allows you to see any part of your input history by printing a range of
4968 the
5016 the
4969 \family typewriter
5017 \family typewriter
4970 _i
5018 _i
4971 \family default
5019 \family default
4972 variables.
5020 variables.
4973 \layout Subsection
5021 \layout Subsection
4974
5022
4975
5023
4976 \begin_inset LatexCommand \label{sec:cache_output}
5024 \begin_inset LatexCommand \label{sec:cache_output}
4977
5025
4978 \end_inset
5026 \end_inset
4979
5027
4980 Output caching system
5028 Output caching system
4981 \layout Standard
5029 \layout Standard
4982
5030
4983 For output that is returned from actions, a system similar to the input
5031 For output that is returned from actions, a system similar to the input
4984 cache exists but using
5032 cache exists but using
4985 \family typewriter
5033 \family typewriter
4986 _
5034 _
4987 \family default
5035 \family default
4988 instead of
5036 instead of
4989 \family typewriter
5037 \family typewriter
4990 _i
5038 _i
4991 \family default
5039 \family default
4992 .
5040 .
4993 Only actions that produce a result (NOT assignments, for example) are cached.
5041 Only actions that produce a result (NOT assignments, for example) are cached.
4994 If you are familiar with Mathematica, IPython's
5042 If you are familiar with Mathematica, IPython's
4995 \family typewriter
5043 \family typewriter
4996 _
5044 _
4997 \family default
5045 \family default
4998 variables behave exactly like Mathematica's
5046 variables behave exactly like Mathematica's
4999 \family typewriter
5047 \family typewriter
5000 %
5048 %
5001 \family default
5049 \family default
5002 variables.
5050 variables.
5003 \layout Standard
5051 \layout Standard
5004
5052
5005 The following GLOBAL variables always exist (so don't overwrite them!):
5053 The following GLOBAL variables always exist (so don't overwrite them!):
5006
5054
5007 \layout List
5055 \layout List
5008 \labelwidthstring 00.00.0000
5056 \labelwidthstring 00.00.0000
5009
5057
5010
5058
5011 \family typewriter
5059 \family typewriter
5012 \series bold
5060 \series bold
5013 _
5061 _
5014 \family default
5062 \family default
5015 \series default
5063 \series default
5016 (a
5064 (a
5017 \emph on
5065 \emph on
5018 single
5066 single
5019 \emph default
5067 \emph default
5020 underscore) : stores previous output, like Python's default interpreter.
5068 underscore) : stores previous output, like Python's default interpreter.
5021 \layout List
5069 \layout List
5022 \labelwidthstring 00.00.0000
5070 \labelwidthstring 00.00.0000
5023
5071
5024
5072
5025 \family typewriter
5073 \family typewriter
5026 \series bold
5074 \series bold
5027 __
5075 __
5028 \family default
5076 \family default
5029 \series default
5077 \series default
5030 (two underscores): next previous.
5078 (two underscores): next previous.
5031 \layout List
5079 \layout List
5032 \labelwidthstring 00.00.0000
5080 \labelwidthstring 00.00.0000
5033
5081
5034
5082
5035 \family typewriter
5083 \family typewriter
5036 \series bold
5084 \series bold
5037 ___
5085 ___
5038 \family default
5086 \family default
5039 \series default
5087 \series default
5040 (three underscores): next-next previous.
5088 (three underscores): next-next previous.
5041 \layout Standard
5089 \layout Standard
5042
5090
5043 Additionally, global variables named
5091 Additionally, global variables named
5044 \family typewriter
5092 \family typewriter
5045 _<n>
5093 _<n>
5046 \family default
5094 \family default
5047 are dynamically created (
5095 are dynamically created (
5048 \family typewriter
5096 \family typewriter
5049 <n>
5097 <n>
5050 \family default
5098 \family default
5051 being the prompt counter), such that the result of output
5099 being the prompt counter), such that the result of output
5052 \family typewriter
5100 \family typewriter
5053 <n>
5101 <n>
5054 \family default
5102 \family default
5055 is always available as
5103 is always available as
5056 \family typewriter
5104 \family typewriter
5057 _<n>
5105 _<n>
5058 \family default
5106 \family default
5059 (don't use the angle brackets, just the number, e.g.
5107 (don't use the angle brackets, just the number, e.g.
5060
5108
5061 \family typewriter
5109 \family typewriter
5062 _21
5110 _21
5063 \family default
5111 \family default
5064 ).
5112 ).
5065 \layout Standard
5113 \layout Standard
5066
5114
5067 These global variables are all stored in a global dictionary (not a list,
5115 These global variables are all stored in a global dictionary (not a list,
5068 since it only has entries for lines which returned a result) available
5116 since it only has entries for lines which returned a result) available
5069 under the names
5117 under the names
5070 \family typewriter
5118 \family typewriter
5071 _oh
5119 _oh
5072 \family default
5120 \family default
5073 and
5121 and
5074 \family typewriter
5122 \family typewriter
5075 Out
5123 Out
5076 \family default
5124 \family default
5077 (similar to
5125 (similar to
5078 \family typewriter
5126 \family typewriter
5079 _ih
5127 _ih
5080 \family default
5128 \family default
5081 and
5129 and
5082 \family typewriter
5130 \family typewriter
5083 In
5131 In
5084 \family default
5132 \family default
5085 ).
5133 ).
5086 So the output from line 12 can be obtained as
5134 So the output from line 12 can be obtained as
5087 \family typewriter
5135 \family typewriter
5088 _12
5136 _12
5089 \family default
5137 \family default
5090 ,
5138 ,
5091 \family typewriter
5139 \family typewriter
5092 Out[12]
5140 Out[12]
5093 \family default
5141 \family default
5094 or
5142 or
5095 \family typewriter
5143 \family typewriter
5096 _oh[12]
5144 _oh[12]
5097 \family default
5145 \family default
5098 .
5146 .
5099 If you accidentally overwrite the
5147 If you accidentally overwrite the
5100 \family typewriter
5148 \family typewriter
5101 Out
5149 Out
5102 \family default
5150 \family default
5103 variable you can recover it by typing
5151 variable you can recover it by typing
5104 \family typewriter
5152 \family typewriter
5105 'Out=_oh
5153 'Out=_oh
5106 \family default
5154 \family default
5107 ' at the prompt.
5155 ' at the prompt.
5108 \layout Standard
5156 \layout Standard
5109
5157
5110 This system obviously can potentially put heavy memory demands on your system,
5158 This system obviously can potentially put heavy memory demands on your system,
5111 since it prevents Python's garbage collector from removing any previously
5159 since it prevents Python's garbage collector from removing any previously
5112 computed results.
5160 computed results.
5113 You can control how many results are kept in memory with the option (at
5161 You can control how many results are kept in memory with the option (at
5114 the command line or in your
5162 the command line or in your
5115 \family typewriter
5163 \family typewriter
5116 ipythonrc
5164 ipythonrc
5117 \family default
5165 \family default
5118 file)
5166 file)
5119 \family typewriter
5167 \family typewriter
5120 cache_size
5168 cache_size
5121 \family default
5169 \family default
5122 .
5170 .
5123 If you set it to 0, the whole system is completely disabled and the prompts
5171 If you set it to 0, the whole system is completely disabled and the prompts
5124 revert to the classic
5172 revert to the classic
5125 \family typewriter
5173 \family typewriter
5126 '>>>'
5174 '>>>'
5127 \family default
5175 \family default
5128 of normal Python.
5176 of normal Python.
5129 \layout Subsection
5177 \layout Subsection
5130
5178
5131 Directory history
5179 Directory history
5132 \layout Standard
5180 \layout Standard
5133
5181
5134 Your history of visited directories is kept in the global list
5182 Your history of visited directories is kept in the global list
5135 \family typewriter
5183 \family typewriter
5136 _dh
5184 _dh
5137 \family default
5185 \family default
5138 , and the magic
5186 , and the magic
5139 \family typewriter
5187 \family typewriter
5140 %cd
5188 %cd
5141 \family default
5189 \family default
5142 command can be used to go to any entry in that list.
5190 command can be used to go to any entry in that list.
5143 The
5191 The
5144 \family typewriter
5192 \family typewriter
5145 %dhist
5193 %dhist
5146 \family default
5194 \family default
5147 command allows you to view this history.
5195 command allows you to view this history.
5148 \layout Subsection
5196 \layout Subsection
5149
5197
5150 Automatic parentheses and quotes
5198 Automatic parentheses and quotes
5151 \layout Standard
5199 \layout Standard
5152
5200
5153 These features were adapted from Nathan Gray's LazyPython.
5201 These features were adapted from Nathan Gray's LazyPython.
5154 They are meant to allow less typing for common situations.
5202 They are meant to allow less typing for common situations.
5155 \layout Subsubsection
5203 \layout Subsubsection
5156
5204
5157 Automatic parentheses
5205 Automatic parentheses
5158 \layout Standard
5206 \layout Standard
5159
5207
5160 Callable objects (i.e.
5208 Callable objects (i.e.
5161 functions, methods, etc) can be invoked like this (notice the commas between
5209 functions, methods, etc) can be invoked like this (notice the commas between
5162 the arguments):
5210 the arguments):
5163 \layout Standard
5211 \layout Standard
5164
5212
5165
5213
5166 \family typewriter
5214 \family typewriter
5167 >>> callable_ob arg1, arg2, arg3
5215 >>> callable_ob arg1, arg2, arg3
5168 \layout Standard
5216 \layout Standard
5169
5217
5170 and the input will be translated to this:
5218 and the input will be translated to this:
5171 \layout Standard
5219 \layout Standard
5172
5220
5173
5221
5174 \family typewriter
5222 \family typewriter
5175 --> callable_ob(arg1, arg2, arg3)
5223 --> callable_ob(arg1, arg2, arg3)
5176 \layout Standard
5224 \layout Standard
5177
5225
5178 You can force automatic parentheses by using '/' as the first character
5226 You can force automatic parentheses by using '/' as the first character
5179 of a line.
5227 of a line.
5180 For example:
5228 For example:
5181 \layout Standard
5229 \layout Standard
5182
5230
5183
5231
5184 \family typewriter
5232 \family typewriter
5185 >>> /globals # becomes 'globals()'
5233 >>> /globals # becomes 'globals()'
5186 \layout Standard
5234 \layout Standard
5187
5235
5188 Note that the '/' MUST be the first character on the line! This won't work:
5236 Note that the '/' MUST be the first character on the line! This won't work:
5189
5237
5190 \layout Standard
5238 \layout Standard
5191
5239
5192
5240
5193 \family typewriter
5241 \family typewriter
5194 >>> print /globals # syntax error
5242 >>> print /globals # syntax error
5195 \layout Standard
5243 \layout Standard
5196
5244
5197 In most cases the automatic algorithm should work, so you should rarely
5245 In most cases the automatic algorithm should work, so you should rarely
5198 need to explicitly invoke /.
5246 need to explicitly invoke /.
5199 One notable exception is if you are trying to call a function with a list
5247 One notable exception is if you are trying to call a function with a list
5200 of tuples as arguments (the parenthesis will confuse IPython):
5248 of tuples as arguments (the parenthesis will confuse IPython):
5201 \layout Standard
5249 \layout Standard
5202
5250
5203
5251
5204 \family typewriter
5252 \family typewriter
5205 In [1]: zip (1,2,3),(4,5,6) # won't work
5253 In [1]: zip (1,2,3),(4,5,6) # won't work
5206 \layout Standard
5254 \layout Standard
5207
5255
5208 but this will work:
5256 but this will work:
5209 \layout Standard
5257 \layout Standard
5210
5258
5211
5259
5212 \family typewriter
5260 \family typewriter
5213 In [2]: /zip (1,2,3),(4,5,6)
5261 In [2]: /zip (1,2,3),(4,5,6)
5214 \newline
5262 \newline
5215 ------> zip ((1,2,3),(4,5,6))
5263 ------> zip ((1,2,3),(4,5,6))
5216 \newline
5264 \newline
5217 Out[2]= [(1, 4), (2, 5), (3, 6)]
5265 Out[2]= [(1, 4), (2, 5), (3, 6)]
5218 \layout Standard
5266 \layout Standard
5219
5267
5220 IPython tells you that it has altered your command line by displaying the
5268 IPython tells you that it has altered your command line by displaying the
5221 new command line preceded by
5269 new command line preceded by
5222 \family typewriter
5270 \family typewriter
5223 -->
5271 -->
5224 \family default
5272 \family default
5225 .
5273 .
5226 e.g.:
5274 e.g.:
5227 \layout Standard
5275 \layout Standard
5228
5276
5229
5277
5230 \family typewriter
5278 \family typewriter
5231 In [18]: callable list
5279 In [18]: callable list
5232 \newline
5280 \newline
5233 -------> callable (list)
5281 -------> callable (list)
5234 \layout Subsubsection
5282 \layout Subsubsection
5235
5283
5236 Automatic quoting
5284 Automatic quoting
5237 \layout Standard
5285 \layout Standard
5238
5286
5239 You can force automatic quoting of a function's arguments by using
5287 You can force automatic quoting of a function's arguments by using
5240 \family typewriter
5288 \family typewriter
5241 `,'
5289 `,'
5242 \family default
5290 \family default
5243 or
5291 or
5244 \family typewriter
5292 \family typewriter
5245 `;'
5293 `;'
5246 \family default
5294 \family default
5247 as the first character of a line.
5295 as the first character of a line.
5248 For example:
5296 For example:
5249 \layout Standard
5297 \layout Standard
5250
5298
5251
5299
5252 \family typewriter
5300 \family typewriter
5253 >>> ,my_function /home/me # becomes my_function("/home/me")
5301 >>> ,my_function /home/me # becomes my_function("/home/me")
5254 \layout Standard
5302 \layout Standard
5255
5303
5256 If you use
5304 If you use
5257 \family typewriter
5305 \family typewriter
5258 `;'
5306 `;'
5259 \family default
5307 \family default
5260 instead, the whole argument is quoted as a single string (while
5308 instead, the whole argument is quoted as a single string (while
5261 \family typewriter
5309 \family typewriter
5262 `,'
5310 `,'
5263 \family default
5311 \family default
5264 splits on whitespace):
5312 splits on whitespace):
5265 \layout Standard
5313 \layout Standard
5266
5314
5267
5315
5268 \family typewriter
5316 \family typewriter
5269 >>> ,my_function a b c # becomes my_function("a","b","c")
5317 >>> ,my_function a b c # becomes my_function("a","b","c")
5270 \layout Standard
5318 \layout Standard
5271
5319
5272
5320
5273 \family typewriter
5321 \family typewriter
5274 >>> ;my_function a b c # becomes my_function("a b c")
5322 >>> ;my_function a b c # becomes my_function("a b c")
5275 \layout Standard
5323 \layout Standard
5276
5324
5277 Note that the `
5325 Note that the `
5278 \family typewriter
5326 \family typewriter
5279 ,
5327 ,
5280 \family default
5328 \family default
5281 ' or `
5329 ' or `
5282 \family typewriter
5330 \family typewriter
5283 ;
5331 ;
5284 \family default
5332 \family default
5285 ' MUST be the first character on the line! This won't work:
5333 ' MUST be the first character on the line! This won't work:
5286 \layout Standard
5334 \layout Standard
5287
5335
5288
5336
5289 \family typewriter
5337 \family typewriter
5290 >>> x = ,my_function /home/me # syntax error
5338 >>> x = ,my_function /home/me # syntax error
5291 \layout Section
5339 \layout Section
5292
5340
5293
5341
5294 \begin_inset LatexCommand \label{sec:customization}
5342 \begin_inset LatexCommand \label{sec:customization}
5295
5343
5296 \end_inset
5344 \end_inset
5297
5345
5298 Customization
5346 Customization
5299 \layout Standard
5347 \layout Standard
5300
5348
5301 As we've already mentioned, IPython reads a configuration file which can
5349 As we've already mentioned, IPython reads a configuration file which can
5302 be specified at the command line (
5350 be specified at the command line (
5303 \family typewriter
5351 \family typewriter
5304 -rcfile
5352 -rcfile
5305 \family default
5353 \family default
5306 ) or which by default is assumed to be called
5354 ) or which by default is assumed to be called
5307 \family typewriter
5355 \family typewriter
5308 ipythonrc
5356 ipythonrc
5309 \family default
5357 \family default
5310 .
5358 .
5311 Such a file is looked for in the current directory where IPython is started
5359 Such a file is looked for in the current directory where IPython is started
5312 and then in your
5360 and then in your
5313 \family typewriter
5361 \family typewriter
5314 IPYTHONDIR
5362 IPYTHONDIR
5315 \family default
5363 \family default
5316 , which allows you to have local configuration files for specific projects.
5364 , which allows you to have local configuration files for specific projects.
5317 In this section we will call these types of configuration files simply
5365 In this section we will call these types of configuration files simply
5318 rcfiles (short for resource configuration file).
5366 rcfiles (short for resource configuration file).
5319 \layout Standard
5367 \layout Standard
5320
5368
5321 The syntax of an rcfile is one of key-value pairs separated by whitespace,
5369 The syntax of an rcfile is one of key-value pairs separated by whitespace,
5322 one per line.
5370 one per line.
5323 Lines beginning with a
5371 Lines beginning with a
5324 \family typewriter
5372 \family typewriter
5325 #
5373 #
5326 \family default
5374 \family default
5327 are ignored as comments, but comments can
5375 are ignored as comments, but comments can
5328 \series bold
5376 \series bold
5329 not
5377 not
5330 \series default
5378 \series default
5331 be put on lines with data (the parser is fairly primitive).
5379 be put on lines with data (the parser is fairly primitive).
5332 Note that these are not python files, and this is deliberate, because it
5380 Note that these are not python files, and this is deliberate, because it
5333 allows us to do some things which would be quite tricky to implement if
5381 allows us to do some things which would be quite tricky to implement if
5334 they were normal python files.
5382 they were normal python files.
5335 \layout Standard
5383 \layout Standard
5336
5384
5337 First, an rcfile can contain permanent default values for almost all command
5385 First, an rcfile can contain permanent default values for almost all command
5338 line options (except things like
5386 line options (except things like
5339 \family typewriter
5387 \family typewriter
5340 -help
5388 -help
5341 \family default
5389 \family default
5342 or
5390 or
5343 \family typewriter
5391 \family typewriter
5344 -Version
5392 -Version
5345 \family default
5393 \family default
5346 ).
5394 ).
5347 Sec\SpecialChar ~
5395 Sec\SpecialChar ~
5348
5396
5349 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5397 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5350
5398
5351 \end_inset
5399 \end_inset
5352
5400
5353 contains a description of all command-line options.
5401 contains a description of all command-line options.
5354 However, values you explicitly specify at the command line override the
5402 However, values you explicitly specify at the command line override the
5355 values defined in the rcfile.
5403 values defined in the rcfile.
5356 \layout Standard
5404 \layout Standard
5357
5405
5358 Besides command line option values, the rcfile can specify values for certain
5406 Besides command line option values, the rcfile can specify values for certain
5359 extra special options which are not available at the command line.
5407 extra special options which are not available at the command line.
5360 These options are briefly described below.
5408 These options are briefly described below.
5361
5409
5362 \layout Standard
5410 \layout Standard
5363
5411
5364 Each of these options may appear as many times as you need it in the file.
5412 Each of these options may appear as many times as you need it in the file.
5365 \layout List
5413 \layout List
5366 \labelwidthstring 00.00.0000
5414 \labelwidthstring 00.00.0000
5367
5415
5368
5416
5369 \family typewriter
5417 \family typewriter
5370 \series bold
5418 \series bold
5371 include\SpecialChar ~
5419 include\SpecialChar ~
5372 <file1>\SpecialChar ~
5420 <file1>\SpecialChar ~
5373 <file2>\SpecialChar ~
5421 <file2>\SpecialChar ~
5374 ...
5422 ...
5375 \family default
5423 \family default
5376 \series default
5424 \series default
5377 : you can name
5425 : you can name
5378 \emph on
5426 \emph on
5379 other
5427 other
5380 \emph default
5428 \emph default
5381 rcfiles you want to recursively load up to 15 levels (don't use the
5429 rcfiles you want to recursively load up to 15 levels (don't use the
5382 \family typewriter
5430 \family typewriter
5383 <>
5431 <>
5384 \family default
5432 \family default
5385 brackets in your names!).
5433 brackets in your names!).
5386 This feature allows you to define a 'base' rcfile with general options
5434 This feature allows you to define a 'base' rcfile with general options
5387 and special-purpose files which can be loaded only when needed with particular
5435 and special-purpose files which can be loaded only when needed with particular
5388 configuration options.
5436 configuration options.
5389 To make this more convenient, IPython accepts the
5437 To make this more convenient, IPython accepts the
5390 \family typewriter
5438 \family typewriter
5391 -profile <name>
5439 -profile <name>
5392 \family default
5440 \family default
5393 option (abbreviates to
5441 option (abbreviates to
5394 \family typewriter
5442 \family typewriter
5395 -p <name
5443 -p <name
5396 \family default
5444 \family default
5397 >)
5445 >)
5398 \family typewriter
5446 \family typewriter
5399 which
5447 which
5400 \family default
5448 \family default
5401 tells it to look for an rcfile named
5449 tells it to look for an rcfile named
5402 \family typewriter
5450 \family typewriter
5403 ipythonrc-<name>
5451 ipythonrc-<name>
5404 \family default
5452 \family default
5405 .
5453 .
5406
5454
5407 \layout List
5455 \layout List
5408 \labelwidthstring 00.00.0000
5456 \labelwidthstring 00.00.0000
5409
5457
5410
5458
5411 \family typewriter
5459 \family typewriter
5412 \series bold
5460 \series bold
5413 import_mod\SpecialChar ~
5461 import_mod\SpecialChar ~
5414 <mod1>\SpecialChar ~
5462 <mod1>\SpecialChar ~
5415 <mod2>\SpecialChar ~
5463 <mod2>\SpecialChar ~
5416 ...
5464 ...
5417 \family default
5465 \family default
5418 \series default
5466 \series default
5419 : import modules with '
5467 : import modules with '
5420 \family typewriter
5468 \family typewriter
5421 import
5469 import
5422 \family default
5470 \family default
5423
5471
5424 \family typewriter
5472 \family typewriter
5425 <mod1>,<mod2>,...
5473 <mod1>,<mod2>,...
5426 \family default
5474 \family default
5427 '
5475 '
5428 \layout List
5476 \layout List
5429 \labelwidthstring 00.00.0000
5477 \labelwidthstring 00.00.0000
5430
5478
5431
5479
5432 \family typewriter
5480 \family typewriter
5433 \series bold
5481 \series bold
5434 import_some\SpecialChar ~
5482 import_some\SpecialChar ~
5435 <mod>\SpecialChar ~
5483 <mod>\SpecialChar ~
5436 <f1>\SpecialChar ~
5484 <f1>\SpecialChar ~
5437 <f2>\SpecialChar ~
5485 <f2>\SpecialChar ~
5438 ...
5486 ...
5439 \family default
5487 \family default
5440 \series default
5488 \series default
5441 : import functions with '
5489 : import functions with '
5442 \family typewriter
5490 \family typewriter
5443 from <mod> import
5491 from <mod> import
5444 \family default
5492 \family default
5445
5493
5446 \family typewriter
5494 \family typewriter
5447 <f1>,<f2>,...
5495 <f1>,<f2>,...
5448 \family default
5496 \family default
5449 '
5497 '
5450 \layout List
5498 \layout List
5451 \labelwidthstring 00.00.0000
5499 \labelwidthstring 00.00.0000
5452
5500
5453
5501
5454 \family typewriter
5502 \family typewriter
5455 \series bold
5503 \series bold
5456 import_all\SpecialChar ~
5504 import_all\SpecialChar ~
5457 <mod1>\SpecialChar ~
5505 <mod1>\SpecialChar ~
5458 <mod2>\SpecialChar ~
5506 <mod2>\SpecialChar ~
5459 ...
5507 ...
5460 \family default
5508 \family default
5461 \series default
5509 \series default
5462 : for each module listed import functions with '
5510 : for each module listed import functions with '
5463 \family typewriter
5511 \family typewriter
5464 from <mod> import *
5512 from <mod> import *
5465 \family default
5513 \family default
5466 '
5514 '
5467 \layout List
5515 \layout List
5468 \labelwidthstring 00.00.0000
5516 \labelwidthstring 00.00.0000
5469
5517
5470
5518
5471 \family typewriter
5519 \family typewriter
5472 \series bold
5520 \series bold
5473 execute\SpecialChar ~
5521 execute\SpecialChar ~
5474 <python\SpecialChar ~
5522 <python\SpecialChar ~
5475 code>
5523 code>
5476 \family default
5524 \family default
5477 \series default
5525 \series default
5478 : give any single-line python code to be executed.
5526 : give any single-line python code to be executed.
5479 \layout List
5527 \layout List
5480 \labelwidthstring 00.00.0000
5528 \labelwidthstring 00.00.0000
5481
5529
5482
5530
5483 \family typewriter
5531 \family typewriter
5484 \series bold
5532 \series bold
5485 execfile\SpecialChar ~
5533 execfile\SpecialChar ~
5486 <filename>
5534 <filename>
5487 \family default
5535 \family default
5488 \series default
5536 \series default
5489 : execute the python file given with an '
5537 : execute the python file given with an '
5490 \family typewriter
5538 \family typewriter
5491 execfile(filename)
5539 execfile(filename)
5492 \family default
5540 \family default
5493 ' command.
5541 ' command.
5494 Username expansion is performed on the given names.
5542 Username expansion is performed on the given names.
5495 So if you need any amount of extra fancy customization that won't fit in
5543 So if you need any amount of extra fancy customization that won't fit in
5496 any of the above 'canned' options, you can just put it in a separate python
5544 any of the above 'canned' options, you can just put it in a separate python
5497 file and execute it.
5545 file and execute it.
5498 \layout List
5546 \layout List
5499 \labelwidthstring 00.00.0000
5547 \labelwidthstring 00.00.0000
5500
5548
5501
5549
5502 \family typewriter
5550 \family typewriter
5503 \series bold
5551 \series bold
5504 alias\SpecialChar ~
5552 alias\SpecialChar ~
5505 <alias_def>
5553 <alias_def>
5506 \family default
5554 \family default
5507 \series default
5555 \series default
5508 : this is equivalent to calling '
5556 : this is equivalent to calling '
5509 \family typewriter
5557 \family typewriter
5510 %alias\SpecialChar ~
5558 %alias\SpecialChar ~
5511 <alias_def>
5559 <alias_def>
5512 \family default
5560 \family default
5513 ' at the IPython command line.
5561 ' at the IPython command line.
5514 This way, from within IPython you can do common system tasks without having
5562 This way, from within IPython you can do common system tasks without having
5515 to exit it or use the
5563 to exit it or use the
5516 \family typewriter
5564 \family typewriter
5517 !
5565 !
5518 \family default
5566 \family default
5519 escape.
5567 escape.
5520 IPython isn't meant to be a shell replacement, but it is often very useful
5568 IPython isn't meant to be a shell replacement, but it is often very useful
5521 to be able to do things with files while testing code.
5569 to be able to do things with files while testing code.
5522 This gives you the flexibility to have within IPython any aliases you may
5570 This gives you the flexibility to have within IPython any aliases you may
5523 be used to under your normal system shell.
5571 be used to under your normal system shell.
5524 \layout Subsection
5572 \layout Subsection
5525
5573
5526
5574
5527 \begin_inset LatexCommand \label{sec:ipytonrc-sample}
5575 \begin_inset LatexCommand \label{sec:ipytonrc-sample}
5528
5576
5529 \end_inset
5577 \end_inset
5530
5578
5531 Sample
5579 Sample
5532 \family typewriter
5580 \family typewriter
5533 ipythonrc
5581 ipythonrc
5534 \family default
5582 \family default
5535 file
5583 file
5536 \layout Standard
5584 \layout Standard
5537
5585
5538 The default rcfile, called
5586 The default rcfile, called
5539 \family typewriter
5587 \family typewriter
5540 ipythonrc
5588 ipythonrc
5541 \family default
5589 \family default
5542 and supplied in your
5590 and supplied in your
5543 \family typewriter
5591 \family typewriter
5544 IPYTHONDIR
5592 IPYTHONDIR
5545 \family default
5593 \family default
5546 directory contains lots of comments on all of these options.
5594 directory contains lots of comments on all of these options.
5547 We reproduce it here for reference:
5595 We reproduce it here for reference:
5548 \layout Standard
5596 \layout Standard
5549
5597
5550
5598
5551 \begin_inset ERT
5599 \begin_inset ERT
5552 status Open
5600 status Open
5553
5601
5554 \layout Standard
5602 \layout Standard
5555
5603
5556 \backslash
5604 \backslash
5557 codelist{../IPython/UserConfig/ipythonrc}
5605 codelist{../IPython/UserConfig/ipythonrc}
5558 \end_inset
5606 \end_inset
5559
5607
5560
5608
5561 \layout Subsection
5609 \layout Subsection
5562
5610
5563
5611
5564 \begin_inset LatexCommand \label{sec:prompts}
5612 \begin_inset LatexCommand \label{sec:prompts}
5565
5613
5566 \end_inset
5614 \end_inset
5567
5615
5568 Fine-tuning your prompt
5616 Fine-tuning your prompt
5569 \layout Standard
5617 \layout Standard
5570
5618
5571 IPython's prompts can be customized using a syntax similar to that of the
5619 IPython's prompts can be customized using a syntax similar to that of the
5572
5620
5573 \family typewriter
5621 \family typewriter
5574 bash
5622 bash
5575 \family default
5623 \family default
5576 shell.
5624 shell.
5577 Many of
5625 Many of
5578 \family typewriter
5626 \family typewriter
5579 bash
5627 bash
5580 \family default
5628 \family default
5581 's escapes are supported, as well as a few additional ones.
5629 's escapes are supported, as well as a few additional ones.
5582 We list them below:
5630 We list them below:
5583 \layout Description
5631 \layout Description
5584
5632
5585
5633
5586 \backslash
5634 \backslash
5587 # the prompt/history count number
5635 # the prompt/history count number
5588 \layout Description
5636 \layout Description
5589
5637
5590
5638
5591 \backslash
5639 \backslash
5592 D the prompt/history count, with the actual digits replaced by dots.
5640 D the prompt/history count, with the actual digits replaced by dots.
5593 Used mainly in continuation prompts (prompt_in2)
5641 Used mainly in continuation prompts (prompt_in2)
5594 \layout Description
5642 \layout Description
5595
5643
5596
5644
5597 \backslash
5645 \backslash
5598 w the current working directory
5646 w the current working directory
5599 \layout Description
5647 \layout Description
5600
5648
5601
5649
5602 \backslash
5650 \backslash
5603 W the basename of current working directory
5651 W the basename of current working directory
5604 \layout Description
5652 \layout Description
5605
5653
5606
5654
5607 \backslash
5655 \backslash
5608 X
5656 X
5609 \emph on
5657 \emph on
5610 n
5658 n
5611 \emph default
5659 \emph default
5612 where
5660 where
5613 \begin_inset Formula $n=0\ldots5.$
5661 \begin_inset Formula $n=0\ldots5.$
5614 \end_inset
5662 \end_inset
5615
5663
5616 The current working directory, with
5664 The current working directory, with
5617 \family typewriter
5665 \family typewriter
5618 $HOME
5666 $HOME
5619 \family default
5667 \family default
5620 replaced by
5668 replaced by
5621 \family typewriter
5669 \family typewriter
5622 ~
5670 ~
5623 \family default
5671 \family default
5624 , and filtered out to contain only
5672 , and filtered out to contain only
5625 \begin_inset Formula $n$
5673 \begin_inset Formula $n$
5626 \end_inset
5674 \end_inset
5627
5675
5628 path elements
5676 path elements
5629 \layout Description
5677 \layout Description
5630
5678
5631
5679
5632 \backslash
5680 \backslash
5633 Y
5681 Y
5634 \emph on
5682 \emph on
5635 n
5683 n
5636 \emph default
5684 \emph default
5637 Similar to
5685 Similar to
5638 \backslash
5686 \backslash
5639 X
5687 X
5640 \emph on
5688 \emph on
5641 n
5689 n
5642 \emph default
5690 \emph default
5643 , but with the
5691 , but with the
5644 \begin_inset Formula $n+1$
5692 \begin_inset Formula $n+1$
5645 \end_inset
5693 \end_inset
5646
5694
5647 element included if it is
5695 element included if it is
5648 \family typewriter
5696 \family typewriter
5649 ~
5697 ~
5650 \family default
5698 \family default
5651 (this is similar to the behavior of the %c
5699 (this is similar to the behavior of the %c
5652 \emph on
5700 \emph on
5653 n
5701 n
5654 \emph default
5702 \emph default
5655 escapes in
5703 escapes in
5656 \family typewriter
5704 \family typewriter
5657 tcsh
5705 tcsh
5658 \family default
5706 \family default
5659 )
5707 )
5660 \layout Description
5708 \layout Description
5661
5709
5662
5710
5663 \backslash
5711 \backslash
5664 u the username of the current user
5712 u the username of the current user
5665 \layout Description
5713 \layout Description
5666
5714
5667
5715
5668 \backslash
5716 \backslash
5669 $ if the effective UID is 0, a #, otherwise a $
5717 $ if the effective UID is 0, a #, otherwise a $
5670 \layout Description
5718 \layout Description
5671
5719
5672
5720
5673 \backslash
5721 \backslash
5674 h the hostname up to the first `.'
5722 h the hostname up to the first `.'
5675 \layout Description
5723 \layout Description
5676
5724
5677
5725
5678 \backslash
5726 \backslash
5679 H the hostname
5727 H the hostname
5680 \layout Description
5728 \layout Description
5681
5729
5682
5730
5683 \backslash
5731 \backslash
5684 n a newline
5732 n a newline
5685 \layout Description
5733 \layout Description
5686
5734
5687
5735
5688 \backslash
5736 \backslash
5689 r a carriage return
5737 r a carriage return
5690 \layout Description
5738 \layout Description
5691
5739
5692
5740
5693 \backslash
5741 \backslash
5694 v IPython version string
5742 v IPython version string
5695 \layout Standard
5743 \layout Standard
5696
5744
5697 In addition to these, ANSI color escapes can be insterted into the prompts,
5745 In addition to these, ANSI color escapes can be insterted into the prompts,
5698 as
5746 as
5699 \family typewriter
5747 \family typewriter
5700
5748
5701 \backslash
5749 \backslash
5702 C_
5750 C_
5703 \emph on
5751 \emph on
5704 ColorName
5752 ColorName
5705 \family default
5753 \family default
5706 \emph default
5754 \emph default
5707 .
5755 .
5708 The list of valid color names is: Black, Blue, Brown, Cyan, DarkGray, Green,
5756 The list of valid color names is: Black, Blue, Brown, Cyan, DarkGray, Green,
5709 LightBlue, LightCyan, LightGray, LightGreen, LightPurple, LightRed, NoColor,
5757 LightBlue, LightCyan, LightGray, LightGreen, LightPurple, LightRed, NoColor,
5710 Normal, Purple, Red, White, Yellow.
5758 Normal, Purple, Red, White, Yellow.
5711 \layout Standard
5759 \layout Standard
5712
5760
5713 Finally, IPython supports the evaluation of arbitrary expressions in your
5761 Finally, IPython supports the evaluation of arbitrary expressions in your
5714 prompt string.
5762 prompt string.
5715 The prompt strings are evaluated through the syntax of PEP 215, but basically
5763 The prompt strings are evaluated through the syntax of PEP 215, but basically
5716 you can use
5764 you can use
5717 \family typewriter
5765 \family typewriter
5718 $x.y
5766 $x.y
5719 \family default
5767 \family default
5720 to expand the value of
5768 to expand the value of
5721 \family typewriter
5769 \family typewriter
5722 x.y
5770 x.y
5723 \family default
5771 \family default
5724 , and for more complicated expressions you can use braces:
5772 , and for more complicated expressions you can use braces:
5725 \family typewriter
5773 \family typewriter
5726 ${foo()+x}
5774 ${foo()+x}
5727 \family default
5775 \family default
5728 will call function
5776 will call function
5729 \family typewriter
5777 \family typewriter
5730 foo
5778 foo
5731 \family default
5779 \family default
5732 and add to it the value of
5780 and add to it the value of
5733 \family typewriter
5781 \family typewriter
5734 x
5782 x
5735 \family default
5783 \family default
5736 , before putting the result into your prompt.
5784 , before putting the result into your prompt.
5737 For example, using
5785 For example, using
5738 \newline
5786 \newline
5739
5787
5740 \family typewriter
5788 \family typewriter
5741 prompt_in1 '${commands.getoutput("uptime")}
5789 prompt_in1 '${commands.getoutput("uptime")}
5742 \backslash
5790 \backslash
5743 nIn [
5791 nIn [
5744 \backslash
5792 \backslash
5745 #]: '
5793 #]: '
5746 \newline
5794 \newline
5747
5795
5748 \family default
5796 \family default
5749 will print the result of the uptime command on each prompt (assuming the
5797 will print the result of the uptime command on each prompt (assuming the
5750
5798
5751 \family typewriter
5799 \family typewriter
5752 commands
5800 commands
5753 \family default
5801 \family default
5754 module has been imported in your
5802 module has been imported in your
5755 \family typewriter
5803 \family typewriter
5756 ipythonrc
5804 ipythonrc
5757 \family default
5805 \family default
5758 file).
5806 file).
5759 \layout Subsubsection
5807 \layout Subsubsection
5760
5808
5761 Prompt examples
5809 Prompt examples
5762 \layout Standard
5810 \layout Standard
5763
5811
5764 The following options in an ipythonrc file will give you IPython's default
5812 The following options in an ipythonrc file will give you IPython's default
5765 prompts:
5813 prompts:
5766 \layout Standard
5814 \layout Standard
5767
5815
5768
5816
5769 \family typewriter
5817 \family typewriter
5770 prompt_in1 'In [
5818 prompt_in1 'In [
5771 \backslash
5819 \backslash
5772 #]:'
5820 #]:'
5773 \newline
5821 \newline
5774 prompt_in2 '\SpecialChar ~
5822 prompt_in2 '\SpecialChar ~
5775 \SpecialChar ~
5823 \SpecialChar ~
5776 \SpecialChar ~
5824 \SpecialChar ~
5777 .
5825 .
5778 \backslash
5826 \backslash
5779 D.:'
5827 D.:'
5780 \newline
5828 \newline
5781 prompt_out 'Out[
5829 prompt_out 'Out[
5782 \backslash
5830 \backslash
5783 #]:'
5831 #]:'
5784 \layout Standard
5832 \layout Standard
5785
5833
5786 which look like this:
5834 which look like this:
5787 \layout Standard
5835 \layout Standard
5788
5836
5789
5837
5790 \family typewriter
5838 \family typewriter
5791 In [1]: 1+2
5839 In [1]: 1+2
5792 \newline
5840 \newline
5793 Out[1]: 3
5841 Out[1]: 3
5794 \layout Standard
5842 \layout Standard
5795
5843
5796
5844
5797 \family typewriter
5845 \family typewriter
5798 In [2]: for i in (1,2,3):
5846 In [2]: for i in (1,2,3):
5799 \newline
5847 \newline
5800
5848
5801 \begin_inset ERT
5849 \begin_inset ERT
5802 status Collapsed
5850 status Collapsed
5803
5851
5804 \layout Standard
5852 \layout Standard
5805
5853
5806 \backslash
5854 \backslash
5807 hspace*{0mm}
5855 hspace*{0mm}
5808 \end_inset
5856 \end_inset
5809
5857
5810 \SpecialChar ~
5858 \SpecialChar ~
5811 \SpecialChar ~
5859 \SpecialChar ~
5812 \SpecialChar ~
5860 \SpecialChar ~
5813 ...: \SpecialChar ~
5861 ...: \SpecialChar ~
5814 \SpecialChar ~
5862 \SpecialChar ~
5815 \SpecialChar ~
5863 \SpecialChar ~
5816 \SpecialChar ~
5864 \SpecialChar ~
5817 print i,
5865 print i,
5818 \newline
5866 \newline
5819
5867
5820 \begin_inset ERT
5868 \begin_inset ERT
5821 status Collapsed
5869 status Collapsed
5822
5870
5823 \layout Standard
5871 \layout Standard
5824
5872
5825 \backslash
5873 \backslash
5826 hspace*{0mm}
5874 hspace*{0mm}
5827 \end_inset
5875 \end_inset
5828
5876
5829 \SpecialChar ~
5877 \SpecialChar ~
5830 \SpecialChar ~
5878 \SpecialChar ~
5831 \SpecialChar ~
5879 \SpecialChar ~
5832 ...:
5880 ...:
5833 \newline
5881 \newline
5834 1 2 3
5882 1 2 3
5835 \layout Standard
5883 \layout Standard
5836
5884
5837 These will give you a very colorful prompt with path information:
5885 These will give you a very colorful prompt with path information:
5838 \layout Standard
5886 \layout Standard
5839
5887
5840
5888
5841 \family typewriter
5889 \family typewriter
5842 #prompt_in1 '
5890 #prompt_in1 '
5843 \backslash
5891 \backslash
5844 C_Red
5892 C_Red
5845 \backslash
5893 \backslash
5846 u
5894 u
5847 \backslash
5895 \backslash
5848 C_Blue[
5896 C_Blue[
5849 \backslash
5897 \backslash
5850 C_Cyan
5898 C_Cyan
5851 \backslash
5899 \backslash
5852 Y1
5900 Y1
5853 \backslash
5901 \backslash
5854 C_Blue]
5902 C_Blue]
5855 \backslash
5903 \backslash
5856 C_LightGreen
5904 C_LightGreen
5857 \backslash
5905 \backslash
5858 #>'
5906 #>'
5859 \newline
5907 \newline
5860 prompt_in2 ' ..
5908 prompt_in2 ' ..
5861 \backslash
5909 \backslash
5862 D>'
5910 D>'
5863 \newline
5911 \newline
5864 prompt_out '<
5912 prompt_out '<
5865 \backslash
5913 \backslash
5866 #>'
5914 #>'
5867 \layout Standard
5915 \layout Standard
5868
5916
5869 which look like this:
5917 which look like this:
5870 \layout Standard
5918 \layout Standard
5871
5919
5872
5920
5873 \family typewriter
5921 \family typewriter
5874 \color red
5922 \color red
5875 fperez
5923 fperez
5876 \color blue
5924 \color blue
5877 [
5925 [
5878 \color cyan
5926 \color cyan
5879 ~/ipython
5927 ~/ipython
5880 \color blue
5928 \color blue
5881 ]
5929 ]
5882 \color green
5930 \color green
5883 1>
5931 1>
5884 \color default
5932 \color default
5885 1+2
5933 1+2
5886 \newline
5934 \newline
5887
5935
5888 \begin_inset ERT
5936 \begin_inset ERT
5889 status Collapsed
5937 status Collapsed
5890
5938
5891 \layout Standard
5939 \layout Standard
5892
5940
5893 \backslash
5941 \backslash
5894 hspace*{0mm}
5942 hspace*{0mm}
5895 \end_inset
5943 \end_inset
5896
5944
5897 \SpecialChar ~
5945 \SpecialChar ~
5898 \SpecialChar ~
5946 \SpecialChar ~
5899 \SpecialChar ~
5947 \SpecialChar ~
5900 \SpecialChar ~
5948 \SpecialChar ~
5901 \SpecialChar ~
5949 \SpecialChar ~
5902 \SpecialChar ~
5950 \SpecialChar ~
5903 \SpecialChar ~
5951 \SpecialChar ~
5904 \SpecialChar ~
5952 \SpecialChar ~
5905 \SpecialChar ~
5953 \SpecialChar ~
5906 \SpecialChar ~
5954 \SpecialChar ~
5907 \SpecialChar ~
5955 \SpecialChar ~
5908 \SpecialChar ~
5956 \SpecialChar ~
5909 \SpecialChar ~
5957 \SpecialChar ~
5910 \SpecialChar ~
5958 \SpecialChar ~
5911 \SpecialChar ~
5959 \SpecialChar ~
5912 \SpecialChar ~
5960 \SpecialChar ~
5913
5961
5914 \color red
5962 \color red
5915 <1>
5963 <1>
5916 \color default
5964 \color default
5917 3
5965 3
5918 \newline
5966 \newline
5919
5967
5920 \color red
5968 \color red
5921 fperez
5969 fperez
5922 \color blue
5970 \color blue
5923 [
5971 [
5924 \color cyan
5972 \color cyan
5925 ~/ipython
5973 ~/ipython
5926 \color blue
5974 \color blue
5927 ]
5975 ]
5928 \color green
5976 \color green
5929 2>
5977 2>
5930 \color default
5978 \color default
5931 for i in (1,2,3):
5979 for i in (1,2,3):
5932 \newline
5980 \newline
5933
5981
5934 \begin_inset ERT
5982 \begin_inset ERT
5935 status Collapsed
5983 status Collapsed
5936
5984
5937 \layout Standard
5985 \layout Standard
5938
5986
5939 \backslash
5987 \backslash
5940 hspace*{0mm}
5988 hspace*{0mm}
5941 \end_inset
5989 \end_inset
5942
5990
5943 \SpecialChar ~
5991 \SpecialChar ~
5944 \SpecialChar ~
5992 \SpecialChar ~
5945 \SpecialChar ~
5993 \SpecialChar ~
5946 \SpecialChar ~
5994 \SpecialChar ~
5947 \SpecialChar ~
5995 \SpecialChar ~
5948 \SpecialChar ~
5996 \SpecialChar ~
5949 \SpecialChar ~
5997 \SpecialChar ~
5950 \SpecialChar ~
5998 \SpecialChar ~
5951 \SpecialChar ~
5999 \SpecialChar ~
5952 \SpecialChar ~
6000 \SpecialChar ~
5953 \SpecialChar ~
6001 \SpecialChar ~
5954 \SpecialChar ~
6002 \SpecialChar ~
5955 \SpecialChar ~
6003 \SpecialChar ~
5956 \SpecialChar ~
6004 \SpecialChar ~
5957 \SpecialChar ~
6005 \SpecialChar ~
5958
6006
5959 \color green
6007 \color green
5960 ...>
6008 ...>
5961 \color default
6009 \color default
5962 \SpecialChar ~
6010 \SpecialChar ~
5963 \SpecialChar ~
6011 \SpecialChar ~
5964 \SpecialChar ~
6012 \SpecialChar ~
5965 \SpecialChar ~
6013 \SpecialChar ~
5966 print i,
6014 print i,
5967 \newline
6015 \newline
5968
6016
5969 \begin_inset ERT
6017 \begin_inset ERT
5970 status Collapsed
6018 status Collapsed
5971
6019
5972 \layout Standard
6020 \layout Standard
5973
6021
5974 \backslash
6022 \backslash
5975 hspace*{0mm}
6023 hspace*{0mm}
5976 \end_inset
6024 \end_inset
5977
6025
5978 \SpecialChar ~
6026 \SpecialChar ~
5979 \SpecialChar ~
6027 \SpecialChar ~
5980 \SpecialChar ~
6028 \SpecialChar ~
5981 \SpecialChar ~
6029 \SpecialChar ~
5982 \SpecialChar ~
6030 \SpecialChar ~
5983 \SpecialChar ~
6031 \SpecialChar ~
5984 \SpecialChar ~
6032 \SpecialChar ~
5985 \SpecialChar ~
6033 \SpecialChar ~
5986 \SpecialChar ~
6034 \SpecialChar ~
5987 \SpecialChar ~
6035 \SpecialChar ~
5988 \SpecialChar ~
6036 \SpecialChar ~
5989 \SpecialChar ~
6037 \SpecialChar ~
5990 \SpecialChar ~
6038 \SpecialChar ~
5991 \SpecialChar ~
6039 \SpecialChar ~
5992 \SpecialChar ~
6040 \SpecialChar ~
5993
6041
5994 \color green
6042 \color green
5995 ...>
6043 ...>
5996 \color default
6044 \color default
5997
6045
5998 \newline
6046 \newline
5999 1 2 3
6047 1 2 3
6000 \layout Standard
6048 \layout Standard
6001
6049
6002 The following shows the usage of dynamic expression evaluation:
6050 The following shows the usage of dynamic expression evaluation:
6003 \layout Subsection
6051 \layout Subsection
6004
6052
6005
6053
6006 \begin_inset LatexCommand \label{sec:profiles}
6054 \begin_inset LatexCommand \label{sec:profiles}
6007
6055
6008 \end_inset
6056 \end_inset
6009
6057
6010 IPython profiles
6058 IPython profiles
6011 \layout Standard
6059 \layout Standard
6012
6060
6013 As we already mentioned, IPython supports the
6061 As we already mentioned, IPython supports the
6014 \family typewriter
6062 \family typewriter
6015 -profile
6063 -profile
6016 \family default
6064 \family default
6017 command-line option (see sec.
6065 command-line option (see sec.
6018
6066
6019 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
6067 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
6020
6068
6021 \end_inset
6069 \end_inset
6022
6070
6023 ).
6071 ).
6024 A profile is nothing more than a particular configuration file like your
6072 A profile is nothing more than a particular configuration file like your
6025 basic
6073 basic
6026 \family typewriter
6074 \family typewriter
6027 ipythonrc
6075 ipythonrc
6028 \family default
6076 \family default
6029 one, but with particular customizations for a specific purpose.
6077 one, but with particular customizations for a specific purpose.
6030 When you start IPython with '
6078 When you start IPython with '
6031 \family typewriter
6079 \family typewriter
6032 ipython -profile <name>
6080 ipython -profile <name>
6033 \family default
6081 \family default
6034 ', it assumes that in your
6082 ', it assumes that in your
6035 \family typewriter
6083 \family typewriter
6036 IPYTHONDIR
6084 IPYTHONDIR
6037 \family default
6085 \family default
6038 there is a file called
6086 there is a file called
6039 \family typewriter
6087 \family typewriter
6040 ipythonrc-<name>
6088 ipythonrc-<name>
6041 \family default
6089 \family default
6042 , and loads it instead of the normal
6090 , and loads it instead of the normal
6043 \family typewriter
6091 \family typewriter
6044 ipythonrc
6092 ipythonrc
6045 \family default
6093 \family default
6046 .
6094 .
6047 \layout Standard
6095 \layout Standard
6048
6096
6049 This system allows you to maintain multiple configurations which load modules,
6097 This system allows you to maintain multiple configurations which load modules,
6050 set options, define functions, etc.
6098 set options, define functions, etc.
6051 suitable for different tasks and activate them in a very simple manner.
6099 suitable for different tasks and activate them in a very simple manner.
6052 In order to avoid having to repeat all of your basic options (common things
6100 In order to avoid having to repeat all of your basic options (common things
6053 that don't change such as your color preferences, for example), any profile
6101 that don't change such as your color preferences, for example), any profile
6054 can include another configuration file.
6102 can include another configuration file.
6055 The most common way to use profiles is then to have each one include your
6103 The most common way to use profiles is then to have each one include your
6056 basic
6104 basic
6057 \family typewriter
6105 \family typewriter
6058 ipythonrc
6106 ipythonrc
6059 \family default
6107 \family default
6060 file as a starting point, and then add further customizations.
6108 file as a starting point, and then add further customizations.
6061 \layout Standard
6109 \layout Standard
6062
6110
6063 In sections
6111 In sections
6064 \begin_inset LatexCommand \ref{sec:syntax-extensions}
6112 \begin_inset LatexCommand \ref{sec:syntax-extensions}
6065
6113
6066 \end_inset
6114 \end_inset
6067
6115
6068 and
6116 and
6069 \begin_inset LatexCommand \ref{sec:Gnuplot}
6117 \begin_inset LatexCommand \ref{sec:Gnuplot}
6070
6118
6071 \end_inset
6119 \end_inset
6072
6120
6073 we discuss some particular profiles which come as part of the standard
6121 we discuss some particular profiles which come as part of the standard
6074 IPython distribution.
6122 IPython distribution.
6075 You may also look in your
6123 You may also look in your
6076 \family typewriter
6124 \family typewriter
6077 IPYTHONDIR
6125 IPYTHONDIR
6078 \family default
6126 \family default
6079 directory, any file whose name begins with
6127 directory, any file whose name begins with
6080 \family typewriter
6128 \family typewriter
6081 ipythonrc-
6129 ipythonrc-
6082 \family default
6130 \family default
6083 is a profile.
6131 is a profile.
6084 You can use those as examples for further customizations to suit your own
6132 You can use those as examples for further customizations to suit your own
6085 needs.
6133 needs.
6086 \layout Section
6134 \layout Section
6087
6135
6088
6136
6089 \begin_inset OptArg
6137 \begin_inset OptArg
6090 collapsed false
6138 collapsed false
6091
6139
6092 \layout Standard
6140 \layout Standard
6093
6141
6094 IPython as default...
6142 IPython as default...
6095 \end_inset
6143 \end_inset
6096
6144
6097 IPython as your default Python environment
6145 IPython as your default Python environment
6098 \layout Standard
6146 \layout Standard
6099
6147
6100 Python honors the environment variable
6148 Python honors the environment variable
6101 \family typewriter
6149 \family typewriter
6102 PYTHONSTARTUP
6150 PYTHONSTARTUP
6103 \family default
6151 \family default
6104 and will execute at startup the file referenced by this variable.
6152 and will execute at startup the file referenced by this variable.
6105 If you put at the end of this file the following two lines of code:
6153 If you put at the end of this file the following two lines of code:
6106 \layout Standard
6154 \layout Standard
6107
6155
6108
6156
6109 \family typewriter
6157 \family typewriter
6110 import IPython
6158 import IPython
6111 \newline
6159 \newline
6112 IPython.Shell.IPShell().mainloop(sys_exit=1)
6160 IPython.Shell.IPShell().mainloop(sys_exit=1)
6113 \layout Standard
6161 \layout Standard
6114
6162
6115 then IPython will be your working environment anytime you start Python.
6163 then IPython will be your working environment anytime you start Python.
6116 The
6164 The
6117 \family typewriter
6165 \family typewriter
6118 sys_exit=1
6166 sys_exit=1
6119 \family default
6167 \family default
6120 is needed to have IPython issue a call to
6168 is needed to have IPython issue a call to
6121 \family typewriter
6169 \family typewriter
6122 sys.exit()
6170 sys.exit()
6123 \family default
6171 \family default
6124 when it finishes, otherwise you'll be back at the normal Python '
6172 when it finishes, otherwise you'll be back at the normal Python '
6125 \family typewriter
6173 \family typewriter
6126 >>>
6174 >>>
6127 \family default
6175 \family default
6128 ' prompt
6176 ' prompt
6129 \begin_inset Foot
6177 \begin_inset Foot
6130 collapsed true
6178 collapsed true
6131
6179
6132 \layout Standard
6180 \layout Standard
6133
6181
6134 Based on an idea by Holger Krekel.
6182 Based on an idea by Holger Krekel.
6135 \end_inset
6183 \end_inset
6136
6184
6137 .
6185 .
6138 \layout Standard
6186 \layout Standard
6139
6187
6140 This is probably useful to developers who manage multiple Python versions
6188 This is probably useful to developers who manage multiple Python versions
6141 and don't want to have correspondingly multiple IPython versions.
6189 and don't want to have correspondingly multiple IPython versions.
6142 Note that in this mode, there is no way to pass IPython any command-line
6190 Note that in this mode, there is no way to pass IPython any command-line
6143 options, as those are trapped first by Python itself.
6191 options, as those are trapped first by Python itself.
6144 \layout Section
6192 \layout Section
6145
6193
6146
6194
6147 \begin_inset LatexCommand \label{sec:embed}
6195 \begin_inset LatexCommand \label{sec:embed}
6148
6196
6149 \end_inset
6197 \end_inset
6150
6198
6151 Embedding IPython
6199 Embedding IPython
6152 \layout Standard
6200 \layout Standard
6153
6201
6154 It is possible to start an IPython instance
6202 It is possible to start an IPython instance
6155 \emph on
6203 \emph on
6156 inside
6204 inside
6157 \emph default
6205 \emph default
6158 your own Python programs.
6206 your own Python programs.
6159 This allows you to evaluate dynamically the state of your code, operate
6207 This allows you to evaluate dynamically the state of your code, operate
6160 with your variables, analyze them, etc.
6208 with your variables, analyze them, etc.
6161 Note however that any changes you make to values while in the shell do
6209 Note however that any changes you make to values while in the shell do
6162
6210
6163 \emph on
6211 \emph on
6164 not
6212 not
6165 \emph default
6213 \emph default
6166 propagate back to the running code, so it is safe to modify your values
6214 propagate back to the running code, so it is safe to modify your values
6167 because you won't break your code in bizarre ways by doing so.
6215 because you won't break your code in bizarre ways by doing so.
6168 \layout Standard
6216 \layout Standard
6169
6217
6170 This feature allows you to easily have a fully functional python environment
6218 This feature allows you to easily have a fully functional python environment
6171 for doing object introspection anywhere in your code with a simple function
6219 for doing object introspection anywhere in your code with a simple function
6172 call.
6220 call.
6173 In some cases a simple print statement is enough, but if you need to do
6221 In some cases a simple print statement is enough, but if you need to do
6174 more detailed analysis of a code fragment this feature can be very valuable.
6222 more detailed analysis of a code fragment this feature can be very valuable.
6175 \layout Standard
6223 \layout Standard
6176
6224
6177 It can also be useful in scientific computing situations where it is common
6225 It can also be useful in scientific computing situations where it is common
6178 to need to do some automatic, computationally intensive part and then stop
6226 to need to do some automatic, computationally intensive part and then stop
6179 to look at data, plots, etc
6227 to look at data, plots, etc
6180 \begin_inset Foot
6228 \begin_inset Foot
6181 collapsed true
6229 collapsed true
6182
6230
6183 \layout Standard
6231 \layout Standard
6184
6232
6185 This functionality was inspired by IDL's combination of the
6233 This functionality was inspired by IDL's combination of the
6186 \family typewriter
6234 \family typewriter
6187 stop
6235 stop
6188 \family default
6236 \family default
6189 keyword and the
6237 keyword and the
6190 \family typewriter
6238 \family typewriter
6191 .continue
6239 .continue
6192 \family default
6240 \family default
6193 executive command, which I have found very useful in the past, and by a
6241 executive command, which I have found very useful in the past, and by a
6194 posting on comp.lang.python by cmkl <cmkleffner-AT-gmx.de> on Dec.
6242 posting on comp.lang.python by cmkl <cmkleffner-AT-gmx.de> on Dec.
6195 06/01 concerning similar uses of pyrepl.
6243 06/01 concerning similar uses of pyrepl.
6196 \end_inset
6244 \end_inset
6197
6245
6198 .
6246 .
6199 Opening an IPython instance will give you full access to your data and
6247 Opening an IPython instance will give you full access to your data and
6200 functions, and you can resume program execution once you are done with
6248 functions, and you can resume program execution once you are done with
6201 the interactive part (perhaps to stop again later, as many times as needed).
6249 the interactive part (perhaps to stop again later, as many times as needed).
6202 \layout Standard
6250 \layout Standard
6203
6251
6204 The following code snippet is the bare minimum you need to include in your
6252 The following code snippet is the bare minimum you need to include in your
6205 Python programs for this to work (detailed examples follow later):
6253 Python programs for this to work (detailed examples follow later):
6206 \layout LyX-Code
6254 \layout LyX-Code
6207
6255
6208 from IPython.Shell import IPShellEmbed
6256 from IPython.Shell import IPShellEmbed
6209 \layout LyX-Code
6257 \layout LyX-Code
6210
6258
6211 ipshell = IPShellEmbed()
6259 ipshell = IPShellEmbed()
6212 \layout LyX-Code
6260 \layout LyX-Code
6213
6261
6214 ipshell() # this call anywhere in your program will start IPython
6262 ipshell() # this call anywhere in your program will start IPython
6215 \layout Standard
6263 \layout Standard
6216
6264
6217 You can run embedded instances even in code which is itself being run at
6265 You can run embedded instances even in code which is itself being run at
6218 the IPython interactive prompt with '
6266 the IPython interactive prompt with '
6219 \family typewriter
6267 \family typewriter
6220 %run\SpecialChar ~
6268 %run\SpecialChar ~
6221 <filename>
6269 <filename>
6222 \family default
6270 \family default
6223 '.
6271 '.
6224 Since it's easy to get lost as to where you are (in your top-level IPython
6272 Since it's easy to get lost as to where you are (in your top-level IPython
6225 or in your embedded one), it's a good idea in such cases to set the in/out
6273 or in your embedded one), it's a good idea in such cases to set the in/out
6226 prompts to something different for the embedded instances.
6274 prompts to something different for the embedded instances.
6227 The code examples below illustrate this.
6275 The code examples below illustrate this.
6228 \layout Standard
6276 \layout Standard
6229
6277
6230 You can also have multiple IPython instances in your program and open them
6278 You can also have multiple IPython instances in your program and open them
6231 separately, for example with different options for data presentation.
6279 separately, for example with different options for data presentation.
6232 If you close and open the same instance multiple times, its prompt counters
6280 If you close and open the same instance multiple times, its prompt counters
6233 simply continue from each execution to the next.
6281 simply continue from each execution to the next.
6234 \layout Standard
6282 \layout Standard
6235
6283
6236 Please look at the docstrings in the
6284 Please look at the docstrings in the
6237 \family typewriter
6285 \family typewriter
6238 Shell.py
6286 Shell.py
6239 \family default
6287 \family default
6240 module for more details on the use of this system.
6288 module for more details on the use of this system.
6241 \layout Standard
6289 \layout Standard
6242
6290
6243 The following sample file illustrating how to use the embedding functionality
6291 The following sample file illustrating how to use the embedding functionality
6244 is provided in the examples directory as
6292 is provided in the examples directory as
6245 \family typewriter
6293 \family typewriter
6246 example-embed.py
6294 example-embed.py
6247 \family default
6295 \family default
6248 .
6296 .
6249 It should be fairly self-explanatory:
6297 It should be fairly self-explanatory:
6250 \layout Standard
6298 \layout Standard
6251
6299
6252
6300
6253 \begin_inset ERT
6301 \begin_inset ERT
6254 status Open
6302 status Open
6255
6303
6256 \layout Standard
6304 \layout Standard
6257
6305
6258 \backslash
6306 \backslash
6259 codelist{examples/example-embed.py}
6307 codelist{examples/example-embed.py}
6260 \end_inset
6308 \end_inset
6261
6309
6262
6310
6263 \layout Standard
6311 \layout Standard
6264
6312
6265 Once you understand how the system functions, you can use the following
6313 Once you understand how the system functions, you can use the following
6266 code fragments in your programs which are ready for cut and paste:
6314 code fragments in your programs which are ready for cut and paste:
6267 \layout Standard
6315 \layout Standard
6268
6316
6269
6317
6270 \begin_inset ERT
6318 \begin_inset ERT
6271 status Open
6319 status Open
6272
6320
6273 \layout Standard
6321 \layout Standard
6274
6322
6275 \backslash
6323 \backslash
6276 codelist{examples/example-embed-short.py}
6324 codelist{examples/example-embed-short.py}
6277 \end_inset
6325 \end_inset
6278
6326
6279
6327
6280 \layout Section
6328 \layout Section
6281
6329
6282
6330
6283 \begin_inset LatexCommand \label{sec:using-pdb}
6331 \begin_inset LatexCommand \label{sec:using-pdb}
6284
6332
6285 \end_inset
6333 \end_inset
6286
6334
6287 Using the Python debugger (
6335 Using the Python debugger (
6288 \family typewriter
6336 \family typewriter
6289 pdb
6337 pdb
6290 \family default
6338 \family default
6291 )
6339 )
6292 \layout Subsection
6340 \layout Subsection
6293
6341
6294 Running entire programs via
6342 Running entire programs via
6295 \family typewriter
6343 \family typewriter
6296 pdb
6344 pdb
6297 \layout Standard
6345 \layout Standard
6298
6346
6299
6347
6300 \family typewriter
6348 \family typewriter
6301 pdb
6349 pdb
6302 \family default
6350 \family default
6303 , the Python debugger, is a powerful interactive debugger which allows you
6351 , the Python debugger, is a powerful interactive debugger which allows you
6304 to step through code, set breakpoints, watch variables, etc.
6352 to step through code, set breakpoints, watch variables, etc.
6305 IPython makes it very easy to start any script under the control of
6353 IPython makes it very easy to start any script under the control of
6306 \family typewriter
6354 \family typewriter
6307 pdb
6355 pdb
6308 \family default
6356 \family default
6309 , regardless of whether you have wrapped it into a
6357 , regardless of whether you have wrapped it into a
6310 \family typewriter
6358 \family typewriter
6311 `main()'
6359 `main()'
6312 \family default
6360 \family default
6313 function or not.
6361 function or not.
6314 For this, simply type
6362 For this, simply type
6315 \family typewriter
6363 \family typewriter
6316 `%run -d myscript'
6364 `%run -d myscript'
6317 \family default
6365 \family default
6318 at an IPython prompt.
6366 at an IPython prompt.
6319 See the
6367 See the
6320 \family typewriter
6368 \family typewriter
6321 %run
6369 %run
6322 \family default
6370 \family default
6323 command's documentation (via
6371 command's documentation (via
6324 \family typewriter
6372 \family typewriter
6325 `%run?'
6373 `%run?'
6326 \family default
6374 \family default
6327 or in Sec.\SpecialChar ~
6375 or in Sec.\SpecialChar ~
6328
6376
6329 \begin_inset LatexCommand \ref{sec:magic}
6377 \begin_inset LatexCommand \ref{sec:magic}
6330
6378
6331 \end_inset
6379 \end_inset
6332
6380
6333 ) for more details, including how to control where
6381 ) for more details, including how to control where
6334 \family typewriter
6382 \family typewriter
6335 pdb
6383 pdb
6336 \family default
6384 \family default
6337 will stop execution first.
6385 will stop execution first.
6338 \layout Standard
6386 \layout Standard
6339
6387
6340 For more information on the use of the
6388 For more information on the use of the
6341 \family typewriter
6389 \family typewriter
6342 pdb
6390 pdb
6343 \family default
6391 \family default
6344 debugger, read the included
6392 debugger, read the included
6345 \family typewriter
6393 \family typewriter
6346 pdb.doc
6394 pdb.doc
6347 \family default
6395 \family default
6348 file (part of the standard Python distribution).
6396 file (part of the standard Python distribution).
6349 On a stock Linux system it is located at
6397 On a stock Linux system it is located at
6350 \family typewriter
6398 \family typewriter
6351 /usr/lib/python2.3/pdb.doc
6399 /usr/lib/python2.3/pdb.doc
6352 \family default
6400 \family default
6353 , but the easiest way to read it is by using the
6401 , but the easiest way to read it is by using the
6354 \family typewriter
6402 \family typewriter
6355 help()
6403 help()
6356 \family default
6404 \family default
6357 function of the
6405 function of the
6358 \family typewriter
6406 \family typewriter
6359 pdb
6407 pdb
6360 \family default
6408 \family default
6361 module as follows (in an IPython prompt):
6409 module as follows (in an IPython prompt):
6362 \layout Standard
6410 \layout Standard
6363
6411
6364
6412
6365 \family typewriter
6413 \family typewriter
6366 In [1]: import pdb
6414 In [1]: import pdb
6367 \newline
6415 \newline
6368 In [2]: pdb.help()
6416 In [2]: pdb.help()
6369 \layout Standard
6417 \layout Standard
6370
6418
6371 This will load the
6419 This will load the
6372 \family typewriter
6420 \family typewriter
6373 pdb.doc
6421 pdb.doc
6374 \family default
6422 \family default
6375 document in a file viewer for you automatically.
6423 document in a file viewer for you automatically.
6376 \layout Subsection
6424 \layout Subsection
6377
6425
6378 Automatic invocation of
6426 Automatic invocation of
6379 \family typewriter
6427 \family typewriter
6380 pdb
6428 pdb
6381 \family default
6429 \family default
6382 on exceptions
6430 on exceptions
6383 \layout Standard
6431 \layout Standard
6384
6432
6385 IPython, if started with the
6433 IPython, if started with the
6386 \family typewriter
6434 \family typewriter
6387 -pdb
6435 -pdb
6388 \family default
6436 \family default
6389 option (or if the option is set in your rc file) can call the Python
6437 option (or if the option is set in your rc file) can call the Python
6390 \family typewriter
6438 \family typewriter
6391 pdb
6439 pdb
6392 \family default
6440 \family default
6393 debugger every time your code triggers an uncaught exception
6441 debugger every time your code triggers an uncaught exception
6394 \begin_inset Foot
6442 \begin_inset Foot
6395 collapsed true
6443 collapsed true
6396
6444
6397 \layout Standard
6445 \layout Standard
6398
6446
6399 Many thanks to Christopher Hart for the request which prompted adding this
6447 Many thanks to Christopher Hart for the request which prompted adding this
6400 feature to IPython.
6448 feature to IPython.
6401 \end_inset
6449 \end_inset
6402
6450
6403 .
6451 .
6404 This feature can also be toggled at any time with the
6452 This feature can also be toggled at any time with the
6405 \family typewriter
6453 \family typewriter
6406 %pdb
6454 %pdb
6407 \family default
6455 \family default
6408 magic command.
6456 magic command.
6409 This can be extremely useful in order to find the origin of subtle bugs,
6457 This can be extremely useful in order to find the origin of subtle bugs,
6410 because
6458 because
6411 \family typewriter
6459 \family typewriter
6412 pdb
6460 pdb
6413 \family default
6461 \family default
6414 opens up at the point in your code which triggered the exception, and while
6462 opens up at the point in your code which triggered the exception, and while
6415 your program is at this point `dead', all the data is still available and
6463 your program is at this point `dead', all the data is still available and
6416 you can walk up and down the stack frame and understand the origin of the
6464 you can walk up and down the stack frame and understand the origin of the
6417 problem.
6465 problem.
6418 \layout Standard
6466 \layout Standard
6419
6467
6420 Furthermore, you can use these debugging facilities both with the embedded
6468 Furthermore, you can use these debugging facilities both with the embedded
6421 IPython mode and without IPython at all.
6469 IPython mode and without IPython at all.
6422 For an embedded shell (see sec.
6470 For an embedded shell (see sec.
6423
6471
6424 \begin_inset LatexCommand \ref{sec:embed}
6472 \begin_inset LatexCommand \ref{sec:embed}
6425
6473
6426 \end_inset
6474 \end_inset
6427
6475
6428 ), simply call the constructor with
6476 ), simply call the constructor with
6429 \family typewriter
6477 \family typewriter
6430 `-pdb'
6478 `-pdb'
6431 \family default
6479 \family default
6432 in the argument string and automatically
6480 in the argument string and automatically
6433 \family typewriter
6481 \family typewriter
6434 pdb
6482 pdb
6435 \family default
6483 \family default
6436 will be called if an uncaught exception is triggered by your code.
6484 will be called if an uncaught exception is triggered by your code.
6437
6485
6438 \layout Standard
6486 \layout Standard
6439
6487
6440 For stand-alone use of the feature in your programs which do not use IPython
6488 For stand-alone use of the feature in your programs which do not use IPython
6441 at all, put the following lines toward the top of your `main' routine:
6489 at all, put the following lines toward the top of your `main' routine:
6442 \layout Standard
6490 \layout Standard
6443 \align left
6491 \align left
6444
6492
6445 \family typewriter
6493 \family typewriter
6446 import sys,IPython.ultraTB
6494 import sys,IPython.ultraTB
6447 \newline
6495 \newline
6448 sys.excepthook = IPython.ultraTB.FormattedTB(mode=`Verbose', color_scheme=`Linux',
6496 sys.excepthook = IPython.ultraTB.FormattedTB(mode=`Verbose', color_scheme=`Linux',
6449 call_pdb=1)
6497 call_pdb=1)
6450 \layout Standard
6498 \layout Standard
6451
6499
6452 The
6500 The
6453 \family typewriter
6501 \family typewriter
6454 mode
6502 mode
6455 \family default
6503 \family default
6456 keyword can be either
6504 keyword can be either
6457 \family typewriter
6505 \family typewriter
6458 `Verbose'
6506 `Verbose'
6459 \family default
6507 \family default
6460 or
6508 or
6461 \family typewriter
6509 \family typewriter
6462 `Plain'
6510 `Plain'
6463 \family default
6511 \family default
6464 , giving either very detailed or normal tracebacks respectively.
6512 , giving either very detailed or normal tracebacks respectively.
6465 The
6513 The
6466 \family typewriter
6514 \family typewriter
6467 color_scheme
6515 color_scheme
6468 \family default
6516 \family default
6469 keyword can be one of
6517 keyword can be one of
6470 \family typewriter
6518 \family typewriter
6471 `NoColor'
6519 `NoColor'
6472 \family default
6520 \family default
6473 ,
6521 ,
6474 \family typewriter
6522 \family typewriter
6475 `Linux'
6523 `Linux'
6476 \family default
6524 \family default
6477 (default) or
6525 (default) or
6478 \family typewriter
6526 \family typewriter
6479 `LightBG'
6527 `LightBG'
6480 \family default
6528 \family default
6481 .
6529 .
6482 These are the same options which can be set in IPython with
6530 These are the same options which can be set in IPython with
6483 \family typewriter
6531 \family typewriter
6484 -colors
6532 -colors
6485 \family default
6533 \family default
6486 and
6534 and
6487 \family typewriter
6535 \family typewriter
6488 -xmode
6536 -xmode
6489 \family default
6537 \family default
6490 .
6538 .
6491 \layout Standard
6539 \layout Standard
6492
6540
6493 This will give any of your programs detailed, colored tracebacks with automatic
6541 This will give any of your programs detailed, colored tracebacks with automatic
6494 invocation of
6542 invocation of
6495 \family typewriter
6543 \family typewriter
6496 pdb
6544 pdb
6497 \family default
6545 \family default
6498 .
6546 .
6499 \layout Section
6547 \layout Section
6500
6548
6501
6549
6502 \begin_inset LatexCommand \label{sec:syntax-extensions}
6550 \begin_inset LatexCommand \label{sec:syntax-extensions}
6503
6551
6504 \end_inset
6552 \end_inset
6505
6553
6506 Extensions for syntax processing
6554 Extensions for syntax processing
6507 \layout Standard
6555 \layout Standard
6508
6556
6509 This isn't for the faint of heart, because the potential for breaking things
6557 This isn't for the faint of heart, because the potential for breaking things
6510 is quite high.
6558 is quite high.
6511 But it can be a very powerful and useful feature.
6559 But it can be a very powerful and useful feature.
6512 In a nutshell, you can redefine the way IPython processes the user input
6560 In a nutshell, you can redefine the way IPython processes the user input
6513 line to accept new, special extensions to the syntax without needing to
6561 line to accept new, special extensions to the syntax without needing to
6514 change any of IPython's own code.
6562 change any of IPython's own code.
6515 \layout Standard
6563 \layout Standard
6516
6564
6517 In the
6565 In the
6518 \family typewriter
6566 \family typewriter
6519 IPython/Extensions
6567 IPython/Extensions
6520 \family default
6568 \family default
6521 directory you will find some examples supplied, which we will briefly describe
6569 directory you will find some examples supplied, which we will briefly describe
6522 now.
6570 now.
6523 These can be used `as is' (and both provide very useful functionality),
6571 These can be used `as is' (and both provide very useful functionality),
6524 or you can use them as a starting point for writing your own extensions.
6572 or you can use them as a starting point for writing your own extensions.
6525 \layout Subsection
6573 \layout Subsection
6526
6574
6527 Pasting of code starting with
6575 Pasting of code starting with
6528 \family typewriter
6576 \family typewriter
6529 `>>>
6577 `>>>
6530 \family default
6578 \family default
6531 ' or
6579 ' or
6532 \family typewriter
6580 \family typewriter
6533 `...
6581 `...
6534
6582
6535 \family default
6583 \family default
6536 '
6584 '
6537 \layout Standard
6585 \layout Standard
6538
6586
6539 In the python tutorial it is common to find code examples which have been
6587 In the python tutorial it is common to find code examples which have been
6540 taken from real python sessions.
6588 taken from real python sessions.
6541 The problem with those is that all the lines begin with either
6589 The problem with those is that all the lines begin with either
6542 \family typewriter
6590 \family typewriter
6543 `>>>
6591 `>>>
6544 \family default
6592 \family default
6545 ' or
6593 ' or
6546 \family typewriter
6594 \family typewriter
6547 `...
6595 `...
6548
6596
6549 \family default
6597 \family default
6550 ', which makes it impossible to paste them all at once.
6598 ', which makes it impossible to paste them all at once.
6551 One must instead do a line by line manual copying, carefully removing the
6599 One must instead do a line by line manual copying, carefully removing the
6552 leading extraneous characters.
6600 leading extraneous characters.
6553 \layout Standard
6601 \layout Standard
6554
6602
6555 This extension identifies those starting characters and removes them from
6603 This extension identifies those starting characters and removes them from
6556 the input automatically, so that one can paste multi-line examples directly
6604 the input automatically, so that one can paste multi-line examples directly
6557 into IPython, saving a lot of time.
6605 into IPython, saving a lot of time.
6558 Please look at the file
6606 Please look at the file
6559 \family typewriter
6607 \family typewriter
6560 InterpreterPasteInput.py
6608 InterpreterPasteInput.py
6561 \family default
6609 \family default
6562 in the
6610 in the
6563 \family typewriter
6611 \family typewriter
6564 IPython/Extensions
6612 IPython/Extensions
6565 \family default
6613 \family default
6566 directory for details on how this is done.
6614 directory for details on how this is done.
6567 \layout Standard
6615 \layout Standard
6568
6616
6569 IPython comes with a special profile enabling this feature, called
6617 IPython comes with a special profile enabling this feature, called
6570 \family typewriter
6618 \family typewriter
6571 tutorial
6619 tutorial
6572 \family default
6620 \family default
6573 \emph on
6621 \emph on
6574 .
6622 .
6575
6623
6576 \emph default
6624 \emph default
6577 Simply start IPython via
6625 Simply start IPython via
6578 \family typewriter
6626 \family typewriter
6579 `ipython\SpecialChar ~
6627 `ipython\SpecialChar ~
6580 -p\SpecialChar ~
6628 -p\SpecialChar ~
6581 tutorial'
6629 tutorial'
6582 \family default
6630 \family default
6583 and the feature will be available.
6631 and the feature will be available.
6584 In a normal IPython session you can activate the feature by importing the
6632 In a normal IPython session you can activate the feature by importing the
6585 corresponding module with:
6633 corresponding module with:
6586 \newline
6634 \newline
6587
6635
6588 \family typewriter
6636 \family typewriter
6589 In [1]: import IPython.Extensions.InterpreterPasteInput
6637 In [1]: import IPython.Extensions.InterpreterPasteInput
6590 \layout Standard
6638 \layout Standard
6591
6639
6592 The following is a 'screenshot' of how things work when this extension is
6640 The following is a 'screenshot' of how things work when this extension is
6593 on, copying an example from the standard tutorial:
6641 on, copying an example from the standard tutorial:
6594 \layout Standard
6642 \layout Standard
6595
6643
6596
6644
6597 \family typewriter
6645 \family typewriter
6598 IPython profile: tutorial
6646 IPython profile: tutorial
6599 \newline
6647 \newline
6600 \SpecialChar ~
6648 \SpecialChar ~
6601
6649
6602 \newline
6650 \newline
6603 *** Pasting of code with ">>>" or "..." has been enabled.
6651 *** Pasting of code with ">>>" or "..." has been enabled.
6604 \newline
6652 \newline
6605 \SpecialChar ~
6653 \SpecialChar ~
6606
6654
6607 \newline
6655 \newline
6608 In [1]: >>> def fib2(n): # return Fibonacci series up to n
6656 In [1]: >>> def fib2(n): # return Fibonacci series up to n
6609 \newline
6657 \newline
6610
6658
6611 \begin_inset ERT
6659 \begin_inset ERT
6612 status Collapsed
6660 status Collapsed
6613
6661
6614 \layout Standard
6662 \layout Standard
6615
6663
6616 \backslash
6664 \backslash
6617 hspace*{0mm}
6665 hspace*{0mm}
6618 \end_inset
6666 \end_inset
6619
6667
6620 \SpecialChar ~
6668 \SpecialChar ~
6621 \SpecialChar ~
6669 \SpecialChar ~
6622 ...: ...\SpecialChar ~
6670 ...: ...\SpecialChar ~
6623 \SpecialChar ~
6671 \SpecialChar ~
6624 \SpecialChar ~
6672 \SpecialChar ~
6625 \SpecialChar ~
6673 \SpecialChar ~
6626 """Return a list containing the Fibonacci series up to n."""
6674 """Return a list containing the Fibonacci series up to n."""
6627 \newline
6675 \newline
6628
6676
6629 \begin_inset ERT
6677 \begin_inset ERT
6630 status Collapsed
6678 status Collapsed
6631
6679
6632 \layout Standard
6680 \layout Standard
6633
6681
6634 \backslash
6682 \backslash
6635 hspace*{0mm}
6683 hspace*{0mm}
6636 \end_inset
6684 \end_inset
6637
6685
6638 \SpecialChar ~
6686 \SpecialChar ~
6639 \SpecialChar ~
6687 \SpecialChar ~
6640 ...: ...\SpecialChar ~
6688 ...: ...\SpecialChar ~
6641 \SpecialChar ~
6689 \SpecialChar ~
6642 \SpecialChar ~
6690 \SpecialChar ~
6643 \SpecialChar ~
6691 \SpecialChar ~
6644 result = []
6692 result = []
6645 \newline
6693 \newline
6646
6694
6647 \begin_inset ERT
6695 \begin_inset ERT
6648 status Collapsed
6696 status Collapsed
6649
6697
6650 \layout Standard
6698 \layout Standard
6651
6699
6652 \backslash
6700 \backslash
6653 hspace*{0mm}
6701 hspace*{0mm}
6654 \end_inset
6702 \end_inset
6655
6703
6656 \SpecialChar ~
6704 \SpecialChar ~
6657 \SpecialChar ~
6705 \SpecialChar ~
6658 ...: ...\SpecialChar ~
6706 ...: ...\SpecialChar ~
6659 \SpecialChar ~
6707 \SpecialChar ~
6660 \SpecialChar ~
6708 \SpecialChar ~
6661 \SpecialChar ~
6709 \SpecialChar ~
6662 a, b = 0, 1
6710 a, b = 0, 1
6663 \newline
6711 \newline
6664
6712
6665 \begin_inset ERT
6713 \begin_inset ERT
6666 status Collapsed
6714 status Collapsed
6667
6715
6668 \layout Standard
6716 \layout Standard
6669
6717
6670 \backslash
6718 \backslash
6671 hspace*{0mm}
6719 hspace*{0mm}
6672 \end_inset
6720 \end_inset
6673
6721
6674 \SpecialChar ~
6722 \SpecialChar ~
6675 \SpecialChar ~
6723 \SpecialChar ~
6676 ...: ...\SpecialChar ~
6724 ...: ...\SpecialChar ~
6677 \SpecialChar ~
6725 \SpecialChar ~
6678 \SpecialChar ~
6726 \SpecialChar ~
6679 \SpecialChar ~
6727 \SpecialChar ~
6680 while b < n:
6728 while b < n:
6681 \newline
6729 \newline
6682
6730
6683 \begin_inset ERT
6731 \begin_inset ERT
6684 status Collapsed
6732 status Collapsed
6685
6733
6686 \layout Standard
6734 \layout Standard
6687
6735
6688 \backslash
6736 \backslash
6689 hspace*{0mm}
6737 hspace*{0mm}
6690 \end_inset
6738 \end_inset
6691
6739
6692 \SpecialChar ~
6740 \SpecialChar ~
6693 \SpecialChar ~
6741 \SpecialChar ~
6694 ...: ...\SpecialChar ~
6742 ...: ...\SpecialChar ~
6695 \SpecialChar ~
6743 \SpecialChar ~
6696 \SpecialChar ~
6744 \SpecialChar ~
6697 \SpecialChar ~
6745 \SpecialChar ~
6698 \SpecialChar ~
6746 \SpecialChar ~
6699 \SpecialChar ~
6747 \SpecialChar ~
6700 \SpecialChar ~
6748 \SpecialChar ~
6701 \SpecialChar ~
6749 \SpecialChar ~
6702 result.append(b)\SpecialChar ~
6750 result.append(b)\SpecialChar ~
6703 \SpecialChar ~
6751 \SpecialChar ~
6704 \SpecialChar ~
6752 \SpecialChar ~
6705 # see below
6753 # see below
6706 \newline
6754 \newline
6707
6755
6708 \begin_inset ERT
6756 \begin_inset ERT
6709 status Collapsed
6757 status Collapsed
6710
6758
6711 \layout Standard
6759 \layout Standard
6712
6760
6713 \backslash
6761 \backslash
6714 hspace*{0mm}
6762 hspace*{0mm}
6715 \end_inset
6763 \end_inset
6716
6764
6717 \SpecialChar ~
6765 \SpecialChar ~
6718 \SpecialChar ~
6766 \SpecialChar ~
6719 ...: ...\SpecialChar ~
6767 ...: ...\SpecialChar ~
6720 \SpecialChar ~
6768 \SpecialChar ~
6721 \SpecialChar ~
6769 \SpecialChar ~
6722 \SpecialChar ~
6770 \SpecialChar ~
6723 \SpecialChar ~
6771 \SpecialChar ~
6724 \SpecialChar ~
6772 \SpecialChar ~
6725 \SpecialChar ~
6773 \SpecialChar ~
6726 \SpecialChar ~
6774 \SpecialChar ~
6727 a, b = b, a+b
6775 a, b = b, a+b
6728 \newline
6776 \newline
6729
6777
6730 \begin_inset ERT
6778 \begin_inset ERT
6731 status Collapsed
6779 status Collapsed
6732
6780
6733 \layout Standard
6781 \layout Standard
6734
6782
6735 \backslash
6783 \backslash
6736 hspace*{0mm}
6784 hspace*{0mm}
6737 \end_inset
6785 \end_inset
6738
6786
6739 \SpecialChar ~
6787 \SpecialChar ~
6740 \SpecialChar ~
6788 \SpecialChar ~
6741 ...: ...\SpecialChar ~
6789 ...: ...\SpecialChar ~
6742 \SpecialChar ~
6790 \SpecialChar ~
6743 \SpecialChar ~
6791 \SpecialChar ~
6744 \SpecialChar ~
6792 \SpecialChar ~
6745 return result
6793 return result
6746 \newline
6794 \newline
6747
6795
6748 \begin_inset ERT
6796 \begin_inset ERT
6749 status Collapsed
6797 status Collapsed
6750
6798
6751 \layout Standard
6799 \layout Standard
6752
6800
6753 \backslash
6801 \backslash
6754 hspace*{0mm}
6802 hspace*{0mm}
6755 \end_inset
6803 \end_inset
6756
6804
6757 \SpecialChar ~
6805 \SpecialChar ~
6758 \SpecialChar ~
6806 \SpecialChar ~
6759 ...:
6807 ...:
6760 \newline
6808 \newline
6761 \SpecialChar ~
6809 \SpecialChar ~
6762
6810
6763 \newline
6811 \newline
6764 In [2]: fib2(10)
6812 In [2]: fib2(10)
6765 \newline
6813 \newline
6766 Out[2]: [1, 1, 2, 3, 5, 8]
6814 Out[2]: [1, 1, 2, 3, 5, 8]
6767 \layout Standard
6815 \layout Standard
6768
6816
6769 Note that as currently written, this extension does
6817 Note that as currently written, this extension does
6770 \emph on
6818 \emph on
6771 not
6819 not
6772 \emph default
6820 \emph default
6773 recognize IPython's prompts for pasting.
6821 recognize IPython's prompts for pasting.
6774 Those are more complicated, since the user can change them very easily,
6822 Those are more complicated, since the user can change them very easily,
6775 they involve numbers and can vary in length.
6823 they involve numbers and can vary in length.
6776 One could however extract all the relevant information from the IPython
6824 One could however extract all the relevant information from the IPython
6777 instance and build an appropriate regular expression.
6825 instance and build an appropriate regular expression.
6778 This is left as an exercise for the reader.
6826 This is left as an exercise for the reader.
6779 \layout Subsection
6827 \layout Subsection
6780
6828
6781 Input of physical quantities with units
6829 Input of physical quantities with units
6782 \layout Standard
6830 \layout Standard
6783
6831
6784 The module
6832 The module
6785 \family typewriter
6833 \family typewriter
6786 PhysicalQInput
6834 PhysicalQInput
6787 \family default
6835 \family default
6788 allows a simplified form of input for physical quantities with units.
6836 allows a simplified form of input for physical quantities with units.
6789 This file is meant to be used in conjunction with the
6837 This file is meant to be used in conjunction with the
6790 \family typewriter
6838 \family typewriter
6791 PhysicalQInteractive
6839 PhysicalQInteractive
6792 \family default
6840 \family default
6793 module (in the same directory) and
6841 module (in the same directory) and
6794 \family typewriter
6842 \family typewriter
6795 Physics.PhysicalQuantities
6843 Physics.PhysicalQuantities
6796 \family default
6844 \family default
6797 from Konrad Hinsen's ScientificPython (
6845 from Konrad Hinsen's ScientificPython (
6798 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/hinsen/scientific.html}
6846 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/hinsen/scientific.html}
6799
6847
6800 \end_inset
6848 \end_inset
6801
6849
6802 ).
6850 ).
6803 \layout Standard
6851 \layout Standard
6804
6852
6805 The
6853 The
6806 \family typewriter
6854 \family typewriter
6807 Physics.PhysicalQuantities
6855 Physics.PhysicalQuantities
6808 \family default
6856 \family default
6809 module defines
6857 module defines
6810 \family typewriter
6858 \family typewriter
6811 PhysicalQuantity
6859 PhysicalQuantity
6812 \family default
6860 \family default
6813 objects, but these must be declared as instances of a class.
6861 objects, but these must be declared as instances of a class.
6814 For example, to define
6862 For example, to define
6815 \family typewriter
6863 \family typewriter
6816 v
6864 v
6817 \family default
6865 \family default
6818 as a velocity of 3\SpecialChar ~
6866 as a velocity of 3\SpecialChar ~
6819 m/s, normally you would write:
6867 m/s, normally you would write:
6820 \family typewriter
6868 \family typewriter
6821
6869
6822 \newline
6870 \newline
6823 In [1]: v = PhysicalQuantity(3,'m/s')
6871 In [1]: v = PhysicalQuantity(3,'m/s')
6824 \layout Standard
6872 \layout Standard
6825
6873
6826 Using the
6874 Using the
6827 \family typewriter
6875 \family typewriter
6828 PhysicalQ_Input
6876 PhysicalQ_Input
6829 \family default
6877 \family default
6830 extension this can be input instead as:
6878 extension this can be input instead as:
6831 \family typewriter
6879 \family typewriter
6832
6880
6833 \newline
6881 \newline
6834 In [1]: v = 3 m/s
6882 In [1]: v = 3 m/s
6835 \family default
6883 \family default
6836
6884
6837 \newline
6885 \newline
6838 which is much more convenient for interactive use (even though it is blatantly
6886 which is much more convenient for interactive use (even though it is blatantly
6839 invalid Python syntax).
6887 invalid Python syntax).
6840 \layout Standard
6888 \layout Standard
6841
6889
6842 The
6890 The
6843 \family typewriter
6891 \family typewriter
6844 physics
6892 physics
6845 \family default
6893 \family default
6846 profile supplied with IPython (enabled via
6894 profile supplied with IPython (enabled via
6847 \family typewriter
6895 \family typewriter
6848 'ipython -p physics'
6896 'ipython -p physics'
6849 \family default
6897 \family default
6850 ) uses these extensions, which you can also activate with:
6898 ) uses these extensions, which you can also activate with:
6851 \layout Standard
6899 \layout Standard
6852
6900
6853
6901
6854 \family typewriter
6902 \family typewriter
6855 from math import * # math MUST be imported BEFORE PhysicalQInteractive
6903 from math import * # math MUST be imported BEFORE PhysicalQInteractive
6856 \newline
6904 \newline
6857 from IPython.Extensions.PhysicalQInteractive import *
6905 from IPython.Extensions.PhysicalQInteractive import *
6858 \newline
6906 \newline
6859 import IPython.Extensions.PhysicalQInput
6907 import IPython.Extensions.PhysicalQInput
6860 \layout Section
6908 \layout Section
6861
6909
6862
6910
6863 \begin_inset LatexCommand \label{sec:IPython-as-shell}
6911 \begin_inset LatexCommand \label{sec:IPython-as-shell}
6864
6912
6865 \end_inset
6913 \end_inset
6866
6914
6867 IPython as a system shell
6915 IPython as a system shell
6868 \layout Standard
6916 \layout Standard
6869
6917
6870 IPython ships with a special profile called
6918 IPython ships with a special profile called
6871 \family typewriter
6919 \family typewriter
6872 pysh
6920 pysh
6873 \family default
6921 \family default
6874 , which you can activate at the command line as
6922 , which you can activate at the command line as
6875 \family typewriter
6923 \family typewriter
6876 `ipython -p pysh'
6924 `ipython -p pysh'
6877 \family default
6925 \family default
6878 .
6926 .
6879 This loads
6927 This loads
6880 \family typewriter
6928 \family typewriter
6881 InterpreterExec
6929 InterpreterExec
6882 \family default
6930 \family default
6883 , along with some additional facilities and a prompt customized for filesystem
6931 , along with some additional facilities and a prompt customized for filesystem
6884 navigation.
6932 navigation.
6885 \layout Standard
6933 \layout Standard
6886
6934
6887 Note that this does
6935 Note that this does
6888 \emph on
6936 \emph on
6889 not
6937 not
6890 \emph default
6938 \emph default
6891 make IPython a full-fledged system shell.
6939 make IPython a full-fledged system shell.
6892 In particular, it has no job control, so if you type Ctrl-Z (under Unix),
6940 In particular, it has no job control, so if you type Ctrl-Z (under Unix),
6893 you'll suspend pysh itself, not the process you just started.
6941 you'll suspend pysh itself, not the process you just started.
6894
6942
6895 \layout Standard
6943 \layout Standard
6896
6944
6897 What the shell profile allows you to do is to use the convenient and powerful
6945 What the shell profile allows you to do is to use the convenient and powerful
6898 syntax of Python to do quick scripting at the command line.
6946 syntax of Python to do quick scripting at the command line.
6899 Below we describe some of its features.
6947 Below we describe some of its features.
6900 \layout Subsection
6948 \layout Subsection
6901
6949
6902 Aliases
6950 Aliases
6903 \layout Standard
6951 \layout Standard
6904
6952
6905 All of your
6953 All of your
6906 \family typewriter
6954 \family typewriter
6907 $PATH
6955 $PATH
6908 \family default
6956 \family default
6909 has been loaded as IPython aliases, so you should be able to type any normal
6957 has been loaded as IPython aliases, so you should be able to type any normal
6910 system command and have it executed.
6958 system command and have it executed.
6911 See
6959 See
6912 \family typewriter
6960 \family typewriter
6913 %alias?
6961 %alias?
6914 \family default
6962 \family default
6915 and
6963 and
6916 \family typewriter
6964 \family typewriter
6917 %unalias?
6965 %unalias?
6918 \family default
6966 \family default
6919 for details on the alias facilities.
6967 for details on the alias facilities.
6920 See also
6968 See also
6921 \family typewriter
6969 \family typewriter
6922 %rehash?
6970 %rehash?
6923 \family default
6971 \family default
6924 and
6972 and
6925 \family typewriter
6973 \family typewriter
6926 %rehashx?
6974 %rehashx?
6927 \family default
6975 \family default
6928 for details on the mechanism used to load
6976 for details on the mechanism used to load
6929 \family typewriter
6977 \family typewriter
6930 $PATH
6978 $PATH
6931 \family default
6979 \family default
6932 .
6980 .
6933 \layout Subsection
6981 \layout Subsection
6934
6982
6935 Special syntax
6983 Special syntax
6936 \layout Standard
6984 \layout Standard
6937
6985
6938 Any lines which begin with
6986 Any lines which begin with
6939 \family typewriter
6987 \family typewriter
6940 `~'
6988 `~'
6941 \family default
6989 \family default
6942 ,
6990 ,
6943 \family typewriter
6991 \family typewriter
6944 `/'
6992 `/'
6945 \family default
6993 \family default
6946 and
6994 and
6947 \family typewriter
6995 \family typewriter
6948 `.'
6996 `.'
6949 \family default
6997 \family default
6950 will be executed as shell commands instead of as Python code.
6998 will be executed as shell commands instead of as Python code.
6951 The special escapes below are also recognized.
6999 The special escapes below are also recognized.
6952
7000
6953 \family typewriter
7001 \family typewriter
6954 !cmd
7002 !cmd
6955 \family default
7003 \family default
6956 is valid in single or multi-line input, all others are only valid in single-lin
7004 is valid in single or multi-line input, all others are only valid in single-lin
6957 e input:
7005 e input:
6958 \layout Description
7006 \layout Description
6959
7007
6960
7008
6961 \family typewriter
7009 \family typewriter
6962 !cmd
7010 !cmd
6963 \family default
7011 \family default
6964 pass `cmd' directly to the shell
7012 pass `cmd' directly to the shell
6965 \layout Description
7013 \layout Description
6966
7014
6967
7015
6968 \family typewriter
7016 \family typewriter
6969 !!cmd
7017 !!cmd
6970 \family default
7018 \family default
6971 execute `cmd' and return output as a list (split on `
7019 execute `cmd' and return output as a list (split on `
6972 \backslash
7020 \backslash
6973 n')
7021 n')
6974 \layout Description
7022 \layout Description
6975
7023
6976
7024
6977 \family typewriter
7025 \family typewriter
6978 $var=cmd
7026 $var=cmd
6979 \family default
7027 \family default
6980 capture output of cmd into var, as a string
7028 capture output of cmd into var, as a string
6981 \layout Description
7029 \layout Description
6982
7030
6983
7031
6984 \family typewriter
7032 \family typewriter
6985 $$var=cmd
7033 $$var=cmd
6986 \family default
7034 \family default
6987 capture output of cmd into var, as a list (split on `
7035 capture output of cmd into var, as a list (split on `
6988 \backslash
7036 \backslash
6989 n')
7037 n')
6990 \layout Standard
7038 \layout Standard
6991
7039
6992 The
7040 The
6993 \family typewriter
7041 \family typewriter
6994 $
7042 $
6995 \family default
7043 \family default
6996 /
7044 /
6997 \family typewriter
7045 \family typewriter
6998 $$
7046 $$
6999 \family default
7047 \family default
7000 syntaxes make Python variables from system output, which you can later
7048 syntaxes make Python variables from system output, which you can later
7001 use for further scripting.
7049 use for further scripting.
7002 The converse is also possible: when executing an alias or calling to the
7050 The converse is also possible: when executing an alias or calling to the
7003 system via
7051 system via
7004 \family typewriter
7052 \family typewriter
7005 !
7053 !
7006 \family default
7054 \family default
7007 /
7055 /
7008 \family typewriter
7056 \family typewriter
7009 !!
7057 !!
7010 \family default
7058 \family default
7011 , you can expand any python variable or expression by prepending it with
7059 , you can expand any python variable or expression by prepending it with
7012
7060
7013 \family typewriter
7061 \family typewriter
7014 $
7062 $
7015 \family default
7063 \family default
7016 .
7064 .
7017 Full details of the allowed syntax can be found in Python's PEP 215.
7065 Full details of the allowed syntax can be found in Python's PEP 215.
7018 \layout Standard
7066 \layout Standard
7019
7067
7020 A few brief examples will illustrate these (note that the indentation below
7068 A few brief examples will illustrate these (note that the indentation below
7021 may be incorrectly displayed):
7069 may be incorrectly displayed):
7022 \layout Standard
7070 \layout Standard
7023
7071
7024
7072
7025 \family typewriter
7073 \family typewriter
7026 fperez[~/test]|3> !ls *s.py
7074 fperez[~/test]|3> !ls *s.py
7027 \newline
7075 \newline
7028 scopes.py strings.py
7076 scopes.py strings.py
7029 \layout Standard
7077 \layout Standard
7030
7078
7031 ls is an internal alias, so there's no need to use
7079 ls is an internal alias, so there's no need to use
7032 \family typewriter
7080 \family typewriter
7033 !
7081 !
7034 \family default
7082 \family default
7035 :
7083 :
7036 \layout Standard
7084 \layout Standard
7037
7085
7038
7086
7039 \family typewriter
7087 \family typewriter
7040 fperez[~/test]|4> ls *s.py
7088 fperez[~/test]|4> ls *s.py
7041 \newline
7089 \newline
7042 scopes.py* strings.py
7090 scopes.py* strings.py
7043 \layout Standard
7091 \layout Standard
7044
7092
7045 !!ls will return the output into a Python variable:
7093 !!ls will return the output into a Python variable:
7046 \layout Standard
7094 \layout Standard
7047
7095
7048
7096
7049 \family typewriter
7097 \family typewriter
7050 fperez[~/test]|5> !!ls *s.py
7098 fperez[~/test]|5> !!ls *s.py
7051 \newline
7099 \newline
7052
7100
7053 \begin_inset ERT
7101 \begin_inset ERT
7054 status Collapsed
7102 status Collapsed
7055
7103
7056 \layout Standard
7104 \layout Standard
7057
7105
7058 \backslash
7106 \backslash
7059 hspace*{0mm}
7107 hspace*{0mm}
7060 \end_inset
7108 \end_inset
7061
7109
7062 \SpecialChar ~
7110 \SpecialChar ~
7063 \SpecialChar ~
7111 \SpecialChar ~
7064 \SpecialChar ~
7112 \SpecialChar ~
7065 \SpecialChar ~
7113 \SpecialChar ~
7066 \SpecialChar ~
7114 \SpecialChar ~
7067 \SpecialChar ~
7115 \SpecialChar ~
7068 \SpecialChar ~
7116 \SpecialChar ~
7069 \SpecialChar ~
7117 \SpecialChar ~
7070 \SpecialChar ~
7118 \SpecialChar ~
7071 \SpecialChar ~
7119 \SpecialChar ~
7072 \SpecialChar ~
7120 \SpecialChar ~
7073 \SpecialChar ~
7121 \SpecialChar ~
7074 \SpecialChar ~
7122 \SpecialChar ~
7075 \SpecialChar ~
7123 \SpecialChar ~
7076 <5> ['scopes.py', 'strings.py']
7124 <5> ['scopes.py', 'strings.py']
7077 \newline
7125 \newline
7078 fperez[~/test]|6> print _5
7126 fperez[~/test]|6> print _5
7079 \newline
7127 \newline
7080 ['scopes.py', 'strings.py']
7128 ['scopes.py', 'strings.py']
7081 \layout Standard
7129 \layout Standard
7082
7130
7083
7131
7084 \family typewriter
7132 \family typewriter
7085 $
7133 $
7086 \family default
7134 \family default
7087 and
7135 and
7088 \family typewriter
7136 \family typewriter
7089 $$
7137 $$
7090 \family default
7138 \family default
7091 allow direct capture to named variables:
7139 allow direct capture to named variables:
7092 \layout Standard
7140 \layout Standard
7093
7141
7094
7142
7095 \family typewriter
7143 \family typewriter
7096 fperez[~/test]|7> $astr = ls *s.py
7144 fperez[~/test]|7> $astr = ls *s.py
7097 \newline
7145 \newline
7098 fperez[~/test]|8> astr
7146 fperez[~/test]|8> astr
7099 \newline
7147 \newline
7100
7148
7101 \begin_inset ERT
7149 \begin_inset ERT
7102 status Collapsed
7150 status Collapsed
7103
7151
7104 \layout Standard
7152 \layout Standard
7105
7153
7106 \backslash
7154 \backslash
7107 hspace*{0mm}
7155 hspace*{0mm}
7108 \end_inset
7156 \end_inset
7109
7157
7110 \SpecialChar ~
7158 \SpecialChar ~
7111 \SpecialChar ~
7159 \SpecialChar ~
7112 \SpecialChar ~
7160 \SpecialChar ~
7113 \SpecialChar ~
7161 \SpecialChar ~
7114 \SpecialChar ~
7162 \SpecialChar ~
7115 \SpecialChar ~
7163 \SpecialChar ~
7116 \SpecialChar ~
7164 \SpecialChar ~
7117 \SpecialChar ~
7165 \SpecialChar ~
7118 \SpecialChar ~
7166 \SpecialChar ~
7119 \SpecialChar ~
7167 \SpecialChar ~
7120 \SpecialChar ~
7168 \SpecialChar ~
7121 \SpecialChar ~
7169 \SpecialChar ~
7122 \SpecialChar ~
7170 \SpecialChar ~
7123 \SpecialChar ~
7171 \SpecialChar ~
7124 <8> 'scopes.py
7172 <8> 'scopes.py
7125 \backslash
7173 \backslash
7126 nstrings.py'
7174 nstrings.py'
7127 \layout Standard
7175 \layout Standard
7128
7176
7129
7177
7130 \family typewriter
7178 \family typewriter
7131 fperez[~/test]|9> $$alist = ls *s.py
7179 fperez[~/test]|9> $$alist = ls *s.py
7132 \newline
7180 \newline
7133 fperez[~/test]|10> alist
7181 fperez[~/test]|10> alist
7134 \newline
7182 \newline
7135
7183
7136 \begin_inset ERT
7184 \begin_inset ERT
7137 status Collapsed
7185 status Collapsed
7138
7186
7139 \layout Standard
7187 \layout Standard
7140
7188
7141 \backslash
7189 \backslash
7142 hspace*{0mm}
7190 hspace*{0mm}
7143 \end_inset
7191 \end_inset
7144
7192
7145 \SpecialChar ~
7193 \SpecialChar ~
7146 \SpecialChar ~
7194 \SpecialChar ~
7147 \SpecialChar ~
7195 \SpecialChar ~
7148 \SpecialChar ~
7196 \SpecialChar ~
7149 \SpecialChar ~
7197 \SpecialChar ~
7150 \SpecialChar ~
7198 \SpecialChar ~
7151 \SpecialChar ~
7199 \SpecialChar ~
7152 \SpecialChar ~
7200 \SpecialChar ~
7153 \SpecialChar ~
7201 \SpecialChar ~
7154 \SpecialChar ~
7202 \SpecialChar ~
7155 \SpecialChar ~
7203 \SpecialChar ~
7156 \SpecialChar ~
7204 \SpecialChar ~
7157 \SpecialChar ~
7205 \SpecialChar ~
7158 \SpecialChar ~
7206 \SpecialChar ~
7159 <10> ['scopes.py', 'strings.py']
7207 <10> ['scopes.py', 'strings.py']
7160 \layout Standard
7208 \layout Standard
7161
7209
7162 alist is now a normal python list you can loop over.
7210 alist is now a normal python list you can loop over.
7163 Using
7211 Using
7164 \family typewriter
7212 \family typewriter
7165 $
7213 $
7166 \family default
7214 \family default
7167 will expand back the python values when alias calls are made:
7215 will expand back the python values when alias calls are made:
7168 \layout Standard
7216 \layout Standard
7169
7217
7170
7218
7171 \family typewriter
7219 \family typewriter
7172 fperez[~/test]|11> for f in alist:
7220 fperez[~/test]|11> for f in alist:
7173 \newline
7221 \newline
7174
7222
7175 \begin_inset ERT
7223 \begin_inset ERT
7176 status Collapsed
7224 status Collapsed
7177
7225
7178 \layout Standard
7226 \layout Standard
7179
7227
7180 \backslash
7228 \backslash
7181 hspace*{0mm}
7229 hspace*{0mm}
7182 \end_inset
7230 \end_inset
7183
7231
7184 \SpecialChar ~
7232 \SpecialChar ~
7185 \SpecialChar ~
7233 \SpecialChar ~
7186 \SpecialChar ~
7234 \SpecialChar ~
7187 \SpecialChar ~
7235 \SpecialChar ~
7188 \SpecialChar ~
7236 \SpecialChar ~
7189 \SpecialChar ~
7237 \SpecialChar ~
7190 \SpecialChar ~
7238 \SpecialChar ~
7191 \SpecialChar ~
7239 \SpecialChar ~
7192 \SpecialChar ~
7240 \SpecialChar ~
7193 \SpecialChar ~
7241 \SpecialChar ~
7194 \SpecialChar ~
7242 \SpecialChar ~
7195 \SpecialChar ~
7243 \SpecialChar ~
7196 \SpecialChar ~
7244 \SpecialChar ~
7197 \SpecialChar ~
7245 \SpecialChar ~
7198 |..> \SpecialChar ~
7246 |..> \SpecialChar ~
7199 \SpecialChar ~
7247 \SpecialChar ~
7200 \SpecialChar ~
7248 \SpecialChar ~
7201 \SpecialChar ~
7249 \SpecialChar ~
7202 print 'file',f,
7250 print 'file',f,
7203 \newline
7251 \newline
7204
7252
7205 \begin_inset ERT
7253 \begin_inset ERT
7206 status Collapsed
7254 status Collapsed
7207
7255
7208 \layout Standard
7256 \layout Standard
7209
7257
7210 \backslash
7258 \backslash
7211 hspace*{0mm}
7259 hspace*{0mm}
7212 \end_inset
7260 \end_inset
7213
7261
7214 \SpecialChar ~
7262 \SpecialChar ~
7215 \SpecialChar ~
7263 \SpecialChar ~
7216 \SpecialChar ~
7264 \SpecialChar ~
7217 \SpecialChar ~
7265 \SpecialChar ~
7218 \SpecialChar ~
7266 \SpecialChar ~
7219 \SpecialChar ~
7267 \SpecialChar ~
7220 \SpecialChar ~
7268 \SpecialChar ~
7221 \SpecialChar ~
7269 \SpecialChar ~
7222 \SpecialChar ~
7270 \SpecialChar ~
7223 \SpecialChar ~
7271 \SpecialChar ~
7224 \SpecialChar ~
7272 \SpecialChar ~
7225 \SpecialChar ~
7273 \SpecialChar ~
7226 \SpecialChar ~
7274 \SpecialChar ~
7227 \SpecialChar ~
7275 \SpecialChar ~
7228 |..> \SpecialChar ~
7276 |..> \SpecialChar ~
7229 \SpecialChar ~
7277 \SpecialChar ~
7230 \SpecialChar ~
7278 \SpecialChar ~
7231 \SpecialChar ~
7279 \SpecialChar ~
7232 wc -l $f
7280 wc -l $f
7233 \newline
7281 \newline
7234
7282
7235 \begin_inset ERT
7283 \begin_inset ERT
7236 status Collapsed
7284 status Collapsed
7237
7285
7238 \layout Standard
7286 \layout Standard
7239
7287
7240 \backslash
7288 \backslash
7241 hspace*{0mm}
7289 hspace*{0mm}
7242 \end_inset
7290 \end_inset
7243
7291
7244 \SpecialChar ~
7292 \SpecialChar ~
7245 \SpecialChar ~
7293 \SpecialChar ~
7246 \SpecialChar ~
7294 \SpecialChar ~
7247 \SpecialChar ~
7295 \SpecialChar ~
7248 \SpecialChar ~
7296 \SpecialChar ~
7249 \SpecialChar ~
7297 \SpecialChar ~
7250 \SpecialChar ~
7298 \SpecialChar ~
7251 \SpecialChar ~
7299 \SpecialChar ~
7252 \SpecialChar ~
7300 \SpecialChar ~
7253 \SpecialChar ~
7301 \SpecialChar ~
7254 \SpecialChar ~
7302 \SpecialChar ~
7255 \SpecialChar ~
7303 \SpecialChar ~
7256 \SpecialChar ~
7304 \SpecialChar ~
7257 \SpecialChar ~
7305 \SpecialChar ~
7258 |..>
7306 |..>
7259 \newline
7307 \newline
7260 file scopes.py 13 scopes.py
7308 file scopes.py 13 scopes.py
7261 \newline
7309 \newline
7262 file strings.py 4 strings.py
7310 file strings.py 4 strings.py
7263 \layout Standard
7311 \layout Standard
7264
7312
7265 Note that you may need to protect your variables with braces if you want
7313 Note that you may need to protect your variables with braces if you want
7266 to append strings to their names.
7314 to append strings to their names.
7267 To copy all files in alist to
7315 To copy all files in alist to
7268 \family typewriter
7316 \family typewriter
7269 .bak
7317 .bak
7270 \family default
7318 \family default
7271 extensions, you must use:
7319 extensions, you must use:
7272 \layout Standard
7320 \layout Standard
7273
7321
7274
7322
7275 \family typewriter
7323 \family typewriter
7276 fperez[~/test]|12> for f in alist:
7324 fperez[~/test]|12> for f in alist:
7277 \newline
7325 \newline
7278
7326
7279 \begin_inset ERT
7327 \begin_inset ERT
7280 status Collapsed
7328 status Collapsed
7281
7329
7282 \layout Standard
7330 \layout Standard
7283
7331
7284 \backslash
7332 \backslash
7285 hspace*{0mm}
7333 hspace*{0mm}
7286 \end_inset
7334 \end_inset
7287
7335
7288 \SpecialChar ~
7336 \SpecialChar ~
7289 \SpecialChar ~
7337 \SpecialChar ~
7290 \SpecialChar ~
7338 \SpecialChar ~
7291 \SpecialChar ~
7339 \SpecialChar ~
7292 \SpecialChar ~
7340 \SpecialChar ~
7293 \SpecialChar ~
7341 \SpecialChar ~
7294 \SpecialChar ~
7342 \SpecialChar ~
7295 \SpecialChar ~
7343 \SpecialChar ~
7296 \SpecialChar ~
7344 \SpecialChar ~
7297 \SpecialChar ~
7345 \SpecialChar ~
7298 \SpecialChar ~
7346 \SpecialChar ~
7299 \SpecialChar ~
7347 \SpecialChar ~
7300 \SpecialChar ~
7348 \SpecialChar ~
7301 \SpecialChar ~
7349 \SpecialChar ~
7302 |..> \SpecialChar ~
7350 |..> \SpecialChar ~
7303 \SpecialChar ~
7351 \SpecialChar ~
7304 \SpecialChar ~
7352 \SpecialChar ~
7305 \SpecialChar ~
7353 \SpecialChar ~
7306 cp $f ${f}.bak
7354 cp $f ${f}.bak
7307 \layout Standard
7355 \layout Standard
7308
7356
7309 If you try using
7357 If you try using
7310 \family typewriter
7358 \family typewriter
7311 $f.bak
7359 $f.bak
7312 \family default
7360 \family default
7313 , you'll get an AttributeError exception saying that your string object
7361 , you'll get an AttributeError exception saying that your string object
7314 doesn't have a
7362 doesn't have a
7315 \family typewriter
7363 \family typewriter
7316 .bak
7364 .bak
7317 \family default
7365 \family default
7318 attribute.
7366 attribute.
7319 This is because the
7367 This is because the
7320 \family typewriter
7368 \family typewriter
7321 $
7369 $
7322 \family default
7370 \family default
7323 expansion mechanism allows you to expand full Python expressions:
7371 expansion mechanism allows you to expand full Python expressions:
7324 \layout Standard
7372 \layout Standard
7325
7373
7326
7374
7327 \family typewriter
7375 \family typewriter
7328 fperez[~/test]|13> echo "sys.platform is: $sys.platform"
7376 fperez[~/test]|13> echo "sys.platform is: $sys.platform"
7329 \newline
7377 \newline
7330 sys.platform is: linux2
7378 sys.platform is: linux2
7331 \layout Standard
7379 \layout Standard
7332
7380
7333 IPython's input history handling is still active, which allows you to rerun
7381 IPython's input history handling is still active, which allows you to rerun
7334 a single block of multi-line input by simply using exec:
7382 a single block of multi-line input by simply using exec:
7335 \newline
7383 \newline
7336
7384
7337 \family typewriter
7385 \family typewriter
7338 fperez[~/test]|14> $$alist = ls *.eps
7386 fperez[~/test]|14> $$alist = ls *.eps
7339 \newline
7387 \newline
7340 fperez[~/test]|15> exec _i11
7388 fperez[~/test]|15> exec _i11
7341 \newline
7389 \newline
7342 file image2.eps 921 image2.eps
7390 file image2.eps 921 image2.eps
7343 \newline
7391 \newline
7344 file image.eps 921 image.eps
7392 file image.eps 921 image.eps
7345 \layout Standard
7393 \layout Standard
7346
7394
7347 While these are new special-case syntaxes, they are designed to allow very
7395 While these are new special-case syntaxes, they are designed to allow very
7348 efficient use of the shell with minimal typing.
7396 efficient use of the shell with minimal typing.
7349 At an interactive shell prompt, conciseness of expression wins over readability.
7397 At an interactive shell prompt, conciseness of expression wins over readability.
7350 \layout Subsection
7398 \layout Subsection
7351
7399
7352 Useful functions and modules
7400 Useful functions and modules
7353 \layout Standard
7401 \layout Standard
7354
7402
7355 The os, sys and shutil modules from the Python standard library are automaticall
7403 The os, sys and shutil modules from the Python standard library are automaticall
7356 y loaded.
7404 y loaded.
7357 Some additional functions, useful for shell usage, are listed below.
7405 Some additional functions, useful for shell usage, are listed below.
7358 You can request more help about them with `
7406 You can request more help about them with `
7359 \family typewriter
7407 \family typewriter
7360 ?
7408 ?
7361 \family default
7409 \family default
7362 '.
7410 '.
7363 \layout Description
7411 \layout Description
7364
7412
7365
7413
7366 \family typewriter
7414 \family typewriter
7367 shell
7415 shell
7368 \family default
7416 \family default
7369 - execute a command in the underlying system shell
7417 - execute a command in the underlying system shell
7370 \layout Description
7418 \layout Description
7371
7419
7372
7420
7373 \family typewriter
7421 \family typewriter
7374 system
7422 system
7375 \family default
7423 \family default
7376 - like
7424 - like
7377 \family typewriter
7425 \family typewriter
7378 shell()
7426 shell()
7379 \family default
7427 \family default
7380 , but return the exit status of the command
7428 , but return the exit status of the command
7381 \layout Description
7429 \layout Description
7382
7430
7383
7431
7384 \family typewriter
7432 \family typewriter
7385 sout
7433 sout
7386 \family default
7434 \family default
7387 - capture the output of a command as a string
7435 - capture the output of a command as a string
7388 \layout Description
7436 \layout Description
7389
7437
7390
7438
7391 \family typewriter
7439 \family typewriter
7392 lout
7440 lout
7393 \family default
7441 \family default
7394 - capture the output of a command as a list (split on `
7442 - capture the output of a command as a list (split on `
7395 \backslash
7443 \backslash
7396 n')
7444 n')
7397 \layout Description
7445 \layout Description
7398
7446
7399
7447
7400 \family typewriter
7448 \family typewriter
7401 getoutputerror
7449 getoutputerror
7402 \family default
7450 \family default
7403 - capture (output,error) of a shell commandss
7451 - capture (output,error) of a shell commandss
7404 \layout Standard
7452 \layout Standard
7405
7453
7406
7454
7407 \family typewriter
7455 \family typewriter
7408 sout
7456 sout
7409 \family default
7457 \family default
7410 /
7458 /
7411 \family typewriter
7459 \family typewriter
7412 lout
7460 lout
7413 \family default
7461 \family default
7414 are the functional equivalents of
7462 are the functional equivalents of
7415 \family typewriter
7463 \family typewriter
7416 $
7464 $
7417 \family default
7465 \family default
7418 /
7466 /
7419 \family typewriter
7467 \family typewriter
7420 $$
7468 $$
7421 \family default
7469 \family default
7422 .
7470 .
7423 They are provided to allow you to capture system output in the middle of
7471 They are provided to allow you to capture system output in the middle of
7424 true python code, function definitions, etc (where
7472 true python code, function definitions, etc (where
7425 \family typewriter
7473 \family typewriter
7426 $
7474 $
7427 \family default
7475 \family default
7428 and
7476 and
7429 \family typewriter
7477 \family typewriter
7430 $$
7478 $$
7431 \family default
7479 \family default
7432 are invalid).
7480 are invalid).
7433 \layout Subsection
7481 \layout Subsection
7434
7482
7435 Directory management
7483 Directory management
7436 \layout Standard
7484 \layout Standard
7437
7485
7438 Since each command passed by pysh to the underlying system is executed in
7486 Since each command passed by pysh to the underlying system is executed in
7439 a subshell which exits immediately, you can NOT use !cd to navigate the
7487 a subshell which exits immediately, you can NOT use !cd to navigate the
7440 filesystem.
7488 filesystem.
7441 \layout Standard
7489 \layout Standard
7442
7490
7443 Pysh provides its own builtin
7491 Pysh provides its own builtin
7444 \family typewriter
7492 \family typewriter
7445 `%cd
7493 `%cd
7446 \family default
7494 \family default
7447 ' magic command to move in the filesystem (the
7495 ' magic command to move in the filesystem (the
7448 \family typewriter
7496 \family typewriter
7449 %
7497 %
7450 \family default
7498 \family default
7451 is not required with automagic on).
7499 is not required with automagic on).
7452 It also maintains a list of visited directories (use
7500 It also maintains a list of visited directories (use
7453 \family typewriter
7501 \family typewriter
7454 %dhist
7502 %dhist
7455 \family default
7503 \family default
7456 to see it) and allows direct switching to any of them.
7504 to see it) and allows direct switching to any of them.
7457 Type
7505 Type
7458 \family typewriter
7506 \family typewriter
7459 `cd?
7507 `cd?
7460 \family default
7508 \family default
7461 ' for more details.
7509 ' for more details.
7462 \layout Standard
7510 \layout Standard
7463
7511
7464
7512
7465 \family typewriter
7513 \family typewriter
7466 %pushd
7514 %pushd
7467 \family default
7515 \family default
7468 ,
7516 ,
7469 \family typewriter
7517 \family typewriter
7470 %popd
7518 %popd
7471 \family default
7519 \family default
7472 and
7520 and
7473 \family typewriter
7521 \family typewriter
7474 %dirs
7522 %dirs
7475 \family default
7523 \family default
7476 are provided for directory stack handling.
7524 are provided for directory stack handling.
7477 \layout Subsection
7525 \layout Subsection
7478
7526
7479 Prompt customization
7527 Prompt customization
7480 \layout Standard
7528 \layout Standard
7481
7529
7482 The supplied
7530 The supplied
7483 \family typewriter
7531 \family typewriter
7484 ipythonrc-pysh
7532 ipythonrc-pysh
7485 \family default
7533 \family default
7486 profile comes with an example of a very colored and detailed prompt, mainly
7534 profile comes with an example of a very colored and detailed prompt, mainly
7487 to serve as an illustration.
7535 to serve as an illustration.
7488 The valid escape sequences, besides color names, are:
7536 The valid escape sequences, besides color names, are:
7489 \layout Description
7537 \layout Description
7490
7538
7491
7539
7492 \backslash
7540 \backslash
7493 # - Prompt number.
7541 # - Prompt number.
7494 \layout Description
7542 \layout Description
7495
7543
7496
7544
7497 \backslash
7545 \backslash
7498 D - Dots, as many as there are digits in
7546 D - Dots, as many as there are digits in
7499 \backslash
7547 \backslash
7500 # (so they align).
7548 # (so they align).
7501 \layout Description
7549 \layout Description
7502
7550
7503
7551
7504 \backslash
7552 \backslash
7505 w - Current working directory (cwd).
7553 w - Current working directory (cwd).
7506 \layout Description
7554 \layout Description
7507
7555
7508
7556
7509 \backslash
7557 \backslash
7510 W - Basename of current working directory.
7558 W - Basename of current working directory.
7511 \layout Description
7559 \layout Description
7512
7560
7513
7561
7514 \backslash
7562 \backslash
7515 X
7563 X
7516 \emph on
7564 \emph on
7517 N
7565 N
7518 \emph default
7566 \emph default
7519 - Where
7567 - Where
7520 \emph on
7568 \emph on
7521 N
7569 N
7522 \emph default
7570 \emph default
7523 =0..5.
7571 =0..5.
7524 N terms of the cwd, with $HOME written as ~.
7572 N terms of the cwd, with $HOME written as ~.
7525 \layout Description
7573 \layout Description
7526
7574
7527
7575
7528 \backslash
7576 \backslash
7529 Y
7577 Y
7530 \emph on
7578 \emph on
7531 N
7579 N
7532 \emph default
7580 \emph default
7533 - Where
7581 - Where
7534 \emph on
7582 \emph on
7535 N
7583 N
7536 \emph default
7584 \emph default
7537 =0..5.
7585 =0..5.
7538 Like X
7586 Like X
7539 \emph on
7587 \emph on
7540 N
7588 N
7541 \emph default
7589 \emph default
7542 , but if ~ is term
7590 , but if ~ is term
7543 \emph on
7591 \emph on
7544 N
7592 N
7545 \emph default
7593 \emph default
7546 +1 it's also shown.
7594 +1 it's also shown.
7547 \layout Description
7595 \layout Description
7548
7596
7549
7597
7550 \backslash
7598 \backslash
7551 u - Username.
7599 u - Username.
7552 \layout Description
7600 \layout Description
7553
7601
7554
7602
7555 \backslash
7603 \backslash
7556 H - Full hostname.
7604 H - Full hostname.
7557 \layout Description
7605 \layout Description
7558
7606
7559
7607
7560 \backslash
7608 \backslash
7561 h - Hostname up to first '.'
7609 h - Hostname up to first '.'
7562 \layout Description
7610 \layout Description
7563
7611
7564
7612
7565 \backslash
7613 \backslash
7566 $ - Root symbol ($ or #).
7614 $ - Root symbol ($ or #).
7567
7615
7568 \layout Description
7616 \layout Description
7569
7617
7570
7618
7571 \backslash
7619 \backslash
7572 t - Current time, in H:M:S format.
7620 t - Current time, in H:M:S format.
7573 \layout Description
7621 \layout Description
7574
7622
7575
7623
7576 \backslash
7624 \backslash
7577 v - IPython release version.
7625 v - IPython release version.
7578
7626
7579 \layout Description
7627 \layout Description
7580
7628
7581
7629
7582 \backslash
7630 \backslash
7583 n - Newline.
7631 n - Newline.
7584
7632
7585 \layout Description
7633 \layout Description
7586
7634
7587
7635
7588 \backslash
7636 \backslash
7589 r - Carriage return.
7637 r - Carriage return.
7590
7638
7591 \layout Description
7639 \layout Description
7592
7640
7593
7641
7594 \backslash
7642 \backslash
7595
7643
7596 \backslash
7644 \backslash
7597 - An explicitly escaped '
7645 - An explicitly escaped '
7598 \backslash
7646 \backslash
7599 '.
7647 '.
7600 \layout Standard
7648 \layout Standard
7601
7649
7602 You can configure your prompt colors using any ANSI color escape.
7650 You can configure your prompt colors using any ANSI color escape.
7603 Each color escape sets the color for any subsequent text, until another
7651 Each color escape sets the color for any subsequent text, until another
7604 escape comes in and changes things.
7652 escape comes in and changes things.
7605 The valid color escapes are:
7653 The valid color escapes are:
7606 \layout Description
7654 \layout Description
7607
7655
7608
7656
7609 \backslash
7657 \backslash
7610 C_Black
7658 C_Black
7611 \layout Description
7659 \layout Description
7612
7660
7613
7661
7614 \backslash
7662 \backslash
7615 C_Blue
7663 C_Blue
7616 \layout Description
7664 \layout Description
7617
7665
7618
7666
7619 \backslash
7667 \backslash
7620 C_Brown
7668 C_Brown
7621 \layout Description
7669 \layout Description
7622
7670
7623
7671
7624 \backslash
7672 \backslash
7625 C_Cyan
7673 C_Cyan
7626 \layout Description
7674 \layout Description
7627
7675
7628
7676
7629 \backslash
7677 \backslash
7630 C_DarkGray
7678 C_DarkGray
7631 \layout Description
7679 \layout Description
7632
7680
7633
7681
7634 \backslash
7682 \backslash
7635 C_Green
7683 C_Green
7636 \layout Description
7684 \layout Description
7637
7685
7638
7686
7639 \backslash
7687 \backslash
7640 C_LightBlue
7688 C_LightBlue
7641 \layout Description
7689 \layout Description
7642
7690
7643
7691
7644 \backslash
7692 \backslash
7645 C_LightCyan
7693 C_LightCyan
7646 \layout Description
7694 \layout Description
7647
7695
7648
7696
7649 \backslash
7697 \backslash
7650 C_LightGray
7698 C_LightGray
7651 \layout Description
7699 \layout Description
7652
7700
7653
7701
7654 \backslash
7702 \backslash
7655 C_LightGreen
7703 C_LightGreen
7656 \layout Description
7704 \layout Description
7657
7705
7658
7706
7659 \backslash
7707 \backslash
7660 C_LightPurple
7708 C_LightPurple
7661 \layout Description
7709 \layout Description
7662
7710
7663
7711
7664 \backslash
7712 \backslash
7665 C_LightRed
7713 C_LightRed
7666 \layout Description
7714 \layout Description
7667
7715
7668
7716
7669 \backslash
7717 \backslash
7670 C_Purple
7718 C_Purple
7671 \layout Description
7719 \layout Description
7672
7720
7673
7721
7674 \backslash
7722 \backslash
7675 C_Red
7723 C_Red
7676 \layout Description
7724 \layout Description
7677
7725
7678
7726
7679 \backslash
7727 \backslash
7680 C_White
7728 C_White
7681 \layout Description
7729 \layout Description
7682
7730
7683
7731
7684 \backslash
7732 \backslash
7685 C_Yellow
7733 C_Yellow
7686 \layout Description
7734 \layout Description
7687
7735
7688
7736
7689 \backslash
7737 \backslash
7690 C_Normal Stop coloring, defaults to your terminal settings.
7738 C_Normal Stop coloring, defaults to your terminal settings.
7691 \layout Section
7739 \layout Section
7692
7740
7693
7741
7694 \begin_inset LatexCommand \label{sec:Threading-support}
7742 \begin_inset LatexCommand \label{sec:Threading-support}
7695
7743
7696 \end_inset
7744 \end_inset
7697
7745
7698 Threading support
7746 Threading support
7699 \layout Standard
7747 \layout Standard
7700
7748
7701
7749
7702 \series bold
7750 \series bold
7703 WARNING:
7751 WARNING:
7704 \series default
7752 \series default
7705 The threading support is still somewhat experimental, and it has only seen
7753 The threading support is still somewhat experimental, and it has only seen
7706 reasonable testing under Linux.
7754 reasonable testing under Linux.
7707 Threaded code is particularly tricky to debug, and it tends to show extremely
7755 Threaded code is particularly tricky to debug, and it tends to show extremely
7708 platform-dependent behavior.
7756 platform-dependent behavior.
7709 Since I only have access to Linux machines, I will have to rely on user's
7757 Since I only have access to Linux machines, I will have to rely on user's
7710 experiences and assistance for this area of IPython to improve under other
7758 experiences and assistance for this area of IPython to improve under other
7711 platforms.
7759 platforms.
7712 \layout Standard
7760 \layout Standard
7713
7761
7714 IPython, via the
7762 IPython, via the
7715 \family typewriter
7763 \family typewriter
7716 -gthread
7764 -gthread
7717 \family default
7765 \family default
7718 ,
7766 ,
7719 \family typewriter
7767 \family typewriter
7720 -qthread
7768 -qthread
7721 \family default
7769 \family default
7722 and
7770 and
7723 \family typewriter
7771 \family typewriter
7724 -wthread
7772 -wthread
7725 \family default
7773 \family default
7726 options (described in Sec.\SpecialChar ~
7774 options (described in Sec.\SpecialChar ~
7727
7775
7728 \begin_inset LatexCommand \ref{sec:threading-opts}
7776 \begin_inset LatexCommand \ref{sec:threading-opts}
7729
7777
7730 \end_inset
7778 \end_inset
7731
7779
7732 ), can run in multithreaded mode to support pyGTK, Qt and WXPython applications
7780 ), can run in multithreaded mode to support pyGTK, Qt and WXPython applications
7733 respectively.
7781 respectively.
7734 These GUI toolkits need to control the python main loop of execution, so
7782 These GUI toolkits need to control the python main loop of execution, so
7735 under a normal Python interpreter, starting a pyGTK, Qt or WXPython application
7783 under a normal Python interpreter, starting a pyGTK, Qt or WXPython application
7736 will immediately freeze the shell.
7784 will immediately freeze the shell.
7737
7785
7738 \layout Standard
7786 \layout Standard
7739
7787
7740 IPython, with one of these options (you can only use one at a time), separates
7788 IPython, with one of these options (you can only use one at a time), separates
7741 the graphical loop and IPython's code execution run into different threads.
7789 the graphical loop and IPython's code execution run into different threads.
7742 This allows you to test interactively (with
7790 This allows you to test interactively (with
7743 \family typewriter
7791 \family typewriter
7744 %run
7792 %run
7745 \family default
7793 \family default
7746 , for example) your GUI code without blocking.
7794 , for example) your GUI code without blocking.
7747 \layout Standard
7795 \layout Standard
7748
7796
7749 A nice mini-tutorial on using IPython along with the Qt Designer application
7797 A nice mini-tutorial on using IPython along with the Qt Designer application
7750 is available at the SciPy wiki:
7798 is available at the SciPy wiki:
7751 \begin_inset LatexCommand \htmlurl{http://www.scipy.org/wikis/topical_software/QtWithIPythonAndDesigner}
7799 \begin_inset LatexCommand \htmlurl{http://www.scipy.org/wikis/topical_software/QtWithIPythonAndDesigner}
7752
7800
7753 \end_inset
7801 \end_inset
7754
7802
7755 .
7803 .
7756 \layout Subsection
7804 \layout Subsection
7757
7805
7758 Tk issues
7806 Tk issues
7759 \layout Standard
7807 \layout Standard
7760
7808
7761 As indicated in Sec.\SpecialChar ~
7809 As indicated in Sec.\SpecialChar ~
7762
7810
7763 \begin_inset LatexCommand \ref{sec:threading-opts}
7811 \begin_inset LatexCommand \ref{sec:threading-opts}
7764
7812
7765 \end_inset
7813 \end_inset
7766
7814
7767 , a special
7815 , a special
7768 \family typewriter
7816 \family typewriter
7769 -tk
7817 -tk
7770 \family default
7818 \family default
7771 option is provided to try and allow Tk graphical applications to coexist
7819 option is provided to try and allow Tk graphical applications to coexist
7772 interactively with WX, Qt or GTK ones.
7820 interactively with WX, Qt or GTK ones.
7773 Whether this works at all, however, is very platform and configuration
7821 Whether this works at all, however, is very platform and configuration
7774 dependent.
7822 dependent.
7775 Please experiment with simple test cases before committing to using this
7823 Please experiment with simple test cases before committing to using this
7776 combination of Tk and GTK/Qt/WX threading in a production environment.
7824 combination of Tk and GTK/Qt/WX threading in a production environment.
7777 \layout Subsection
7825 \layout Subsection
7778
7826
7779 Signals and Threads
7827 Signals and Threads
7780 \layout Standard
7828 \layout Standard
7781
7829
7782 When any of the thread systems (GTK, Qt or WX) are active, either directly
7830 When any of the thread systems (GTK, Qt or WX) are active, either directly
7783 or via
7831 or via
7784 \family typewriter
7832 \family typewriter
7785 -pylab
7833 -pylab
7786 \family default
7834 \family default
7787 with a threaded backend, it is impossible to interrupt long-running Python
7835 with a threaded backend, it is impossible to interrupt long-running Python
7788 code via
7836 code via
7789 \family typewriter
7837 \family typewriter
7790 Ctrl-C
7838 Ctrl-C
7791 \family default
7839 \family default
7792 .
7840 .
7793 IPython can not pass the KeyboardInterrupt exception (or the underlying
7841 IPython can not pass the KeyboardInterrupt exception (or the underlying
7794
7842
7795 \family typewriter
7843 \family typewriter
7796 SIGINT
7844 SIGINT
7797 \family default
7845 \family default
7798 ) across threads, so any long-running process started from IPython will
7846 ) across threads, so any long-running process started from IPython will
7799 run to completion, or will have to be killed via an external (OS-based)
7847 run to completion, or will have to be killed via an external (OS-based)
7800 mechanism.
7848 mechanism.
7801 \layout Standard
7849 \layout Standard
7802
7850
7803 To the best of my knowledge, this limitation is imposed by the Python interprete
7851 To the best of my knowledge, this limitation is imposed by the Python interprete
7804 r itself, and it comes from the difficulty of writing portable signal/threaded
7852 r itself, and it comes from the difficulty of writing portable signal/threaded
7805 code.
7853 code.
7806 If any user is an expert on this topic and can suggest a better solution,
7854 If any user is an expert on this topic and can suggest a better solution,
7807 I would love to hear about it.
7855 I would love to hear about it.
7808 In the IPython sources, look at the
7856 In the IPython sources, look at the
7809 \family typewriter
7857 \family typewriter
7810 Shell.py
7858 Shell.py
7811 \family default
7859 \family default
7812 module, and in particular at the
7860 module, and in particular at the
7813 \family typewriter
7861 \family typewriter
7814 runcode()
7862 runcode()
7815 \family default
7863 \family default
7816 method.
7864 method.
7817
7865
7818 \layout Subsection
7866 \layout Subsection
7819
7867
7820 I/O pitfalls
7868 I/O pitfalls
7821 \layout Standard
7869 \layout Standard
7822
7870
7823 Be mindful that the Python interpreter switches between threads every
7871 Be mindful that the Python interpreter switches between threads every
7824 \begin_inset Formula $N$
7872 \begin_inset Formula $N$
7825 \end_inset
7873 \end_inset
7826
7874
7827 bytecodes, where the default value as of Python\SpecialChar ~
7875 bytecodes, where the default value as of Python\SpecialChar ~
7828 2.3 is
7876 2.3 is
7829 \begin_inset Formula $N=100.$
7877 \begin_inset Formula $N=100.$
7830 \end_inset
7878 \end_inset
7831
7879
7832 This value can be read by using the
7880 This value can be read by using the
7833 \family typewriter
7881 \family typewriter
7834 sys.getcheckinterval()
7882 sys.getcheckinterval()
7835 \family default
7883 \family default
7836 function, and it can be reset via
7884 function, and it can be reset via
7837 \family typewriter
7885 \family typewriter
7838 sys.setcheckinterval(
7886 sys.setcheckinterval(
7839 \emph on
7887 \emph on
7840 N
7888 N
7841 \emph default
7889 \emph default
7842 )
7890 )
7843 \family default
7891 \family default
7844 .
7892 .
7845 This switching of threads can cause subtly confusing effects if one of
7893 This switching of threads can cause subtly confusing effects if one of
7846 your threads is doing file I/O.
7894 your threads is doing file I/O.
7847 In text mode, most systems only flush file buffers when they encounter
7895 In text mode, most systems only flush file buffers when they encounter
7848 a
7896 a
7849 \family typewriter
7897 \family typewriter
7850 `
7898 `
7851 \backslash
7899 \backslash
7852 n'
7900 n'
7853 \family default
7901 \family default
7854 .
7902 .
7855 An instruction as simple as
7903 An instruction as simple as
7856 \family typewriter
7904 \family typewriter
7857
7905
7858 \newline
7906 \newline
7859 \SpecialChar ~
7907 \SpecialChar ~
7860 \SpecialChar ~
7908 \SpecialChar ~
7861 print >> filehandle,
7909 print >> filehandle,
7862 \begin_inset Quotes eld
7910 \begin_inset Quotes eld
7863 \end_inset
7911 \end_inset
7864
7912
7865 hello world
7913 hello world
7866 \begin_inset Quotes erd
7914 \begin_inset Quotes erd
7867 \end_inset
7915 \end_inset
7868
7916
7869
7917
7870 \family default
7918 \family default
7871
7919
7872 \newline
7920 \newline
7873 actually consists of several bytecodes, so it is possible that the newline
7921 actually consists of several bytecodes, so it is possible that the newline
7874 does not reach your file before the next thread switch.
7922 does not reach your file before the next thread switch.
7875 Similarly, if you are writing to a file in binary mode, the file won't
7923 Similarly, if you are writing to a file in binary mode, the file won't
7876 be flushed until the buffer fills, and your other thread may see apparently
7924 be flushed until the buffer fills, and your other thread may see apparently
7877 truncated files.
7925 truncated files.
7878
7926
7879 \layout Standard
7927 \layout Standard
7880
7928
7881 For this reason, if you are using IPython's thread support and have (for
7929 For this reason, if you are using IPython's thread support and have (for
7882 example) a GUI application which will read data generated by files written
7930 example) a GUI application which will read data generated by files written
7883 to from the IPython thread, the safest approach is to open all of your
7931 to from the IPython thread, the safest approach is to open all of your
7884 files in unbuffered mode (the third argument to the
7932 files in unbuffered mode (the third argument to the
7885 \family typewriter
7933 \family typewriter
7886 file/open
7934 file/open
7887 \family default
7935 \family default
7888 function is the buffering value):
7936 function is the buffering value):
7889 \newline
7937 \newline
7890
7938
7891 \family typewriter
7939 \family typewriter
7892 \SpecialChar ~
7940 \SpecialChar ~
7893 \SpecialChar ~
7941 \SpecialChar ~
7894 filehandle = open(filename,mode,0)
7942 filehandle = open(filename,mode,0)
7895 \layout Standard
7943 \layout Standard
7896
7944
7897 This is obviously a brute force way of avoiding race conditions with the
7945 This is obviously a brute force way of avoiding race conditions with the
7898 file buffering.
7946 file buffering.
7899 If you want to do it cleanly, and you have a resource which is being shared
7947 If you want to do it cleanly, and you have a resource which is being shared
7900 by the interactive IPython loop and your GUI thread, you should really
7948 by the interactive IPython loop and your GUI thread, you should really
7901 handle it with thread locking and syncrhonization properties.
7949 handle it with thread locking and syncrhonization properties.
7902 The Python documentation discusses these.
7950 The Python documentation discusses these.
7903 \layout Section
7951 \layout Section
7904
7952
7905
7953
7906 \begin_inset LatexCommand \label{sec:interactive-demos}
7954 \begin_inset LatexCommand \label{sec:interactive-demos}
7907
7955
7908 \end_inset
7956 \end_inset
7909
7957
7910 Interactive demos with IPython
7958 Interactive demos with IPython
7911 \layout Standard
7959 \layout Standard
7912
7960
7913 IPython ships with a basic system for running scripts interactively in sections,
7961 IPython ships with a basic system for running scripts interactively in sections,
7914 useful when presenting code to audiences.
7962 useful when presenting code to audiences.
7915 A few tags embedded in comments (so that the script remains valid Python
7963 A few tags embedded in comments (so that the script remains valid Python
7916 code) divide a file into separate blocks, and the demo can be run one block
7964 code) divide a file into separate blocks, and the demo can be run one block
7917 at a time, with IPython printing (with syntax highlighting) the block before
7965 at a time, with IPython printing (with syntax highlighting) the block before
7918 executing it, and returning to the interactive prompt after each block.
7966 executing it, and returning to the interactive prompt after each block.
7919 The interactive namespace is updated after each block is run with the contents
7967 The interactive namespace is updated after each block is run with the contents
7920 of the demo's namespace.
7968 of the demo's namespace.
7921 \layout Standard
7969 \layout Standard
7922
7970
7923 This allows you to show a piece of code, run it and then execute interactively
7971 This allows you to show a piece of code, run it and then execute interactively
7924 commands based on the variables just created.
7972 commands based on the variables just created.
7925 Once you want to continue, you simply execute the next block of the demo.
7973 Once you want to continue, you simply execute the next block of the demo.
7926 The following listing shows the markup necessary for dividing a script
7974 The following listing shows the markup necessary for dividing a script
7927 into sections for execution as a demo.
7975 into sections for execution as a demo.
7928 \layout Standard
7976 \layout Standard
7929
7977
7930
7978
7931 \begin_inset ERT
7979 \begin_inset ERT
7932 status Open
7980 status Open
7933
7981
7934 \layout Standard
7982 \layout Standard
7935
7983
7936 \backslash
7984 \backslash
7937 codelist{examples/example-demo.py}
7985 codelist{examples/example-demo.py}
7938 \end_inset
7986 \end_inset
7939
7987
7940
7988
7941 \layout Standard
7989 \layout Standard
7942
7990
7943 In order to run a file as a demo, you must first make a
7991 In order to run a file as a demo, you must first make a
7944 \family typewriter
7992 \family typewriter
7945 Demo
7993 Demo
7946 \family default
7994 \family default
7947 object out of it.
7995 object out of it.
7948 If the file is named
7996 If the file is named
7949 \family typewriter
7997 \family typewriter
7950 myscript.py
7998 myscript.py
7951 \family default
7999 \family default
7952 , the following code will make a demo:
8000 , the following code will make a demo:
7953 \layout LyX-Code
8001 \layout LyX-Code
7954
8002
7955 from IPython.demo import Demo
8003 from IPython.demo import Demo
7956 \layout LyX-Code
8004 \layout LyX-Code
7957
8005
7958 mydemo = Demo('myscript.py')
8006 mydemo = Demo('myscript.py')
7959 \layout Standard
8007 \layout Standard
7960
8008
7961 This creates the
8009 This creates the
7962 \family typewriter
8010 \family typewriter
7963 mydemo
8011 mydemo
7964 \family default
8012 \family default
7965 object, whose blocks you run one at a time by simply calling the object
8013 object, whose blocks you run one at a time by simply calling the object
7966 with no arguments.
8014 with no arguments.
7967 If you have autocall active in IPython (the default), all you need to do
8015 If you have autocall active in IPython (the default), all you need to do
7968 is type
8016 is type
7969 \layout LyX-Code
8017 \layout LyX-Code
7970
8018
7971 mydemo
8019 mydemo
7972 \layout Standard
8020 \layout Standard
7973
8021
7974 and IPython will call it, executing each block.
8022 and IPython will call it, executing each block.
7975 Demo objects can be restarted, you can move forward or back skipping blocks,
8023 Demo objects can be restarted, you can move forward or back skipping blocks,
7976 re-execute the last block, etc.
8024 re-execute the last block, etc.
7977 Simply use the Tab key on a demo object to see its methods, and call
8025 Simply use the Tab key on a demo object to see its methods, and call
7978 \family typewriter
8026 \family typewriter
7979 `?'
8027 `?'
7980 \family default
8028 \family default
7981 on them to see their docstrings for more usage details.
8029 on them to see their docstrings for more usage details.
7982 In addition, the
8030 In addition, the
7983 \family typewriter
8031 \family typewriter
7984 demo
8032 demo
7985 \family default
8033 \family default
7986 module itself contains a comprehensive docstring, which you can access
8034 module itself contains a comprehensive docstring, which you can access
7987 via
8035 via
7988 \layout LyX-Code
8036 \layout LyX-Code
7989
8037
7990 from IPython import demo
8038 from IPython import demo
7991 \layout LyX-Code
8039 \layout LyX-Code
7992
8040
7993 demo?
8041 demo?
7994 \layout Standard
8042 \layout Standard
7995
8043
7996
8044
7997 \series bold
8045 \series bold
7998 Limitations:
8046 Limitations:
7999 \series default
8047 \series default
8000 It is important to note that these demos are limited to fairly simple uses.
8048 It is important to note that these demos are limited to fairly simple uses.
8001 In particular, you can
8049 In particular, you can
8002 \emph on
8050 \emph on
8003 not
8051 not
8004 \emph default
8052 \emph default
8005 put division marks in indented code (loops, if statements, function definitions
8053 put division marks in indented code (loops, if statements, function definitions
8006 , etc.) Supporting something like this would basically require tracking the
8054 , etc.) Supporting something like this would basically require tracking the
8007 internal execution state of the Python interpreter, so only top-level divisions
8055 internal execution state of the Python interpreter, so only top-level divisions
8008 are allowed.
8056 are allowed.
8009 If you want to be able to open an IPython instance at an arbitrary point
8057 If you want to be able to open an IPython instance at an arbitrary point
8010 in a program, you can use IPython's embedding facilities, described in
8058 in a program, you can use IPython's embedding facilities, described in
8011 detail in Sec\SpecialChar \@.
8059 detail in Sec\SpecialChar \@.
8012 \SpecialChar ~
8060 \SpecialChar ~
8013
8061
8014 \begin_inset LatexCommand \ref{sec:embed}
8062 \begin_inset LatexCommand \ref{sec:embed}
8015
8063
8016 \end_inset
8064 \end_inset
8017
8065
8018 .
8066 .
8019 \layout Section
8067 \layout Section
8020
8068
8021
8069
8022 \begin_inset LatexCommand \label{sec:matplotlib-support}
8070 \begin_inset LatexCommand \label{sec:matplotlib-support}
8023
8071
8024 \end_inset
8072 \end_inset
8025
8073
8026 Plotting with
8074 Plotting with
8027 \family typewriter
8075 \family typewriter
8028 matplotlib
8076 matplotlib
8029 \family default
8077 \family default
8030
8078
8031 \layout Standard
8079 \layout Standard
8032
8080
8033 The matplotlib library (
8081 The matplotlib library (
8034 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
8082 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
8035
8083
8036 \end_inset
8084 \end_inset
8037
8085
8038 ) provides high quality 2D plotting for Python.
8086 ) provides high quality 2D plotting for Python.
8039 Matplotlib can produce plots on screen using a variety of GUI toolkits,
8087 Matplotlib can produce plots on screen using a variety of GUI toolkits,
8040 including Tk, GTK and WXPython.
8088 including Tk, GTK and WXPython.
8041 It also provides a number of commands useful for scientific computing,
8089 It also provides a number of commands useful for scientific computing,
8042 all with a syntax compatible with that of the popular Matlab program.
8090 all with a syntax compatible with that of the popular Matlab program.
8043 \layout Standard
8091 \layout Standard
8044
8092
8045 IPython accepts the special option
8093 IPython accepts the special option
8046 \family typewriter
8094 \family typewriter
8047 -pylab
8095 -pylab
8048 \family default
8096 \family default
8049 (Sec.\SpecialChar ~
8097 (Sec.\SpecialChar ~
8050
8098
8051 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
8099 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
8052
8100
8053 \end_inset
8101 \end_inset
8054
8102
8055 ).
8103 ).
8056 This configures it to support matplotlib, honoring the settings in the
8104 This configures it to support matplotlib, honoring the settings in the
8057
8105
8058 \family typewriter
8106 \family typewriter
8059 .matplotlibrc
8107 .matplotlibrc
8060 \family default
8108 \family default
8061 file.
8109 file.
8062 IPython will detect the user's choice of matplotlib GUI backend, and automatica
8110 IPython will detect the user's choice of matplotlib GUI backend, and automatica
8063 lly select the proper threading model to prevent blocking.
8111 lly select the proper threading model to prevent blocking.
8064 It also sets matplotlib in interactive mode and modifies
8112 It also sets matplotlib in interactive mode and modifies
8065 \family typewriter
8113 \family typewriter
8066 %run
8114 %run
8067 \family default
8115 \family default
8068 slightly, so that any matplotlib-based script can be executed using
8116 slightly, so that any matplotlib-based script can be executed using
8069 \family typewriter
8117 \family typewriter
8070 %run
8118 %run
8071 \family default
8119 \family default
8072 and the final
8120 and the final
8073 \family typewriter
8121 \family typewriter
8074 show()
8122 show()
8075 \family default
8123 \family default
8076 command does not block the interactive shell.
8124 command does not block the interactive shell.
8077 \layout Standard
8125 \layout Standard
8078
8126
8079 The
8127 The
8080 \family typewriter
8128 \family typewriter
8081 -pylab
8129 -pylab
8082 \family default
8130 \family default
8083 option must be given first in order for IPython to configure its threading
8131 option must be given first in order for IPython to configure its threading
8084 mode.
8132 mode.
8085 However, you can still issue other options afterwards.
8133 However, you can still issue other options afterwards.
8086 This allows you to have a matplotlib-based environment customized with
8134 This allows you to have a matplotlib-based environment customized with
8087 additional modules using the standard IPython profile mechanism (Sec.\SpecialChar ~
8135 additional modules using the standard IPython profile mechanism (Sec.\SpecialChar ~
8088
8136
8089 \begin_inset LatexCommand \ref{sec:profiles}
8137 \begin_inset LatexCommand \ref{sec:profiles}
8090
8138
8091 \end_inset
8139 \end_inset
8092
8140
8093 ): ``
8141 ): ``
8094 \family typewriter
8142 \family typewriter
8095 ipython -pylab -p myprofile
8143 ipython -pylab -p myprofile
8096 \family default
8144 \family default
8097 '' will load the profile defined in
8145 '' will load the profile defined in
8098 \family typewriter
8146 \family typewriter
8099 ipythonrc-myprofile
8147 ipythonrc-myprofile
8100 \family default
8148 \family default
8101 after configuring matplotlib.
8149 after configuring matplotlib.
8102 \layout Section
8150 \layout Section
8103
8151
8104
8152
8105 \begin_inset LatexCommand \label{sec:Gnuplot}
8153 \begin_inset LatexCommand \label{sec:Gnuplot}
8106
8154
8107 \end_inset
8155 \end_inset
8108
8156
8109 Plotting with
8157 Plotting with
8110 \family typewriter
8158 \family typewriter
8111 Gnuplot
8159 Gnuplot
8112 \layout Standard
8160 \layout Standard
8113
8161
8114 Through the magic extension system described in sec.
8162 Through the magic extension system described in sec.
8115
8163
8116 \begin_inset LatexCommand \ref{sec:magic}
8164 \begin_inset LatexCommand \ref{sec:magic}
8117
8165
8118 \end_inset
8166 \end_inset
8119
8167
8120 , IPython incorporates a mechanism for conveniently interfacing with the
8168 , IPython incorporates a mechanism for conveniently interfacing with the
8121 Gnuplot system (
8169 Gnuplot system (
8122 \begin_inset LatexCommand \htmlurl{http://www.gnuplot.info}
8170 \begin_inset LatexCommand \htmlurl{http://www.gnuplot.info}
8123
8171
8124 \end_inset
8172 \end_inset
8125
8173
8126 ).
8174 ).
8127 Gnuplot is a very complete 2D and 3D plotting package available for many
8175 Gnuplot is a very complete 2D and 3D plotting package available for many
8128 operating systems and commonly included in modern Linux distributions.
8176 operating systems and commonly included in modern Linux distributions.
8129
8177
8130 \layout Standard
8178 \layout Standard
8131
8179
8132 Besides having Gnuplot installed, this functionality requires the
8180 Besides having Gnuplot installed, this functionality requires the
8133 \family typewriter
8181 \family typewriter
8134 Gnuplot.py
8182 Gnuplot.py
8135 \family default
8183 \family default
8136 module for interfacing python with Gnuplot.
8184 module for interfacing python with Gnuplot.
8137 It can be downloaded from:
8185 It can be downloaded from:
8138 \begin_inset LatexCommand \htmlurl{http://gnuplot-py.sourceforge.net}
8186 \begin_inset LatexCommand \htmlurl{http://gnuplot-py.sourceforge.net}
8139
8187
8140 \end_inset
8188 \end_inset
8141
8189
8142 .
8190 .
8143 \layout Subsection
8191 \layout Subsection
8144
8192
8145 Proper Gnuplot configuration
8193 Proper Gnuplot configuration
8146 \layout Standard
8194 \layout Standard
8147
8195
8148 As of version 4.0, Gnuplot has excellent mouse and interactive keyboard support.
8196 As of version 4.0, Gnuplot has excellent mouse and interactive keyboard support.
8149 However, as of
8197 However, as of
8150 \family typewriter
8198 \family typewriter
8151 Gnuplot.py
8199 Gnuplot.py
8152 \family default
8200 \family default
8153 version 1.7, a new option was added to communicate between Python and Gnuplot
8201 version 1.7, a new option was added to communicate between Python and Gnuplot
8154 via FIFOs (pipes).
8202 via FIFOs (pipes).
8155 This mechanism, while fast, also breaks the mouse system.
8203 This mechanism, while fast, also breaks the mouse system.
8156 You must therefore set the variable
8204 You must therefore set the variable
8157 \family typewriter
8205 \family typewriter
8158 prefer_fifo_data
8206 prefer_fifo_data
8159 \family default
8207 \family default
8160 to
8208 to
8161 \family typewriter
8209 \family typewriter
8162 0
8210 0
8163 \family default
8211 \family default
8164 in file
8212 in file
8165 \family typewriter
8213 \family typewriter
8166 gp_unix.py
8214 gp_unix.py
8167 \family default
8215 \family default
8168 if you wish to keep the interactive mouse and keyboard features working
8216 if you wish to keep the interactive mouse and keyboard features working
8169 properly (
8217 properly (
8170 \family typewriter
8218 \family typewriter
8171 prefer_inline_data
8219 prefer_inline_data
8172 \family default
8220 \family default
8173 also must be
8221 also must be
8174 \family typewriter
8222 \family typewriter
8175 0
8223 0
8176 \family default
8224 \family default
8177 , but this is the default so unless you've changed it manually you should
8225 , but this is the default so unless you've changed it manually you should
8178 be fine).
8226 be fine).
8179 \layout Standard
8227 \layout Standard
8180
8228
8181 'Out of the box', Gnuplot is configured with a rather poor set of size,
8229 'Out of the box', Gnuplot is configured with a rather poor set of size,
8182 color and linewidth choices which make the graphs fairly hard to read on
8230 color and linewidth choices which make the graphs fairly hard to read on
8183 modern high-resolution displays (although they work fine on old 640x480
8231 modern high-resolution displays (although they work fine on old 640x480
8184 ones).
8232 ones).
8185 Below is a section of my
8233 Below is a section of my
8186 \family typewriter
8234 \family typewriter
8187 .Xdefaults
8235 .Xdefaults
8188 \family default
8236 \family default
8189 file which I use for having a more convenient Gnuplot setup.
8237 file which I use for having a more convenient Gnuplot setup.
8190 Remember to load it by running
8238 Remember to load it by running
8191 \family typewriter
8239 \family typewriter
8192 `xrdb .Xdefaults`
8240 `xrdb .Xdefaults`
8193 \family default
8241 \family default
8194 :
8242 :
8195 \layout Standard
8243 \layout Standard
8196
8244
8197
8245
8198 \family typewriter
8246 \family typewriter
8199 !******************************************************************
8247 !******************************************************************
8200 \newline
8248 \newline
8201 ! gnuplot options
8249 ! gnuplot options
8202 \newline
8250 \newline
8203 ! modify this for a convenient window size
8251 ! modify this for a convenient window size
8204 \newline
8252 \newline
8205 gnuplot*geometry: 780x580
8253 gnuplot*geometry: 780x580
8206 \layout Standard
8254 \layout Standard
8207
8255
8208
8256
8209 \family typewriter
8257 \family typewriter
8210 ! on-screen font (not for PostScript)
8258 ! on-screen font (not for PostScript)
8211 \newline
8259 \newline
8212 gnuplot*font: -misc-fixed-bold-r-normal--15-120-100-100-c-90-iso8859-1
8260 gnuplot*font: -misc-fixed-bold-r-normal--15-120-100-100-c-90-iso8859-1
8213 \layout Standard
8261 \layout Standard
8214
8262
8215
8263
8216 \family typewriter
8264 \family typewriter
8217 ! color options
8265 ! color options
8218 \newline
8266 \newline
8219 gnuplot*background: black
8267 gnuplot*background: black
8220 \newline
8268 \newline
8221 gnuplot*textColor: white
8269 gnuplot*textColor: white
8222 \newline
8270 \newline
8223 gnuplot*borderColor: white
8271 gnuplot*borderColor: white
8224 \newline
8272 \newline
8225 gnuplot*axisColor: white
8273 gnuplot*axisColor: white
8226 \newline
8274 \newline
8227 gnuplot*line1Color: red
8275 gnuplot*line1Color: red
8228 \newline
8276 \newline
8229 gnuplot*line2Color: green
8277 gnuplot*line2Color: green
8230 \newline
8278 \newline
8231 gnuplot*line3Color: blue
8279 gnuplot*line3Color: blue
8232 \newline
8280 \newline
8233 gnuplot*line4Color: magenta
8281 gnuplot*line4Color: magenta
8234 \newline
8282 \newline
8235 gnuplot*line5Color: cyan
8283 gnuplot*line5Color: cyan
8236 \newline
8284 \newline
8237 gnuplot*line6Color: sienna
8285 gnuplot*line6Color: sienna
8238 \newline
8286 \newline
8239 gnuplot*line7Color: orange
8287 gnuplot*line7Color: orange
8240 \newline
8288 \newline
8241 gnuplot*line8Color: coral
8289 gnuplot*line8Color: coral
8242 \layout Standard
8290 \layout Standard
8243
8291
8244
8292
8245 \family typewriter
8293 \family typewriter
8246 ! multiplicative factor for point styles
8294 ! multiplicative factor for point styles
8247 \newline
8295 \newline
8248 gnuplot*pointsize: 2
8296 gnuplot*pointsize: 2
8249 \layout Standard
8297 \layout Standard
8250
8298
8251
8299
8252 \family typewriter
8300 \family typewriter
8253 ! line width options (in pixels)
8301 ! line width options (in pixels)
8254 \newline
8302 \newline
8255 gnuplot*borderWidth: 2
8303 gnuplot*borderWidth: 2
8256 \newline
8304 \newline
8257 gnuplot*axisWidth: 2
8305 gnuplot*axisWidth: 2
8258 \newline
8306 \newline
8259 gnuplot*line1Width: 2
8307 gnuplot*line1Width: 2
8260 \newline
8308 \newline
8261 gnuplot*line2Width: 2
8309 gnuplot*line2Width: 2
8262 \newline
8310 \newline
8263 gnuplot*line3Width: 2
8311 gnuplot*line3Width: 2
8264 \newline
8312 \newline
8265 gnuplot*line4Width: 2
8313 gnuplot*line4Width: 2
8266 \newline
8314 \newline
8267 gnuplot*line5Width: 2
8315 gnuplot*line5Width: 2
8268 \newline
8316 \newline
8269 gnuplot*line6Width: 2
8317 gnuplot*line6Width: 2
8270 \newline
8318 \newline
8271 gnuplot*line7Width: 2
8319 gnuplot*line7Width: 2
8272 \newline
8320 \newline
8273 gnuplot*line8Width: 2
8321 gnuplot*line8Width: 2
8274 \layout Subsection
8322 \layout Subsection
8275
8323
8276 The
8324 The
8277 \family typewriter
8325 \family typewriter
8278 IPython.GnuplotRuntime
8326 IPython.GnuplotRuntime
8279 \family default
8327 \family default
8280 module
8328 module
8281 \layout Standard
8329 \layout Standard
8282
8330
8283 IPython includes a module called
8331 IPython includes a module called
8284 \family typewriter
8332 \family typewriter
8285 Gnuplot2.py
8333 Gnuplot2.py
8286 \family default
8334 \family default
8287 which extends and improves the default
8335 which extends and improves the default
8288 \family typewriter
8336 \family typewriter
8289 Gnuplot
8337 Gnuplot
8290 \family default
8338 \family default
8291 .
8339 .
8292 \family typewriter
8340 \family typewriter
8293 py
8341 py
8294 \family default
8342 \family default
8295 (which it still relies upon).
8343 (which it still relies upon).
8296 For example, the new
8344 For example, the new
8297 \family typewriter
8345 \family typewriter
8298 plot
8346 plot
8299 \family default
8347 \family default
8300 function adds several improvements to the original making it more convenient
8348 function adds several improvements to the original making it more convenient
8301 for interactive use, and
8349 for interactive use, and
8302 \family typewriter
8350 \family typewriter
8303 hardcopy
8351 hardcopy
8304 \family default
8352 \family default
8305 fixes a bug in the original which under some circumstances blocks the creation
8353 fixes a bug in the original which under some circumstances blocks the creation
8306 of PostScript output.
8354 of PostScript output.
8307 \layout Standard
8355 \layout Standard
8308
8356
8309 For scripting use,
8357 For scripting use,
8310 \family typewriter
8358 \family typewriter
8311 GnuplotRuntime.py
8359 GnuplotRuntime.py
8312 \family default
8360 \family default
8313 is provided, which wraps
8361 is provided, which wraps
8314 \family typewriter
8362 \family typewriter
8315 Gnuplot2.py
8363 Gnuplot2.py
8316 \family default
8364 \family default
8317 and creates a series of global aliases.
8365 and creates a series of global aliases.
8318 These make it easy to control Gnuplot plotting jobs through the Python
8366 These make it easy to control Gnuplot plotting jobs through the Python
8319 language.
8367 language.
8320 \layout Standard
8368 \layout Standard
8321
8369
8322 Below is some example code which illustrates how to configure Gnuplot inside
8370 Below is some example code which illustrates how to configure Gnuplot inside
8323 your own programs but have it available for further interactive use through
8371 your own programs but have it available for further interactive use through
8324 an embedded IPython instance.
8372 an embedded IPython instance.
8325 Simply run this file at a system prompt.
8373 Simply run this file at a system prompt.
8326 This file is provided as
8374 This file is provided as
8327 \family typewriter
8375 \family typewriter
8328 example-gnuplot.py
8376 example-gnuplot.py
8329 \family default
8377 \family default
8330 in the examples directory:
8378 in the examples directory:
8331 \layout Standard
8379 \layout Standard
8332
8380
8333
8381
8334 \begin_inset ERT
8382 \begin_inset ERT
8335 status Open
8383 status Open
8336
8384
8337 \layout Standard
8385 \layout Standard
8338
8386
8339 \backslash
8387 \backslash
8340 codelist{examples/example-gnuplot.py}
8388 codelist{examples/example-gnuplot.py}
8341 \end_inset
8389 \end_inset
8342
8390
8343
8391
8344 \layout Subsection
8392 \layout Subsection
8345
8393
8346 The
8394 The
8347 \family typewriter
8395 \family typewriter
8348 numeric
8396 numeric
8349 \family default
8397 \family default
8350 profile: a scientific computing environment
8398 profile: a scientific computing environment
8351 \layout Standard
8399 \layout Standard
8352
8400
8353 The
8401 The
8354 \family typewriter
8402 \family typewriter
8355 numeric
8403 numeric
8356 \family default
8404 \family default
8357 IPython profile, which you can activate with
8405 IPython profile, which you can activate with
8358 \family typewriter
8406 \family typewriter
8359 `ipython -p numeric
8407 `ipython -p numeric
8360 \family default
8408 \family default
8361 ' will automatically load the IPython Gnuplot extensions (plus Numeric and
8409 ' will automatically load the IPython Gnuplot extensions (plus Numeric and
8362 other useful things for numerical computing), contained in the
8410 other useful things for numerical computing), contained in the
8363 \family typewriter
8411 \family typewriter
8364 IPython.GnuplotInteractive
8412 IPython.GnuplotInteractive
8365 \family default
8413 \family default
8366 module.
8414 module.
8367 This will create the globals
8415 This will create the globals
8368 \family typewriter
8416 \family typewriter
8369 Gnuplot
8417 Gnuplot
8370 \family default
8418 \family default
8371 (an alias to the improved Gnuplot2 module),
8419 (an alias to the improved Gnuplot2 module),
8372 \family typewriter
8420 \family typewriter
8373 gp
8421 gp
8374 \family default
8422 \family default
8375 (a Gnuplot active instance), the new magic commands
8423 (a Gnuplot active instance), the new magic commands
8376 \family typewriter
8424 \family typewriter
8377 %gpc
8425 %gpc
8378 \family default
8426 \family default
8379 and
8427 and
8380 \family typewriter
8428 \family typewriter
8381 %gp_set_instance
8429 %gp_set_instance
8382 \family default
8430 \family default
8383 and several other convenient globals.
8431 and several other convenient globals.
8384 Type
8432 Type
8385 \family typewriter
8433 \family typewriter
8386 gphelp()
8434 gphelp()
8387 \family default
8435 \family default
8388 for further details.
8436 for further details.
8389 \layout Standard
8437 \layout Standard
8390
8438
8391 This should turn IPython into a convenient environment for numerical computing,
8439 This should turn IPython into a convenient environment for numerical computing,
8392 with all the functions in the NumPy library and the Gnuplot facilities
8440 with all the functions in the NumPy library and the Gnuplot facilities
8393 for plotting.
8441 for plotting.
8394 Further improvements can be obtained by loading the SciPy libraries for
8442 Further improvements can be obtained by loading the SciPy libraries for
8395 scientific computing, available at
8443 scientific computing, available at
8396 \begin_inset LatexCommand \htmlurl{http://scipy.org}
8444 \begin_inset LatexCommand \htmlurl{http://scipy.org}
8397
8445
8398 \end_inset
8446 \end_inset
8399
8447
8400 .
8448 .
8401 \layout Standard
8449 \layout Standard
8402
8450
8403 If you are in the middle of a working session with numerical objects and
8451 If you are in the middle of a working session with numerical objects and
8404 need to plot them but you didn't start the
8452 need to plot them but you didn't start the
8405 \family typewriter
8453 \family typewriter
8406 numeric
8454 numeric
8407 \family default
8455 \family default
8408 profile, you can load these extensions at any time by typing
8456 profile, you can load these extensions at any time by typing
8409 \newline
8457 \newline
8410
8458
8411 \family typewriter
8459 \family typewriter
8412 from IPython.GnuplotInteractive import *
8460 from IPython.GnuplotInteractive import *
8413 \newline
8461 \newline
8414
8462
8415 \family default
8463 \family default
8416 at the IPython prompt.
8464 at the IPython prompt.
8417 This will allow you to keep your objects intact and start using Gnuplot
8465 This will allow you to keep your objects intact and start using Gnuplot
8418 to view them.
8466 to view them.
8419 \layout Section
8467 \layout Section
8420
8468
8421 Reporting bugs
8469 Reporting bugs
8422 \layout Subsection*
8470 \layout Subsection*
8423
8471
8424 Automatic crash reports
8472 Automatic crash reports
8425 \layout Standard
8473 \layout Standard
8426
8474
8427 Ideally, IPython itself shouldn't crash.
8475 Ideally, IPython itself shouldn't crash.
8428 It will catch exceptions produced by you, but bugs in its internals will
8476 It will catch exceptions produced by you, but bugs in its internals will
8429 still crash it.
8477 still crash it.
8430 \layout Standard
8478 \layout Standard
8431
8479
8432 In such a situation, IPython will leave a file named
8480 In such a situation, IPython will leave a file named
8433 \family typewriter
8481 \family typewriter
8434 IPython_crash_report.txt
8482 IPython_crash_report.txt
8435 \family default
8483 \family default
8436 in your IPYTHONDIR directory (that way if crashes happen several times
8484 in your IPYTHONDIR directory (that way if crashes happen several times
8437 it won't litter many directories, the post-mortem file is always located
8485 it won't litter many directories, the post-mortem file is always located
8438 in the same place and new occurrences just overwrite the previous one).
8486 in the same place and new occurrences just overwrite the previous one).
8439 If you can mail this file to the developers (see sec.
8487 If you can mail this file to the developers (see sec.
8440
8488
8441 \begin_inset LatexCommand \ref{sec:credits}
8489 \begin_inset LatexCommand \ref{sec:credits}
8442
8490
8443 \end_inset
8491 \end_inset
8444
8492
8445 for names and addresses), it will help us
8493 for names and addresses), it will help us
8446 \emph on
8494 \emph on
8447 a lot
8495 a lot
8448 \emph default
8496 \emph default
8449 in understanding the cause of the problem and fixing it sooner.
8497 in understanding the cause of the problem and fixing it sooner.
8450 \layout Subsection*
8498 \layout Subsection*
8451
8499
8452 The bug tracker
8500 The bug tracker
8453 \layout Standard
8501 \layout Standard
8454
8502
8455 IPython also has an online bug-tracker, located at
8503 IPython also has an online bug-tracker, located at
8456 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython}
8504 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython}
8457
8505
8458 \end_inset
8506 \end_inset
8459
8507
8460 .
8508 .
8461 In addition to mailing the developers, it would be a good idea to file
8509 In addition to mailing the developers, it would be a good idea to file
8462 a bug report here.
8510 a bug report here.
8463 This will ensure that the issue is properly followed to conclusion.
8511 This will ensure that the issue is properly followed to conclusion.
8464 \layout Standard
8512 \layout Standard
8465
8513
8466 You can also use this bug tracker to file feature requests.
8514 You can also use this bug tracker to file feature requests.
8467 \layout Section
8515 \layout Section
8468
8516
8469 Brief history
8517 Brief history
8470 \layout Subsection
8518 \layout Subsection
8471
8519
8472 Origins
8520 Origins
8473 \layout Standard
8521 \layout Standard
8474
8522
8475 The current IPython system grew out of the following three projects:
8523 The current IPython system grew out of the following three projects:
8476 \layout List
8524 \layout List
8477 \labelwidthstring 00.00.0000
8525 \labelwidthstring 00.00.0000
8478
8526
8479 ipython by Fernando Pérez.
8527 ipython by Fernando Pérez.
8480 I was working on adding Mathematica-type prompts and a flexible configuration
8528 I was working on adding Mathematica-type prompts and a flexible configuration
8481 system (something better than
8529 system (something better than
8482 \family typewriter
8530 \family typewriter
8483 $PYTHONSTARTUP
8531 $PYTHONSTARTUP
8484 \family default
8532 \family default
8485 ) to the standard Python interactive interpreter.
8533 ) to the standard Python interactive interpreter.
8486 \layout List
8534 \layout List
8487 \labelwidthstring 00.00.0000
8535 \labelwidthstring 00.00.0000
8488
8536
8489 IPP by Janko Hauser.
8537 IPP by Janko Hauser.
8490 Very well organized, great usability.
8538 Very well organized, great usability.
8491 Had an old help system.
8539 Had an old help system.
8492 IPP was used as the `container' code into which I added the functionality
8540 IPP was used as the `container' code into which I added the functionality
8493 from ipython and LazyPython.
8541 from ipython and LazyPython.
8494 \layout List
8542 \layout List
8495 \labelwidthstring 00.00.0000
8543 \labelwidthstring 00.00.0000
8496
8544
8497 LazyPython by Nathan Gray.
8545 LazyPython by Nathan Gray.
8498 Simple but
8546 Simple but
8499 \emph on
8547 \emph on
8500 very
8548 very
8501 \emph default
8549 \emph default
8502 powerful.
8550 powerful.
8503 The quick syntax (auto parens, auto quotes) and verbose/colored tracebacks
8551 The quick syntax (auto parens, auto quotes) and verbose/colored tracebacks
8504 were all taken from here.
8552 were all taken from here.
8505 \layout Standard
8553 \layout Standard
8506
8554
8507 When I found out (see sec.
8555 When I found out (see sec.
8508
8556
8509 \begin_inset LatexCommand \ref{figgins}
8557 \begin_inset LatexCommand \ref{figgins}
8510
8558
8511 \end_inset
8559 \end_inset
8512
8560
8513 ) about IPP and LazyPython I tried to join all three into a unified system.
8561 ) about IPP and LazyPython I tried to join all three into a unified system.
8514 I thought this could provide a very nice working environment, both for
8562 I thought this could provide a very nice working environment, both for
8515 regular programming and scientific computing: shell-like features, IDL/Matlab
8563 regular programming and scientific computing: shell-like features, IDL/Matlab
8516 numerics, Mathematica-type prompt history and great object introspection
8564 numerics, Mathematica-type prompt history and great object introspection
8517 and help facilities.
8565 and help facilities.
8518 I think it worked reasonably well, though it was a lot more work than I
8566 I think it worked reasonably well, though it was a lot more work than I
8519 had initially planned.
8567 had initially planned.
8520 \layout Subsection
8568 \layout Subsection
8521
8569
8522 Current status
8570 Current status
8523 \layout Standard
8571 \layout Standard
8524
8572
8525 The above listed features work, and quite well for the most part.
8573 The above listed features work, and quite well for the most part.
8526 But until a major internal restructuring is done (see below), only bug
8574 But until a major internal restructuring is done (see below), only bug
8527 fixing will be done, no other features will be added (unless very minor
8575 fixing will be done, no other features will be added (unless very minor
8528 and well localized in the cleaner parts of the code).
8576 and well localized in the cleaner parts of the code).
8529 \layout Standard
8577 \layout Standard
8530
8578
8531 IPython consists of some 12000 lines of pure python code, of which roughly
8579 IPython consists of some 12000 lines of pure python code, of which roughly
8532 50% are fairly clean.
8580 50% are fairly clean.
8533 The other 50% are fragile, messy code which needs a massive restructuring
8581 The other 50% are fragile, messy code which needs a massive restructuring
8534 before any further major work is done.
8582 before any further major work is done.
8535 Even the messy code is fairly well documented though, and most of the problems
8583 Even the messy code is fairly well documented though, and most of the problems
8536 in the (non-existent) class design are well pointed to by a PyChecker run.
8584 in the (non-existent) class design are well pointed to by a PyChecker run.
8537 So the rewriting work isn't that bad, it will just be time-consuming.
8585 So the rewriting work isn't that bad, it will just be time-consuming.
8538 \layout Subsection
8586 \layout Subsection
8539
8587
8540 Future
8588 Future
8541 \layout Standard
8589 \layout Standard
8542
8590
8543 See the separate
8591 See the separate
8544 \family typewriter
8592 \family typewriter
8545 new_design
8593 new_design
8546 \family default
8594 \family default
8547 document for details.
8595 document for details.
8548 Ultimately, I would like to see IPython become part of the standard Python
8596 Ultimately, I would like to see IPython become part of the standard Python
8549 distribution as a `big brother with batteries' to the standard Python interacti
8597 distribution as a `big brother with batteries' to the standard Python interacti
8550 ve interpreter.
8598 ve interpreter.
8551 But that will never happen with the current state of the code, so all contribut
8599 But that will never happen with the current state of the code, so all contribut
8552 ions are welcome.
8600 ions are welcome.
8553 \layout Section
8601 \layout Section
8554
8602
8555 License
8603 License
8556 \layout Standard
8604 \layout Standard
8557
8605
8558 IPython is released under the terms of the BSD license, whose general form
8606 IPython is released under the terms of the BSD license, whose general form
8559 can be found at:
8607 can be found at:
8560 \begin_inset LatexCommand \htmlurl{http://www.opensource.org/licenses/bsd-license.php}
8608 \begin_inset LatexCommand \htmlurl{http://www.opensource.org/licenses/bsd-license.php}
8561
8609
8562 \end_inset
8610 \end_inset
8563
8611
8564 .
8612 .
8565 The full text of the IPython license is reproduced below:
8613 The full text of the IPython license is reproduced below:
8566 \layout Quote
8614 \layout Quote
8567
8615
8568
8616
8569 \family typewriter
8617 \family typewriter
8570 \size small
8618 \size small
8571 IPython is released under a BSD-type license.
8619 IPython is released under a BSD-type license.
8572 \layout Quote
8620 \layout Quote
8573
8621
8574
8622
8575 \family typewriter
8623 \family typewriter
8576 \size small
8624 \size small
8577 Copyright (c) 2001, 2002, 2003, 2004 Fernando Perez <fperez@colorado.edu>.
8625 Copyright (c) 2001, 2002, 2003, 2004 Fernando Perez <fperez@colorado.edu>.
8578 \layout Quote
8626 \layout Quote
8579
8627
8580
8628
8581 \family typewriter
8629 \family typewriter
8582 \size small
8630 \size small
8583 Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and
8631 Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and
8584 \newline
8632 \newline
8585 Nathaniel Gray <n8gray@caltech.edu>.
8633 Nathaniel Gray <n8gray@caltech.edu>.
8586 \layout Quote
8634 \layout Quote
8587
8635
8588
8636
8589 \family typewriter
8637 \family typewriter
8590 \size small
8638 \size small
8591 All rights reserved.
8639 All rights reserved.
8592 \layout Quote
8640 \layout Quote
8593
8641
8594
8642
8595 \family typewriter
8643 \family typewriter
8596 \size small
8644 \size small
8597 Redistribution and use in source and binary forms, with or without modification,
8645 Redistribution and use in source and binary forms, with or without modification,
8598 are permitted provided that the following conditions are met:
8646 are permitted provided that the following conditions are met:
8599 \layout Quote
8647 \layout Quote
8600
8648
8601
8649
8602 \family typewriter
8650 \family typewriter
8603 \size small
8651 \size small
8604 a.
8652 a.
8605 Redistributions of source code must retain the above copyright notice,
8653 Redistributions of source code must retain the above copyright notice,
8606 this list of conditions and the following disclaimer.
8654 this list of conditions and the following disclaimer.
8607 \layout Quote
8655 \layout Quote
8608
8656
8609
8657
8610 \family typewriter
8658 \family typewriter
8611 \size small
8659 \size small
8612 b.
8660 b.
8613 Redistributions in binary form must reproduce the above copyright notice,
8661 Redistributions in binary form must reproduce the above copyright notice,
8614 this list of conditions and the following disclaimer in the documentation
8662 this list of conditions and the following disclaimer in the documentation
8615 and/or other materials provided with the distribution.
8663 and/or other materials provided with the distribution.
8616 \layout Quote
8664 \layout Quote
8617
8665
8618
8666
8619 \family typewriter
8667 \family typewriter
8620 \size small
8668 \size small
8621 c.
8669 c.
8622 Neither the name of the copyright holders nor the names of any contributors
8670 Neither the name of the copyright holders nor the names of any contributors
8623 to this software may be used to endorse or promote products derived from
8671 to this software may be used to endorse or promote products derived from
8624 this software without specific prior written permission.
8672 this software without specific prior written permission.
8625 \layout Quote
8673 \layout Quote
8626
8674
8627
8675
8628 \family typewriter
8676 \family typewriter
8629 \size small
8677 \size small
8630 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
8678 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
8631 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
8679 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
8632 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
8680 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
8633 PURPOSE ARE DISCLAIMED.
8681 PURPOSE ARE DISCLAIMED.
8634 IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
8682 IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
8635 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
8683 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
8636 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8684 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8637 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8685 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8638 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8686 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8639 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8687 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8640 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8688 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8641
8689
8642 \layout Standard
8690 \layout Standard
8643
8691
8644 Individual authors are the holders of the copyright for their code and are
8692 Individual authors are the holders of the copyright for their code and are
8645 listed in each file.
8693 listed in each file.
8646 \layout Standard
8694 \layout Standard
8647
8695
8648 Some files (
8696 Some files (
8649 \family typewriter
8697 \family typewriter
8650 DPyGetOpt.py
8698 DPyGetOpt.py
8651 \family default
8699 \family default
8652 , for example) may be licensed under different conditions.
8700 , for example) may be licensed under different conditions.
8653 Ultimately each file indicates clearly the conditions under which its author/au
8701 Ultimately each file indicates clearly the conditions under which its author/au
8654 thors have decided to publish the code.
8702 thors have decided to publish the code.
8655 \layout Standard
8703 \layout Standard
8656
8704
8657 Versions of IPython up to and including 0.6.3 were released under the GNU
8705 Versions of IPython up to and including 0.6.3 were released under the GNU
8658 Lesser General Public License (LGPL), available at
8706 Lesser General Public License (LGPL), available at
8659 \begin_inset LatexCommand \htmlurl{http://www.gnu.org/copyleft/lesser.html}
8707 \begin_inset LatexCommand \htmlurl{http://www.gnu.org/copyleft/lesser.html}
8660
8708
8661 \end_inset
8709 \end_inset
8662
8710
8663 .
8711 .
8664 \layout Section
8712 \layout Section
8665
8713
8666
8714
8667 \begin_inset LatexCommand \label{sec:credits}
8715 \begin_inset LatexCommand \label{sec:credits}
8668
8716
8669 \end_inset
8717 \end_inset
8670
8718
8671 Credits
8719 Credits
8672 \layout Standard
8720 \layout Standard
8673
8721
8674 IPython is mainly developed by Fernando Pérez
8722 IPython is mainly developed by Fernando Pérez
8675 \family typewriter
8723 \family typewriter
8676 <fperez@colorado.edu>
8724 <fperez@colorado.edu>
8677 \family default
8725 \family default
8678 , but the project was born from mixing in Fernando's code with the IPP project
8726 , but the project was born from mixing in Fernando's code with the IPP project
8679 by Janko Hauser
8727 by Janko Hauser
8680 \family typewriter
8728 \family typewriter
8681 <jhauser-AT-zscout.de>
8729 <jhauser-AT-zscout.de>
8682 \family default
8730 \family default
8683 and LazyPython by Nathan Gray
8731 and LazyPython by Nathan Gray
8684 \family typewriter
8732 \family typewriter
8685 <n8gray-AT-caltech.edu>
8733 <n8gray-AT-caltech.edu>
8686 \family default
8734 \family default
8687 .
8735 .
8688 For all IPython-related requests, please contact Fernando.
8736 For all IPython-related requests, please contact Fernando.
8689
8737
8690 \layout Standard
8738 \layout Standard
8691
8739
8692 As of late 2005, the following developers have joined the core team:
8740 As of late 2005, the following developers have joined the core team:
8693 \layout List
8741 \layout List
8694 \labelwidthstring 00.00.0000
8742 \labelwidthstring 00.00.0000
8695
8743
8696 Robert\SpecialChar ~
8744 Robert\SpecialChar ~
8697 Kern
8745 Kern
8698 \family typewriter
8746 \family typewriter
8699 <rkern-AT-enthought.com>
8747 <rkern-AT-enthought.com>
8700 \family default
8748 \family default
8701 : co-mentored the 2005 Google Summer of Code project to develop python interacti
8749 : co-mentored the 2005 Google Summer of Code project to develop python interacti
8702 ve notebooks (XML documents) and graphical interface.
8750 ve notebooks (XML documents) and graphical interface.
8703 This project was awarded to the students Tzanko Matev
8751 This project was awarded to the students Tzanko Matev
8704 \family typewriter
8752 \family typewriter
8705 <tsanko-AT-gmail.com>
8753 <tsanko-AT-gmail.com>
8706 \family default
8754 \family default
8707 and Toni Alatalo
8755 and Toni Alatalo
8708 \family typewriter
8756 \family typewriter
8709 <antont-AT-an.org>
8757 <antont-AT-an.org>
8710 \layout List
8758 \layout List
8711 \labelwidthstring 00.00.0000
8759 \labelwidthstring 00.00.0000
8712
8760
8713 Brian\SpecialChar ~
8761 Brian\SpecialChar ~
8714 Granger
8762 Granger
8715 \family typewriter
8763 \family typewriter
8716 <bgranger-AT-scu.edu>
8764 <bgranger-AT-scu.edu>
8717 \family default
8765 \family default
8718 : extending IPython to allow support for interactive parallel computing.
8766 : extending IPython to allow support for interactive parallel computing.
8719 \layout Standard
8767 \layout Standard
8720
8768
8721 User or development help should be requested via the IPython mailing lists:
8769 User or development help should be requested via the IPython mailing lists:
8722 \layout Description
8770 \layout Description
8723
8771
8724 User\SpecialChar ~
8772 User\SpecialChar ~
8725 list:
8773 list:
8726 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-user}
8774 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-user}
8727
8775
8728 \end_inset
8776 \end_inset
8729
8777
8730
8778
8731 \layout Description
8779 \layout Description
8732
8780
8733 Developer's\SpecialChar ~
8781 Developer's\SpecialChar ~
8734 list:
8782 list:
8735 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-dev}
8783 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-dev}
8736
8784
8737 \end_inset
8785 \end_inset
8738
8786
8739
8787
8740 \layout Standard
8788 \layout Standard
8741
8789
8742 The IPython project is also very grateful to
8790 The IPython project is also very grateful to
8743 \begin_inset Foot
8791 \begin_inset Foot
8744 collapsed true
8792 collapsed true
8745
8793
8746 \layout Standard
8794 \layout Standard
8747
8795
8748 I've mangled email addresses to reduce spam, since the IPython manuals can
8796 I've mangled email addresses to reduce spam, since the IPython manuals can
8749 be accessed online.
8797 be accessed online.
8750 \end_inset
8798 \end_inset
8751
8799
8752 :
8800 :
8753 \layout Standard
8801 \layout Standard
8754
8802
8755 Bill Bumgarner
8803 Bill Bumgarner
8756 \family typewriter
8804 \family typewriter
8757 <bbum-AT-friday.com>
8805 <bbum-AT-friday.com>
8758 \family default
8806 \family default
8759 : for providing the DPyGetOpt module which gives very powerful and convenient
8807 : for providing the DPyGetOpt module which gives very powerful and convenient
8760 handling of command-line options (light years ahead of what Python 2.1.1's
8808 handling of command-line options (light years ahead of what Python 2.1.1's
8761 getopt module does).
8809 getopt module does).
8762 \layout Standard
8810 \layout Standard
8763
8811
8764 Ka-Ping Yee
8812 Ka-Ping Yee
8765 \family typewriter
8813 \family typewriter
8766 <ping-AT-lfw.org>
8814 <ping-AT-lfw.org>
8767 \family default
8815 \family default
8768 : for providing the Itpl module for convenient and powerful string interpolation
8816 : for providing the Itpl module for convenient and powerful string interpolation
8769 with a much nicer syntax than formatting through the '%' operator.
8817 with a much nicer syntax than formatting through the '%' operator.
8770 \layout Standard
8818 \layout Standard
8771
8819
8772 Arnd Bäcker
8820 Arnd Bäcker
8773 \family typewriter
8821 \family typewriter
8774 <baecker-AT-physik.tu-dresden.de>
8822 <baecker-AT-physik.tu-dresden.de>
8775 \family default
8823 \family default
8776 : for his many very useful suggestions and comments, and lots of help with
8824 : for his many very useful suggestions and comments, and lots of help with
8777 testing and documentation checking.
8825 testing and documentation checking.
8778 Many of IPython's newer features are a result of discussions with him (bugs
8826 Many of IPython's newer features are a result of discussions with him (bugs
8779 are still my fault, not his).
8827 are still my fault, not his).
8780 \layout Standard
8828 \layout Standard
8781
8829
8782 Obviously Guido van\SpecialChar ~
8830 Obviously Guido van\SpecialChar ~
8783 Rossum and the whole Python development team, that goes
8831 Rossum and the whole Python development team, that goes
8784 without saying.
8832 without saying.
8785 \layout Standard
8833 \layout Standard
8786
8834
8787 IPython's website is generously hosted at
8835 IPython's website is generously hosted at
8788 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
8836 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
8789
8837
8790 \end_inset
8838 \end_inset
8791
8839
8792 by Enthought (
8840 by Enthought (
8793 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
8841 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
8794
8842
8795 \end_inset
8843 \end_inset
8796
8844
8797 ).
8845 ).
8798 I am very grateful to them and all of the SciPy team for their contribution.
8846 I am very grateful to them and all of the SciPy team for their contribution.
8799 \layout Standard
8847 \layout Standard
8800
8848
8801
8849
8802 \begin_inset LatexCommand \label{figgins}
8850 \begin_inset LatexCommand \label{figgins}
8803
8851
8804 \end_inset
8852 \end_inset
8805
8853
8806 Fernando would also like to thank Stephen Figgins
8854 Fernando would also like to thank Stephen Figgins
8807 \family typewriter
8855 \family typewriter
8808 <fig-AT-monitor.net>
8856 <fig-AT-monitor.net>
8809 \family default
8857 \family default
8810 , an O'Reilly Python editor.
8858 , an O'Reilly Python editor.
8811 His Oct/11/2001 article about IPP and LazyPython, was what got this project
8859 His Oct/11/2001 article about IPP and LazyPython, was what got this project
8812 started.
8860 started.
8813 You can read it at:
8861 You can read it at:
8814 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html}
8862 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html}
8815
8863
8816 \end_inset
8864 \end_inset
8817
8865
8818 .
8866 .
8819 \layout Standard
8867 \layout Standard
8820
8868
8821 And last but not least, all the kind IPython users who have emailed new
8869 And last but not least, all the kind IPython users who have emailed new
8822 code, bug reports, fixes, comments and ideas.
8870 code, bug reports, fixes, comments and ideas.
8823 A brief list follows, please let me know if I have ommitted your name by
8871 A brief list follows, please let me know if I have ommitted your name by
8824 accident:
8872 accident:
8825 \layout List
8873 \layout List
8826 \labelwidthstring 00.00.0000
8874 \labelwidthstring 00.00.0000
8827
8875
8828 Jack\SpecialChar ~
8876 Jack\SpecialChar ~
8829 Moffit
8877 Moffit
8830 \family typewriter
8878 \family typewriter
8831 <jack-AT-xiph.org>
8879 <jack-AT-xiph.org>
8832 \family default
8880 \family default
8833 Bug fixes, including the infamous color problem.
8881 Bug fixes, including the infamous color problem.
8834 This bug alone caused many lost hours and frustration, many thanks to him
8882 This bug alone caused many lost hours and frustration, many thanks to him
8835 for the fix.
8883 for the fix.
8836 I've always been a fan of Ogg & friends, now I have one more reason to
8884 I've always been a fan of Ogg & friends, now I have one more reason to
8837 like these folks.
8885 like these folks.
8838 \newline
8886 \newline
8839 Jack is also contributing with Debian packaging and many other things.
8887 Jack is also contributing with Debian packaging and many other things.
8840 \layout List
8888 \layout List
8841 \labelwidthstring 00.00.0000
8889 \labelwidthstring 00.00.0000
8842
8890
8843 Alexander\SpecialChar ~
8891 Alexander\SpecialChar ~
8844 Schmolck
8892 Schmolck
8845 \family typewriter
8893 \family typewriter
8846 <a.schmolck-AT-gmx.net>
8894 <a.schmolck-AT-gmx.net>
8847 \family default
8895 \family default
8848 Emacs work, bug reports, bug fixes, ideas, lots more.
8896 Emacs work, bug reports, bug fixes, ideas, lots more.
8849 The ipython.el mode for (X)Emacs is Alex's code, providing full support
8897 The ipython.el mode for (X)Emacs is Alex's code, providing full support
8850 for IPython under (X)Emacs.
8898 for IPython under (X)Emacs.
8851 \layout List
8899 \layout List
8852 \labelwidthstring 00.00.0000
8900 \labelwidthstring 00.00.0000
8853
8901
8854 Andrea\SpecialChar ~
8902 Andrea\SpecialChar ~
8855 Riciputi
8903 Riciputi
8856 \family typewriter
8904 \family typewriter
8857 <andrea.riciputi-AT-libero.it>
8905 <andrea.riciputi-AT-libero.it>
8858 \family default
8906 \family default
8859 Mac OSX information, Fink package management.
8907 Mac OSX information, Fink package management.
8860 \layout List
8908 \layout List
8861 \labelwidthstring 00.00.0000
8909 \labelwidthstring 00.00.0000
8862
8910
8863 Gary\SpecialChar ~
8911 Gary\SpecialChar ~
8864 Bishop
8912 Bishop
8865 \family typewriter
8913 \family typewriter
8866 <gb-AT-cs.unc.edu>
8914 <gb-AT-cs.unc.edu>
8867 \family default
8915 \family default
8868 Bug reports, and patches to work around the exception handling idiosyncracies
8916 Bug reports, and patches to work around the exception handling idiosyncracies
8869 of WxPython.
8917 of WxPython.
8870 Readline and color support for Windows.
8918 Readline and color support for Windows.
8871 \layout List
8919 \layout List
8872 \labelwidthstring 00.00.0000
8920 \labelwidthstring 00.00.0000
8873
8921
8874 Jeffrey\SpecialChar ~
8922 Jeffrey\SpecialChar ~
8875 Collins
8923 Collins
8876 \family typewriter
8924 \family typewriter
8877 <Jeff.Collins-AT-vexcel.com>
8925 <Jeff.Collins-AT-vexcel.com>
8878 \family default
8926 \family default
8879 Bug reports.
8927 Bug reports.
8880 Much improved readline support, including fixes for Python 2.3.
8928 Much improved readline support, including fixes for Python 2.3.
8881 \layout List
8929 \layout List
8882 \labelwidthstring 00.00.0000
8930 \labelwidthstring 00.00.0000
8883
8931
8884 Dryice\SpecialChar ~
8932 Dryice\SpecialChar ~
8885 Liu
8933 Liu
8886 \family typewriter
8934 \family typewriter
8887 <dryice-AT-liu.com.cn>
8935 <dryice-AT-liu.com.cn>
8888 \family default
8936 \family default
8889 FreeBSD port.
8937 FreeBSD port.
8890 \layout List
8938 \layout List
8891 \labelwidthstring 00.00.0000
8939 \labelwidthstring 00.00.0000
8892
8940
8893 Mike\SpecialChar ~
8941 Mike\SpecialChar ~
8894 Heeter
8942 Heeter
8895 \family typewriter
8943 \family typewriter
8896 <korora-AT-SDF.LONESTAR.ORG>
8944 <korora-AT-SDF.LONESTAR.ORG>
8897 \layout List
8945 \layout List
8898 \labelwidthstring 00.00.0000
8946 \labelwidthstring 00.00.0000
8899
8947
8900 Christopher\SpecialChar ~
8948 Christopher\SpecialChar ~
8901 Hart
8949 Hart
8902 \family typewriter
8950 \family typewriter
8903 <hart-AT-caltech.edu>
8951 <hart-AT-caltech.edu>
8904 \family default
8952 \family default
8905 PDB integration.
8953 PDB integration.
8906 \layout List
8954 \layout List
8907 \labelwidthstring 00.00.0000
8955 \labelwidthstring 00.00.0000
8908
8956
8909 Milan\SpecialChar ~
8957 Milan\SpecialChar ~
8910 Zamazal
8958 Zamazal
8911 \family typewriter
8959 \family typewriter
8912 <pdm-AT-zamazal.org>
8960 <pdm-AT-zamazal.org>
8913 \family default
8961 \family default
8914 Emacs info.
8962 Emacs info.
8915 \layout List
8963 \layout List
8916 \labelwidthstring 00.00.0000
8964 \labelwidthstring 00.00.0000
8917
8965
8918 Philip\SpecialChar ~
8966 Philip\SpecialChar ~
8919 Hisley
8967 Hisley
8920 \family typewriter
8968 \family typewriter
8921 <compsys-AT-starpower.net>
8969 <compsys-AT-starpower.net>
8922 \layout List
8970 \layout List
8923 \labelwidthstring 00.00.0000
8971 \labelwidthstring 00.00.0000
8924
8972
8925 Holger\SpecialChar ~
8973 Holger\SpecialChar ~
8926 Krekel
8974 Krekel
8927 \family typewriter
8975 \family typewriter
8928 <pyth-AT-devel.trillke.net>
8976 <pyth-AT-devel.trillke.net>
8929 \family default
8977 \family default
8930 Tab completion, lots more.
8978 Tab completion, lots more.
8931 \layout List
8979 \layout List
8932 \labelwidthstring 00.00.0000
8980 \labelwidthstring 00.00.0000
8933
8981
8934 Robin\SpecialChar ~
8982 Robin\SpecialChar ~
8935 Siebler
8983 Siebler
8936 \family typewriter
8984 \family typewriter
8937 <robinsiebler-AT-starband.net>
8985 <robinsiebler-AT-starband.net>
8938 \layout List
8986 \layout List
8939 \labelwidthstring 00.00.0000
8987 \labelwidthstring 00.00.0000
8940
8988
8941 Ralf\SpecialChar ~
8989 Ralf\SpecialChar ~
8942 Ahlbrink
8990 Ahlbrink
8943 \family typewriter
8991 \family typewriter
8944 <ralf_ahlbrink-AT-web.de>
8992 <ralf_ahlbrink-AT-web.de>
8945 \layout List
8993 \layout List
8946 \labelwidthstring 00.00.0000
8994 \labelwidthstring 00.00.0000
8947
8995
8948 Thorsten\SpecialChar ~
8996 Thorsten\SpecialChar ~
8949 Kampe
8997 Kampe
8950 \family typewriter
8998 \family typewriter
8951 <thorsten-AT-thorstenkampe.de>
8999 <thorsten-AT-thorstenkampe.de>
8952 \layout List
9000 \layout List
8953 \labelwidthstring 00.00.0000
9001 \labelwidthstring 00.00.0000
8954
9002
8955 Fredrik\SpecialChar ~
9003 Fredrik\SpecialChar ~
8956 Kant
9004 Kant
8957 \family typewriter
9005 \family typewriter
8958 <fredrik.kant-AT-front.com>
9006 <fredrik.kant-AT-front.com>
8959 \family default
9007 \family default
8960 Windows setup.
9008 Windows setup.
8961 \layout List
9009 \layout List
8962 \labelwidthstring 00.00.0000
9010 \labelwidthstring 00.00.0000
8963
9011
8964 Syver\SpecialChar ~
9012 Syver\SpecialChar ~
8965 Enstad
9013 Enstad
8966 \family typewriter
9014 \family typewriter
8967 <syver-en-AT-online.no>
9015 <syver-en-AT-online.no>
8968 \family default
9016 \family default
8969 Windows setup.
9017 Windows setup.
8970 \layout List
9018 \layout List
8971 \labelwidthstring 00.00.0000
9019 \labelwidthstring 00.00.0000
8972
9020
8973 Richard
9021 Richard
8974 \family typewriter
9022 \family typewriter
8975 <rxe-AT-renre-europe.com>
9023 <rxe-AT-renre-europe.com>
8976 \family default
9024 \family default
8977 Global embedding.
9025 Global embedding.
8978 \layout List
9026 \layout List
8979 \labelwidthstring 00.00.0000
9027 \labelwidthstring 00.00.0000
8980
9028
8981 Hayden\SpecialChar ~
9029 Hayden\SpecialChar ~
8982 Callow
9030 Callow
8983 \family typewriter
9031 \family typewriter
8984 <h.callow-AT-elec.canterbury.ac.nz>
9032 <h.callow-AT-elec.canterbury.ac.nz>
8985 \family default
9033 \family default
8986 Gnuplot.py 1.6 compatibility.
9034 Gnuplot.py 1.6 compatibility.
8987 \layout List
9035 \layout List
8988 \labelwidthstring 00.00.0000
9036 \labelwidthstring 00.00.0000
8989
9037
8990 Leonardo\SpecialChar ~
9038 Leonardo\SpecialChar ~
8991 Santagada
9039 Santagada
8992 \family typewriter
9040 \family typewriter
8993 <retype-AT-terra.com.br>
9041 <retype-AT-terra.com.br>
8994 \family default
9042 \family default
8995 Fixes for Windows installation.
9043 Fixes for Windows installation.
8996 \layout List
9044 \layout List
8997 \labelwidthstring 00.00.0000
9045 \labelwidthstring 00.00.0000
8998
9046
8999 Christopher\SpecialChar ~
9047 Christopher\SpecialChar ~
9000 Armstrong
9048 Armstrong
9001 \family typewriter
9049 \family typewriter
9002 <radix-AT-twistedmatrix.com>
9050 <radix-AT-twistedmatrix.com>
9003 \family default
9051 \family default
9004 Bugfixes.
9052 Bugfixes.
9005 \layout List
9053 \layout List
9006 \labelwidthstring 00.00.0000
9054 \labelwidthstring 00.00.0000
9007
9055
9008 Francois\SpecialChar ~
9056 Francois\SpecialChar ~
9009 Pinard
9057 Pinard
9010 \family typewriter
9058 \family typewriter
9011 <pinard-AT-iro.umontreal.ca>
9059 <pinard-AT-iro.umontreal.ca>
9012 \family default
9060 \family default
9013 Code and documentation fixes.
9061 Code and documentation fixes.
9014 \layout List
9062 \layout List
9015 \labelwidthstring 00.00.0000
9063 \labelwidthstring 00.00.0000
9016
9064
9017 Cory\SpecialChar ~
9065 Cory\SpecialChar ~
9018 Dodt
9066 Dodt
9019 \family typewriter
9067 \family typewriter
9020 <cdodt-AT-fcoe.k12.ca.us>
9068 <cdodt-AT-fcoe.k12.ca.us>
9021 \family default
9069 \family default
9022 Bug reports and Windows ideas.
9070 Bug reports and Windows ideas.
9023 Patches for Windows installer.
9071 Patches for Windows installer.
9024 \layout List
9072 \layout List
9025 \labelwidthstring 00.00.0000
9073 \labelwidthstring 00.00.0000
9026
9074
9027 Olivier\SpecialChar ~
9075 Olivier\SpecialChar ~
9028 Aubert
9076 Aubert
9029 \family typewriter
9077 \family typewriter
9030 <oaubert-AT-bat710.univ-lyon1.fr>
9078 <oaubert-AT-bat710.univ-lyon1.fr>
9031 \family default
9079 \family default
9032 New magics.
9080 New magics.
9033 \layout List
9081 \layout List
9034 \labelwidthstring 00.00.0000
9082 \labelwidthstring 00.00.0000
9035
9083
9036 King\SpecialChar ~
9084 King\SpecialChar ~
9037 C.\SpecialChar ~
9085 C.\SpecialChar ~
9038 Shu
9086 Shu
9039 \family typewriter
9087 \family typewriter
9040 <kingshu-AT-myrealbox.com>
9088 <kingshu-AT-myrealbox.com>
9041 \family default
9089 \family default
9042 Autoindent patch.
9090 Autoindent patch.
9043 \layout List
9091 \layout List
9044 \labelwidthstring 00.00.0000
9092 \labelwidthstring 00.00.0000
9045
9093
9046 Chris\SpecialChar ~
9094 Chris\SpecialChar ~
9047 Drexler
9095 Drexler
9048 \family typewriter
9096 \family typewriter
9049 <chris-AT-ac-drexler.de>
9097 <chris-AT-ac-drexler.de>
9050 \family default
9098 \family default
9051 Readline packages for Win32/CygWin.
9099 Readline packages for Win32/CygWin.
9052 \layout List
9100 \layout List
9053 \labelwidthstring 00.00.0000
9101 \labelwidthstring 00.00.0000
9054
9102
9055 Gustavo\SpecialChar ~
9103 Gustavo\SpecialChar ~
9056 Córdova\SpecialChar ~
9104 Córdova\SpecialChar ~
9057 Avila
9105 Avila
9058 \family typewriter
9106 \family typewriter
9059 <gcordova-AT-sismex.com>
9107 <gcordova-AT-sismex.com>
9060 \family default
9108 \family default
9061 EvalDict code for nice, lightweight string interpolation.
9109 EvalDict code for nice, lightweight string interpolation.
9062 \layout List
9110 \layout List
9063 \labelwidthstring 00.00.0000
9111 \labelwidthstring 00.00.0000
9064
9112
9065 Kasper\SpecialChar ~
9113 Kasper\SpecialChar ~
9066 Souren
9114 Souren
9067 \family typewriter
9115 \family typewriter
9068 <Kasper.Souren-AT-ircam.fr>
9116 <Kasper.Souren-AT-ircam.fr>
9069 \family default
9117 \family default
9070 Bug reports, ideas.
9118 Bug reports, ideas.
9071 \layout List
9119 \layout List
9072 \labelwidthstring 00.00.0000
9120 \labelwidthstring 00.00.0000
9073
9121
9074 Gever\SpecialChar ~
9122 Gever\SpecialChar ~
9075 Tulley
9123 Tulley
9076 \family typewriter
9124 \family typewriter
9077 <gever-AT-helium.com>
9125 <gever-AT-helium.com>
9078 \family default
9126 \family default
9079 Code contributions.
9127 Code contributions.
9080 \layout List
9128 \layout List
9081 \labelwidthstring 00.00.0000
9129 \labelwidthstring 00.00.0000
9082
9130
9083 Ralf\SpecialChar ~
9131 Ralf\SpecialChar ~
9084 Schmitt
9132 Schmitt
9085 \family typewriter
9133 \family typewriter
9086 <ralf-AT-brainbot.com>
9134 <ralf-AT-brainbot.com>
9087 \family default
9135 \family default
9088 Bug reports & fixes.
9136 Bug reports & fixes.
9089 \layout List
9137 \layout List
9090 \labelwidthstring 00.00.0000
9138 \labelwidthstring 00.00.0000
9091
9139
9092 Oliver\SpecialChar ~
9140 Oliver\SpecialChar ~
9093 Sander
9141 Sander
9094 \family typewriter
9142 \family typewriter
9095 <osander-AT-gmx.de>
9143 <osander-AT-gmx.de>
9096 \family default
9144 \family default
9097 Bug reports.
9145 Bug reports.
9098 \layout List
9146 \layout List
9099 \labelwidthstring 00.00.0000
9147 \labelwidthstring 00.00.0000
9100
9148
9101 Rod\SpecialChar ~
9149 Rod\SpecialChar ~
9102 Holland
9150 Holland
9103 \family typewriter
9151 \family typewriter
9104 <rhh-AT-structurelabs.com>
9152 <rhh-AT-structurelabs.com>
9105 \family default
9153 \family default
9106 Bug reports and fixes to logging module.
9154 Bug reports and fixes to logging module.
9107 \layout List
9155 \layout List
9108 \labelwidthstring 00.00.0000
9156 \labelwidthstring 00.00.0000
9109
9157
9110 Daniel\SpecialChar ~
9158 Daniel\SpecialChar ~
9111 'Dang'\SpecialChar ~
9159 'Dang'\SpecialChar ~
9112 Griffith
9160 Griffith
9113 \family typewriter
9161 \family typewriter
9114 <pythondev-dang-AT-lazytwinacres.net>
9162 <pythondev-dang-AT-lazytwinacres.net>
9115 \family default
9163 \family default
9116 Fixes, enhancement suggestions for system shell use.
9164 Fixes, enhancement suggestions for system shell use.
9117 \layout List
9165 \layout List
9118 \labelwidthstring 00.00.0000
9166 \labelwidthstring 00.00.0000
9119
9167
9120 Viktor\SpecialChar ~
9168 Viktor\SpecialChar ~
9121 Ransmayr
9169 Ransmayr
9122 \family typewriter
9170 \family typewriter
9123 <viktor.ransmayr-AT-t-online.de>
9171 <viktor.ransmayr-AT-t-online.de>
9124 \family default
9172 \family default
9125 Tests and reports on Windows installation issues.
9173 Tests and reports on Windows installation issues.
9126 Contributed a true Windows binary installer.
9174 Contributed a true Windows binary installer.
9127 \layout List
9175 \layout List
9128 \labelwidthstring 00.00.0000
9176 \labelwidthstring 00.00.0000
9129
9177
9130 Mike\SpecialChar ~
9178 Mike\SpecialChar ~
9131 Salib
9179 Salib
9132 \family typewriter
9180 \family typewriter
9133 <msalib-AT-mit.edu>
9181 <msalib-AT-mit.edu>
9134 \family default
9182 \family default
9135 Help fixing a subtle bug related to traceback printing.
9183 Help fixing a subtle bug related to traceback printing.
9136 \layout List
9184 \layout List
9137 \labelwidthstring 00.00.0000
9185 \labelwidthstring 00.00.0000
9138
9186
9139 W.J.\SpecialChar ~
9187 W.J.\SpecialChar ~
9140 van\SpecialChar ~
9188 van\SpecialChar ~
9141 der\SpecialChar ~
9189 der\SpecialChar ~
9142 Laan
9190 Laan
9143 \family typewriter
9191 \family typewriter
9144 <gnufnork-AT-hetdigitalegat.nl>
9192 <gnufnork-AT-hetdigitalegat.nl>
9145 \family default
9193 \family default
9146 Bash-like prompt specials.
9194 Bash-like prompt specials.
9147 \layout List
9195 \layout List
9148 \labelwidthstring 00.00.0000
9196 \labelwidthstring 00.00.0000
9149
9197
9150 Ville\SpecialChar ~
9198 Ville\SpecialChar ~
9151 Vainio
9199 Vainio
9152 \family typewriter
9200 \family typewriter
9153 <vivainio-AT-kolumbus.fi>
9201 <vivainio-AT-kolumbus.fi>
9154 \family default
9202 \family default
9155 Bugfixes and suggestions.
9203 Bugfixes and suggestions.
9156 Excellent patches for many new features.
9204 Excellent patches for many new features.
9157 \layout List
9205 \layout List
9158 \labelwidthstring 00.00.0000
9206 \labelwidthstring 00.00.0000
9159
9207
9160 Antoon\SpecialChar ~
9208 Antoon\SpecialChar ~
9161 Pardon
9209 Pardon
9162 \family typewriter
9210 \family typewriter
9163 <Antoon.Pardon-AT-rece.vub.ac.be>
9211 <Antoon.Pardon-AT-rece.vub.ac.be>
9164 \family default
9212 \family default
9165 Critical fix for the multithreaded IPython.
9213 Critical fix for the multithreaded IPython.
9166 \layout List
9214 \layout List
9167 \labelwidthstring 00.00.0000
9215 \labelwidthstring 00.00.0000
9168
9216
9169 John\SpecialChar ~
9217 John\SpecialChar ~
9170 Hunter
9218 Hunter
9171 \family typewriter
9219 \family typewriter
9172 <jdhunter-AT-nitace.bsd.uchicago.edu>
9220 <jdhunter-AT-nitace.bsd.uchicago.edu>
9173 \family default
9221 \family default
9174 Matplotlib author, helped with all the development of support for matplotlib
9222 Matplotlib author, helped with all the development of support for matplotlib
9175 in IPyhton, including making necessary changes to matplotlib itself.
9223 in IPyhton, including making necessary changes to matplotlib itself.
9176 \layout List
9224 \layout List
9177 \labelwidthstring 00.00.0000
9225 \labelwidthstring 00.00.0000
9178
9226
9179 Matthew\SpecialChar ~
9227 Matthew\SpecialChar ~
9180 Arnison
9228 Arnison
9181 \family typewriter
9229 \family typewriter
9182 <maffew-AT-cat.org.au>
9230 <maffew-AT-cat.org.au>
9183 \family default
9231 \family default
9184 Bug reports, `
9232 Bug reports, `
9185 \family typewriter
9233 \family typewriter
9186 %run -d
9234 %run -d
9187 \family default
9235 \family default
9188 ' idea.
9236 ' idea.
9189 \layout List
9237 \layout List
9190 \labelwidthstring 00.00.0000
9238 \labelwidthstring 00.00.0000
9191
9239
9192 Prabhu\SpecialChar ~
9240 Prabhu\SpecialChar ~
9193 Ramachandran
9241 Ramachandran
9194 \family typewriter
9242 \family typewriter
9195 <prabhu_r-AT-users.sourceforge.net>
9243 <prabhu_r-AT-users.sourceforge.net>
9196 \family default
9244 \family default
9197 Help with (X)Emacs support, threading patches, ideas...
9245 Help with (X)Emacs support, threading patches, ideas...
9198 \layout List
9246 \layout List
9199 \labelwidthstring 00.00.0000
9247 \labelwidthstring 00.00.0000
9200
9248
9201 Norbert\SpecialChar ~
9249 Norbert\SpecialChar ~
9202 Tretkowski
9250 Tretkowski
9203 \family typewriter
9251 \family typewriter
9204 <tretkowski-AT-inittab.de>
9252 <tretkowski-AT-inittab.de>
9205 \family default
9253 \family default
9206 help with Debian packaging and distribution.
9254 help with Debian packaging and distribution.
9207 \layout List
9255 \layout List
9208 \labelwidthstring 00.00.0000
9256 \labelwidthstring 00.00.0000
9209
9257
9210 George\SpecialChar ~
9258 George\SpecialChar ~
9211 Sakkis <
9259 Sakkis <
9212 \family typewriter
9260 \family typewriter
9213 gsakkis-AT-eden.rutgers.edu>
9261 gsakkis-AT-eden.rutgers.edu>
9214 \family default
9262 \family default
9215 New matcher for tab-completing named arguments of user-defined functions.
9263 New matcher for tab-completing named arguments of user-defined functions.
9216 \layout List
9264 \layout List
9217 \labelwidthstring 00.00.0000
9265 \labelwidthstring 00.00.0000
9218
9266
9219 J�rgen\SpecialChar ~
9267 J�rgen\SpecialChar ~
9220 Stenarson
9268 Stenarson
9221 \family typewriter
9269 \family typewriter
9222 <jorgen.stenarson-AT-bostream.nu>
9270 <jorgen.stenarson-AT-bostream.nu>
9223 \family default
9271 \family default
9224 Wildcard support implementation for searching namespaces.
9272 Wildcard support implementation for searching namespaces.
9225 \layout List
9273 \layout List
9226 \labelwidthstring 00.00.0000
9274 \labelwidthstring 00.00.0000
9227
9275
9228 Vivian\SpecialChar ~
9276 Vivian\SpecialChar ~
9229 De\SpecialChar ~
9277 De\SpecialChar ~
9230 Smedt
9278 Smedt
9231 \family typewriter
9279 \family typewriter
9232 <vivian-AT-vdesmedt.com>
9280 <vivian-AT-vdesmedt.com>
9233 \family default
9281 \family default
9234 Debugger enhancements, so that when pdb is activated from within IPython,
9282 Debugger enhancements, so that when pdb is activated from within IPython,
9235 coloring, tab completion and other features continue to work seamlessly.
9283 coloring, tab completion and other features continue to work seamlessly.
9236 \layout List
9284 \layout List
9237 \labelwidthstring 00.00.0000
9285 \labelwidthstring 00.00.0000
9238
9286
9239 Scott\SpecialChar ~
9287 Scott\SpecialChar ~
9240 Tsai
9288 Tsai
9241 \family typewriter
9289 \family typewriter
9242 <scottt958-AT-yahoo.com.tw>
9290 <scottt958-AT-yahoo.com.tw>
9243 \family default
9291 \family default
9244 Support for automatic editor invocation on syntax errors (see
9292 Support for automatic editor invocation on syntax errors (see
9245 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython/issue36}
9293 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython/issue36}
9246
9294
9247 \end_inset
9295 \end_inset
9248
9296
9249 ).
9297 ).
9250 \layout List
9298 \layout List
9251 \labelwidthstring 00.00.0000
9299 \labelwidthstring 00.00.0000
9252
9300
9253 Alexander\SpecialChar ~
9301 Alexander\SpecialChar ~
9254 Belchenko
9302 Belchenko
9255 \family typewriter
9303 \family typewriter
9256 <bialix-AT-ukr.net>
9304 <bialix-AT-ukr.net>
9257 \family default
9305 \family default
9258 Improvements for win32 paging system.
9306 Improvements for win32 paging system.
9259 \the_end
9307 \the_end
@@ -1,99 +1,103 b''
1 #!/bin/sh
1 #!/bin/sh
2 # IPython release script
2 # IPython release script
3
3
4 PYVER=`python -V 2>&1 | awk '{print $2}' | awk -F '.' '{print $1$2}' `
4 PYVER=`python -V 2>&1 | awk '{print $2}' | awk -F '.' '{print $1$2}' `
5 version=`ipython -Version`
5 version=`ipython -Version`
6 ipdir=~/ipython/ipython
6 ipdir=~/ipython/ipython
7
7
8 echo
8 echo
9 echo "Releasing IPython version $version"
9 echo "Releasing IPython version $version"
10 echo "=================================="
10 echo "=================================="
11
11
12 echo "Marking ChangeLog with release information and making NEWS file..."
12 echo "Marking ChangeLog with release information and making NEWS file..."
13
13
14 # Stamp changelog and save a copy of the status at each version, in case later
14 # Stamp changelog and save a copy of the status at each version, in case later
15 # we want the NEWS file to start from a point before the very last release (if
15 # we want the NEWS file to start from a point before the very last release (if
16 # very small interim releases have no significant changes).
16 # very small interim releases have no significant changes).
17
17
18 cd $ipdir/doc
18 cd $ipdir/doc
19 cp ChangeLog ChangeLog.old
19 cp ChangeLog ChangeLog.old
20 cp ChangeLog ChangeLog.$version
20 cp ChangeLog ChangeLog.$version
21 daystamp=`date +%Y-%m-%d`
21 daystamp=`date +%Y-%m-%d`
22 echo $daystamp " ***" Released version $version > ChangeLog
22 echo $daystamp " ***" Released version $version > ChangeLog
23 echo >> ChangeLog
23 echo >> ChangeLog
24 cat ChangeLog.old >> ChangeLog
24 cat ChangeLog.old >> ChangeLog
25 rm ChangeLog.old
25 rm ChangeLog.old
26
26
27 # Build NEWS file
27 # Build NEWS file
28 echo "Changes between the last two releases (major or minor)" > NEWS
28 echo "Changes between the last two releases (major or minor)" > NEWS
29 echo "Note that this is an auto-generated diff of the ChangeLogs" >> NEWS
29 echo "Note that this is an auto-generated diff of the ChangeLogs" >> NEWS
30 echo >> NEWS
30 echo >> NEWS
31 diff ChangeLog.previous ChangeLog | grep -v '^0a' | sed 's/^> //g' >> NEWS
31 diff ChangeLog.previous ChangeLog | grep -v '^0a' | sed 's/^> //g' >> NEWS
32 cp ChangeLog ChangeLog.previous
32 cp ChangeLog ChangeLog.previous
33
33
34 # Clean up build/dist directories
34 # Clean up build/dist directories
35 rm -rf $ipdir/build/*
35 rm -rf $ipdir/build/*
36 rm -rf $ipdir/dist/*
36 rm -rf $ipdir/dist/*
37
37
38 # Perform local backup
38 # Perform local backup
39 cd $ipdir/tools
39 cd $ipdir/tools
40 ./bkp.py
40 ./bkp.py
41
41
42 # Build source and binary distros
42 # Build source and binary distros
43 cd $ipdir
43 cd $ipdir
44 ./setup.py sdist --formats=gztar
44 ./setup.py sdist --formats=gztar
45 #./setup.py bdist_rpm --release=py$PYVER
45 #./setup.py bdist_rpm --release=py$PYVER
46 python2.3 ./setup.py bdist_rpm --release=py23 --python=/usr/bin/python2.3
46 python2.3 ./setup.py bdist_rpm --release=py23 --python=/usr/bin/python2.3
47
47
48 # A 2.4-specific RPM, where we must use the --python option to ensure that
48 # A 2.4-specific RPM, where we must use the --python option to ensure that
49 # the resulting RPM is really built with 2.4 (so things go to
49 # the resulting RPM is really built with 2.4 (so things go to
50 # lib/python2.4/...)
50 # lib/python2.4/...)
51 python2.4 ./setup.py bdist_rpm --release=py24 --python=/usr/bin/python2.4
51 python2.4 ./setup.py bdist_rpm --release=py24 --python=/usr/bin/python2.4
52
52
53 # Build eggs
54 python2.3 ./setup_bdist_egg.py
55 python2.4 ./setup_bdist_egg.py
56
53 # Call the windows build separately, so that the extra Windows scripts don't
57 # Call the windows build separately, so that the extra Windows scripts don't
54 # get pulled into Unix builds (setup.py has code which checks for
58 # get pulled into Unix builds (setup.py has code which checks for
55 # bdist_wininst)
59 # bdist_wininst)
56 #./setup.py bdist_wininst --install-script=ipython_win_post_install.py
60 #./setup.py bdist_wininst --install-script=ipython_win_post_install.py
57
61
58 # For now, make the win32 installer with a hand-built 2.3.5 python, which is
62 # For now, make the win32 installer with a hand-built 2.3.5 python, which is
59 # the only one that fixes a crash in the post-install phase.
63 # the only one that fixes a crash in the post-install phase.
60 $HOME/tmp/local/bin/python2.3 setup.py bdist_wininst \
64 $HOME/tmp/local/bin/python2.3 setup.py bdist_wininst \
61 --install-script=ipython_win_post_install.py
65 --install-script=ipython_win_post_install.py
62
66
63
67
64 # Register with the Python Package Index (PyPI)
68 # Register with the Python Package Index (PyPI)
65 echo "Registering with PyPI..."
69 echo "Registering with PyPI..."
66 cd $ipdir
70 cd $ipdir
67 ./setup.py register
71 ./setup.py register
68
72
69 # Upload all files
73 # Upload all files
70 cd $ipdir/dist
74 cd $ipdir/dist
71 echo "Uploading distribution files..."
75 echo "Uploading distribution files..."
72 scp * fperez@scipy.org:www/dist/
76 scp * fperez@scipy.org:www/dist/
73
77
74 echo "Uploading backup files..."
78 echo "Uploading backup files..."
75 cd ~/ipython/backup
79 cd ~/ipython/backup
76 scp `ls -1tr | tail -1` fperez@scipy.org:www/backup/
80 scp `ls -1tr | tail -1` fperez@scipy.org:www/backup/
77
81
78 echo "Updating webpage..."
82 echo "Updating webpage..."
79 cd $ipdir/doc
83 cd $ipdir/doc
80 www=~/ipython/homepage
84 www=~/ipython/homepage
81 cp ChangeLog NEWS $www
85 cp ChangeLog NEWS $www
82 rm -rf $www/doc/*
86 rm -rf $www/doc/*
83 cp -r manual.pdf manual/ $www/doc
87 cp -r manual.pdf manual/ $www/doc
84 cd $www
88 cd $www
85 ./update
89 ./update
86
90
87 # Alert package maintainers
91 # Alert package maintainers
88 echo "Alerting package maintainers..."
92 echo "Alerting package maintainers..."
89 maintainers='fperez@colorado.edu ariciputi@users.sourceforge.net jack@xiph.org tretkowski@inittab.de dryice@hotpop.com'
93 maintainers='fperez@colorado.edu ariciputi@users.sourceforge.net jack@xiph.org tretkowski@inittab.de dryice@hotpop.com'
90 #maintainers='fperez@colorado.edu'
94 #maintainers='fperez@colorado.edu'
91
95
92 for email in $maintainers
96 for email in $maintainers
93 do
97 do
94 echo "Emailing $email..."
98 echo "Emailing $email..."
95 mail -s "[Package maintainer notice] A new IPython is out. Version: $version" \
99 mail -s "[Package maintainer notice] A new IPython is out. Version: $version" \
96 $email < NEWS
100 $email < NEWS
97 done
101 done
98
102
99 echo "Done!"
103 echo "Done!"
@@ -1,24 +1,28 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 # release test
3 # release test
4
4
5 # clean up build/dist directories
5 # clean up build/dist directories
6 rm -rf ~/ipython/ipython/build/*
6 rm -rf ~/ipython/ipython/build/*
7 rm -rf ~/ipython/ipython/dist/*
7 rm -rf ~/ipython/ipython/dist/*
8
8
9 # build source distros
9 # build source distros
10 cd ~/ipython/ipython
10 cd ~/ipython/ipython
11
11
12 ./setup.py sdist --formats=gztar
12 ./setup.py sdist --formats=gztar
13
13
14 python2.3 ./setup.py bdist_rpm --release=py23 --python=/usr/bin/python2.3
14 python2.3 ./setup.py bdist_rpm --release=py23 --python=/usr/bin/python2.3
15 python2.4 ./setup.py bdist_rpm --release=py24 --python=/usr/bin/python2.4
15 python2.4 ./setup.py bdist_rpm --release=py24 --python=/usr/bin/python2.4
16
16
17 # Build eggs
18 python2.3 ./setup_bdist_egg.py
19 python2.4 ./setup_bdist_egg.py
20
17 # Call the windows build separately, so that the extra Windows scripts don't
21 # Call the windows build separately, so that the extra Windows scripts don't
18 # get pulled into Unix builds (setup.py has code which checks for
22 # get pulled into Unix builds (setup.py has code which checks for
19 # bdist_wininst)
23 # bdist_wininst)
20
24
21 # For now, make the win32 installer with a hand-built 2.3.5 python, which is
25 # For now, make the win32 installer with a hand-built 2.3.5 python, which is
22 # the only one that fixes a crash in the post-install phase.
26 # the only one that fixes a crash in the post-install phase.
23 $HOME/tmp/local/bin/python2.3 setup.py bdist_wininst \
27 $HOME/tmp/local/bin/python2.3 setup.py bdist_wininst \
24 --install-script=ipython_win_post_install.py
28 --install-script=ipython_win_post_install.py
General Comments 0
You need to be logged in to leave comments. Login now