##// END OF EJS Templates
- Small manual update about Emacs...
fperez -
Show More
@@ -1,5264 +1,5275 b''
1 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * Manual: thanks to a tip on proper color handling for Emacs, by
4 Eric J Haywiser <ejh1-AT-MIT.EDU>.
5
6 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
7 by applying the provided patch. Thanks to Liu Jin
8 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
9 XEmacs/Linux, I'm trusting the submitter that it actually helps
10 under win32/GNU Emacs. Will revisit if any problems are reported.
11
1 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
12 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
2
13
3 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
14 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
4 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
15 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
5
16
6 2006-03-12 Ville Vainio <vivainio@gmail.com>
17 2006-03-12 Ville Vainio <vivainio@gmail.com>
7
18
8 * Magic.py (magic_timeit): Added %timeit magic, contributed by
19 * Magic.py (magic_timeit): Added %timeit magic, contributed by
9 Torsten Marek.
20 Torsten Marek.
10
21
11 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
22 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
12
23
13 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
24 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
14 line ranges works again.
25 line ranges works again.
15
26
16 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
27 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
17
28
18 * IPython/iplib.py (showtraceback): add back sys.last_traceback
29 * IPython/iplib.py (showtraceback): add back sys.last_traceback
19 and friends, after a discussion with Zach Pincus on ipython-user.
30 and friends, after a discussion with Zach Pincus on ipython-user.
20 I'm not 100% sure, but after thinking aobut it quite a bit, it may
31 I'm not 100% sure, but after thinking aobut it quite a bit, it may
21 be OK. Testing with the multithreaded shells didn't reveal any
32 be OK. Testing with the multithreaded shells didn't reveal any
22 problems, but let's keep an eye out.
33 problems, but let's keep an eye out.
23
34
24 In the process, I fixed a few things which were calling
35 In the process, I fixed a few things which were calling
25 self.InteractiveTB() directly (like safe_execfile), which is a
36 self.InteractiveTB() directly (like safe_execfile), which is a
26 mistake: ALL exception reporting should be done by calling
37 mistake: ALL exception reporting should be done by calling
27 self.showtraceback(), which handles state and tab-completion and
38 self.showtraceback(), which handles state and tab-completion and
28 more.
39 more.
29
40
30 2006-03-01 Ville Vainio <vivainio@gmail.com>
41 2006-03-01 Ville Vainio <vivainio@gmail.com>
31
42
32 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
43 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
33 To use, do "from ipipe import *".
44 To use, do "from ipipe import *".
34
45
35 2006-02-24 Ville Vainio <vivainio@gmail.com>
46 2006-02-24 Ville Vainio <vivainio@gmail.com>
36
47
37 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
48 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
38 "cleanly" and safely than the older upgrade mechanism.
49 "cleanly" and safely than the older upgrade mechanism.
39
50
40 2006-02-21 Ville Vainio <vivainio@gmail.com>
51 2006-02-21 Ville Vainio <vivainio@gmail.com>
41
52
42 * Magic.py: %save works again.
53 * Magic.py: %save works again.
43
54
44 2006-02-15 Ville Vainio <vivainio@gmail.com>
55 2006-02-15 Ville Vainio <vivainio@gmail.com>
45
56
46 * Magic.py: %Pprint works again
57 * Magic.py: %Pprint works again
47
58
48 * Extensions/ipy_sane_defaults.py: Provide everything provided
59 * Extensions/ipy_sane_defaults.py: Provide everything provided
49 in default ipythonrc, to make it possible to have a completely empty
60 in default ipythonrc, to make it possible to have a completely empty
50 ipythonrc (and thus completely rc-file free configuration)
61 ipythonrc (and thus completely rc-file free configuration)
51
62
52
63
53 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
64 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
54
65
55 * IPython/hooks.py (editor): quote the call to the editor command,
66 * IPython/hooks.py (editor): quote the call to the editor command,
56 to allow commands with spaces in them. Problem noted by watching
67 to allow commands with spaces in them. Problem noted by watching
57 Ian Oswald's video about textpad under win32 at
68 Ian Oswald's video about textpad under win32 at
58 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
69 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
59
70
60 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
71 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
61 describing magics (we haven't used @ for a loong time).
72 describing magics (we haven't used @ for a loong time).
62
73
63 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
74 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
64 contributed by marienz to close
75 contributed by marienz to close
65 http://www.scipy.net/roundup/ipython/issue53.
76 http://www.scipy.net/roundup/ipython/issue53.
66
77
67 2006-02-10 Ville Vainio <vivainio@gmail.com>
78 2006-02-10 Ville Vainio <vivainio@gmail.com>
68
79
69 * genutils.py: getoutput now works in win32 too
80 * genutils.py: getoutput now works in win32 too
70
81
71 * completer.py: alias and magic completion only invoked
82 * completer.py: alias and magic completion only invoked
72 at the first "item" in the line, to avoid "cd %store"
83 at the first "item" in the line, to avoid "cd %store"
73 nonsense.
84 nonsense.
74
85
75 2006-02-09 Ville Vainio <vivainio@gmail.com>
86 2006-02-09 Ville Vainio <vivainio@gmail.com>
76
87
77 * test/*: Added a unit testing framework (finally).
88 * test/*: Added a unit testing framework (finally).
78 '%run runtests.py' to run test_*.
89 '%run runtests.py' to run test_*.
79
90
80 * ipapi.py: Exposed runlines and set_custom_exc
91 * ipapi.py: Exposed runlines and set_custom_exc
81
92
82 2006-02-07 Ville Vainio <vivainio@gmail.com>
93 2006-02-07 Ville Vainio <vivainio@gmail.com>
83
94
84 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
95 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
85 instead use "f(1 2)" as before.
96 instead use "f(1 2)" as before.
86
97
87 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
98 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
88
99
89 * IPython/demo.py (IPythonDemo): Add new classes to the demo
100 * IPython/demo.py (IPythonDemo): Add new classes to the demo
90 facilities, for demos processed by the IPython input filter
101 facilities, for demos processed by the IPython input filter
91 (IPythonDemo), and for running a script one-line-at-a-time as a
102 (IPythonDemo), and for running a script one-line-at-a-time as a
92 demo, both for pure Python (LineDemo) and for IPython-processed
103 demo, both for pure Python (LineDemo) and for IPython-processed
93 input (IPythonLineDemo). After a request by Dave Kohel, from the
104 input (IPythonLineDemo). After a request by Dave Kohel, from the
94 SAGE team.
105 SAGE team.
95 (Demo.edit): added and edit() method to the demo objects, to edit
106 (Demo.edit): added and edit() method to the demo objects, to edit
96 the in-memory copy of the last executed block.
107 the in-memory copy of the last executed block.
97
108
98 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
109 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
99 processing to %edit, %macro and %save. These commands can now be
110 processing to %edit, %macro and %save. These commands can now be
100 invoked on the unprocessed input as it was typed by the user
111 invoked on the unprocessed input as it was typed by the user
101 (without any prefilters applied). After requests by the SAGE team
112 (without any prefilters applied). After requests by the SAGE team
102 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
113 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
103
114
104 2006-02-01 Ville Vainio <vivainio@gmail.com>
115 2006-02-01 Ville Vainio <vivainio@gmail.com>
105
116
106 * setup.py, eggsetup.py: easy_install ipython==dev works
117 * setup.py, eggsetup.py: easy_install ipython==dev works
107 correctly now (on Linux)
118 correctly now (on Linux)
108
119
109 * ipy_user_conf,ipmaker: user config changes, removed spurious
120 * ipy_user_conf,ipmaker: user config changes, removed spurious
110 warnings
121 warnings
111
122
112 * iplib: if rc.banner is string, use it as is.
123 * iplib: if rc.banner is string, use it as is.
113
124
114 * Magic: %pycat accepts a string argument and pages it's contents.
125 * Magic: %pycat accepts a string argument and pages it's contents.
115
126
116
127
117 2006-01-30 Ville Vainio <vivainio@gmail.com>
128 2006-01-30 Ville Vainio <vivainio@gmail.com>
118
129
119 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
130 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
120 Now %store and bookmarks work through PickleShare, meaning that
131 Now %store and bookmarks work through PickleShare, meaning that
121 concurrent access is possible and all ipython sessions see the
132 concurrent access is possible and all ipython sessions see the
122 same database situation all the time, instead of snapshot of
133 same database situation all the time, instead of snapshot of
123 the situation when the session was started. Hence, %bookmark
134 the situation when the session was started. Hence, %bookmark
124 results are immediately accessible from othes sessions. The database
135 results are immediately accessible from othes sessions. The database
125 is also available for use by user extensions. See:
136 is also available for use by user extensions. See:
126 http://www.python.org/pypi/pickleshare
137 http://www.python.org/pypi/pickleshare
127
138
128 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
139 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
129
140
130 * aliases can now be %store'd
141 * aliases can now be %store'd
131
142
132 * path.py move to Extensions so that pickleshare does not need
143 * path.py move to Extensions so that pickleshare does not need
133 IPython-specific import. Extensions added to pythonpath right
144 IPython-specific import. Extensions added to pythonpath right
134 at __init__.
145 at __init__.
135
146
136 * iplib.py: ipalias deprecated/redundant; aliases are converted and
147 * iplib.py: ipalias deprecated/redundant; aliases are converted and
137 called with _ip.system and the pre-transformed command string.
148 called with _ip.system and the pre-transformed command string.
138
149
139 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
150 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
140
151
141 * IPython/iplib.py (interact): Fix that we were not catching
152 * IPython/iplib.py (interact): Fix that we were not catching
142 KeyboardInterrupt exceptions properly. I'm not quite sure why the
153 KeyboardInterrupt exceptions properly. I'm not quite sure why the
143 logic here had to change, but it's fixed now.
154 logic here had to change, but it's fixed now.
144
155
145 2006-01-29 Ville Vainio <vivainio@gmail.com>
156 2006-01-29 Ville Vainio <vivainio@gmail.com>
146
157
147 * iplib.py: Try to import pyreadline on Windows.
158 * iplib.py: Try to import pyreadline on Windows.
148
159
149 2006-01-27 Ville Vainio <vivainio@gmail.com>
160 2006-01-27 Ville Vainio <vivainio@gmail.com>
150
161
151 * iplib.py: Expose ipapi as _ip in builtin namespace.
162 * iplib.py: Expose ipapi as _ip in builtin namespace.
152 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
163 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
153 and ip_set_hook (-> _ip.set_hook) redundant. % and !
164 and ip_set_hook (-> _ip.set_hook) redundant. % and !
154 syntax now produce _ip.* variant of the commands.
165 syntax now produce _ip.* variant of the commands.
155
166
156 * "_ip.options().autoedit_syntax = 2" automatically throws
167 * "_ip.options().autoedit_syntax = 2" automatically throws
157 user to editor for syntax error correction without prompting.
168 user to editor for syntax error correction without prompting.
158
169
159 2006-01-27 Ville Vainio <vivainio@gmail.com>
170 2006-01-27 Ville Vainio <vivainio@gmail.com>
160
171
161 * ipmaker.py: Give "realistic" sys.argv for scripts (without
172 * ipmaker.py: Give "realistic" sys.argv for scripts (without
162 'ipython' at argv[0]) executed through command line.
173 'ipython' at argv[0]) executed through command line.
163 NOTE: this DEPRECATES calling ipython with multiple scripts
174 NOTE: this DEPRECATES calling ipython with multiple scripts
164 ("ipython a.py b.py c.py")
175 ("ipython a.py b.py c.py")
165
176
166 * iplib.py, hooks.py: Added configurable input prefilter,
177 * iplib.py, hooks.py: Added configurable input prefilter,
167 named 'input_prefilter'. See ext_rescapture.py for example
178 named 'input_prefilter'. See ext_rescapture.py for example
168 usage.
179 usage.
169
180
170 * ext_rescapture.py, Magic.py: Better system command output capture
181 * ext_rescapture.py, Magic.py: Better system command output capture
171 through 'var = !ls' (deprecates user-visible %sc). Same notation
182 through 'var = !ls' (deprecates user-visible %sc). Same notation
172 applies for magics, 'var = %alias' assigns alias list to var.
183 applies for magics, 'var = %alias' assigns alias list to var.
173
184
174 * ipapi.py: added meta() for accessing extension-usable data store.
185 * ipapi.py: added meta() for accessing extension-usable data store.
175
186
176 * iplib.py: added InteractiveShell.getapi(). New magics should be
187 * iplib.py: added InteractiveShell.getapi(). New magics should be
177 written doing self.getapi() instead of using the shell directly.
188 written doing self.getapi() instead of using the shell directly.
178
189
179 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
190 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
180 %store foo >> ~/myfoo.txt to store variables to files (in clean
191 %store foo >> ~/myfoo.txt to store variables to files (in clean
181 textual form, not a restorable pickle).
192 textual form, not a restorable pickle).
182
193
183 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
194 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
184
195
185 * usage.py, Magic.py: added %quickref
196 * usage.py, Magic.py: added %quickref
186
197
187 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
198 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
188
199
189 * GetoptErrors when invoking magics etc. with wrong args
200 * GetoptErrors when invoking magics etc. with wrong args
190 are now more helpful:
201 are now more helpful:
191 GetoptError: option -l not recognized (allowed: "qb" )
202 GetoptError: option -l not recognized (allowed: "qb" )
192
203
193 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
204 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
194
205
195 * IPython/demo.py (Demo.show): Flush stdout after each block, so
206 * IPython/demo.py (Demo.show): Flush stdout after each block, so
196 computationally intensive blocks don't appear to stall the demo.
207 computationally intensive blocks don't appear to stall the demo.
197
208
198 2006-01-24 Ville Vainio <vivainio@gmail.com>
209 2006-01-24 Ville Vainio <vivainio@gmail.com>
199
210
200 * iplib.py, hooks.py: 'result_display' hook can return a non-None
211 * iplib.py, hooks.py: 'result_display' hook can return a non-None
201 value to manipulate resulting history entry.
212 value to manipulate resulting history entry.
202
213
203 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
214 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
204 to instance methods of IPApi class, to make extending an embedded
215 to instance methods of IPApi class, to make extending an embedded
205 IPython feasible. See ext_rehashdir.py for example usage.
216 IPython feasible. See ext_rehashdir.py for example usage.
206
217
207 * Merged 1071-1076 from banches/0.7.1
218 * Merged 1071-1076 from banches/0.7.1
208
219
209
220
210 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
221 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
211
222
212 * tools/release (daystamp): Fix build tools to use the new
223 * tools/release (daystamp): Fix build tools to use the new
213 eggsetup.py script to build lightweight eggs.
224 eggsetup.py script to build lightweight eggs.
214
225
215 * Applied changesets 1062 and 1064 before 0.7.1 release.
226 * Applied changesets 1062 and 1064 before 0.7.1 release.
216
227
217 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
228 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
218 see the raw input history (without conversions like %ls ->
229 see the raw input history (without conversions like %ls ->
219 ipmagic("ls")). After a request from W. Stein, SAGE
230 ipmagic("ls")). After a request from W. Stein, SAGE
220 (http://modular.ucsd.edu/sage) developer. This information is
231 (http://modular.ucsd.edu/sage) developer. This information is
221 stored in the input_hist_raw attribute of the IPython instance, so
232 stored in the input_hist_raw attribute of the IPython instance, so
222 developers can access it if needed (it's an InputList instance).
233 developers can access it if needed (it's an InputList instance).
223
234
224 * Versionstring = 0.7.2.svn
235 * Versionstring = 0.7.2.svn
225
236
226 * eggsetup.py: A separate script for constructing eggs, creates
237 * eggsetup.py: A separate script for constructing eggs, creates
227 proper launch scripts even on Windows (an .exe file in
238 proper launch scripts even on Windows (an .exe file in
228 \python24\scripts).
239 \python24\scripts).
229
240
230 * ipapi.py: launch_new_instance, launch entry point needed for the
241 * ipapi.py: launch_new_instance, launch entry point needed for the
231 egg.
242 egg.
232
243
233 2006-01-23 Ville Vainio <vivainio@gmail.com>
244 2006-01-23 Ville Vainio <vivainio@gmail.com>
234
245
235 * Added %cpaste magic for pasting python code
246 * Added %cpaste magic for pasting python code
236
247
237 2006-01-22 Ville Vainio <vivainio@gmail.com>
248 2006-01-22 Ville Vainio <vivainio@gmail.com>
238
249
239 * Merge from branches/0.7.1 into trunk, revs 1052-1057
250 * Merge from branches/0.7.1 into trunk, revs 1052-1057
240
251
241 * Versionstring = 0.7.2.svn
252 * Versionstring = 0.7.2.svn
242
253
243 * eggsetup.py: A separate script for constructing eggs, creates
254 * eggsetup.py: A separate script for constructing eggs, creates
244 proper launch scripts even on Windows (an .exe file in
255 proper launch scripts even on Windows (an .exe file in
245 \python24\scripts).
256 \python24\scripts).
246
257
247 * ipapi.py: launch_new_instance, launch entry point needed for the
258 * ipapi.py: launch_new_instance, launch entry point needed for the
248 egg.
259 egg.
249
260
250 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
261 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
251
262
252 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
263 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
253 %pfile foo would print the file for foo even if it was a binary.
264 %pfile foo would print the file for foo even if it was a binary.
254 Now, extensions '.so' and '.dll' are skipped.
265 Now, extensions '.so' and '.dll' are skipped.
255
266
256 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
267 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
257 bug, where macros would fail in all threaded modes. I'm not 100%
268 bug, where macros would fail in all threaded modes. I'm not 100%
258 sure, so I'm going to put out an rc instead of making a release
269 sure, so I'm going to put out an rc instead of making a release
259 today, and wait for feedback for at least a few days.
270 today, and wait for feedback for at least a few days.
260
271
261 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
272 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
262 it...) the handling of pasting external code with autoindent on.
273 it...) the handling of pasting external code with autoindent on.
263 To get out of a multiline input, the rule will appear for most
274 To get out of a multiline input, the rule will appear for most
264 users unchanged: two blank lines or change the indent level
275 users unchanged: two blank lines or change the indent level
265 proposed by IPython. But there is a twist now: you can
276 proposed by IPython. But there is a twist now: you can
266 add/subtract only *one or two spaces*. If you add/subtract three
277 add/subtract only *one or two spaces*. If you add/subtract three
267 or more (unless you completely delete the line), IPython will
278 or more (unless you completely delete the line), IPython will
268 accept that line, and you'll need to enter a second one of pure
279 accept that line, and you'll need to enter a second one of pure
269 whitespace. I know it sounds complicated, but I can't find a
280 whitespace. I know it sounds complicated, but I can't find a
270 different solution that covers all the cases, with the right
281 different solution that covers all the cases, with the right
271 heuristics. Hopefully in actual use, nobody will really notice
282 heuristics. Hopefully in actual use, nobody will really notice
272 all these strange rules and things will 'just work'.
283 all these strange rules and things will 'just work'.
273
284
274 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
285 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
275
286
276 * IPython/iplib.py (interact): catch exceptions which can be
287 * IPython/iplib.py (interact): catch exceptions which can be
277 triggered asynchronously by signal handlers. Thanks to an
288 triggered asynchronously by signal handlers. Thanks to an
278 automatic crash report, submitted by Colin Kingsley
289 automatic crash report, submitted by Colin Kingsley
279 <tercel-AT-gentoo.org>.
290 <tercel-AT-gentoo.org>.
280
291
281 2006-01-20 Ville Vainio <vivainio@gmail.com>
292 2006-01-20 Ville Vainio <vivainio@gmail.com>
282
293
283 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
294 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
284 (%rehashdir, very useful, try it out) of how to extend ipython
295 (%rehashdir, very useful, try it out) of how to extend ipython
285 with new magics. Also added Extensions dir to pythonpath to make
296 with new magics. Also added Extensions dir to pythonpath to make
286 importing extensions easy.
297 importing extensions easy.
287
298
288 * %store now complains when trying to store interactively declared
299 * %store now complains when trying to store interactively declared
289 classes / instances of those classes.
300 classes / instances of those classes.
290
301
291 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
302 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
292 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
303 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
293 if they exist, and ipy_user_conf.py with some defaults is created for
304 if they exist, and ipy_user_conf.py with some defaults is created for
294 the user.
305 the user.
295
306
296 * Startup rehashing done by the config file, not InterpreterExec.
307 * Startup rehashing done by the config file, not InterpreterExec.
297 This means system commands are available even without selecting the
308 This means system commands are available even without selecting the
298 pysh profile. It's the sensible default after all.
309 pysh profile. It's the sensible default after all.
299
310
300 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
311 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
301
312
302 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
313 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
303 multiline code with autoindent on working. But I am really not
314 multiline code with autoindent on working. But I am really not
304 sure, so this needs more testing. Will commit a debug-enabled
315 sure, so this needs more testing. Will commit a debug-enabled
305 version for now, while I test it some more, so that Ville and
316 version for now, while I test it some more, so that Ville and
306 others may also catch any problems. Also made
317 others may also catch any problems. Also made
307 self.indent_current_str() a method, to ensure that there's no
318 self.indent_current_str() a method, to ensure that there's no
308 chance of the indent space count and the corresponding string
319 chance of the indent space count and the corresponding string
309 falling out of sync. All code needing the string should just call
320 falling out of sync. All code needing the string should just call
310 the method.
321 the method.
311
322
312 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
323 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
313
324
314 * IPython/Magic.py (magic_edit): fix check for when users don't
325 * IPython/Magic.py (magic_edit): fix check for when users don't
315 save their output files, the try/except was in the wrong section.
326 save their output files, the try/except was in the wrong section.
316
327
317 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
328 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
318
329
319 * IPython/Magic.py (magic_run): fix __file__ global missing from
330 * IPython/Magic.py (magic_run): fix __file__ global missing from
320 script's namespace when executed via %run. After a report by
331 script's namespace when executed via %run. After a report by
321 Vivian.
332 Vivian.
322
333
323 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
334 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
324 when using python 2.4. The parent constructor changed in 2.4, and
335 when using python 2.4. The parent constructor changed in 2.4, and
325 we need to track it directly (we can't call it, as it messes up
336 we need to track it directly (we can't call it, as it messes up
326 readline and tab-completion inside our pdb would stop working).
337 readline and tab-completion inside our pdb would stop working).
327 After a bug report by R. Bernstein <rocky-AT-panix.com>.
338 After a bug report by R. Bernstein <rocky-AT-panix.com>.
328
339
329 2006-01-16 Ville Vainio <vivainio@gmail.com>
340 2006-01-16 Ville Vainio <vivainio@gmail.com>
330
341
331 * Ipython/magic.py:Reverted back to old %edit functionality
342 * Ipython/magic.py:Reverted back to old %edit functionality
332 that returns file contents on exit.
343 that returns file contents on exit.
333
344
334 * IPython/path.py: Added Jason Orendorff's "path" module to
345 * IPython/path.py: Added Jason Orendorff's "path" module to
335 IPython tree, http://www.jorendorff.com/articles/python/path/.
346 IPython tree, http://www.jorendorff.com/articles/python/path/.
336 You can get path objects conveniently through %sc, and !!, e.g.:
347 You can get path objects conveniently through %sc, and !!, e.g.:
337 sc files=ls
348 sc files=ls
338 for p in files.paths: # or files.p
349 for p in files.paths: # or files.p
339 print p,p.mtime
350 print p,p.mtime
340
351
341 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
352 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
342 now work again without considering the exclusion regexp -
353 now work again without considering the exclusion regexp -
343 hence, things like ',foo my/path' turn to 'foo("my/path")'
354 hence, things like ',foo my/path' turn to 'foo("my/path")'
344 instead of syntax error.
355 instead of syntax error.
345
356
346
357
347 2006-01-14 Ville Vainio <vivainio@gmail.com>
358 2006-01-14 Ville Vainio <vivainio@gmail.com>
348
359
349 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
360 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
350 ipapi decorators for python 2.4 users, options() provides access to rc
361 ipapi decorators for python 2.4 users, options() provides access to rc
351 data.
362 data.
352
363
353 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
364 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
354 as path separators (even on Linux ;-). Space character after
365 as path separators (even on Linux ;-). Space character after
355 backslash (as yielded by tab completer) is still space;
366 backslash (as yielded by tab completer) is still space;
356 "%cd long\ name" works as expected.
367 "%cd long\ name" works as expected.
357
368
358 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
369 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
359 as "chain of command", with priority. API stays the same,
370 as "chain of command", with priority. API stays the same,
360 TryNext exception raised by a hook function signals that
371 TryNext exception raised by a hook function signals that
361 current hook failed and next hook should try handling it, as
372 current hook failed and next hook should try handling it, as
362 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
373 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
363 requested configurable display hook, which is now implemented.
374 requested configurable display hook, which is now implemented.
364
375
365 2006-01-13 Ville Vainio <vivainio@gmail.com>
376 2006-01-13 Ville Vainio <vivainio@gmail.com>
366
377
367 * IPython/platutils*.py: platform specific utility functions,
378 * IPython/platutils*.py: platform specific utility functions,
368 so far only set_term_title is implemented (change terminal
379 so far only set_term_title is implemented (change terminal
369 label in windowing systems). %cd now changes the title to
380 label in windowing systems). %cd now changes the title to
370 current dir.
381 current dir.
371
382
372 * IPython/Release.py: Added myself to "authors" list,
383 * IPython/Release.py: Added myself to "authors" list,
373 had to create new files.
384 had to create new files.
374
385
375 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
386 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
376 shell escape; not a known bug but had potential to be one in the
387 shell escape; not a known bug but had potential to be one in the
377 future.
388 future.
378
389
379 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
390 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
380 extension API for IPython! See the module for usage example. Fix
391 extension API for IPython! See the module for usage example. Fix
381 OInspect for docstring-less magic functions.
392 OInspect for docstring-less magic functions.
382
393
383
394
384 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
395 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
385
396
386 * IPython/iplib.py (raw_input): temporarily deactivate all
397 * IPython/iplib.py (raw_input): temporarily deactivate all
387 attempts at allowing pasting of code with autoindent on. It
398 attempts at allowing pasting of code with autoindent on. It
388 introduced bugs (reported by Prabhu) and I can't seem to find a
399 introduced bugs (reported by Prabhu) and I can't seem to find a
389 robust combination which works in all cases. Will have to revisit
400 robust combination which works in all cases. Will have to revisit
390 later.
401 later.
391
402
392 * IPython/genutils.py: remove isspace() function. We've dropped
403 * IPython/genutils.py: remove isspace() function. We've dropped
393 2.2 compatibility, so it's OK to use the string method.
404 2.2 compatibility, so it's OK to use the string method.
394
405
395 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
406 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
396
407
397 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
408 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
398 matching what NOT to autocall on, to include all python binary
409 matching what NOT to autocall on, to include all python binary
399 operators (including things like 'and', 'or', 'is' and 'in').
410 operators (including things like 'and', 'or', 'is' and 'in').
400 Prompted by a bug report on 'foo & bar', but I realized we had
411 Prompted by a bug report on 'foo & bar', but I realized we had
401 many more potential bug cases with other operators. The regexp is
412 many more potential bug cases with other operators. The regexp is
402 self.re_exclude_auto, it's fairly commented.
413 self.re_exclude_auto, it's fairly commented.
403
414
404 2006-01-12 Ville Vainio <vivainio@gmail.com>
415 2006-01-12 Ville Vainio <vivainio@gmail.com>
405
416
406 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
417 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
407 Prettified and hardened string/backslash quoting with ipsystem(),
418 Prettified and hardened string/backslash quoting with ipsystem(),
408 ipalias() and ipmagic(). Now even \ characters are passed to
419 ipalias() and ipmagic(). Now even \ characters are passed to
409 %magics, !shell escapes and aliases exactly as they are in the
420 %magics, !shell escapes and aliases exactly as they are in the
410 ipython command line. Should improve backslash experience,
421 ipython command line. Should improve backslash experience,
411 particularly in Windows (path delimiter for some commands that
422 particularly in Windows (path delimiter for some commands that
412 won't understand '/'), but Unix benefits as well (regexps). %cd
423 won't understand '/'), but Unix benefits as well (regexps). %cd
413 magic still doesn't support backslash path delimiters, though. Also
424 magic still doesn't support backslash path delimiters, though. Also
414 deleted all pretense of supporting multiline command strings in
425 deleted all pretense of supporting multiline command strings in
415 !system or %magic commands. Thanks to Jerry McRae for suggestions.
426 !system or %magic commands. Thanks to Jerry McRae for suggestions.
416
427
417 * doc/build_doc_instructions.txt added. Documentation on how to
428 * doc/build_doc_instructions.txt added. Documentation on how to
418 use doc/update_manual.py, added yesterday. Both files contributed
429 use doc/update_manual.py, added yesterday. Both files contributed
419 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
430 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
420 doc/*.sh for deprecation at a later date.
431 doc/*.sh for deprecation at a later date.
421
432
422 * /ipython.py Added ipython.py to root directory for
433 * /ipython.py Added ipython.py to root directory for
423 zero-installation (tar xzvf ipython.tgz; cd ipython; python
434 zero-installation (tar xzvf ipython.tgz; cd ipython; python
424 ipython.py) and development convenience (no need to kee doing
435 ipython.py) and development convenience (no need to kee doing
425 "setup.py install" between changes).
436 "setup.py install" between changes).
426
437
427 * Made ! and !! shell escapes work (again) in multiline expressions:
438 * Made ! and !! shell escapes work (again) in multiline expressions:
428 if 1:
439 if 1:
429 !ls
440 !ls
430 !!ls
441 !!ls
431
442
432 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
443 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
433
444
434 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
445 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
435 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
446 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
436 module in case-insensitive installation. Was causing crashes
447 module in case-insensitive installation. Was causing crashes
437 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
448 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
438
449
439 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
450 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
440 <marienz-AT-gentoo.org>, closes
451 <marienz-AT-gentoo.org>, closes
441 http://www.scipy.net/roundup/ipython/issue51.
452 http://www.scipy.net/roundup/ipython/issue51.
442
453
443 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
454 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
444
455
445 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the the
456 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the the
446 problem of excessive CPU usage under *nix and keyboard lag under
457 problem of excessive CPU usage under *nix and keyboard lag under
447 win32.
458 win32.
448
459
449 2006-01-10 *** Released version 0.7.0
460 2006-01-10 *** Released version 0.7.0
450
461
451 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
462 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
452
463
453 * IPython/Release.py (revision): tag version number to 0.7.0,
464 * IPython/Release.py (revision): tag version number to 0.7.0,
454 ready for release.
465 ready for release.
455
466
456 * IPython/Magic.py (magic_edit): Add print statement to %edit so
467 * IPython/Magic.py (magic_edit): Add print statement to %edit so
457 it informs the user of the name of the temp. file used. This can
468 it informs the user of the name of the temp. file used. This can
458 help if you decide later to reuse that same file, so you know
469 help if you decide later to reuse that same file, so you know
459 where to copy the info from.
470 where to copy the info from.
460
471
461 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
472 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
462
473
463 * setup_bdist_egg.py: little script to build an egg. Added
474 * setup_bdist_egg.py: little script to build an egg. Added
464 support in the release tools as well.
475 support in the release tools as well.
465
476
466 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
477 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
467
478
468 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
479 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
469 version selection (new -wxversion command line and ipythonrc
480 version selection (new -wxversion command line and ipythonrc
470 parameter). Patch contributed by Arnd Baecker
481 parameter). Patch contributed by Arnd Baecker
471 <arnd.baecker-AT-web.de>.
482 <arnd.baecker-AT-web.de>.
472
483
473 * IPython/iplib.py (embed_mainloop): fix tab-completion in
484 * IPython/iplib.py (embed_mainloop): fix tab-completion in
474 embedded instances, for variables defined at the interactive
485 embedded instances, for variables defined at the interactive
475 prompt of the embedded ipython. Reported by Arnd.
486 prompt of the embedded ipython. Reported by Arnd.
476
487
477 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
488 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
478 it can be used as a (stateful) toggle, or with a direct parameter.
489 it can be used as a (stateful) toggle, or with a direct parameter.
479
490
480 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
491 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
481 could be triggered in certain cases and cause the traceback
492 could be triggered in certain cases and cause the traceback
482 printer not to work.
493 printer not to work.
483
494
484 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
495 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
485
496
486 * IPython/iplib.py (_should_recompile): Small fix, closes
497 * IPython/iplib.py (_should_recompile): Small fix, closes
487 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
498 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
488
499
489 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
500 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
490
501
491 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
502 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
492 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
503 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
493 Moad for help with tracking it down.
504 Moad for help with tracking it down.
494
505
495 * IPython/iplib.py (handle_auto): fix autocall handling for
506 * IPython/iplib.py (handle_auto): fix autocall handling for
496 objects which support BOTH __getitem__ and __call__ (so that f [x]
507 objects which support BOTH __getitem__ and __call__ (so that f [x]
497 is left alone, instead of becoming f([x]) automatically).
508 is left alone, instead of becoming f([x]) automatically).
498
509
499 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
510 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
500 Ville's patch.
511 Ville's patch.
501
512
502 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
513 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
503
514
504 * IPython/iplib.py (handle_auto): changed autocall semantics to
515 * IPython/iplib.py (handle_auto): changed autocall semantics to
505 include 'smart' mode, where the autocall transformation is NOT
516 include 'smart' mode, where the autocall transformation is NOT
506 applied if there are no arguments on the line. This allows you to
517 applied if there are no arguments on the line. This allows you to
507 just type 'foo' if foo is a callable to see its internal form,
518 just type 'foo' if foo is a callable to see its internal form,
508 instead of having it called with no arguments (typically a
519 instead of having it called with no arguments (typically a
509 mistake). The old 'full' autocall still exists: for that, you
520 mistake). The old 'full' autocall still exists: for that, you
510 need to set the 'autocall' parameter to 2 in your ipythonrc file.
521 need to set the 'autocall' parameter to 2 in your ipythonrc file.
511
522
512 * IPython/completer.py (Completer.attr_matches): add
523 * IPython/completer.py (Completer.attr_matches): add
513 tab-completion support for Enthoughts' traits. After a report by
524 tab-completion support for Enthoughts' traits. After a report by
514 Arnd and a patch by Prabhu.
525 Arnd and a patch by Prabhu.
515
526
516 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
527 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
517
528
518 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
529 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
519 Schmolck's patch to fix inspect.getinnerframes().
530 Schmolck's patch to fix inspect.getinnerframes().
520
531
521 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
532 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
522 for embedded instances, regarding handling of namespaces and items
533 for embedded instances, regarding handling of namespaces and items
523 added to the __builtin__ one. Multiple embedded instances and
534 added to the __builtin__ one. Multiple embedded instances and
524 recursive embeddings should work better now (though I'm not sure
535 recursive embeddings should work better now (though I'm not sure
525 I've got all the corner cases fixed, that code is a bit of a brain
536 I've got all the corner cases fixed, that code is a bit of a brain
526 twister).
537 twister).
527
538
528 * IPython/Magic.py (magic_edit): added support to edit in-memory
539 * IPython/Magic.py (magic_edit): added support to edit in-memory
529 macros (automatically creates the necessary temp files). %edit
540 macros (automatically creates the necessary temp files). %edit
530 also doesn't return the file contents anymore, it's just noise.
541 also doesn't return the file contents anymore, it's just noise.
531
542
532 * IPython/completer.py (Completer.attr_matches): revert change to
543 * IPython/completer.py (Completer.attr_matches): revert change to
533 complete only on attributes listed in __all__. I realized it
544 complete only on attributes listed in __all__. I realized it
534 cripples the tab-completion system as a tool for exploring the
545 cripples the tab-completion system as a tool for exploring the
535 internals of unknown libraries (it renders any non-__all__
546 internals of unknown libraries (it renders any non-__all__
536 attribute off-limits). I got bit by this when trying to see
547 attribute off-limits). I got bit by this when trying to see
537 something inside the dis module.
548 something inside the dis module.
538
549
539 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
550 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
540
551
541 * IPython/iplib.py (InteractiveShell.__init__): add .meta
552 * IPython/iplib.py (InteractiveShell.__init__): add .meta
542 namespace for users and extension writers to hold data in. This
553 namespace for users and extension writers to hold data in. This
543 follows the discussion in
554 follows the discussion in
544 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
555 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
545
556
546 * IPython/completer.py (IPCompleter.complete): small patch to help
557 * IPython/completer.py (IPCompleter.complete): small patch to help
547 tab-completion under Emacs, after a suggestion by John Barnard
558 tab-completion under Emacs, after a suggestion by John Barnard
548 <barnarj-AT-ccf.org>.
559 <barnarj-AT-ccf.org>.
549
560
550 * IPython/Magic.py (Magic.extract_input_slices): added support for
561 * IPython/Magic.py (Magic.extract_input_slices): added support for
551 the slice notation in magics to use N-M to represent numbers N...M
562 the slice notation in magics to use N-M to represent numbers N...M
552 (closed endpoints). This is used by %macro and %save.
563 (closed endpoints). This is used by %macro and %save.
553
564
554 * IPython/completer.py (Completer.attr_matches): for modules which
565 * IPython/completer.py (Completer.attr_matches): for modules which
555 define __all__, complete only on those. After a patch by Jeffrey
566 define __all__, complete only on those. After a patch by Jeffrey
556 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
567 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
557 speed up this routine.
568 speed up this routine.
558
569
559 * IPython/Logger.py (Logger.log): fix a history handling bug. I
570 * IPython/Logger.py (Logger.log): fix a history handling bug. I
560 don't know if this is the end of it, but the behavior now is
571 don't know if this is the end of it, but the behavior now is
561 certainly much more correct. Note that coupled with macros,
572 certainly much more correct. Note that coupled with macros,
562 slightly surprising (at first) behavior may occur: a macro will in
573 slightly surprising (at first) behavior may occur: a macro will in
563 general expand to multiple lines of input, so upon exiting, the
574 general expand to multiple lines of input, so upon exiting, the
564 in/out counters will both be bumped by the corresponding amount
575 in/out counters will both be bumped by the corresponding amount
565 (as if the macro's contents had been typed interactively). Typing
576 (as if the macro's contents had been typed interactively). Typing
566 %hist will reveal the intermediate (silently processed) lines.
577 %hist will reveal the intermediate (silently processed) lines.
567
578
568 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
579 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
569 pickle to fail (%run was overwriting __main__ and not restoring
580 pickle to fail (%run was overwriting __main__ and not restoring
570 it, but pickle relies on __main__ to operate).
581 it, but pickle relies on __main__ to operate).
571
582
572 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
583 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
573 using properties, but forgot to make the main InteractiveShell
584 using properties, but forgot to make the main InteractiveShell
574 class a new-style class. Properties fail silently, and
585 class a new-style class. Properties fail silently, and
575 misteriously, with old-style class (getters work, but
586 misteriously, with old-style class (getters work, but
576 setters don't do anything).
587 setters don't do anything).
577
588
578 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
589 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
579
590
580 * IPython/Magic.py (magic_history): fix history reporting bug (I
591 * IPython/Magic.py (magic_history): fix history reporting bug (I
581 know some nasties are still there, I just can't seem to find a
592 know some nasties are still there, I just can't seem to find a
582 reproducible test case to track them down; the input history is
593 reproducible test case to track them down; the input history is
583 falling out of sync...)
594 falling out of sync...)
584
595
585 * IPython/iplib.py (handle_shell_escape): fix bug where both
596 * IPython/iplib.py (handle_shell_escape): fix bug where both
586 aliases and system accesses where broken for indented code (such
597 aliases and system accesses where broken for indented code (such
587 as loops).
598 as loops).
588
599
589 * IPython/genutils.py (shell): fix small but critical bug for
600 * IPython/genutils.py (shell): fix small but critical bug for
590 win32 system access.
601 win32 system access.
591
602
592 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
603 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
593
604
594 * IPython/iplib.py (showtraceback): remove use of the
605 * IPython/iplib.py (showtraceback): remove use of the
595 sys.last_{type/value/traceback} structures, which are non
606 sys.last_{type/value/traceback} structures, which are non
596 thread-safe.
607 thread-safe.
597 (_prefilter): change control flow to ensure that we NEVER
608 (_prefilter): change control flow to ensure that we NEVER
598 introspect objects when autocall is off. This will guarantee that
609 introspect objects when autocall is off. This will guarantee that
599 having an input line of the form 'x.y', where access to attribute
610 having an input line of the form 'x.y', where access to attribute
600 'y' has side effects, doesn't trigger the side effect TWICE. It
611 'y' has side effects, doesn't trigger the side effect TWICE. It
601 is important to note that, with autocall on, these side effects
612 is important to note that, with autocall on, these side effects
602 can still happen.
613 can still happen.
603 (ipsystem): new builtin, to complete the ip{magic/alias/system}
614 (ipsystem): new builtin, to complete the ip{magic/alias/system}
604 trio. IPython offers these three kinds of special calls which are
615 trio. IPython offers these three kinds of special calls which are
605 not python code, and it's a good thing to have their call method
616 not python code, and it's a good thing to have their call method
606 be accessible as pure python functions (not just special syntax at
617 be accessible as pure python functions (not just special syntax at
607 the command line). It gives us a better internal implementation
618 the command line). It gives us a better internal implementation
608 structure, as well as exposing these for user scripting more
619 structure, as well as exposing these for user scripting more
609 cleanly.
620 cleanly.
610
621
611 * IPython/macro.py (Macro.__init__): moved macros to a standalone
622 * IPython/macro.py (Macro.__init__): moved macros to a standalone
612 file. Now that they'll be more likely to be used with the
623 file. Now that they'll be more likely to be used with the
613 persistance system (%store), I want to make sure their module path
624 persistance system (%store), I want to make sure their module path
614 doesn't change in the future, so that we don't break things for
625 doesn't change in the future, so that we don't break things for
615 users' persisted data.
626 users' persisted data.
616
627
617 * IPython/iplib.py (autoindent_update): move indentation
628 * IPython/iplib.py (autoindent_update): move indentation
618 management into the _text_ processing loop, not the keyboard
629 management into the _text_ processing loop, not the keyboard
619 interactive one. This is necessary to correctly process non-typed
630 interactive one. This is necessary to correctly process non-typed
620 multiline input (such as macros).
631 multiline input (such as macros).
621
632
622 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
633 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
623 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
634 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
624 which was producing problems in the resulting manual.
635 which was producing problems in the resulting manual.
625 (magic_whos): improve reporting of instances (show their class,
636 (magic_whos): improve reporting of instances (show their class,
626 instead of simply printing 'instance' which isn't terribly
637 instead of simply printing 'instance' which isn't terribly
627 informative).
638 informative).
628
639
629 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
640 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
630 (minor mods) to support network shares under win32.
641 (minor mods) to support network shares under win32.
631
642
632 * IPython/winconsole.py (get_console_size): add new winconsole
643 * IPython/winconsole.py (get_console_size): add new winconsole
633 module and fixes to page_dumb() to improve its behavior under
644 module and fixes to page_dumb() to improve its behavior under
634 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
645 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
635
646
636 * IPython/Magic.py (Macro): simplified Macro class to just
647 * IPython/Magic.py (Macro): simplified Macro class to just
637 subclass list. We've had only 2.2 compatibility for a very long
648 subclass list. We've had only 2.2 compatibility for a very long
638 time, yet I was still avoiding subclassing the builtin types. No
649 time, yet I was still avoiding subclassing the builtin types. No
639 more (I'm also starting to use properties, though I won't shift to
650 more (I'm also starting to use properties, though I won't shift to
640 2.3-specific features quite yet).
651 2.3-specific features quite yet).
641 (magic_store): added Ville's patch for lightweight variable
652 (magic_store): added Ville's patch for lightweight variable
642 persistence, after a request on the user list by Matt Wilkie
653 persistence, after a request on the user list by Matt Wilkie
643 <maphew-AT-gmail.com>. The new %store magic's docstring has full
654 <maphew-AT-gmail.com>. The new %store magic's docstring has full
644 details.
655 details.
645
656
646 * IPython/iplib.py (InteractiveShell.post_config_initialization):
657 * IPython/iplib.py (InteractiveShell.post_config_initialization):
647 changed the default logfile name from 'ipython.log' to
658 changed the default logfile name from 'ipython.log' to
648 'ipython_log.py'. These logs are real python files, and now that
659 'ipython_log.py'. These logs are real python files, and now that
649 we have much better multiline support, people are more likely to
660 we have much better multiline support, people are more likely to
650 want to use them as such. Might as well name them correctly.
661 want to use them as such. Might as well name them correctly.
651
662
652 * IPython/Magic.py: substantial cleanup. While we can't stop
663 * IPython/Magic.py: substantial cleanup. While we can't stop
653 using magics as mixins, due to the existing customizations 'out
664 using magics as mixins, due to the existing customizations 'out
654 there' which rely on the mixin naming conventions, at least I
665 there' which rely on the mixin naming conventions, at least I
655 cleaned out all cross-class name usage. So once we are OK with
666 cleaned out all cross-class name usage. So once we are OK with
656 breaking compatibility, the two systems can be separated.
667 breaking compatibility, the two systems can be separated.
657
668
658 * IPython/Logger.py: major cleanup. This one is NOT a mixin
669 * IPython/Logger.py: major cleanup. This one is NOT a mixin
659 anymore, and the class is a fair bit less hideous as well. New
670 anymore, and the class is a fair bit less hideous as well. New
660 features were also introduced: timestamping of input, and logging
671 features were also introduced: timestamping of input, and logging
661 of output results. These are user-visible with the -t and -o
672 of output results. These are user-visible with the -t and -o
662 options to %logstart. Closes
673 options to %logstart. Closes
663 http://www.scipy.net/roundup/ipython/issue11 and a request by
674 http://www.scipy.net/roundup/ipython/issue11 and a request by
664 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
675 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
665
676
666 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
677 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
667
678
668 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
679 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
669 better hadnle backslashes in paths. See the thread 'More Windows
680 better hadnle backslashes in paths. See the thread 'More Windows
670 questions part 2 - \/ characters revisited' on the iypthon user
681 questions part 2 - \/ characters revisited' on the iypthon user
671 list:
682 list:
672 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
683 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
673
684
674 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
685 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
675
686
676 (InteractiveShell.__init__): change threaded shells to not use the
687 (InteractiveShell.__init__): change threaded shells to not use the
677 ipython crash handler. This was causing more problems than not,
688 ipython crash handler. This was causing more problems than not,
678 as exceptions in the main thread (GUI code, typically) would
689 as exceptions in the main thread (GUI code, typically) would
679 always show up as a 'crash', when they really weren't.
690 always show up as a 'crash', when they really weren't.
680
691
681 The colors and exception mode commands (%colors/%xmode) have been
692 The colors and exception mode commands (%colors/%xmode) have been
682 synchronized to also take this into account, so users can get
693 synchronized to also take this into account, so users can get
683 verbose exceptions for their threaded code as well. I also added
694 verbose exceptions for their threaded code as well. I also added
684 support for activating pdb inside this exception handler as well,
695 support for activating pdb inside this exception handler as well,
685 so now GUI authors can use IPython's enhanced pdb at runtime.
696 so now GUI authors can use IPython's enhanced pdb at runtime.
686
697
687 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
698 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
688 true by default, and add it to the shipped ipythonrc file. Since
699 true by default, and add it to the shipped ipythonrc file. Since
689 this asks the user before proceeding, I think it's OK to make it
700 this asks the user before proceeding, I think it's OK to make it
690 true by default.
701 true by default.
691
702
692 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
703 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
693 of the previous special-casing of input in the eval loop. I think
704 of the previous special-casing of input in the eval loop. I think
694 this is cleaner, as they really are commands and shouldn't have
705 this is cleaner, as they really are commands and shouldn't have
695 a special role in the middle of the core code.
706 a special role in the middle of the core code.
696
707
697 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
708 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
698
709
699 * IPython/iplib.py (edit_syntax_error): added support for
710 * IPython/iplib.py (edit_syntax_error): added support for
700 automatically reopening the editor if the file had a syntax error
711 automatically reopening the editor if the file had a syntax error
701 in it. Thanks to scottt who provided the patch at:
712 in it. Thanks to scottt who provided the patch at:
702 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
713 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
703 version committed).
714 version committed).
704
715
705 * IPython/iplib.py (handle_normal): add suport for multi-line
716 * IPython/iplib.py (handle_normal): add suport for multi-line
706 input with emtpy lines. This fixes
717 input with emtpy lines. This fixes
707 http://www.scipy.net/roundup/ipython/issue43 and a similar
718 http://www.scipy.net/roundup/ipython/issue43 and a similar
708 discussion on the user list.
719 discussion on the user list.
709
720
710 WARNING: a behavior change is necessarily introduced to support
721 WARNING: a behavior change is necessarily introduced to support
711 blank lines: now a single blank line with whitespace does NOT
722 blank lines: now a single blank line with whitespace does NOT
712 break the input loop, which means that when autoindent is on, by
723 break the input loop, which means that when autoindent is on, by
713 default hitting return on the next (indented) line does NOT exit.
724 default hitting return on the next (indented) line does NOT exit.
714
725
715 Instead, to exit a multiline input you can either have:
726 Instead, to exit a multiline input you can either have:
716
727
717 - TWO whitespace lines (just hit return again), or
728 - TWO whitespace lines (just hit return again), or
718 - a single whitespace line of a different length than provided
729 - a single whitespace line of a different length than provided
719 by the autoindent (add or remove a space).
730 by the autoindent (add or remove a space).
720
731
721 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
732 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
722 module to better organize all readline-related functionality.
733 module to better organize all readline-related functionality.
723 I've deleted FlexCompleter and put all completion clases here.
734 I've deleted FlexCompleter and put all completion clases here.
724
735
725 * IPython/iplib.py (raw_input): improve indentation management.
736 * IPython/iplib.py (raw_input): improve indentation management.
726 It is now possible to paste indented code with autoindent on, and
737 It is now possible to paste indented code with autoindent on, and
727 the code is interpreted correctly (though it still looks bad on
738 the code is interpreted correctly (though it still looks bad on
728 screen, due to the line-oriented nature of ipython).
739 screen, due to the line-oriented nature of ipython).
729 (MagicCompleter.complete): change behavior so that a TAB key on an
740 (MagicCompleter.complete): change behavior so that a TAB key on an
730 otherwise empty line actually inserts a tab, instead of completing
741 otherwise empty line actually inserts a tab, instead of completing
731 on the entire global namespace. This makes it easier to use the
742 on the entire global namespace. This makes it easier to use the
732 TAB key for indentation. After a request by Hans Meine
743 TAB key for indentation. After a request by Hans Meine
733 <hans_meine-AT-gmx.net>
744 <hans_meine-AT-gmx.net>
734 (_prefilter): add support so that typing plain 'exit' or 'quit'
745 (_prefilter): add support so that typing plain 'exit' or 'quit'
735 does a sensible thing. Originally I tried to deviate as little as
746 does a sensible thing. Originally I tried to deviate as little as
736 possible from the default python behavior, but even that one may
747 possible from the default python behavior, but even that one may
737 change in this direction (thread on python-dev to that effect).
748 change in this direction (thread on python-dev to that effect).
738 Regardless, ipython should do the right thing even if CPython's
749 Regardless, ipython should do the right thing even if CPython's
739 '>>>' prompt doesn't.
750 '>>>' prompt doesn't.
740 (InteractiveShell): removed subclassing code.InteractiveConsole
751 (InteractiveShell): removed subclassing code.InteractiveConsole
741 class. By now we'd overridden just about all of its methods: I've
752 class. By now we'd overridden just about all of its methods: I've
742 copied the remaining two over, and now ipython is a standalone
753 copied the remaining two over, and now ipython is a standalone
743 class. This will provide a clearer picture for the chainsaw
754 class. This will provide a clearer picture for the chainsaw
744 branch refactoring.
755 branch refactoring.
745
756
746 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
757 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
747
758
748 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
759 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
749 failures for objects which break when dir() is called on them.
760 failures for objects which break when dir() is called on them.
750
761
751 * IPython/FlexCompleter.py (Completer.__init__): Added support for
762 * IPython/FlexCompleter.py (Completer.__init__): Added support for
752 distinct local and global namespaces in the completer API. This
763 distinct local and global namespaces in the completer API. This
753 change allows us top properly handle completion with distinct
764 change allows us top properly handle completion with distinct
754 scopes, including in embedded instances (this had never really
765 scopes, including in embedded instances (this had never really
755 worked correctly).
766 worked correctly).
756
767
757 Note: this introduces a change in the constructor for
768 Note: this introduces a change in the constructor for
758 MagicCompleter, as a new global_namespace parameter is now the
769 MagicCompleter, as a new global_namespace parameter is now the
759 second argument (the others were bumped one position).
770 second argument (the others were bumped one position).
760
771
761 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
772 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
762
773
763 * IPython/iplib.py (embed_mainloop): fix tab-completion in
774 * IPython/iplib.py (embed_mainloop): fix tab-completion in
764 embedded instances (which can be done now thanks to Vivian's
775 embedded instances (which can be done now thanks to Vivian's
765 frame-handling fixes for pdb).
776 frame-handling fixes for pdb).
766 (InteractiveShell.__init__): Fix namespace handling problem in
777 (InteractiveShell.__init__): Fix namespace handling problem in
767 embedded instances. We were overwriting __main__ unconditionally,
778 embedded instances. We were overwriting __main__ unconditionally,
768 and this should only be done for 'full' (non-embedded) IPython;
779 and this should only be done for 'full' (non-embedded) IPython;
769 embedded instances must respect the caller's __main__. Thanks to
780 embedded instances must respect the caller's __main__. Thanks to
770 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
781 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
771
782
772 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
783 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
773
784
774 * setup.py: added download_url to setup(). This registers the
785 * setup.py: added download_url to setup(). This registers the
775 download address at PyPI, which is not only useful to humans
786 download address at PyPI, which is not only useful to humans
776 browsing the site, but is also picked up by setuptools (the Eggs
787 browsing the site, but is also picked up by setuptools (the Eggs
777 machinery). Thanks to Ville and R. Kern for the info/discussion
788 machinery). Thanks to Ville and R. Kern for the info/discussion
778 on this.
789 on this.
779
790
780 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
791 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
781
792
782 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
793 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
783 This brings a lot of nice functionality to the pdb mode, which now
794 This brings a lot of nice functionality to the pdb mode, which now
784 has tab-completion, syntax highlighting, and better stack handling
795 has tab-completion, syntax highlighting, and better stack handling
785 than before. Many thanks to Vivian De Smedt
796 than before. Many thanks to Vivian De Smedt
786 <vivian-AT-vdesmedt.com> for the original patches.
797 <vivian-AT-vdesmedt.com> for the original patches.
787
798
788 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
799 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
789
800
790 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
801 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
791 sequence to consistently accept the banner argument. The
802 sequence to consistently accept the banner argument. The
792 inconsistency was tripping SAGE, thanks to Gary Zablackis
803 inconsistency was tripping SAGE, thanks to Gary Zablackis
793 <gzabl-AT-yahoo.com> for the report.
804 <gzabl-AT-yahoo.com> for the report.
794
805
795 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
806 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
796
807
797 * IPython/iplib.py (InteractiveShell.post_config_initialization):
808 * IPython/iplib.py (InteractiveShell.post_config_initialization):
798 Fix bug where a naked 'alias' call in the ipythonrc file would
809 Fix bug where a naked 'alias' call in the ipythonrc file would
799 cause a crash. Bug reported by Jorgen Stenarson.
810 cause a crash. Bug reported by Jorgen Stenarson.
800
811
801 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
812 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
802
813
803 * IPython/ipmaker.py (make_IPython): cleanups which should improve
814 * IPython/ipmaker.py (make_IPython): cleanups which should improve
804 startup time.
815 startup time.
805
816
806 * IPython/iplib.py (runcode): my globals 'fix' for embedded
817 * IPython/iplib.py (runcode): my globals 'fix' for embedded
807 instances had introduced a bug with globals in normal code. Now
818 instances had introduced a bug with globals in normal code. Now
808 it's working in all cases.
819 it's working in all cases.
809
820
810 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
821 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
811 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
822 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
812 has been introduced to set the default case sensitivity of the
823 has been introduced to set the default case sensitivity of the
813 searches. Users can still select either mode at runtime on a
824 searches. Users can still select either mode at runtime on a
814 per-search basis.
825 per-search basis.
815
826
816 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
827 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
817
828
818 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
829 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
819 attributes in wildcard searches for subclasses. Modified version
830 attributes in wildcard searches for subclasses. Modified version
820 of a patch by Jorgen.
831 of a patch by Jorgen.
821
832
822 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
833 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
823
834
824 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
835 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
825 embedded instances. I added a user_global_ns attribute to the
836 embedded instances. I added a user_global_ns attribute to the
826 InteractiveShell class to handle this.
837 InteractiveShell class to handle this.
827
838
828 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
839 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
829
840
830 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
841 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
831 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
842 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
832 (reported under win32, but may happen also in other platforms).
843 (reported under win32, but may happen also in other platforms).
833 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
844 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
834
845
835 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
846 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
836
847
837 * IPython/Magic.py (magic_psearch): new support for wildcard
848 * IPython/Magic.py (magic_psearch): new support for wildcard
838 patterns. Now, typing ?a*b will list all names which begin with a
849 patterns. Now, typing ?a*b will list all names which begin with a
839 and end in b, for example. The %psearch magic has full
850 and end in b, for example. The %psearch magic has full
840 docstrings. Many thanks to JΓΆrgen Stenarson
851 docstrings. Many thanks to JΓΆrgen Stenarson
841 <jorgen.stenarson-AT-bostream.nu>, author of the patches
852 <jorgen.stenarson-AT-bostream.nu>, author of the patches
842 implementing this functionality.
853 implementing this functionality.
843
854
844 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
855 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
845
856
846 * Manual: fixed long-standing annoyance of double-dashes (as in
857 * Manual: fixed long-standing annoyance of double-dashes (as in
847 --prefix=~, for example) being stripped in the HTML version. This
858 --prefix=~, for example) being stripped in the HTML version. This
848 is a latex2html bug, but a workaround was provided. Many thanks
859 is a latex2html bug, but a workaround was provided. Many thanks
849 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
860 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
850 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
861 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
851 rolling. This seemingly small issue had tripped a number of users
862 rolling. This seemingly small issue had tripped a number of users
852 when first installing, so I'm glad to see it gone.
863 when first installing, so I'm glad to see it gone.
853
864
854 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
865 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
855
866
856 * IPython/Extensions/numeric_formats.py: fix missing import,
867 * IPython/Extensions/numeric_formats.py: fix missing import,
857 reported by Stephen Walton.
868 reported by Stephen Walton.
858
869
859 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
870 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
860
871
861 * IPython/demo.py: finish demo module, fully documented now.
872 * IPython/demo.py: finish demo module, fully documented now.
862
873
863 * IPython/genutils.py (file_read): simple little utility to read a
874 * IPython/genutils.py (file_read): simple little utility to read a
864 file and ensure it's closed afterwards.
875 file and ensure it's closed afterwards.
865
876
866 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
877 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
867
878
868 * IPython/demo.py (Demo.__init__): added support for individually
879 * IPython/demo.py (Demo.__init__): added support for individually
869 tagging blocks for automatic execution.
880 tagging blocks for automatic execution.
870
881
871 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
882 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
872 syntax-highlighted python sources, requested by John.
883 syntax-highlighted python sources, requested by John.
873
884
874 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
885 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
875
886
876 * IPython/demo.py (Demo.again): fix bug where again() blocks after
887 * IPython/demo.py (Demo.again): fix bug where again() blocks after
877 finishing.
888 finishing.
878
889
879 * IPython/genutils.py (shlex_split): moved from Magic to here,
890 * IPython/genutils.py (shlex_split): moved from Magic to here,
880 where all 2.2 compatibility stuff lives. I needed it for demo.py.
891 where all 2.2 compatibility stuff lives. I needed it for demo.py.
881
892
882 * IPython/demo.py (Demo.__init__): added support for silent
893 * IPython/demo.py (Demo.__init__): added support for silent
883 blocks, improved marks as regexps, docstrings written.
894 blocks, improved marks as regexps, docstrings written.
884 (Demo.__init__): better docstring, added support for sys.argv.
895 (Demo.__init__): better docstring, added support for sys.argv.
885
896
886 * IPython/genutils.py (marquee): little utility used by the demo
897 * IPython/genutils.py (marquee): little utility used by the demo
887 code, handy in general.
898 code, handy in general.
888
899
889 * IPython/demo.py (Demo.__init__): new class for interactive
900 * IPython/demo.py (Demo.__init__): new class for interactive
890 demos. Not documented yet, I just wrote it in a hurry for
901 demos. Not documented yet, I just wrote it in a hurry for
891 scipy'05. Will docstring later.
902 scipy'05. Will docstring later.
892
903
893 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
904 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
894
905
895 * IPython/Shell.py (sigint_handler): Drastic simplification which
906 * IPython/Shell.py (sigint_handler): Drastic simplification which
896 also seems to make Ctrl-C work correctly across threads! This is
907 also seems to make Ctrl-C work correctly across threads! This is
897 so simple, that I can't beleive I'd missed it before. Needs more
908 so simple, that I can't beleive I'd missed it before. Needs more
898 testing, though.
909 testing, though.
899 (KBINT): Never mind, revert changes. I'm sure I'd tried something
910 (KBINT): Never mind, revert changes. I'm sure I'd tried something
900 like this before...
911 like this before...
901
912
902 * IPython/genutils.py (get_home_dir): add protection against
913 * IPython/genutils.py (get_home_dir): add protection against
903 non-dirs in win32 registry.
914 non-dirs in win32 registry.
904
915
905 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
916 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
906 bug where dict was mutated while iterating (pysh crash).
917 bug where dict was mutated while iterating (pysh crash).
907
918
908 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
919 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
909
920
910 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
921 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
911 spurious newlines added by this routine. After a report by
922 spurious newlines added by this routine. After a report by
912 F. Mantegazza.
923 F. Mantegazza.
913
924
914 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
925 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
915
926
916 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
927 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
917 calls. These were a leftover from the GTK 1.x days, and can cause
928 calls. These were a leftover from the GTK 1.x days, and can cause
918 problems in certain cases (after a report by John Hunter).
929 problems in certain cases (after a report by John Hunter).
919
930
920 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
931 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
921 os.getcwd() fails at init time. Thanks to patch from David Remahl
932 os.getcwd() fails at init time. Thanks to patch from David Remahl
922 <chmod007-AT-mac.com>.
933 <chmod007-AT-mac.com>.
923 (InteractiveShell.__init__): prevent certain special magics from
934 (InteractiveShell.__init__): prevent certain special magics from
924 being shadowed by aliases. Closes
935 being shadowed by aliases. Closes
925 http://www.scipy.net/roundup/ipython/issue41.
936 http://www.scipy.net/roundup/ipython/issue41.
926
937
927 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
938 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
928
939
929 * IPython/iplib.py (InteractiveShell.complete): Added new
940 * IPython/iplib.py (InteractiveShell.complete): Added new
930 top-level completion method to expose the completion mechanism
941 top-level completion method to expose the completion mechanism
931 beyond readline-based environments.
942 beyond readline-based environments.
932
943
933 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
944 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
934
945
935 * tools/ipsvnc (svnversion): fix svnversion capture.
946 * tools/ipsvnc (svnversion): fix svnversion capture.
936
947
937 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
948 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
938 attribute to self, which was missing. Before, it was set by a
949 attribute to self, which was missing. Before, it was set by a
939 routine which in certain cases wasn't being called, so the
950 routine which in certain cases wasn't being called, so the
940 instance could end up missing the attribute. This caused a crash.
951 instance could end up missing the attribute. This caused a crash.
941 Closes http://www.scipy.net/roundup/ipython/issue40.
952 Closes http://www.scipy.net/roundup/ipython/issue40.
942
953
943 2005-08-16 Fernando Perez <fperez@colorado.edu>
954 2005-08-16 Fernando Perez <fperez@colorado.edu>
944
955
945 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
956 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
946 contains non-string attribute. Closes
957 contains non-string attribute. Closes
947 http://www.scipy.net/roundup/ipython/issue38.
958 http://www.scipy.net/roundup/ipython/issue38.
948
959
949 2005-08-14 Fernando Perez <fperez@colorado.edu>
960 2005-08-14 Fernando Perez <fperez@colorado.edu>
950
961
951 * tools/ipsvnc: Minor improvements, to add changeset info.
962 * tools/ipsvnc: Minor improvements, to add changeset info.
952
963
953 2005-08-12 Fernando Perez <fperez@colorado.edu>
964 2005-08-12 Fernando Perez <fperez@colorado.edu>
954
965
955 * IPython/iplib.py (runsource): remove self.code_to_run_src
966 * IPython/iplib.py (runsource): remove self.code_to_run_src
956 attribute. I realized this is nothing more than
967 attribute. I realized this is nothing more than
957 '\n'.join(self.buffer), and having the same data in two different
968 '\n'.join(self.buffer), and having the same data in two different
958 places is just asking for synchronization bugs. This may impact
969 places is just asking for synchronization bugs. This may impact
959 people who have custom exception handlers, so I need to warn
970 people who have custom exception handlers, so I need to warn
960 ipython-dev about it (F. Mantegazza may use them).
971 ipython-dev about it (F. Mantegazza may use them).
961
972
962 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
973 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
963
974
964 * IPython/genutils.py: fix 2.2 compatibility (generators)
975 * IPython/genutils.py: fix 2.2 compatibility (generators)
965
976
966 2005-07-18 Fernando Perez <fperez@colorado.edu>
977 2005-07-18 Fernando Perez <fperez@colorado.edu>
967
978
968 * IPython/genutils.py (get_home_dir): fix to help users with
979 * IPython/genutils.py (get_home_dir): fix to help users with
969 invalid $HOME under win32.
980 invalid $HOME under win32.
970
981
971 2005-07-17 Fernando Perez <fperez@colorado.edu>
982 2005-07-17 Fernando Perez <fperez@colorado.edu>
972
983
973 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
984 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
974 some old hacks and clean up a bit other routines; code should be
985 some old hacks and clean up a bit other routines; code should be
975 simpler and a bit faster.
986 simpler and a bit faster.
976
987
977 * IPython/iplib.py (interact): removed some last-resort attempts
988 * IPython/iplib.py (interact): removed some last-resort attempts
978 to survive broken stdout/stderr. That code was only making it
989 to survive broken stdout/stderr. That code was only making it
979 harder to abstract out the i/o (necessary for gui integration),
990 harder to abstract out the i/o (necessary for gui integration),
980 and the crashes it could prevent were extremely rare in practice
991 and the crashes it could prevent were extremely rare in practice
981 (besides being fully user-induced in a pretty violent manner).
992 (besides being fully user-induced in a pretty violent manner).
982
993
983 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
994 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
984 Nothing major yet, but the code is simpler to read; this should
995 Nothing major yet, but the code is simpler to read; this should
985 make it easier to do more serious modifications in the future.
996 make it easier to do more serious modifications in the future.
986
997
987 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
998 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
988 which broke in .15 (thanks to a report by Ville).
999 which broke in .15 (thanks to a report by Ville).
989
1000
990 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
1001 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
991 be quite correct, I know next to nothing about unicode). This
1002 be quite correct, I know next to nothing about unicode). This
992 will allow unicode strings to be used in prompts, amongst other
1003 will allow unicode strings to be used in prompts, amongst other
993 cases. It also will prevent ipython from crashing when unicode
1004 cases. It also will prevent ipython from crashing when unicode
994 shows up unexpectedly in many places. If ascii encoding fails, we
1005 shows up unexpectedly in many places. If ascii encoding fails, we
995 assume utf_8. Currently the encoding is not a user-visible
1006 assume utf_8. Currently the encoding is not a user-visible
996 setting, though it could be made so if there is demand for it.
1007 setting, though it could be made so if there is demand for it.
997
1008
998 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
1009 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
999
1010
1000 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1011 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
1001
1012
1002 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1013 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
1003
1014
1004 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1015 * IPython/genutils.py: Add 2.2 compatibility here, so all other
1005 code can work transparently for 2.2/2.3.
1016 code can work transparently for 2.2/2.3.
1006
1017
1007 2005-07-16 Fernando Perez <fperez@colorado.edu>
1018 2005-07-16 Fernando Perez <fperez@colorado.edu>
1008
1019
1009 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1020 * IPython/ultraTB.py (ExceptionColors): Make a global variable
1010 out of the color scheme table used for coloring exception
1021 out of the color scheme table used for coloring exception
1011 tracebacks. This allows user code to add new schemes at runtime.
1022 tracebacks. This allows user code to add new schemes at runtime.
1012 This is a minimally modified version of the patch at
1023 This is a minimally modified version of the patch at
1013 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1024 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
1014 for the contribution.
1025 for the contribution.
1015
1026
1016 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1027 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
1017 slightly modified version of the patch in
1028 slightly modified version of the patch in
1018 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1029 http://www.scipy.net/roundup/ipython/issue34, which also allows me
1019 to remove the previous try/except solution (which was costlier).
1030 to remove the previous try/except solution (which was costlier).
1020 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1031 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
1021
1032
1022 2005-06-08 Fernando Perez <fperez@colorado.edu>
1033 2005-06-08 Fernando Perez <fperez@colorado.edu>
1023
1034
1024 * IPython/iplib.py (write/write_err): Add methods to abstract all
1035 * IPython/iplib.py (write/write_err): Add methods to abstract all
1025 I/O a bit more.
1036 I/O a bit more.
1026
1037
1027 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1038 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
1028 warning, reported by Aric Hagberg, fix by JD Hunter.
1039 warning, reported by Aric Hagberg, fix by JD Hunter.
1029
1040
1030 2005-06-02 *** Released version 0.6.15
1041 2005-06-02 *** Released version 0.6.15
1031
1042
1032 2005-06-01 Fernando Perez <fperez@colorado.edu>
1043 2005-06-01 Fernando Perez <fperez@colorado.edu>
1033
1044
1034 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1045 * IPython/iplib.py (MagicCompleter.file_matches): Fix
1035 tab-completion of filenames within open-quoted strings. Note that
1046 tab-completion of filenames within open-quoted strings. Note that
1036 this requires that in ~/.ipython/ipythonrc, users change the
1047 this requires that in ~/.ipython/ipythonrc, users change the
1037 readline delimiters configuration to read:
1048 readline delimiters configuration to read:
1038
1049
1039 readline_remove_delims -/~
1050 readline_remove_delims -/~
1040
1051
1041
1052
1042 2005-05-31 *** Released version 0.6.14
1053 2005-05-31 *** Released version 0.6.14
1043
1054
1044 2005-05-29 Fernando Perez <fperez@colorado.edu>
1055 2005-05-29 Fernando Perez <fperez@colorado.edu>
1045
1056
1046 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1057 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
1047 with files not on the filesystem. Reported by Eliyahu Sandler
1058 with files not on the filesystem. Reported by Eliyahu Sandler
1048 <eli@gondolin.net>
1059 <eli@gondolin.net>
1049
1060
1050 2005-05-22 Fernando Perez <fperez@colorado.edu>
1061 2005-05-22 Fernando Perez <fperez@colorado.edu>
1051
1062
1052 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1063 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
1053 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1064 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
1054
1065
1055 2005-05-19 Fernando Perez <fperez@colorado.edu>
1066 2005-05-19 Fernando Perez <fperez@colorado.edu>
1056
1067
1057 * IPython/iplib.py (safe_execfile): close a file which could be
1068 * IPython/iplib.py (safe_execfile): close a file which could be
1058 left open (causing problems in win32, which locks open files).
1069 left open (causing problems in win32, which locks open files).
1059 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1070 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
1060
1071
1061 2005-05-18 Fernando Perez <fperez@colorado.edu>
1072 2005-05-18 Fernando Perez <fperez@colorado.edu>
1062
1073
1063 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1074 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
1064 keyword arguments correctly to safe_execfile().
1075 keyword arguments correctly to safe_execfile().
1065
1076
1066 2005-05-13 Fernando Perez <fperez@colorado.edu>
1077 2005-05-13 Fernando Perez <fperez@colorado.edu>
1067
1078
1068 * ipython.1: Added info about Qt to manpage, and threads warning
1079 * ipython.1: Added info about Qt to manpage, and threads warning
1069 to usage page (invoked with --help).
1080 to usage page (invoked with --help).
1070
1081
1071 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1082 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
1072 new matcher (it goes at the end of the priority list) to do
1083 new matcher (it goes at the end of the priority list) to do
1073 tab-completion on named function arguments. Submitted by George
1084 tab-completion on named function arguments. Submitted by George
1074 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1085 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
1075 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1086 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
1076 for more details.
1087 for more details.
1077
1088
1078 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1089 * IPython/Magic.py (magic_run): Added new -e flag to ignore
1079 SystemExit exceptions in the script being run. Thanks to a report
1090 SystemExit exceptions in the script being run. Thanks to a report
1080 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1091 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
1081 producing very annoying behavior when running unit tests.
1092 producing very annoying behavior when running unit tests.
1082
1093
1083 2005-05-12 Fernando Perez <fperez@colorado.edu>
1094 2005-05-12 Fernando Perez <fperez@colorado.edu>
1084
1095
1085 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1096 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
1086 which I'd broken (again) due to a changed regexp. In the process,
1097 which I'd broken (again) due to a changed regexp. In the process,
1087 added ';' as an escape to auto-quote the whole line without
1098 added ';' as an escape to auto-quote the whole line without
1088 splitting its arguments. Thanks to a report by Jerry McRae
1099 splitting its arguments. Thanks to a report by Jerry McRae
1089 <qrs0xyc02-AT-sneakemail.com>.
1100 <qrs0xyc02-AT-sneakemail.com>.
1090
1101
1091 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1102 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
1092 possible crashes caused by a TokenError. Reported by Ed Schofield
1103 possible crashes caused by a TokenError. Reported by Ed Schofield
1093 <schofield-AT-ftw.at>.
1104 <schofield-AT-ftw.at>.
1094
1105
1095 2005-05-06 Fernando Perez <fperez@colorado.edu>
1106 2005-05-06 Fernando Perez <fperez@colorado.edu>
1096
1107
1097 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1108 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
1098
1109
1099 2005-04-29 Fernando Perez <fperez@colorado.edu>
1110 2005-04-29 Fernando Perez <fperez@colorado.edu>
1100
1111
1101 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1112 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
1102 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1113 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
1103 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1114 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
1104 which provides support for Qt interactive usage (similar to the
1115 which provides support for Qt interactive usage (similar to the
1105 existing one for WX and GTK). This had been often requested.
1116 existing one for WX and GTK). This had been often requested.
1106
1117
1107 2005-04-14 *** Released version 0.6.13
1118 2005-04-14 *** Released version 0.6.13
1108
1119
1109 2005-04-08 Fernando Perez <fperez@colorado.edu>
1120 2005-04-08 Fernando Perez <fperez@colorado.edu>
1110
1121
1111 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1122 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
1112 from _ofind, which gets called on almost every input line. Now,
1123 from _ofind, which gets called on almost every input line. Now,
1113 we only try to get docstrings if they are actually going to be
1124 we only try to get docstrings if they are actually going to be
1114 used (the overhead of fetching unnecessary docstrings can be
1125 used (the overhead of fetching unnecessary docstrings can be
1115 noticeable for certain objects, such as Pyro proxies).
1126 noticeable for certain objects, such as Pyro proxies).
1116
1127
1117 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1128 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
1118 for completers. For some reason I had been passing them the state
1129 for completers. For some reason I had been passing them the state
1119 variable, which completers never actually need, and was in
1130 variable, which completers never actually need, and was in
1120 conflict with the rlcompleter API. Custom completers ONLY need to
1131 conflict with the rlcompleter API. Custom completers ONLY need to
1121 take the text parameter.
1132 take the text parameter.
1122
1133
1123 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1134 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
1124 work correctly in pysh. I've also moved all the logic which used
1135 work correctly in pysh. I've also moved all the logic which used
1125 to be in pysh.py here, which will prevent problems with future
1136 to be in pysh.py here, which will prevent problems with future
1126 upgrades. However, this time I must warn users to update their
1137 upgrades. However, this time I must warn users to update their
1127 pysh profile to include the line
1138 pysh profile to include the line
1128
1139
1129 import_all IPython.Extensions.InterpreterExec
1140 import_all IPython.Extensions.InterpreterExec
1130
1141
1131 because otherwise things won't work for them. They MUST also
1142 because otherwise things won't work for them. They MUST also
1132 delete pysh.py and the line
1143 delete pysh.py and the line
1133
1144
1134 execfile pysh.py
1145 execfile pysh.py
1135
1146
1136 from their ipythonrc-pysh.
1147 from their ipythonrc-pysh.
1137
1148
1138 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1149 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
1139 robust in the face of objects whose dir() returns non-strings
1150 robust in the face of objects whose dir() returns non-strings
1140 (which it shouldn't, but some broken libs like ITK do). Thanks to
1151 (which it shouldn't, but some broken libs like ITK do). Thanks to
1141 a patch by John Hunter (implemented differently, though). Also
1152 a patch by John Hunter (implemented differently, though). Also
1142 minor improvements by using .extend instead of + on lists.
1153 minor improvements by using .extend instead of + on lists.
1143
1154
1144 * pysh.py:
1155 * pysh.py:
1145
1156
1146 2005-04-06 Fernando Perez <fperez@colorado.edu>
1157 2005-04-06 Fernando Perez <fperez@colorado.edu>
1147
1158
1148 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1159 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
1149 by default, so that all users benefit from it. Those who don't
1160 by default, so that all users benefit from it. Those who don't
1150 want it can still turn it off.
1161 want it can still turn it off.
1151
1162
1152 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1163 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
1153 config file, I'd forgotten about this, so users were getting it
1164 config file, I'd forgotten about this, so users were getting it
1154 off by default.
1165 off by default.
1155
1166
1156 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1167 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
1157 consistency. Now magics can be called in multiline statements,
1168 consistency. Now magics can be called in multiline statements,
1158 and python variables can be expanded in magic calls via $var.
1169 and python variables can be expanded in magic calls via $var.
1159 This makes the magic system behave just like aliases or !system
1170 This makes the magic system behave just like aliases or !system
1160 calls.
1171 calls.
1161
1172
1162 2005-03-28 Fernando Perez <fperez@colorado.edu>
1173 2005-03-28 Fernando Perez <fperez@colorado.edu>
1163
1174
1164 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1175 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
1165 expensive string additions for building command. Add support for
1176 expensive string additions for building command. Add support for
1166 trailing ';' when autocall is used.
1177 trailing ';' when autocall is used.
1167
1178
1168 2005-03-26 Fernando Perez <fperez@colorado.edu>
1179 2005-03-26 Fernando Perez <fperez@colorado.edu>
1169
1180
1170 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1181 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
1171 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1182 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
1172 ipython.el robust against prompts with any number of spaces
1183 ipython.el robust against prompts with any number of spaces
1173 (including 0) after the ':' character.
1184 (including 0) after the ':' character.
1174
1185
1175 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1186 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
1176 continuation prompt, which misled users to think the line was
1187 continuation prompt, which misled users to think the line was
1177 already indented. Closes debian Bug#300847, reported to me by
1188 already indented. Closes debian Bug#300847, reported to me by
1178 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1189 Norbert Tretkowski <tretkowski-AT-inittab.de>.
1179
1190
1180 2005-03-23 Fernando Perez <fperez@colorado.edu>
1191 2005-03-23 Fernando Perez <fperez@colorado.edu>
1181
1192
1182 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1193 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
1183 properly aligned if they have embedded newlines.
1194 properly aligned if they have embedded newlines.
1184
1195
1185 * IPython/iplib.py (runlines): Add a public method to expose
1196 * IPython/iplib.py (runlines): Add a public method to expose
1186 IPython's code execution machinery, so that users can run strings
1197 IPython's code execution machinery, so that users can run strings
1187 as if they had been typed at the prompt interactively.
1198 as if they had been typed at the prompt interactively.
1188 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1199 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
1189 methods which can call the system shell, but with python variable
1200 methods which can call the system shell, but with python variable
1190 expansion. The three such methods are: __IPYTHON__.system,
1201 expansion. The three such methods are: __IPYTHON__.system,
1191 .getoutput and .getoutputerror. These need to be documented in a
1202 .getoutput and .getoutputerror. These need to be documented in a
1192 'public API' section (to be written) of the manual.
1203 'public API' section (to be written) of the manual.
1193
1204
1194 2005-03-20 Fernando Perez <fperez@colorado.edu>
1205 2005-03-20 Fernando Perez <fperez@colorado.edu>
1195
1206
1196 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1207 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
1197 for custom exception handling. This is quite powerful, and it
1208 for custom exception handling. This is quite powerful, and it
1198 allows for user-installable exception handlers which can trap
1209 allows for user-installable exception handlers which can trap
1199 custom exceptions at runtime and treat them separately from
1210 custom exceptions at runtime and treat them separately from
1200 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1211 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
1201 Mantegazza <mantegazza-AT-ill.fr>.
1212 Mantegazza <mantegazza-AT-ill.fr>.
1202 (InteractiveShell.set_custom_completer): public API function to
1213 (InteractiveShell.set_custom_completer): public API function to
1203 add new completers at runtime.
1214 add new completers at runtime.
1204
1215
1205 2005-03-19 Fernando Perez <fperez@colorado.edu>
1216 2005-03-19 Fernando Perez <fperez@colorado.edu>
1206
1217
1207 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1218 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
1208 allow objects which provide their docstrings via non-standard
1219 allow objects which provide their docstrings via non-standard
1209 mechanisms (like Pyro proxies) to still be inspected by ipython's
1220 mechanisms (like Pyro proxies) to still be inspected by ipython's
1210 ? system.
1221 ? system.
1211
1222
1212 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1223 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
1213 automatic capture system. I tried quite hard to make it work
1224 automatic capture system. I tried quite hard to make it work
1214 reliably, and simply failed. I tried many combinations with the
1225 reliably, and simply failed. I tried many combinations with the
1215 subprocess module, but eventually nothing worked in all needed
1226 subprocess module, but eventually nothing worked in all needed
1216 cases (not blocking stdin for the child, duplicating stdout
1227 cases (not blocking stdin for the child, duplicating stdout
1217 without blocking, etc). The new %sc/%sx still do capture to these
1228 without blocking, etc). The new %sc/%sx still do capture to these
1218 magical list/string objects which make shell use much more
1229 magical list/string objects which make shell use much more
1219 conveninent, so not all is lost.
1230 conveninent, so not all is lost.
1220
1231
1221 XXX - FIX MANUAL for the change above!
1232 XXX - FIX MANUAL for the change above!
1222
1233
1223 (runsource): I copied code.py's runsource() into ipython to modify
1234 (runsource): I copied code.py's runsource() into ipython to modify
1224 it a bit. Now the code object and source to be executed are
1235 it a bit. Now the code object and source to be executed are
1225 stored in ipython. This makes this info accessible to third-party
1236 stored in ipython. This makes this info accessible to third-party
1226 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1237 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
1227 Mantegazza <mantegazza-AT-ill.fr>.
1238 Mantegazza <mantegazza-AT-ill.fr>.
1228
1239
1229 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1240 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
1230 history-search via readline (like C-p/C-n). I'd wanted this for a
1241 history-search via readline (like C-p/C-n). I'd wanted this for a
1231 long time, but only recently found out how to do it. For users
1242 long time, but only recently found out how to do it. For users
1232 who already have their ipythonrc files made and want this, just
1243 who already have their ipythonrc files made and want this, just
1233 add:
1244 add:
1234
1245
1235 readline_parse_and_bind "\e[A": history-search-backward
1246 readline_parse_and_bind "\e[A": history-search-backward
1236 readline_parse_and_bind "\e[B": history-search-forward
1247 readline_parse_and_bind "\e[B": history-search-forward
1237
1248
1238 2005-03-18 Fernando Perez <fperez@colorado.edu>
1249 2005-03-18 Fernando Perez <fperez@colorado.edu>
1239
1250
1240 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1251 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
1241 LSString and SList classes which allow transparent conversions
1252 LSString and SList classes which allow transparent conversions
1242 between list mode and whitespace-separated string.
1253 between list mode and whitespace-separated string.
1243 (magic_r): Fix recursion problem in %r.
1254 (magic_r): Fix recursion problem in %r.
1244
1255
1245 * IPython/genutils.py (LSString): New class to be used for
1256 * IPython/genutils.py (LSString): New class to be used for
1246 automatic storage of the results of all alias/system calls in _o
1257 automatic storage of the results of all alias/system calls in _o
1247 and _e (stdout/err). These provide a .l/.list attribute which
1258 and _e (stdout/err). These provide a .l/.list attribute which
1248 does automatic splitting on newlines. This means that for most
1259 does automatic splitting on newlines. This means that for most
1249 uses, you'll never need to do capturing of output with %sc/%sx
1260 uses, you'll never need to do capturing of output with %sc/%sx
1250 anymore, since ipython keeps this always done for you. Note that
1261 anymore, since ipython keeps this always done for you. Note that
1251 only the LAST results are stored, the _o/e variables are
1262 only the LAST results are stored, the _o/e variables are
1252 overwritten on each call. If you need to save their contents
1263 overwritten on each call. If you need to save their contents
1253 further, simply bind them to any other name.
1264 further, simply bind them to any other name.
1254
1265
1255 2005-03-17 Fernando Perez <fperez@colorado.edu>
1266 2005-03-17 Fernando Perez <fperez@colorado.edu>
1256
1267
1257 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1268 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
1258 prompt namespace handling.
1269 prompt namespace handling.
1259
1270
1260 2005-03-16 Fernando Perez <fperez@colorado.edu>
1271 2005-03-16 Fernando Perez <fperez@colorado.edu>
1261
1272
1262 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1273 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
1263 classic prompts to be '>>> ' (final space was missing, and it
1274 classic prompts to be '>>> ' (final space was missing, and it
1264 trips the emacs python mode).
1275 trips the emacs python mode).
1265 (BasePrompt.__str__): Added safe support for dynamic prompt
1276 (BasePrompt.__str__): Added safe support for dynamic prompt
1266 strings. Now you can set your prompt string to be '$x', and the
1277 strings. Now you can set your prompt string to be '$x', and the
1267 value of x will be printed from your interactive namespace. The
1278 value of x will be printed from your interactive namespace. The
1268 interpolation syntax includes the full Itpl support, so
1279 interpolation syntax includes the full Itpl support, so
1269 ${foo()+x+bar()} is a valid prompt string now, and the function
1280 ${foo()+x+bar()} is a valid prompt string now, and the function
1270 calls will be made at runtime.
1281 calls will be made at runtime.
1271
1282
1272 2005-03-15 Fernando Perez <fperez@colorado.edu>
1283 2005-03-15 Fernando Perez <fperez@colorado.edu>
1273
1284
1274 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1285 * IPython/Magic.py (magic_history): renamed %hist to %history, to
1275 avoid name clashes in pylab. %hist still works, it just forwards
1286 avoid name clashes in pylab. %hist still works, it just forwards
1276 the call to %history.
1287 the call to %history.
1277
1288
1278 2005-03-02 *** Released version 0.6.12
1289 2005-03-02 *** Released version 0.6.12
1279
1290
1280 2005-03-02 Fernando Perez <fperez@colorado.edu>
1291 2005-03-02 Fernando Perez <fperez@colorado.edu>
1281
1292
1282 * IPython/iplib.py (handle_magic): log magic calls properly as
1293 * IPython/iplib.py (handle_magic): log magic calls properly as
1283 ipmagic() function calls.
1294 ipmagic() function calls.
1284
1295
1285 * IPython/Magic.py (magic_time): Improved %time to support
1296 * IPython/Magic.py (magic_time): Improved %time to support
1286 statements and provide wall-clock as well as CPU time.
1297 statements and provide wall-clock as well as CPU time.
1287
1298
1288 2005-02-27 Fernando Perez <fperez@colorado.edu>
1299 2005-02-27 Fernando Perez <fperez@colorado.edu>
1289
1300
1290 * IPython/hooks.py: New hooks module, to expose user-modifiable
1301 * IPython/hooks.py: New hooks module, to expose user-modifiable
1291 IPython functionality in a clean manner. For now only the editor
1302 IPython functionality in a clean manner. For now only the editor
1292 hook is actually written, and other thigns which I intend to turn
1303 hook is actually written, and other thigns which I intend to turn
1293 into proper hooks aren't yet there. The display and prefilter
1304 into proper hooks aren't yet there. The display and prefilter
1294 stuff, for example, should be hooks. But at least now the
1305 stuff, for example, should be hooks. But at least now the
1295 framework is in place, and the rest can be moved here with more
1306 framework is in place, and the rest can be moved here with more
1296 time later. IPython had had a .hooks variable for a long time for
1307 time later. IPython had had a .hooks variable for a long time for
1297 this purpose, but I'd never actually used it for anything.
1308 this purpose, but I'd never actually used it for anything.
1298
1309
1299 2005-02-26 Fernando Perez <fperez@colorado.edu>
1310 2005-02-26 Fernando Perez <fperez@colorado.edu>
1300
1311
1301 * IPython/ipmaker.py (make_IPython): make the default ipython
1312 * IPython/ipmaker.py (make_IPython): make the default ipython
1302 directory be called _ipython under win32, to follow more the
1313 directory be called _ipython under win32, to follow more the
1303 naming peculiarities of that platform (where buggy software like
1314 naming peculiarities of that platform (where buggy software like
1304 Visual Sourcesafe breaks with .named directories). Reported by
1315 Visual Sourcesafe breaks with .named directories). Reported by
1305 Ville Vainio.
1316 Ville Vainio.
1306
1317
1307 2005-02-23 Fernando Perez <fperez@colorado.edu>
1318 2005-02-23 Fernando Perez <fperez@colorado.edu>
1308
1319
1309 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1320 * IPython/iplib.py (InteractiveShell.__init__): removed a few
1310 auto_aliases for win32 which were causing problems. Users can
1321 auto_aliases for win32 which were causing problems. Users can
1311 define the ones they personally like.
1322 define the ones they personally like.
1312
1323
1313 2005-02-21 Fernando Perez <fperez@colorado.edu>
1324 2005-02-21 Fernando Perez <fperez@colorado.edu>
1314
1325
1315 * IPython/Magic.py (magic_time): new magic to time execution of
1326 * IPython/Magic.py (magic_time): new magic to time execution of
1316 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1327 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
1317
1328
1318 2005-02-19 Fernando Perez <fperez@colorado.edu>
1329 2005-02-19 Fernando Perez <fperez@colorado.edu>
1319
1330
1320 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1331 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
1321 into keys (for prompts, for example).
1332 into keys (for prompts, for example).
1322
1333
1323 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1334 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
1324 prompts in case users want them. This introduces a small behavior
1335 prompts in case users want them. This introduces a small behavior
1325 change: ipython does not automatically add a space to all prompts
1336 change: ipython does not automatically add a space to all prompts
1326 anymore. To get the old prompts with a space, users should add it
1337 anymore. To get the old prompts with a space, users should add it
1327 manually to their ipythonrc file, so for example prompt_in1 should
1338 manually to their ipythonrc file, so for example prompt_in1 should
1328 now read 'In [\#]: ' instead of 'In [\#]:'.
1339 now read 'In [\#]: ' instead of 'In [\#]:'.
1329 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1340 (BasePrompt.__init__): New option prompts_pad_left (only in rc
1330 file) to control left-padding of secondary prompts.
1341 file) to control left-padding of secondary prompts.
1331
1342
1332 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1343 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
1333 the profiler can't be imported. Fix for Debian, which removed
1344 the profiler can't be imported. Fix for Debian, which removed
1334 profile.py because of License issues. I applied a slightly
1345 profile.py because of License issues. I applied a slightly
1335 modified version of the original Debian patch at
1346 modified version of the original Debian patch at
1336 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1347 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
1337
1348
1338 2005-02-17 Fernando Perez <fperez@colorado.edu>
1349 2005-02-17 Fernando Perez <fperez@colorado.edu>
1339
1350
1340 * IPython/genutils.py (native_line_ends): Fix bug which would
1351 * IPython/genutils.py (native_line_ends): Fix bug which would
1341 cause improper line-ends under win32 b/c I was not opening files
1352 cause improper line-ends under win32 b/c I was not opening files
1342 in binary mode. Bug report and fix thanks to Ville.
1353 in binary mode. Bug report and fix thanks to Ville.
1343
1354
1344 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1355 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
1345 trying to catch spurious foo[1] autocalls. My fix actually broke
1356 trying to catch spurious foo[1] autocalls. My fix actually broke
1346 ',/' autoquote/call with explicit escape (bad regexp).
1357 ',/' autoquote/call with explicit escape (bad regexp).
1347
1358
1348 2005-02-15 *** Released version 0.6.11
1359 2005-02-15 *** Released version 0.6.11
1349
1360
1350 2005-02-14 Fernando Perez <fperez@colorado.edu>
1361 2005-02-14 Fernando Perez <fperez@colorado.edu>
1351
1362
1352 * IPython/background_jobs.py: New background job management
1363 * IPython/background_jobs.py: New background job management
1353 subsystem. This is implemented via a new set of classes, and
1364 subsystem. This is implemented via a new set of classes, and
1354 IPython now provides a builtin 'jobs' object for background job
1365 IPython now provides a builtin 'jobs' object for background job
1355 execution. A convenience %bg magic serves as a lightweight
1366 execution. A convenience %bg magic serves as a lightweight
1356 frontend for starting the more common type of calls. This was
1367 frontend for starting the more common type of calls. This was
1357 inspired by discussions with B. Granger and the BackgroundCommand
1368 inspired by discussions with B. Granger and the BackgroundCommand
1358 class described in the book Python Scripting for Computational
1369 class described in the book Python Scripting for Computational
1359 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1370 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
1360 (although ultimately no code from this text was used, as IPython's
1371 (although ultimately no code from this text was used, as IPython's
1361 system is a separate implementation).
1372 system is a separate implementation).
1362
1373
1363 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1374 * IPython/iplib.py (MagicCompleter.python_matches): add new option
1364 to control the completion of single/double underscore names
1375 to control the completion of single/double underscore names
1365 separately. As documented in the example ipytonrc file, the
1376 separately. As documented in the example ipytonrc file, the
1366 readline_omit__names variable can now be set to 2, to omit even
1377 readline_omit__names variable can now be set to 2, to omit even
1367 single underscore names. Thanks to a patch by Brian Wong
1378 single underscore names. Thanks to a patch by Brian Wong
1368 <BrianWong-AT-AirgoNetworks.Com>.
1379 <BrianWong-AT-AirgoNetworks.Com>.
1369 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1380 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
1370 be autocalled as foo([1]) if foo were callable. A problem for
1381 be autocalled as foo([1]) if foo were callable. A problem for
1371 things which are both callable and implement __getitem__.
1382 things which are both callable and implement __getitem__.
1372 (init_readline): Fix autoindentation for win32. Thanks to a patch
1383 (init_readline): Fix autoindentation for win32. Thanks to a patch
1373 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1384 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
1374
1385
1375 2005-02-12 Fernando Perez <fperez@colorado.edu>
1386 2005-02-12 Fernando Perez <fperez@colorado.edu>
1376
1387
1377 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1388 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
1378 which I had written long ago to sort out user error messages which
1389 which I had written long ago to sort out user error messages which
1379 may occur during startup. This seemed like a good idea initially,
1390 may occur during startup. This seemed like a good idea initially,
1380 but it has proven a disaster in retrospect. I don't want to
1391 but it has proven a disaster in retrospect. I don't want to
1381 change much code for now, so my fix is to set the internal 'debug'
1392 change much code for now, so my fix is to set the internal 'debug'
1382 flag to true everywhere, whose only job was precisely to control
1393 flag to true everywhere, whose only job was precisely to control
1383 this subsystem. This closes issue 28 (as well as avoiding all
1394 this subsystem. This closes issue 28 (as well as avoiding all
1384 sorts of strange hangups which occur from time to time).
1395 sorts of strange hangups which occur from time to time).
1385
1396
1386 2005-02-07 Fernando Perez <fperez@colorado.edu>
1397 2005-02-07 Fernando Perez <fperez@colorado.edu>
1387
1398
1388 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1399 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
1389 previous call produced a syntax error.
1400 previous call produced a syntax error.
1390
1401
1391 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1402 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1392 classes without constructor.
1403 classes without constructor.
1393
1404
1394 2005-02-06 Fernando Perez <fperez@colorado.edu>
1405 2005-02-06 Fernando Perez <fperez@colorado.edu>
1395
1406
1396 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1407 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
1397 completions with the results of each matcher, so we return results
1408 completions with the results of each matcher, so we return results
1398 to the user from all namespaces. This breaks with ipython
1409 to the user from all namespaces. This breaks with ipython
1399 tradition, but I think it's a nicer behavior. Now you get all
1410 tradition, but I think it's a nicer behavior. Now you get all
1400 possible completions listed, from all possible namespaces (python,
1411 possible completions listed, from all possible namespaces (python,
1401 filesystem, magics...) After a request by John Hunter
1412 filesystem, magics...) After a request by John Hunter
1402 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1413 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1403
1414
1404 2005-02-05 Fernando Perez <fperez@colorado.edu>
1415 2005-02-05 Fernando Perez <fperez@colorado.edu>
1405
1416
1406 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1417 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
1407 the call had quote characters in it (the quotes were stripped).
1418 the call had quote characters in it (the quotes were stripped).
1408
1419
1409 2005-01-31 Fernando Perez <fperez@colorado.edu>
1420 2005-01-31 Fernando Perez <fperez@colorado.edu>
1410
1421
1411 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1422 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
1412 Itpl.itpl() to make the code more robust against psyco
1423 Itpl.itpl() to make the code more robust against psyco
1413 optimizations.
1424 optimizations.
1414
1425
1415 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1426 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
1416 of causing an exception. Quicker, cleaner.
1427 of causing an exception. Quicker, cleaner.
1417
1428
1418 2005-01-28 Fernando Perez <fperez@colorado.edu>
1429 2005-01-28 Fernando Perez <fperez@colorado.edu>
1419
1430
1420 * scripts/ipython_win_post_install.py (install): hardcode
1431 * scripts/ipython_win_post_install.py (install): hardcode
1421 sys.prefix+'python.exe' as the executable path. It turns out that
1432 sys.prefix+'python.exe' as the executable path. It turns out that
1422 during the post-installation run, sys.executable resolves to the
1433 during the post-installation run, sys.executable resolves to the
1423 name of the binary installer! I should report this as a distutils
1434 name of the binary installer! I should report this as a distutils
1424 bug, I think. I updated the .10 release with this tiny fix, to
1435 bug, I think. I updated the .10 release with this tiny fix, to
1425 avoid annoying the lists further.
1436 avoid annoying the lists further.
1426
1437
1427 2005-01-27 *** Released version 0.6.10
1438 2005-01-27 *** Released version 0.6.10
1428
1439
1429 2005-01-27 Fernando Perez <fperez@colorado.edu>
1440 2005-01-27 Fernando Perez <fperez@colorado.edu>
1430
1441
1431 * IPython/numutils.py (norm): Added 'inf' as optional name for
1442 * IPython/numutils.py (norm): Added 'inf' as optional name for
1432 L-infinity norm, included references to mathworld.com for vector
1443 L-infinity norm, included references to mathworld.com for vector
1433 norm definitions.
1444 norm definitions.
1434 (amin/amax): added amin/amax for array min/max. Similar to what
1445 (amin/amax): added amin/amax for array min/max. Similar to what
1435 pylab ships with after the recent reorganization of names.
1446 pylab ships with after the recent reorganization of names.
1436 (spike/spike_odd): removed deprecated spike/spike_odd functions.
1447 (spike/spike_odd): removed deprecated spike/spike_odd functions.
1437
1448
1438 * ipython.el: committed Alex's recent fixes and improvements.
1449 * ipython.el: committed Alex's recent fixes and improvements.
1439 Tested with python-mode from CVS, and it looks excellent. Since
1450 Tested with python-mode from CVS, and it looks excellent. Since
1440 python-mode hasn't released anything in a while, I'm temporarily
1451 python-mode hasn't released anything in a while, I'm temporarily
1441 putting a copy of today's CVS (v 4.70) of python-mode in:
1452 putting a copy of today's CVS (v 4.70) of python-mode in:
1442 http://ipython.scipy.org/tmp/python-mode.el
1453 http://ipython.scipy.org/tmp/python-mode.el
1443
1454
1444 * scripts/ipython_win_post_install.py (install): Win32 fix to use
1455 * scripts/ipython_win_post_install.py (install): Win32 fix to use
1445 sys.executable for the executable name, instead of assuming it's
1456 sys.executable for the executable name, instead of assuming it's
1446 called 'python.exe' (the post-installer would have produced broken
1457 called 'python.exe' (the post-installer would have produced broken
1447 setups on systems with a differently named python binary).
1458 setups on systems with a differently named python binary).
1448
1459
1449 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
1460 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
1450 references to os.linesep, to make the code more
1461 references to os.linesep, to make the code more
1451 platform-independent. This is also part of the win32 coloring
1462 platform-independent. This is also part of the win32 coloring
1452 fixes.
1463 fixes.
1453
1464
1454 * IPython/genutils.py (page_dumb): Remove attempts to chop long
1465 * IPython/genutils.py (page_dumb): Remove attempts to chop long
1455 lines, which actually cause coloring bugs because the length of
1466 lines, which actually cause coloring bugs because the length of
1456 the line is very difficult to correctly compute with embedded
1467 the line is very difficult to correctly compute with embedded
1457 escapes. This was the source of all the coloring problems under
1468 escapes. This was the source of all the coloring problems under
1458 Win32. I think that _finally_, Win32 users have a properly
1469 Win32. I think that _finally_, Win32 users have a properly
1459 working ipython in all respects. This would never have happened
1470 working ipython in all respects. This would never have happened
1460 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1471 if not for Gary Bishop and Viktor Ransmayr's great help and work.
1461
1472
1462 2005-01-26 *** Released version 0.6.9
1473 2005-01-26 *** Released version 0.6.9
1463
1474
1464 2005-01-25 Fernando Perez <fperez@colorado.edu>
1475 2005-01-25 Fernando Perez <fperez@colorado.edu>
1465
1476
1466 * setup.py: finally, we have a true Windows installer, thanks to
1477 * setup.py: finally, we have a true Windows installer, thanks to
1467 the excellent work of Viktor Ransmayr
1478 the excellent work of Viktor Ransmayr
1468 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1479 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1469 Windows users. The setup routine is quite a bit cleaner thanks to
1480 Windows users. The setup routine is quite a bit cleaner thanks to
1470 this, and the post-install script uses the proper functions to
1481 this, and the post-install script uses the proper functions to
1471 allow a clean de-installation using the standard Windows Control
1482 allow a clean de-installation using the standard Windows Control
1472 Panel.
1483 Panel.
1473
1484
1474 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1485 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1475 environment variable under all OSes (including win32) if
1486 environment variable under all OSes (including win32) if
1476 available. This will give consistency to win32 users who have set
1487 available. This will give consistency to win32 users who have set
1477 this variable for any reason. If os.environ['HOME'] fails, the
1488 this variable for any reason. If os.environ['HOME'] fails, the
1478 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1489 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1479
1490
1480 2005-01-24 Fernando Perez <fperez@colorado.edu>
1491 2005-01-24 Fernando Perez <fperez@colorado.edu>
1481
1492
1482 * IPython/numutils.py (empty_like): add empty_like(), similar to
1493 * IPython/numutils.py (empty_like): add empty_like(), similar to
1483 zeros_like() but taking advantage of the new empty() Numeric routine.
1494 zeros_like() but taking advantage of the new empty() Numeric routine.
1484
1495
1485 2005-01-23 *** Released version 0.6.8
1496 2005-01-23 *** Released version 0.6.8
1486
1497
1487 2005-01-22 Fernando Perez <fperez@colorado.edu>
1498 2005-01-22 Fernando Perez <fperez@colorado.edu>
1488
1499
1489 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1500 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1490 automatic show() calls. After discussing things with JDH, it
1501 automatic show() calls. After discussing things with JDH, it
1491 turns out there are too many corner cases where this can go wrong.
1502 turns out there are too many corner cases where this can go wrong.
1492 It's best not to try to be 'too smart', and simply have ipython
1503 It's best not to try to be 'too smart', and simply have ipython
1493 reproduce as much as possible the default behavior of a normal
1504 reproduce as much as possible the default behavior of a normal
1494 python shell.
1505 python shell.
1495
1506
1496 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1507 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1497 line-splitting regexp and _prefilter() to avoid calling getattr()
1508 line-splitting regexp and _prefilter() to avoid calling getattr()
1498 on assignments. This closes
1509 on assignments. This closes
1499 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1510 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1500 readline uses getattr(), so a simple <TAB> keypress is still
1511 readline uses getattr(), so a simple <TAB> keypress is still
1501 enough to trigger getattr() calls on an object.
1512 enough to trigger getattr() calls on an object.
1502
1513
1503 2005-01-21 Fernando Perez <fperez@colorado.edu>
1514 2005-01-21 Fernando Perez <fperez@colorado.edu>
1504
1515
1505 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1516 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1506 docstring under pylab so it doesn't mask the original.
1517 docstring under pylab so it doesn't mask the original.
1507
1518
1508 2005-01-21 *** Released version 0.6.7
1519 2005-01-21 *** Released version 0.6.7
1509
1520
1510 2005-01-21 Fernando Perez <fperez@colorado.edu>
1521 2005-01-21 Fernando Perez <fperez@colorado.edu>
1511
1522
1512 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
1523 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
1513 signal handling for win32 users in multithreaded mode.
1524 signal handling for win32 users in multithreaded mode.
1514
1525
1515 2005-01-17 Fernando Perez <fperez@colorado.edu>
1526 2005-01-17 Fernando Perez <fperez@colorado.edu>
1516
1527
1517 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1528 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1518 instances with no __init__. After a crash report by Norbert Nemec
1529 instances with no __init__. After a crash report by Norbert Nemec
1519 <Norbert-AT-nemec-online.de>.
1530 <Norbert-AT-nemec-online.de>.
1520
1531
1521 2005-01-14 Fernando Perez <fperez@colorado.edu>
1532 2005-01-14 Fernando Perez <fperez@colorado.edu>
1522
1533
1523 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
1534 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
1524 names for verbose exceptions, when multiple dotted names and the
1535 names for verbose exceptions, when multiple dotted names and the
1525 'parent' object were present on the same line.
1536 'parent' object were present on the same line.
1526
1537
1527 2005-01-11 Fernando Perez <fperez@colorado.edu>
1538 2005-01-11 Fernando Perez <fperez@colorado.edu>
1528
1539
1529 * IPython/genutils.py (flag_calls): new utility to trap and flag
1540 * IPython/genutils.py (flag_calls): new utility to trap and flag
1530 calls in functions. I need it to clean up matplotlib support.
1541 calls in functions. I need it to clean up matplotlib support.
1531 Also removed some deprecated code in genutils.
1542 Also removed some deprecated code in genutils.
1532
1543
1533 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
1544 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
1534 that matplotlib scripts called with %run, which don't call show()
1545 that matplotlib scripts called with %run, which don't call show()
1535 themselves, still have their plotting windows open.
1546 themselves, still have their plotting windows open.
1536
1547
1537 2005-01-05 Fernando Perez <fperez@colorado.edu>
1548 2005-01-05 Fernando Perez <fperez@colorado.edu>
1538
1549
1539 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1550 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1540 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1551 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1541
1552
1542 2004-12-19 Fernando Perez <fperez@colorado.edu>
1553 2004-12-19 Fernando Perez <fperez@colorado.edu>
1543
1554
1544 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1555 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1545 parent_runcode, which was an eyesore. The same result can be
1556 parent_runcode, which was an eyesore. The same result can be
1546 obtained with Python's regular superclass mechanisms.
1557 obtained with Python's regular superclass mechanisms.
1547
1558
1548 2004-12-17 Fernando Perez <fperez@colorado.edu>
1559 2004-12-17 Fernando Perez <fperez@colorado.edu>
1549
1560
1550 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1561 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1551 reported by Prabhu.
1562 reported by Prabhu.
1552 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1563 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1553 sys.stderr) instead of explicitly calling sys.stderr. This helps
1564 sys.stderr) instead of explicitly calling sys.stderr. This helps
1554 maintain our I/O abstractions clean, for future GUI embeddings.
1565 maintain our I/O abstractions clean, for future GUI embeddings.
1555
1566
1556 * IPython/genutils.py (info): added new utility for sys.stderr
1567 * IPython/genutils.py (info): added new utility for sys.stderr
1557 unified info message handling (thin wrapper around warn()).
1568 unified info message handling (thin wrapper around warn()).
1558
1569
1559 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1570 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1560 composite (dotted) names on verbose exceptions.
1571 composite (dotted) names on verbose exceptions.
1561 (VerboseTB.nullrepr): harden against another kind of errors which
1572 (VerboseTB.nullrepr): harden against another kind of errors which
1562 Python's inspect module can trigger, and which were crashing
1573 Python's inspect module can trigger, and which were crashing
1563 IPython. Thanks to a report by Marco Lombardi
1574 IPython. Thanks to a report by Marco Lombardi
1564 <mlombard-AT-ma010192.hq.eso.org>.
1575 <mlombard-AT-ma010192.hq.eso.org>.
1565
1576
1566 2004-12-13 *** Released version 0.6.6
1577 2004-12-13 *** Released version 0.6.6
1567
1578
1568 2004-12-12 Fernando Perez <fperez@colorado.edu>
1579 2004-12-12 Fernando Perez <fperez@colorado.edu>
1569
1580
1570 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1581 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1571 generated by pygtk upon initialization if it was built without
1582 generated by pygtk upon initialization if it was built without
1572 threads (for matplotlib users). After a crash reported by
1583 threads (for matplotlib users). After a crash reported by
1573 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1584 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1574
1585
1575 * IPython/ipmaker.py (make_IPython): fix small bug in the
1586 * IPython/ipmaker.py (make_IPython): fix small bug in the
1576 import_some parameter for multiple imports.
1587 import_some parameter for multiple imports.
1577
1588
1578 * IPython/iplib.py (ipmagic): simplified the interface of
1589 * IPython/iplib.py (ipmagic): simplified the interface of
1579 ipmagic() to take a single string argument, just as it would be
1590 ipmagic() to take a single string argument, just as it would be
1580 typed at the IPython cmd line.
1591 typed at the IPython cmd line.
1581 (ipalias): Added new ipalias() with an interface identical to
1592 (ipalias): Added new ipalias() with an interface identical to
1582 ipmagic(). This completes exposing a pure python interface to the
1593 ipmagic(). This completes exposing a pure python interface to the
1583 alias and magic system, which can be used in loops or more complex
1594 alias and magic system, which can be used in loops or more complex
1584 code where IPython's automatic line mangling is not active.
1595 code where IPython's automatic line mangling is not active.
1585
1596
1586 * IPython/genutils.py (timing): changed interface of timing to
1597 * IPython/genutils.py (timing): changed interface of timing to
1587 simply run code once, which is the most common case. timings()
1598 simply run code once, which is the most common case. timings()
1588 remains unchanged, for the cases where you want multiple runs.
1599 remains unchanged, for the cases where you want multiple runs.
1589
1600
1590 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1601 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1591 bug where Python2.2 crashes with exec'ing code which does not end
1602 bug where Python2.2 crashes with exec'ing code which does not end
1592 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1603 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1593 before.
1604 before.
1594
1605
1595 2004-12-10 Fernando Perez <fperez@colorado.edu>
1606 2004-12-10 Fernando Perez <fperez@colorado.edu>
1596
1607
1597 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1608 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1598 -t to -T, to accomodate the new -t flag in %run (the %run and
1609 -t to -T, to accomodate the new -t flag in %run (the %run and
1599 %prun options are kind of intermixed, and it's not easy to change
1610 %prun options are kind of intermixed, and it's not easy to change
1600 this with the limitations of python's getopt).
1611 this with the limitations of python's getopt).
1601
1612
1602 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1613 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1603 the execution of scripts. It's not as fine-tuned as timeit.py,
1614 the execution of scripts. It's not as fine-tuned as timeit.py,
1604 but it works from inside ipython (and under 2.2, which lacks
1615 but it works from inside ipython (and under 2.2, which lacks
1605 timeit.py). Optionally a number of runs > 1 can be given for
1616 timeit.py). Optionally a number of runs > 1 can be given for
1606 timing very short-running code.
1617 timing very short-running code.
1607
1618
1608 * IPython/genutils.py (uniq_stable): new routine which returns a
1619 * IPython/genutils.py (uniq_stable): new routine which returns a
1609 list of unique elements in any iterable, but in stable order of
1620 list of unique elements in any iterable, but in stable order of
1610 appearance. I needed this for the ultraTB fixes, and it's a handy
1621 appearance. I needed this for the ultraTB fixes, and it's a handy
1611 utility.
1622 utility.
1612
1623
1613 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1624 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1614 dotted names in Verbose exceptions. This had been broken since
1625 dotted names in Verbose exceptions. This had been broken since
1615 the very start, now x.y will properly be printed in a Verbose
1626 the very start, now x.y will properly be printed in a Verbose
1616 traceback, instead of x being shown and y appearing always as an
1627 traceback, instead of x being shown and y appearing always as an
1617 'undefined global'. Getting this to work was a bit tricky,
1628 'undefined global'. Getting this to work was a bit tricky,
1618 because by default python tokenizers are stateless. Saved by
1629 because by default python tokenizers are stateless. Saved by
1619 python's ability to easily add a bit of state to an arbitrary
1630 python's ability to easily add a bit of state to an arbitrary
1620 function (without needing to build a full-blown callable object).
1631 function (without needing to build a full-blown callable object).
1621
1632
1622 Also big cleanup of this code, which had horrendous runtime
1633 Also big cleanup of this code, which had horrendous runtime
1623 lookups of zillions of attributes for colorization. Moved all
1634 lookups of zillions of attributes for colorization. Moved all
1624 this code into a few templates, which make it cleaner and quicker.
1635 this code into a few templates, which make it cleaner and quicker.
1625
1636
1626 Printout quality was also improved for Verbose exceptions: one
1637 Printout quality was also improved for Verbose exceptions: one
1627 variable per line, and memory addresses are printed (this can be
1638 variable per line, and memory addresses are printed (this can be
1628 quite handy in nasty debugging situations, which is what Verbose
1639 quite handy in nasty debugging situations, which is what Verbose
1629 is for).
1640 is for).
1630
1641
1631 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1642 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1632 the command line as scripts to be loaded by embedded instances.
1643 the command line as scripts to be loaded by embedded instances.
1633 Doing so has the potential for an infinite recursion if there are
1644 Doing so has the potential for an infinite recursion if there are
1634 exceptions thrown in the process. This fixes a strange crash
1645 exceptions thrown in the process. This fixes a strange crash
1635 reported by Philippe MULLER <muller-AT-irit.fr>.
1646 reported by Philippe MULLER <muller-AT-irit.fr>.
1636
1647
1637 2004-12-09 Fernando Perez <fperez@colorado.edu>
1648 2004-12-09 Fernando Perez <fperez@colorado.edu>
1638
1649
1639 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1650 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1640 to reflect new names in matplotlib, which now expose the
1651 to reflect new names in matplotlib, which now expose the
1641 matlab-compatible interface via a pylab module instead of the
1652 matlab-compatible interface via a pylab module instead of the
1642 'matlab' name. The new code is backwards compatible, so users of
1653 'matlab' name. The new code is backwards compatible, so users of
1643 all matplotlib versions are OK. Patch by J. Hunter.
1654 all matplotlib versions are OK. Patch by J. Hunter.
1644
1655
1645 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1656 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1646 of __init__ docstrings for instances (class docstrings are already
1657 of __init__ docstrings for instances (class docstrings are already
1647 automatically printed). Instances with customized docstrings
1658 automatically printed). Instances with customized docstrings
1648 (indep. of the class) are also recognized and all 3 separate
1659 (indep. of the class) are also recognized and all 3 separate
1649 docstrings are printed (instance, class, constructor). After some
1660 docstrings are printed (instance, class, constructor). After some
1650 comments/suggestions by J. Hunter.
1661 comments/suggestions by J. Hunter.
1651
1662
1652 2004-12-05 Fernando Perez <fperez@colorado.edu>
1663 2004-12-05 Fernando Perez <fperez@colorado.edu>
1653
1664
1654 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1665 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1655 warnings when tab-completion fails and triggers an exception.
1666 warnings when tab-completion fails and triggers an exception.
1656
1667
1657 2004-12-03 Fernando Perez <fperez@colorado.edu>
1668 2004-12-03 Fernando Perez <fperez@colorado.edu>
1658
1669
1659 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1670 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1660 be triggered when using 'run -p'. An incorrect option flag was
1671 be triggered when using 'run -p'. An incorrect option flag was
1661 being set ('d' instead of 'D').
1672 being set ('d' instead of 'D').
1662 (manpage): fix missing escaped \- sign.
1673 (manpage): fix missing escaped \- sign.
1663
1674
1664 2004-11-30 *** Released version 0.6.5
1675 2004-11-30 *** Released version 0.6.5
1665
1676
1666 2004-11-30 Fernando Perez <fperez@colorado.edu>
1677 2004-11-30 Fernando Perez <fperez@colorado.edu>
1667
1678
1668 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1679 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1669 setting with -d option.
1680 setting with -d option.
1670
1681
1671 * setup.py (docfiles): Fix problem where the doc glob I was using
1682 * setup.py (docfiles): Fix problem where the doc glob I was using
1672 was COMPLETELY BROKEN. It was giving the right files by pure
1683 was COMPLETELY BROKEN. It was giving the right files by pure
1673 accident, but failed once I tried to include ipython.el. Note:
1684 accident, but failed once I tried to include ipython.el. Note:
1674 glob() does NOT allow you to do exclusion on multiple endings!
1685 glob() does NOT allow you to do exclusion on multiple endings!
1675
1686
1676 2004-11-29 Fernando Perez <fperez@colorado.edu>
1687 2004-11-29 Fernando Perez <fperez@colorado.edu>
1677
1688
1678 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1689 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1679 the manpage as the source. Better formatting & consistency.
1690 the manpage as the source. Better formatting & consistency.
1680
1691
1681 * IPython/Magic.py (magic_run): Added new -d option, to run
1692 * IPython/Magic.py (magic_run): Added new -d option, to run
1682 scripts under the control of the python pdb debugger. Note that
1693 scripts under the control of the python pdb debugger. Note that
1683 this required changing the %prun option -d to -D, to avoid a clash
1694 this required changing the %prun option -d to -D, to avoid a clash
1684 (since %run must pass options to %prun, and getopt is too dumb to
1695 (since %run must pass options to %prun, and getopt is too dumb to
1685 handle options with string values with embedded spaces). Thanks
1696 handle options with string values with embedded spaces). Thanks
1686 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1697 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1687 (magic_who_ls): added type matching to %who and %whos, so that one
1698 (magic_who_ls): added type matching to %who and %whos, so that one
1688 can filter their output to only include variables of certain
1699 can filter their output to only include variables of certain
1689 types. Another suggestion by Matthew.
1700 types. Another suggestion by Matthew.
1690 (magic_whos): Added memory summaries in kb and Mb for arrays.
1701 (magic_whos): Added memory summaries in kb and Mb for arrays.
1691 (magic_who): Improve formatting (break lines every 9 vars).
1702 (magic_who): Improve formatting (break lines every 9 vars).
1692
1703
1693 2004-11-28 Fernando Perez <fperez@colorado.edu>
1704 2004-11-28 Fernando Perez <fperez@colorado.edu>
1694
1705
1695 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1706 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1696 cache when empty lines were present.
1707 cache when empty lines were present.
1697
1708
1698 2004-11-24 Fernando Perez <fperez@colorado.edu>
1709 2004-11-24 Fernando Perez <fperez@colorado.edu>
1699
1710
1700 * IPython/usage.py (__doc__): document the re-activated threading
1711 * IPython/usage.py (__doc__): document the re-activated threading
1701 options for WX and GTK.
1712 options for WX and GTK.
1702
1713
1703 2004-11-23 Fernando Perez <fperez@colorado.edu>
1714 2004-11-23 Fernando Perez <fperez@colorado.edu>
1704
1715
1705 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1716 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1706 the -wthread and -gthread options, along with a new -tk one to try
1717 the -wthread and -gthread options, along with a new -tk one to try
1707 and coordinate Tk threading with wx/gtk. The tk support is very
1718 and coordinate Tk threading with wx/gtk. The tk support is very
1708 platform dependent, since it seems to require Tcl and Tk to be
1719 platform dependent, since it seems to require Tcl and Tk to be
1709 built with threads (Fedora1/2 appears NOT to have it, but in
1720 built with threads (Fedora1/2 appears NOT to have it, but in
1710 Prabhu's Debian boxes it works OK). But even with some Tk
1721 Prabhu's Debian boxes it works OK). But even with some Tk
1711 limitations, this is a great improvement.
1722 limitations, this is a great improvement.
1712
1723
1713 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1724 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1714 info in user prompts. Patch by Prabhu.
1725 info in user prompts. Patch by Prabhu.
1715
1726
1716 2004-11-18 Fernando Perez <fperez@colorado.edu>
1727 2004-11-18 Fernando Perez <fperez@colorado.edu>
1717
1728
1718 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1729 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1719 EOFErrors and bail, to avoid infinite loops if a non-terminating
1730 EOFErrors and bail, to avoid infinite loops if a non-terminating
1720 file is fed into ipython. Patch submitted in issue 19 by user,
1731 file is fed into ipython. Patch submitted in issue 19 by user,
1721 many thanks.
1732 many thanks.
1722
1733
1723 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1734 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1724 autoquote/parens in continuation prompts, which can cause lots of
1735 autoquote/parens in continuation prompts, which can cause lots of
1725 problems. Closes roundup issue 20.
1736 problems. Closes roundup issue 20.
1726
1737
1727 2004-11-17 Fernando Perez <fperez@colorado.edu>
1738 2004-11-17 Fernando Perez <fperez@colorado.edu>
1728
1739
1729 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1740 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1730 reported as debian bug #280505. I'm not sure my local changelog
1741 reported as debian bug #280505. I'm not sure my local changelog
1731 entry has the proper debian format (Jack?).
1742 entry has the proper debian format (Jack?).
1732
1743
1733 2004-11-08 *** Released version 0.6.4
1744 2004-11-08 *** Released version 0.6.4
1734
1745
1735 2004-11-08 Fernando Perez <fperez@colorado.edu>
1746 2004-11-08 Fernando Perez <fperez@colorado.edu>
1736
1747
1737 * IPython/iplib.py (init_readline): Fix exit message for Windows
1748 * IPython/iplib.py (init_readline): Fix exit message for Windows
1738 when readline is active. Thanks to a report by Eric Jones
1749 when readline is active. Thanks to a report by Eric Jones
1739 <eric-AT-enthought.com>.
1750 <eric-AT-enthought.com>.
1740
1751
1741 2004-11-07 Fernando Perez <fperez@colorado.edu>
1752 2004-11-07 Fernando Perez <fperez@colorado.edu>
1742
1753
1743 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1754 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1744 sometimes seen by win2k/cygwin users.
1755 sometimes seen by win2k/cygwin users.
1745
1756
1746 2004-11-06 Fernando Perez <fperez@colorado.edu>
1757 2004-11-06 Fernando Perez <fperez@colorado.edu>
1747
1758
1748 * IPython/iplib.py (interact): Change the handling of %Exit from
1759 * IPython/iplib.py (interact): Change the handling of %Exit from
1749 trying to propagate a SystemExit to an internal ipython flag.
1760 trying to propagate a SystemExit to an internal ipython flag.
1750 This is less elegant than using Python's exception mechanism, but
1761 This is less elegant than using Python's exception mechanism, but
1751 I can't get that to work reliably with threads, so under -pylab
1762 I can't get that to work reliably with threads, so under -pylab
1752 %Exit was hanging IPython. Cross-thread exception handling is
1763 %Exit was hanging IPython. Cross-thread exception handling is
1753 really a bitch. Thaks to a bug report by Stephen Walton
1764 really a bitch. Thaks to a bug report by Stephen Walton
1754 <stephen.walton-AT-csun.edu>.
1765 <stephen.walton-AT-csun.edu>.
1755
1766
1756 2004-11-04 Fernando Perez <fperez@colorado.edu>
1767 2004-11-04 Fernando Perez <fperez@colorado.edu>
1757
1768
1758 * IPython/iplib.py (raw_input_original): store a pointer to the
1769 * IPython/iplib.py (raw_input_original): store a pointer to the
1759 true raw_input to harden against code which can modify it
1770 true raw_input to harden against code which can modify it
1760 (wx.py.PyShell does this and would otherwise crash ipython).
1771 (wx.py.PyShell does this and would otherwise crash ipython).
1761 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1772 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1762
1773
1763 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1774 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1764 Ctrl-C problem, which does not mess up the input line.
1775 Ctrl-C problem, which does not mess up the input line.
1765
1776
1766 2004-11-03 Fernando Perez <fperez@colorado.edu>
1777 2004-11-03 Fernando Perez <fperez@colorado.edu>
1767
1778
1768 * IPython/Release.py: Changed licensing to BSD, in all files.
1779 * IPython/Release.py: Changed licensing to BSD, in all files.
1769 (name): lowercase name for tarball/RPM release.
1780 (name): lowercase name for tarball/RPM release.
1770
1781
1771 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1782 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1772 use throughout ipython.
1783 use throughout ipython.
1773
1784
1774 * IPython/Magic.py (Magic._ofind): Switch to using the new
1785 * IPython/Magic.py (Magic._ofind): Switch to using the new
1775 OInspect.getdoc() function.
1786 OInspect.getdoc() function.
1776
1787
1777 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1788 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1778 of the line currently being canceled via Ctrl-C. It's extremely
1789 of the line currently being canceled via Ctrl-C. It's extremely
1779 ugly, but I don't know how to do it better (the problem is one of
1790 ugly, but I don't know how to do it better (the problem is one of
1780 handling cross-thread exceptions).
1791 handling cross-thread exceptions).
1781
1792
1782 2004-10-28 Fernando Perez <fperez@colorado.edu>
1793 2004-10-28 Fernando Perez <fperez@colorado.edu>
1783
1794
1784 * IPython/Shell.py (signal_handler): add signal handlers to trap
1795 * IPython/Shell.py (signal_handler): add signal handlers to trap
1785 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1796 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1786 report by Francesc Alted.
1797 report by Francesc Alted.
1787
1798
1788 2004-10-21 Fernando Perez <fperez@colorado.edu>
1799 2004-10-21 Fernando Perez <fperez@colorado.edu>
1789
1800
1790 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1801 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1791 to % for pysh syntax extensions.
1802 to % for pysh syntax extensions.
1792
1803
1793 2004-10-09 Fernando Perez <fperez@colorado.edu>
1804 2004-10-09 Fernando Perez <fperez@colorado.edu>
1794
1805
1795 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1806 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1796 arrays to print a more useful summary, without calling str(arr).
1807 arrays to print a more useful summary, without calling str(arr).
1797 This avoids the problem of extremely lengthy computations which
1808 This avoids the problem of extremely lengthy computations which
1798 occur if arr is large, and appear to the user as a system lockup
1809 occur if arr is large, and appear to the user as a system lockup
1799 with 100% cpu activity. After a suggestion by Kristian Sandberg
1810 with 100% cpu activity. After a suggestion by Kristian Sandberg
1800 <Kristian.Sandberg@colorado.edu>.
1811 <Kristian.Sandberg@colorado.edu>.
1801 (Magic.__init__): fix bug in global magic escapes not being
1812 (Magic.__init__): fix bug in global magic escapes not being
1802 correctly set.
1813 correctly set.
1803
1814
1804 2004-10-08 Fernando Perez <fperez@colorado.edu>
1815 2004-10-08 Fernando Perez <fperez@colorado.edu>
1805
1816
1806 * IPython/Magic.py (__license__): change to absolute imports of
1817 * IPython/Magic.py (__license__): change to absolute imports of
1807 ipython's own internal packages, to start adapting to the absolute
1818 ipython's own internal packages, to start adapting to the absolute
1808 import requirement of PEP-328.
1819 import requirement of PEP-328.
1809
1820
1810 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1821 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1811 files, and standardize author/license marks through the Release
1822 files, and standardize author/license marks through the Release
1812 module instead of having per/file stuff (except for files with
1823 module instead of having per/file stuff (except for files with
1813 particular licenses, like the MIT/PSF-licensed codes).
1824 particular licenses, like the MIT/PSF-licensed codes).
1814
1825
1815 * IPython/Debugger.py: remove dead code for python 2.1
1826 * IPython/Debugger.py: remove dead code for python 2.1
1816
1827
1817 2004-10-04 Fernando Perez <fperez@colorado.edu>
1828 2004-10-04 Fernando Perez <fperez@colorado.edu>
1818
1829
1819 * IPython/iplib.py (ipmagic): New function for accessing magics
1830 * IPython/iplib.py (ipmagic): New function for accessing magics
1820 via a normal python function call.
1831 via a normal python function call.
1821
1832
1822 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1833 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1823 from '@' to '%', to accomodate the new @decorator syntax of python
1834 from '@' to '%', to accomodate the new @decorator syntax of python
1824 2.4.
1835 2.4.
1825
1836
1826 2004-09-29 Fernando Perez <fperez@colorado.edu>
1837 2004-09-29 Fernando Perez <fperez@colorado.edu>
1827
1838
1828 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1839 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1829 matplotlib.use to prevent running scripts which try to switch
1840 matplotlib.use to prevent running scripts which try to switch
1830 interactive backends from within ipython. This will just crash
1841 interactive backends from within ipython. This will just crash
1831 the python interpreter, so we can't allow it (but a detailed error
1842 the python interpreter, so we can't allow it (but a detailed error
1832 is given to the user).
1843 is given to the user).
1833
1844
1834 2004-09-28 Fernando Perez <fperez@colorado.edu>
1845 2004-09-28 Fernando Perez <fperez@colorado.edu>
1835
1846
1836 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1847 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1837 matplotlib-related fixes so that using @run with non-matplotlib
1848 matplotlib-related fixes so that using @run with non-matplotlib
1838 scripts doesn't pop up spurious plot windows. This requires
1849 scripts doesn't pop up spurious plot windows. This requires
1839 matplotlib >= 0.63, where I had to make some changes as well.
1850 matplotlib >= 0.63, where I had to make some changes as well.
1840
1851
1841 * IPython/ipmaker.py (make_IPython): update version requirement to
1852 * IPython/ipmaker.py (make_IPython): update version requirement to
1842 python 2.2.
1853 python 2.2.
1843
1854
1844 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1855 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1845 banner arg for embedded customization.
1856 banner arg for embedded customization.
1846
1857
1847 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1858 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1848 explicit uses of __IP as the IPython's instance name. Now things
1859 explicit uses of __IP as the IPython's instance name. Now things
1849 are properly handled via the shell.name value. The actual code
1860 are properly handled via the shell.name value. The actual code
1850 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1861 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1851 is much better than before. I'll clean things completely when the
1862 is much better than before. I'll clean things completely when the
1852 magic stuff gets a real overhaul.
1863 magic stuff gets a real overhaul.
1853
1864
1854 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1865 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1855 minor changes to debian dir.
1866 minor changes to debian dir.
1856
1867
1857 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1868 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1858 pointer to the shell itself in the interactive namespace even when
1869 pointer to the shell itself in the interactive namespace even when
1859 a user-supplied dict is provided. This is needed for embedding
1870 a user-supplied dict is provided. This is needed for embedding
1860 purposes (found by tests with Michel Sanner).
1871 purposes (found by tests with Michel Sanner).
1861
1872
1862 2004-09-27 Fernando Perez <fperez@colorado.edu>
1873 2004-09-27 Fernando Perez <fperez@colorado.edu>
1863
1874
1864 * IPython/UserConfig/ipythonrc: remove []{} from
1875 * IPython/UserConfig/ipythonrc: remove []{} from
1865 readline_remove_delims, so that things like [modname.<TAB> do
1876 readline_remove_delims, so that things like [modname.<TAB> do
1866 proper completion. This disables [].TAB, but that's a less common
1877 proper completion. This disables [].TAB, but that's a less common
1867 case than module names in list comprehensions, for example.
1878 case than module names in list comprehensions, for example.
1868 Thanks to a report by Andrea Riciputi.
1879 Thanks to a report by Andrea Riciputi.
1869
1880
1870 2004-09-09 Fernando Perez <fperez@colorado.edu>
1881 2004-09-09 Fernando Perez <fperez@colorado.edu>
1871
1882
1872 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1883 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1873 blocking problems in win32 and osx. Fix by John.
1884 blocking problems in win32 and osx. Fix by John.
1874
1885
1875 2004-09-08 Fernando Perez <fperez@colorado.edu>
1886 2004-09-08 Fernando Perez <fperez@colorado.edu>
1876
1887
1877 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1888 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1878 for Win32 and OSX. Fix by John Hunter.
1889 for Win32 and OSX. Fix by John Hunter.
1879
1890
1880 2004-08-30 *** Released version 0.6.3
1891 2004-08-30 *** Released version 0.6.3
1881
1892
1882 2004-08-30 Fernando Perez <fperez@colorado.edu>
1893 2004-08-30 Fernando Perez <fperez@colorado.edu>
1883
1894
1884 * setup.py (isfile): Add manpages to list of dependent files to be
1895 * setup.py (isfile): Add manpages to list of dependent files to be
1885 updated.
1896 updated.
1886
1897
1887 2004-08-27 Fernando Perez <fperez@colorado.edu>
1898 2004-08-27 Fernando Perez <fperez@colorado.edu>
1888
1899
1889 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1900 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1890 for now. They don't really work with standalone WX/GTK code
1901 for now. They don't really work with standalone WX/GTK code
1891 (though matplotlib IS working fine with both of those backends).
1902 (though matplotlib IS working fine with both of those backends).
1892 This will neeed much more testing. I disabled most things with
1903 This will neeed much more testing. I disabled most things with
1893 comments, so turning it back on later should be pretty easy.
1904 comments, so turning it back on later should be pretty easy.
1894
1905
1895 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1906 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1896 autocalling of expressions like r'foo', by modifying the line
1907 autocalling of expressions like r'foo', by modifying the line
1897 split regexp. Closes
1908 split regexp. Closes
1898 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1909 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1899 Riley <ipythonbugs-AT-sabi.net>.
1910 Riley <ipythonbugs-AT-sabi.net>.
1900 (InteractiveShell.mainloop): honor --nobanner with banner
1911 (InteractiveShell.mainloop): honor --nobanner with banner
1901 extensions.
1912 extensions.
1902
1913
1903 * IPython/Shell.py: Significant refactoring of all classes, so
1914 * IPython/Shell.py: Significant refactoring of all classes, so
1904 that we can really support ALL matplotlib backends and threading
1915 that we can really support ALL matplotlib backends and threading
1905 models (John spotted a bug with Tk which required this). Now we
1916 models (John spotted a bug with Tk which required this). Now we
1906 should support single-threaded, WX-threads and GTK-threads, both
1917 should support single-threaded, WX-threads and GTK-threads, both
1907 for generic code and for matplotlib.
1918 for generic code and for matplotlib.
1908
1919
1909 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1920 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1910 -pylab, to simplify things for users. Will also remove the pylab
1921 -pylab, to simplify things for users. Will also remove the pylab
1911 profile, since now all of matplotlib configuration is directly
1922 profile, since now all of matplotlib configuration is directly
1912 handled here. This also reduces startup time.
1923 handled here. This also reduces startup time.
1913
1924
1914 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1925 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1915 shell wasn't being correctly called. Also in IPShellWX.
1926 shell wasn't being correctly called. Also in IPShellWX.
1916
1927
1917 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1928 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1918 fine-tune banner.
1929 fine-tune banner.
1919
1930
1920 * IPython/numutils.py (spike): Deprecate these spike functions,
1931 * IPython/numutils.py (spike): Deprecate these spike functions,
1921 delete (long deprecated) gnuplot_exec handler.
1932 delete (long deprecated) gnuplot_exec handler.
1922
1933
1923 2004-08-26 Fernando Perez <fperez@colorado.edu>
1934 2004-08-26 Fernando Perez <fperez@colorado.edu>
1924
1935
1925 * ipython.1: Update for threading options, plus some others which
1936 * ipython.1: Update for threading options, plus some others which
1926 were missing.
1937 were missing.
1927
1938
1928 * IPython/ipmaker.py (__call__): Added -wthread option for
1939 * IPython/ipmaker.py (__call__): Added -wthread option for
1929 wxpython thread handling. Make sure threading options are only
1940 wxpython thread handling. Make sure threading options are only
1930 valid at the command line.
1941 valid at the command line.
1931
1942
1932 * scripts/ipython: moved shell selection into a factory function
1943 * scripts/ipython: moved shell selection into a factory function
1933 in Shell.py, to keep the starter script to a minimum.
1944 in Shell.py, to keep the starter script to a minimum.
1934
1945
1935 2004-08-25 Fernando Perez <fperez@colorado.edu>
1946 2004-08-25 Fernando Perez <fperez@colorado.edu>
1936
1947
1937 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1948 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1938 John. Along with some recent changes he made to matplotlib, the
1949 John. Along with some recent changes he made to matplotlib, the
1939 next versions of both systems should work very well together.
1950 next versions of both systems should work very well together.
1940
1951
1941 2004-08-24 Fernando Perez <fperez@colorado.edu>
1952 2004-08-24 Fernando Perez <fperez@colorado.edu>
1942
1953
1943 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1954 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1944 tried to switch the profiling to using hotshot, but I'm getting
1955 tried to switch the profiling to using hotshot, but I'm getting
1945 strange errors from prof.runctx() there. I may be misreading the
1956 strange errors from prof.runctx() there. I may be misreading the
1946 docs, but it looks weird. For now the profiling code will
1957 docs, but it looks weird. For now the profiling code will
1947 continue to use the standard profiler.
1958 continue to use the standard profiler.
1948
1959
1949 2004-08-23 Fernando Perez <fperez@colorado.edu>
1960 2004-08-23 Fernando Perez <fperez@colorado.edu>
1950
1961
1951 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1962 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1952 threaded shell, by John Hunter. It's not quite ready yet, but
1963 threaded shell, by John Hunter. It's not quite ready yet, but
1953 close.
1964 close.
1954
1965
1955 2004-08-22 Fernando Perez <fperez@colorado.edu>
1966 2004-08-22 Fernando Perez <fperez@colorado.edu>
1956
1967
1957 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1968 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1958 in Magic and ultraTB.
1969 in Magic and ultraTB.
1959
1970
1960 * ipython.1: document threading options in manpage.
1971 * ipython.1: document threading options in manpage.
1961
1972
1962 * scripts/ipython: Changed name of -thread option to -gthread,
1973 * scripts/ipython: Changed name of -thread option to -gthread,
1963 since this is GTK specific. I want to leave the door open for a
1974 since this is GTK specific. I want to leave the door open for a
1964 -wthread option for WX, which will most likely be necessary. This
1975 -wthread option for WX, which will most likely be necessary. This
1965 change affects usage and ipmaker as well.
1976 change affects usage and ipmaker as well.
1966
1977
1967 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1978 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1968 handle the matplotlib shell issues. Code by John Hunter
1979 handle the matplotlib shell issues. Code by John Hunter
1969 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1980 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1970 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1981 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1971 broken (and disabled for end users) for now, but it puts the
1982 broken (and disabled for end users) for now, but it puts the
1972 infrastructure in place.
1983 infrastructure in place.
1973
1984
1974 2004-08-21 Fernando Perez <fperez@colorado.edu>
1985 2004-08-21 Fernando Perez <fperez@colorado.edu>
1975
1986
1976 * ipythonrc-pylab: Add matplotlib support.
1987 * ipythonrc-pylab: Add matplotlib support.
1977
1988
1978 * matplotlib_config.py: new files for matplotlib support, part of
1989 * matplotlib_config.py: new files for matplotlib support, part of
1979 the pylab profile.
1990 the pylab profile.
1980
1991
1981 * IPython/usage.py (__doc__): documented the threading options.
1992 * IPython/usage.py (__doc__): documented the threading options.
1982
1993
1983 2004-08-20 Fernando Perez <fperez@colorado.edu>
1994 2004-08-20 Fernando Perez <fperez@colorado.edu>
1984
1995
1985 * ipython: Modified the main calling routine to handle the -thread
1996 * ipython: Modified the main calling routine to handle the -thread
1986 and -mpthread options. This needs to be done as a top-level hack,
1997 and -mpthread options. This needs to be done as a top-level hack,
1987 because it determines which class to instantiate for IPython
1998 because it determines which class to instantiate for IPython
1988 itself.
1999 itself.
1989
2000
1990 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
2001 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
1991 classes to support multithreaded GTK operation without blocking,
2002 classes to support multithreaded GTK operation without blocking,
1992 and matplotlib with all backends. This is a lot of still very
2003 and matplotlib with all backends. This is a lot of still very
1993 experimental code, and threads are tricky. So it may still have a
2004 experimental code, and threads are tricky. So it may still have a
1994 few rough edges... This code owes a lot to
2005 few rough edges... This code owes a lot to
1995 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
2006 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
1996 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
2007 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
1997 to John Hunter for all the matplotlib work.
2008 to John Hunter for all the matplotlib work.
1998
2009
1999 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2010 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
2000 options for gtk thread and matplotlib support.
2011 options for gtk thread and matplotlib support.
2001
2012
2002 2004-08-16 Fernando Perez <fperez@colorado.edu>
2013 2004-08-16 Fernando Perez <fperez@colorado.edu>
2003
2014
2004 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2015 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
2005 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2016 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
2006 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2017 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
2007
2018
2008 2004-08-11 Fernando Perez <fperez@colorado.edu>
2019 2004-08-11 Fernando Perez <fperez@colorado.edu>
2009
2020
2010 * setup.py (isfile): Fix build so documentation gets updated for
2021 * setup.py (isfile): Fix build so documentation gets updated for
2011 rpms (it was only done for .tgz builds).
2022 rpms (it was only done for .tgz builds).
2012
2023
2013 2004-08-10 Fernando Perez <fperez@colorado.edu>
2024 2004-08-10 Fernando Perez <fperez@colorado.edu>
2014
2025
2015 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2026 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
2016
2027
2017 * iplib.py : Silence syntax error exceptions in tab-completion.
2028 * iplib.py : Silence syntax error exceptions in tab-completion.
2018
2029
2019 2004-08-05 Fernando Perez <fperez@colorado.edu>
2030 2004-08-05 Fernando Perez <fperez@colorado.edu>
2020
2031
2021 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2032 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
2022 'color off' mark for continuation prompts. This was causing long
2033 'color off' mark for continuation prompts. This was causing long
2023 continuation lines to mis-wrap.
2034 continuation lines to mis-wrap.
2024
2035
2025 2004-08-01 Fernando Perez <fperez@colorado.edu>
2036 2004-08-01 Fernando Perez <fperez@colorado.edu>
2026
2037
2027 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2038 * IPython/ipmaker.py (make_IPython): Allow the shell class used
2028 for building ipython to be a parameter. All this is necessary
2039 for building ipython to be a parameter. All this is necessary
2029 right now to have a multithreaded version, but this insane
2040 right now to have a multithreaded version, but this insane
2030 non-design will be cleaned up soon. For now, it's a hack that
2041 non-design will be cleaned up soon. For now, it's a hack that
2031 works.
2042 works.
2032
2043
2033 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2044 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
2034 args in various places. No bugs so far, but it's a dangerous
2045 args in various places. No bugs so far, but it's a dangerous
2035 practice.
2046 practice.
2036
2047
2037 2004-07-31 Fernando Perez <fperez@colorado.edu>
2048 2004-07-31 Fernando Perez <fperez@colorado.edu>
2038
2049
2039 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2050 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
2040 fix completion of files with dots in their names under most
2051 fix completion of files with dots in their names under most
2041 profiles (pysh was OK because the completion order is different).
2052 profiles (pysh was OK because the completion order is different).
2042
2053
2043 2004-07-27 Fernando Perez <fperez@colorado.edu>
2054 2004-07-27 Fernando Perez <fperez@colorado.edu>
2044
2055
2045 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2056 * IPython/iplib.py (InteractiveShell.__init__): build dict of
2046 keywords manually, b/c the one in keyword.py was removed in python
2057 keywords manually, b/c the one in keyword.py was removed in python
2047 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2058 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
2048 This is NOT a bug under python 2.3 and earlier.
2059 This is NOT a bug under python 2.3 and earlier.
2049
2060
2050 2004-07-26 Fernando Perez <fperez@colorado.edu>
2061 2004-07-26 Fernando Perez <fperez@colorado.edu>
2051
2062
2052 * IPython/ultraTB.py (VerboseTB.text): Add another
2063 * IPython/ultraTB.py (VerboseTB.text): Add another
2053 linecache.checkcache() call to try to prevent inspect.py from
2064 linecache.checkcache() call to try to prevent inspect.py from
2054 crashing under python 2.3. I think this fixes
2065 crashing under python 2.3. I think this fixes
2055 http://www.scipy.net/roundup/ipython/issue17.
2066 http://www.scipy.net/roundup/ipython/issue17.
2056
2067
2057 2004-07-26 *** Released version 0.6.2
2068 2004-07-26 *** Released version 0.6.2
2058
2069
2059 2004-07-26 Fernando Perez <fperez@colorado.edu>
2070 2004-07-26 Fernando Perez <fperez@colorado.edu>
2060
2071
2061 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2072 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
2062 fail for any number.
2073 fail for any number.
2063 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2074 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
2064 empty bookmarks.
2075 empty bookmarks.
2065
2076
2066 2004-07-26 *** Released version 0.6.1
2077 2004-07-26 *** Released version 0.6.1
2067
2078
2068 2004-07-26 Fernando Perez <fperez@colorado.edu>
2079 2004-07-26 Fernando Perez <fperez@colorado.edu>
2069
2080
2070 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2081 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
2071
2082
2072 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2083 * IPython/iplib.py (protect_filename): Applied Ville's patch for
2073 escaping '()[]{}' in filenames.
2084 escaping '()[]{}' in filenames.
2074
2085
2075 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2086 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
2076 Python 2.2 users who lack a proper shlex.split.
2087 Python 2.2 users who lack a proper shlex.split.
2077
2088
2078 2004-07-19 Fernando Perez <fperez@colorado.edu>
2089 2004-07-19 Fernando Perez <fperez@colorado.edu>
2079
2090
2080 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2091 * IPython/iplib.py (InteractiveShell.init_readline): Add support
2081 for reading readline's init file. I follow the normal chain:
2092 for reading readline's init file. I follow the normal chain:
2082 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2093 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
2083 report by Mike Heeter. This closes
2094 report by Mike Heeter. This closes
2084 http://www.scipy.net/roundup/ipython/issue16.
2095 http://www.scipy.net/roundup/ipython/issue16.
2085
2096
2086 2004-07-18 Fernando Perez <fperez@colorado.edu>
2097 2004-07-18 Fernando Perez <fperez@colorado.edu>
2087
2098
2088 * IPython/iplib.py (__init__): Add better handling of '\' under
2099 * IPython/iplib.py (__init__): Add better handling of '\' under
2089 Win32 for filenames. After a patch by Ville.
2100 Win32 for filenames. After a patch by Ville.
2090
2101
2091 2004-07-17 Fernando Perez <fperez@colorado.edu>
2102 2004-07-17 Fernando Perez <fperez@colorado.edu>
2092
2103
2093 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2104 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2094 autocalling would be triggered for 'foo is bar' if foo is
2105 autocalling would be triggered for 'foo is bar' if foo is
2095 callable. I also cleaned up the autocall detection code to use a
2106 callable. I also cleaned up the autocall detection code to use a
2096 regexp, which is faster. Bug reported by Alexander Schmolck.
2107 regexp, which is faster. Bug reported by Alexander Schmolck.
2097
2108
2098 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2109 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
2099 '?' in them would confuse the help system. Reported by Alex
2110 '?' in them would confuse the help system. Reported by Alex
2100 Schmolck.
2111 Schmolck.
2101
2112
2102 2004-07-16 Fernando Perez <fperez@colorado.edu>
2113 2004-07-16 Fernando Perez <fperez@colorado.edu>
2103
2114
2104 * IPython/GnuplotInteractive.py (__all__): added plot2.
2115 * IPython/GnuplotInteractive.py (__all__): added plot2.
2105
2116
2106 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2117 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
2107 plotting dictionaries, lists or tuples of 1d arrays.
2118 plotting dictionaries, lists or tuples of 1d arrays.
2108
2119
2109 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2120 * IPython/Magic.py (Magic.magic_hist): small clenaups and
2110 optimizations.
2121 optimizations.
2111
2122
2112 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2123 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
2113 the information which was there from Janko's original IPP code:
2124 the information which was there from Janko's original IPP code:
2114
2125
2115 03.05.99 20:53 porto.ifm.uni-kiel.de
2126 03.05.99 20:53 porto.ifm.uni-kiel.de
2116 --Started changelog.
2127 --Started changelog.
2117 --make clear do what it say it does
2128 --make clear do what it say it does
2118 --added pretty output of lines from inputcache
2129 --added pretty output of lines from inputcache
2119 --Made Logger a mixin class, simplifies handling of switches
2130 --Made Logger a mixin class, simplifies handling of switches
2120 --Added own completer class. .string<TAB> expands to last history
2131 --Added own completer class. .string<TAB> expands to last history
2121 line which starts with string. The new expansion is also present
2132 line which starts with string. The new expansion is also present
2122 with Ctrl-r from the readline library. But this shows, who this
2133 with Ctrl-r from the readline library. But this shows, who this
2123 can be done for other cases.
2134 can be done for other cases.
2124 --Added convention that all shell functions should accept a
2135 --Added convention that all shell functions should accept a
2125 parameter_string This opens the door for different behaviour for
2136 parameter_string This opens the door for different behaviour for
2126 each function. @cd is a good example of this.
2137 each function. @cd is a good example of this.
2127
2138
2128 04.05.99 12:12 porto.ifm.uni-kiel.de
2139 04.05.99 12:12 porto.ifm.uni-kiel.de
2129 --added logfile rotation
2140 --added logfile rotation
2130 --added new mainloop method which freezes first the namespace
2141 --added new mainloop method which freezes first the namespace
2131
2142
2132 07.05.99 21:24 porto.ifm.uni-kiel.de
2143 07.05.99 21:24 porto.ifm.uni-kiel.de
2133 --added the docreader classes. Now there is a help system.
2144 --added the docreader classes. Now there is a help system.
2134 -This is only a first try. Currently it's not easy to put new
2145 -This is only a first try. Currently it's not easy to put new
2135 stuff in the indices. But this is the way to go. Info would be
2146 stuff in the indices. But this is the way to go. Info would be
2136 better, but HTML is every where and not everybody has an info
2147 better, but HTML is every where and not everybody has an info
2137 system installed and it's not so easy to change html-docs to info.
2148 system installed and it's not so easy to change html-docs to info.
2138 --added global logfile option
2149 --added global logfile option
2139 --there is now a hook for object inspection method pinfo needs to
2150 --there is now a hook for object inspection method pinfo needs to
2140 be provided for this. Can be reached by two '??'.
2151 be provided for this. Can be reached by two '??'.
2141
2152
2142 08.05.99 20:51 porto.ifm.uni-kiel.de
2153 08.05.99 20:51 porto.ifm.uni-kiel.de
2143 --added a README
2154 --added a README
2144 --bug in rc file. Something has changed so functions in the rc
2155 --bug in rc file. Something has changed so functions in the rc
2145 file need to reference the shell and not self. Not clear if it's a
2156 file need to reference the shell and not self. Not clear if it's a
2146 bug or feature.
2157 bug or feature.
2147 --changed rc file for new behavior
2158 --changed rc file for new behavior
2148
2159
2149 2004-07-15 Fernando Perez <fperez@colorado.edu>
2160 2004-07-15 Fernando Perez <fperez@colorado.edu>
2150
2161
2151 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2162 * IPython/Logger.py (Logger.log): fixed recent bug where the input
2152 cache was falling out of sync in bizarre manners when multi-line
2163 cache was falling out of sync in bizarre manners when multi-line
2153 input was present. Minor optimizations and cleanup.
2164 input was present. Minor optimizations and cleanup.
2154
2165
2155 (Logger): Remove old Changelog info for cleanup. This is the
2166 (Logger): Remove old Changelog info for cleanup. This is the
2156 information which was there from Janko's original code:
2167 information which was there from Janko's original code:
2157
2168
2158 Changes to Logger: - made the default log filename a parameter
2169 Changes to Logger: - made the default log filename a parameter
2159
2170
2160 - put a check for lines beginning with !@? in log(). Needed
2171 - put a check for lines beginning with !@? in log(). Needed
2161 (even if the handlers properly log their lines) for mid-session
2172 (even if the handlers properly log their lines) for mid-session
2162 logging activation to work properly. Without this, lines logged
2173 logging activation to work properly. Without this, lines logged
2163 in mid session, which get read from the cache, would end up
2174 in mid session, which get read from the cache, would end up
2164 'bare' (with !@? in the open) in the log. Now they are caught
2175 'bare' (with !@? in the open) in the log. Now they are caught
2165 and prepended with a #.
2176 and prepended with a #.
2166
2177
2167 * IPython/iplib.py (InteractiveShell.init_readline): added check
2178 * IPython/iplib.py (InteractiveShell.init_readline): added check
2168 in case MagicCompleter fails to be defined, so we don't crash.
2179 in case MagicCompleter fails to be defined, so we don't crash.
2169
2180
2170 2004-07-13 Fernando Perez <fperez@colorado.edu>
2181 2004-07-13 Fernando Perez <fperez@colorado.edu>
2171
2182
2172 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2183 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
2173 of EPS if the requested filename ends in '.eps'.
2184 of EPS if the requested filename ends in '.eps'.
2174
2185
2175 2004-07-04 Fernando Perez <fperez@colorado.edu>
2186 2004-07-04 Fernando Perez <fperez@colorado.edu>
2176
2187
2177 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2188 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
2178 escaping of quotes when calling the shell.
2189 escaping of quotes when calling the shell.
2179
2190
2180 2004-07-02 Fernando Perez <fperez@colorado.edu>
2191 2004-07-02 Fernando Perez <fperez@colorado.edu>
2181
2192
2182 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2193 * IPython/Prompts.py (CachedOutput.update): Fix problem with
2183 gettext not working because we were clobbering '_'. Fixes
2194 gettext not working because we were clobbering '_'. Fixes
2184 http://www.scipy.net/roundup/ipython/issue6.
2195 http://www.scipy.net/roundup/ipython/issue6.
2185
2196
2186 2004-07-01 Fernando Perez <fperez@colorado.edu>
2197 2004-07-01 Fernando Perez <fperez@colorado.edu>
2187
2198
2188 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2199 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
2189 into @cd. Patch by Ville.
2200 into @cd. Patch by Ville.
2190
2201
2191 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2202 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2192 new function to store things after ipmaker runs. Patch by Ville.
2203 new function to store things after ipmaker runs. Patch by Ville.
2193 Eventually this will go away once ipmaker is removed and the class
2204 Eventually this will go away once ipmaker is removed and the class
2194 gets cleaned up, but for now it's ok. Key functionality here is
2205 gets cleaned up, but for now it's ok. Key functionality here is
2195 the addition of the persistent storage mechanism, a dict for
2206 the addition of the persistent storage mechanism, a dict for
2196 keeping data across sessions (for now just bookmarks, but more can
2207 keeping data across sessions (for now just bookmarks, but more can
2197 be implemented later).
2208 be implemented later).
2198
2209
2199 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2210 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
2200 persistent across sections. Patch by Ville, I modified it
2211 persistent across sections. Patch by Ville, I modified it
2201 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2212 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
2202 added a '-l' option to list all bookmarks.
2213 added a '-l' option to list all bookmarks.
2203
2214
2204 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2215 * IPython/iplib.py (InteractiveShell.atexit_operations): new
2205 center for cleanup. Registered with atexit.register(). I moved
2216 center for cleanup. Registered with atexit.register(). I moved
2206 here the old exit_cleanup(). After a patch by Ville.
2217 here the old exit_cleanup(). After a patch by Ville.
2207
2218
2208 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2219 * IPython/Magic.py (get_py_filename): added '~' to the accepted
2209 characters in the hacked shlex_split for python 2.2.
2220 characters in the hacked shlex_split for python 2.2.
2210
2221
2211 * IPython/iplib.py (file_matches): more fixes to filenames with
2222 * IPython/iplib.py (file_matches): more fixes to filenames with
2212 whitespace in them. It's not perfect, but limitations in python's
2223 whitespace in them. It's not perfect, but limitations in python's
2213 readline make it impossible to go further.
2224 readline make it impossible to go further.
2214
2225
2215 2004-06-29 Fernando Perez <fperez@colorado.edu>
2226 2004-06-29 Fernando Perez <fperez@colorado.edu>
2216
2227
2217 * IPython/iplib.py (file_matches): escape whitespace correctly in
2228 * IPython/iplib.py (file_matches): escape whitespace correctly in
2218 filename completions. Bug reported by Ville.
2229 filename completions. Bug reported by Ville.
2219
2230
2220 2004-06-28 Fernando Perez <fperez@colorado.edu>
2231 2004-06-28 Fernando Perez <fperez@colorado.edu>
2221
2232
2222 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2233 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
2223 the history file will be called 'history-PROFNAME' (or just
2234 the history file will be called 'history-PROFNAME' (or just
2224 'history' if no profile is loaded). I was getting annoyed at
2235 'history' if no profile is loaded). I was getting annoyed at
2225 getting my Numerical work history clobbered by pysh sessions.
2236 getting my Numerical work history clobbered by pysh sessions.
2226
2237
2227 * IPython/iplib.py (InteractiveShell.__init__): Internal
2238 * IPython/iplib.py (InteractiveShell.__init__): Internal
2228 getoutputerror() function so that we can honor the system_verbose
2239 getoutputerror() function so that we can honor the system_verbose
2229 flag for _all_ system calls. I also added escaping of #
2240 flag for _all_ system calls. I also added escaping of #
2230 characters here to avoid confusing Itpl.
2241 characters here to avoid confusing Itpl.
2231
2242
2232 * IPython/Magic.py (shlex_split): removed call to shell in
2243 * IPython/Magic.py (shlex_split): removed call to shell in
2233 parse_options and replaced it with shlex.split(). The annoying
2244 parse_options and replaced it with shlex.split(). The annoying
2234 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2245 part was that in Python 2.2, shlex.split() doesn't exist, so I had
2235 to backport it from 2.3, with several frail hacks (the shlex
2246 to backport it from 2.3, with several frail hacks (the shlex
2236 module is rather limited in 2.2). Thanks to a suggestion by Ville
2247 module is rather limited in 2.2). Thanks to a suggestion by Ville
2237 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2248 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
2238 problem.
2249 problem.
2239
2250
2240 (Magic.magic_system_verbose): new toggle to print the actual
2251 (Magic.magic_system_verbose): new toggle to print the actual
2241 system calls made by ipython. Mainly for debugging purposes.
2252 system calls made by ipython. Mainly for debugging purposes.
2242
2253
2243 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2254 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
2244 doesn't support persistence. Reported (and fix suggested) by
2255 doesn't support persistence. Reported (and fix suggested) by
2245 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2256 Travis Caldwell <travis_caldwell2000@yahoo.com>.
2246
2257
2247 2004-06-26 Fernando Perez <fperez@colorado.edu>
2258 2004-06-26 Fernando Perez <fperez@colorado.edu>
2248
2259
2249 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2260 * IPython/Logger.py (Logger.log): fix to handle correctly empty
2250 continue prompts.
2261 continue prompts.
2251
2262
2252 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2263 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
2253 function (basically a big docstring) and a few more things here to
2264 function (basically a big docstring) and a few more things here to
2254 speedup startup. pysh.py is now very lightweight. We want because
2265 speedup startup. pysh.py is now very lightweight. We want because
2255 it gets execfile'd, while InterpreterExec gets imported, so
2266 it gets execfile'd, while InterpreterExec gets imported, so
2256 byte-compilation saves time.
2267 byte-compilation saves time.
2257
2268
2258 2004-06-25 Fernando Perez <fperez@colorado.edu>
2269 2004-06-25 Fernando Perez <fperez@colorado.edu>
2259
2270
2260 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2271 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
2261 -NUM', which was recently broken.
2272 -NUM', which was recently broken.
2262
2273
2263 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2274 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
2264 in multi-line input (but not !!, which doesn't make sense there).
2275 in multi-line input (but not !!, which doesn't make sense there).
2265
2276
2266 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2277 * IPython/UserConfig/ipythonrc: made autoindent on by default.
2267 It's just too useful, and people can turn it off in the less
2278 It's just too useful, and people can turn it off in the less
2268 common cases where it's a problem.
2279 common cases where it's a problem.
2269
2280
2270 2004-06-24 Fernando Perez <fperez@colorado.edu>
2281 2004-06-24 Fernando Perez <fperez@colorado.edu>
2271
2282
2272 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2283 * IPython/iplib.py (InteractiveShell._prefilter): big change -
2273 special syntaxes (like alias calling) is now allied in multi-line
2284 special syntaxes (like alias calling) is now allied in multi-line
2274 input. This is still _very_ experimental, but it's necessary for
2285 input. This is still _very_ experimental, but it's necessary for
2275 efficient shell usage combining python looping syntax with system
2286 efficient shell usage combining python looping syntax with system
2276 calls. For now it's restricted to aliases, I don't think it
2287 calls. For now it's restricted to aliases, I don't think it
2277 really even makes sense to have this for magics.
2288 really even makes sense to have this for magics.
2278
2289
2279 2004-06-23 Fernando Perez <fperez@colorado.edu>
2290 2004-06-23 Fernando Perez <fperez@colorado.edu>
2280
2291
2281 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2292 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
2282 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2293 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
2283
2294
2284 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2295 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
2285 extensions under Windows (after code sent by Gary Bishop). The
2296 extensions under Windows (after code sent by Gary Bishop). The
2286 extensions considered 'executable' are stored in IPython's rc
2297 extensions considered 'executable' are stored in IPython's rc
2287 structure as win_exec_ext.
2298 structure as win_exec_ext.
2288
2299
2289 * IPython/genutils.py (shell): new function, like system() but
2300 * IPython/genutils.py (shell): new function, like system() but
2290 without return value. Very useful for interactive shell work.
2301 without return value. Very useful for interactive shell work.
2291
2302
2292 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2303 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
2293 delete aliases.
2304 delete aliases.
2294
2305
2295 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2306 * IPython/iplib.py (InteractiveShell.alias_table_update): make
2296 sure that the alias table doesn't contain python keywords.
2307 sure that the alias table doesn't contain python keywords.
2297
2308
2298 2004-06-21 Fernando Perez <fperez@colorado.edu>
2309 2004-06-21 Fernando Perez <fperez@colorado.edu>
2299
2310
2300 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2311 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
2301 non-existent items are found in $PATH. Reported by Thorsten.
2312 non-existent items are found in $PATH. Reported by Thorsten.
2302
2313
2303 2004-06-20 Fernando Perez <fperez@colorado.edu>
2314 2004-06-20 Fernando Perez <fperez@colorado.edu>
2304
2315
2305 * IPython/iplib.py (complete): modified the completer so that the
2316 * IPython/iplib.py (complete): modified the completer so that the
2306 order of priorities can be easily changed at runtime.
2317 order of priorities can be easily changed at runtime.
2307
2318
2308 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2319 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
2309 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2320 Modified to auto-execute all lines beginning with '~', '/' or '.'.
2310
2321
2311 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2322 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
2312 expand Python variables prepended with $ in all system calls. The
2323 expand Python variables prepended with $ in all system calls. The
2313 same was done to InteractiveShell.handle_shell_escape. Now all
2324 same was done to InteractiveShell.handle_shell_escape. Now all
2314 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2325 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
2315 expansion of python variables and expressions according to the
2326 expansion of python variables and expressions according to the
2316 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2327 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
2317
2328
2318 Though PEP-215 has been rejected, a similar (but simpler) one
2329 Though PEP-215 has been rejected, a similar (but simpler) one
2319 seems like it will go into Python 2.4, PEP-292 -
2330 seems like it will go into Python 2.4, PEP-292 -
2320 http://www.python.org/peps/pep-0292.html.
2331 http://www.python.org/peps/pep-0292.html.
2321
2332
2322 I'll keep the full syntax of PEP-215, since IPython has since the
2333 I'll keep the full syntax of PEP-215, since IPython has since the
2323 start used Ka-Ping Yee's reference implementation discussed there
2334 start used Ka-Ping Yee's reference implementation discussed there
2324 (Itpl), and I actually like the powerful semantics it offers.
2335 (Itpl), and I actually like the powerful semantics it offers.
2325
2336
2326 In order to access normal shell variables, the $ has to be escaped
2337 In order to access normal shell variables, the $ has to be escaped
2327 via an extra $. For example:
2338 via an extra $. For example:
2328
2339
2329 In [7]: PATH='a python variable'
2340 In [7]: PATH='a python variable'
2330
2341
2331 In [8]: !echo $PATH
2342 In [8]: !echo $PATH
2332 a python variable
2343 a python variable
2333
2344
2334 In [9]: !echo $$PATH
2345 In [9]: !echo $$PATH
2335 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2346 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
2336
2347
2337 (Magic.parse_options): escape $ so the shell doesn't evaluate
2348 (Magic.parse_options): escape $ so the shell doesn't evaluate
2338 things prematurely.
2349 things prematurely.
2339
2350
2340 * IPython/iplib.py (InteractiveShell.call_alias): added the
2351 * IPython/iplib.py (InteractiveShell.call_alias): added the
2341 ability for aliases to expand python variables via $.
2352 ability for aliases to expand python variables via $.
2342
2353
2343 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2354 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
2344 system, now there's a @rehash/@rehashx pair of magics. These work
2355 system, now there's a @rehash/@rehashx pair of magics. These work
2345 like the csh rehash command, and can be invoked at any time. They
2356 like the csh rehash command, and can be invoked at any time. They
2346 build a table of aliases to everything in the user's $PATH
2357 build a table of aliases to everything in the user's $PATH
2347 (@rehash uses everything, @rehashx is slower but only adds
2358 (@rehash uses everything, @rehashx is slower but only adds
2348 executable files). With this, the pysh.py-based shell profile can
2359 executable files). With this, the pysh.py-based shell profile can
2349 now simply call rehash upon startup, and full access to all
2360 now simply call rehash upon startup, and full access to all
2350 programs in the user's path is obtained.
2361 programs in the user's path is obtained.
2351
2362
2352 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2363 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
2353 functionality is now fully in place. I removed the old dynamic
2364 functionality is now fully in place. I removed the old dynamic
2354 code generation based approach, in favor of a much lighter one
2365 code generation based approach, in favor of a much lighter one
2355 based on a simple dict. The advantage is that this allows me to
2366 based on a simple dict. The advantage is that this allows me to
2356 now have thousands of aliases with negligible cost (unthinkable
2367 now have thousands of aliases with negligible cost (unthinkable
2357 with the old system).
2368 with the old system).
2358
2369
2359 2004-06-19 Fernando Perez <fperez@colorado.edu>
2370 2004-06-19 Fernando Perez <fperez@colorado.edu>
2360
2371
2361 * IPython/iplib.py (__init__): extended MagicCompleter class to
2372 * IPython/iplib.py (__init__): extended MagicCompleter class to
2362 also complete (last in priority) on user aliases.
2373 also complete (last in priority) on user aliases.
2363
2374
2364 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2375 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
2365 call to eval.
2376 call to eval.
2366 (ItplNS.__init__): Added a new class which functions like Itpl,
2377 (ItplNS.__init__): Added a new class which functions like Itpl,
2367 but allows configuring the namespace for the evaluation to occur
2378 but allows configuring the namespace for the evaluation to occur
2368 in.
2379 in.
2369
2380
2370 2004-06-18 Fernando Perez <fperez@colorado.edu>
2381 2004-06-18 Fernando Perez <fperez@colorado.edu>
2371
2382
2372 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2383 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
2373 better message when 'exit' or 'quit' are typed (a common newbie
2384 better message when 'exit' or 'quit' are typed (a common newbie
2374 confusion).
2385 confusion).
2375
2386
2376 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2387 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
2377 check for Windows users.
2388 check for Windows users.
2378
2389
2379 * IPython/iplib.py (InteractiveShell.user_setup): removed
2390 * IPython/iplib.py (InteractiveShell.user_setup): removed
2380 disabling of colors for Windows. I'll test at runtime and issue a
2391 disabling of colors for Windows. I'll test at runtime and issue a
2381 warning if Gary's readline isn't found, as to nudge users to
2392 warning if Gary's readline isn't found, as to nudge users to
2382 download it.
2393 download it.
2383
2394
2384 2004-06-16 Fernando Perez <fperez@colorado.edu>
2395 2004-06-16 Fernando Perez <fperez@colorado.edu>
2385
2396
2386 * IPython/genutils.py (Stream.__init__): changed to print errors
2397 * IPython/genutils.py (Stream.__init__): changed to print errors
2387 to sys.stderr. I had a circular dependency here. Now it's
2398 to sys.stderr. I had a circular dependency here. Now it's
2388 possible to run ipython as IDLE's shell (consider this pre-alpha,
2399 possible to run ipython as IDLE's shell (consider this pre-alpha,
2389 since true stdout things end up in the starting terminal instead
2400 since true stdout things end up in the starting terminal instead
2390 of IDLE's out).
2401 of IDLE's out).
2391
2402
2392 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2403 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
2393 users who haven't # updated their prompt_in2 definitions. Remove
2404 users who haven't # updated their prompt_in2 definitions. Remove
2394 eventually.
2405 eventually.
2395 (multiple_replace): added credit to original ASPN recipe.
2406 (multiple_replace): added credit to original ASPN recipe.
2396
2407
2397 2004-06-15 Fernando Perez <fperez@colorado.edu>
2408 2004-06-15 Fernando Perez <fperez@colorado.edu>
2398
2409
2399 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2410 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
2400 list of auto-defined aliases.
2411 list of auto-defined aliases.
2401
2412
2402 2004-06-13 Fernando Perez <fperez@colorado.edu>
2413 2004-06-13 Fernando Perez <fperez@colorado.edu>
2403
2414
2404 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2415 * setup.py (scriptfiles): Don't trigger win_post_install unless an
2405 install was really requested (so setup.py can be used for other
2416 install was really requested (so setup.py can be used for other
2406 things under Windows).
2417 things under Windows).
2407
2418
2408 2004-06-10 Fernando Perez <fperez@colorado.edu>
2419 2004-06-10 Fernando Perez <fperez@colorado.edu>
2409
2420
2410 * IPython/Logger.py (Logger.create_log): Manually remove any old
2421 * IPython/Logger.py (Logger.create_log): Manually remove any old
2411 backup, since os.remove may fail under Windows. Fixes bug
2422 backup, since os.remove may fail under Windows. Fixes bug
2412 reported by Thorsten.
2423 reported by Thorsten.
2413
2424
2414 2004-06-09 Fernando Perez <fperez@colorado.edu>
2425 2004-06-09 Fernando Perez <fperez@colorado.edu>
2415
2426
2416 * examples/example-embed.py: fixed all references to %n (replaced
2427 * examples/example-embed.py: fixed all references to %n (replaced
2417 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2428 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
2418 for all examples and the manual as well.
2429 for all examples and the manual as well.
2419
2430
2420 2004-06-08 Fernando Perez <fperez@colorado.edu>
2431 2004-06-08 Fernando Perez <fperez@colorado.edu>
2421
2432
2422 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2433 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
2423 alignment and color management. All 3 prompt subsystems now
2434 alignment and color management. All 3 prompt subsystems now
2424 inherit from BasePrompt.
2435 inherit from BasePrompt.
2425
2436
2426 * tools/release: updates for windows installer build and tag rpms
2437 * tools/release: updates for windows installer build and tag rpms
2427 with python version (since paths are fixed).
2438 with python version (since paths are fixed).
2428
2439
2429 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2440 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
2430 which will become eventually obsolete. Also fixed the default
2441 which will become eventually obsolete. Also fixed the default
2431 prompt_in2 to use \D, so at least new users start with the correct
2442 prompt_in2 to use \D, so at least new users start with the correct
2432 defaults.
2443 defaults.
2433 WARNING: Users with existing ipythonrc files will need to apply
2444 WARNING: Users with existing ipythonrc files will need to apply
2434 this fix manually!
2445 this fix manually!
2435
2446
2436 * setup.py: make windows installer (.exe). This is finally the
2447 * setup.py: make windows installer (.exe). This is finally the
2437 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
2448 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
2438 which I hadn't included because it required Python 2.3 (or recent
2449 which I hadn't included because it required Python 2.3 (or recent
2439 distutils).
2450 distutils).
2440
2451
2441 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
2452 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
2442 usage of new '\D' escape.
2453 usage of new '\D' escape.
2443
2454
2444 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
2455 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
2445 lacks os.getuid())
2456 lacks os.getuid())
2446 (CachedOutput.set_colors): Added the ability to turn coloring
2457 (CachedOutput.set_colors): Added the ability to turn coloring
2447 on/off with @colors even for manually defined prompt colors. It
2458 on/off with @colors even for manually defined prompt colors. It
2448 uses a nasty global, but it works safely and via the generic color
2459 uses a nasty global, but it works safely and via the generic color
2449 handling mechanism.
2460 handling mechanism.
2450 (Prompt2.__init__): Introduced new escape '\D' for continuation
2461 (Prompt2.__init__): Introduced new escape '\D' for continuation
2451 prompts. It represents the counter ('\#') as dots.
2462 prompts. It represents the counter ('\#') as dots.
2452 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
2463 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
2453 need to update their ipythonrc files and replace '%n' with '\D' in
2464 need to update their ipythonrc files and replace '%n' with '\D' in
2454 their prompt_in2 settings everywhere. Sorry, but there's
2465 their prompt_in2 settings everywhere. Sorry, but there's
2455 otherwise no clean way to get all prompts to properly align. The
2466 otherwise no clean way to get all prompts to properly align. The
2456 ipythonrc shipped with IPython has been updated.
2467 ipythonrc shipped with IPython has been updated.
2457
2468
2458 2004-06-07 Fernando Perez <fperez@colorado.edu>
2469 2004-06-07 Fernando Perez <fperez@colorado.edu>
2459
2470
2460 * setup.py (isfile): Pass local_icons option to latex2html, so the
2471 * setup.py (isfile): Pass local_icons option to latex2html, so the
2461 resulting HTML file is self-contained. Thanks to
2472 resulting HTML file is self-contained. Thanks to
2462 dryice-AT-liu.com.cn for the tip.
2473 dryice-AT-liu.com.cn for the tip.
2463
2474
2464 * pysh.py: I created a new profile 'shell', which implements a
2475 * pysh.py: I created a new profile 'shell', which implements a
2465 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2476 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2466 system shell, nor will it become one anytime soon. It's mainly
2477 system shell, nor will it become one anytime soon. It's mainly
2467 meant to illustrate the use of the new flexible bash-like prompts.
2478 meant to illustrate the use of the new flexible bash-like prompts.
2468 I guess it could be used by hardy souls for true shell management,
2479 I guess it could be used by hardy souls for true shell management,
2469 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2480 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2470 profile. This uses the InterpreterExec extension provided by
2481 profile. This uses the InterpreterExec extension provided by
2471 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2482 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2472
2483
2473 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2484 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2474 auto-align itself with the length of the previous input prompt
2485 auto-align itself with the length of the previous input prompt
2475 (taking into account the invisible color escapes).
2486 (taking into account the invisible color escapes).
2476 (CachedOutput.__init__): Large restructuring of this class. Now
2487 (CachedOutput.__init__): Large restructuring of this class. Now
2477 all three prompts (primary1, primary2, output) are proper objects,
2488 all three prompts (primary1, primary2, output) are proper objects,
2478 managed by the 'parent' CachedOutput class. The code is still a
2489 managed by the 'parent' CachedOutput class. The code is still a
2479 bit hackish (all prompts share state via a pointer to the cache),
2490 bit hackish (all prompts share state via a pointer to the cache),
2480 but it's overall far cleaner than before.
2491 but it's overall far cleaner than before.
2481
2492
2482 * IPython/genutils.py (getoutputerror): modified to add verbose,
2493 * IPython/genutils.py (getoutputerror): modified to add verbose,
2483 debug and header options. This makes the interface of all getout*
2494 debug and header options. This makes the interface of all getout*
2484 functions uniform.
2495 functions uniform.
2485 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2496 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2486
2497
2487 * IPython/Magic.py (Magic.default_option): added a function to
2498 * IPython/Magic.py (Magic.default_option): added a function to
2488 allow registering default options for any magic command. This
2499 allow registering default options for any magic command. This
2489 makes it easy to have profiles which customize the magics globally
2500 makes it easy to have profiles which customize the magics globally
2490 for a certain use. The values set through this function are
2501 for a certain use. The values set through this function are
2491 picked up by the parse_options() method, which all magics should
2502 picked up by the parse_options() method, which all magics should
2492 use to parse their options.
2503 use to parse their options.
2493
2504
2494 * IPython/genutils.py (warn): modified the warnings framework to
2505 * IPython/genutils.py (warn): modified the warnings framework to
2495 use the Term I/O class. I'm trying to slowly unify all of
2506 use the Term I/O class. I'm trying to slowly unify all of
2496 IPython's I/O operations to pass through Term.
2507 IPython's I/O operations to pass through Term.
2497
2508
2498 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2509 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2499 the secondary prompt to correctly match the length of the primary
2510 the secondary prompt to correctly match the length of the primary
2500 one for any prompt. Now multi-line code will properly line up
2511 one for any prompt. Now multi-line code will properly line up
2501 even for path dependent prompts, such as the new ones available
2512 even for path dependent prompts, such as the new ones available
2502 via the prompt_specials.
2513 via the prompt_specials.
2503
2514
2504 2004-06-06 Fernando Perez <fperez@colorado.edu>
2515 2004-06-06 Fernando Perez <fperez@colorado.edu>
2505
2516
2506 * IPython/Prompts.py (prompt_specials): Added the ability to have
2517 * IPython/Prompts.py (prompt_specials): Added the ability to have
2507 bash-like special sequences in the prompts, which get
2518 bash-like special sequences in the prompts, which get
2508 automatically expanded. Things like hostname, current working
2519 automatically expanded. Things like hostname, current working
2509 directory and username are implemented already, but it's easy to
2520 directory and username are implemented already, but it's easy to
2510 add more in the future. Thanks to a patch by W.J. van der Laan
2521 add more in the future. Thanks to a patch by W.J. van der Laan
2511 <gnufnork-AT-hetdigitalegat.nl>
2522 <gnufnork-AT-hetdigitalegat.nl>
2512 (prompt_specials): Added color support for prompt strings, so
2523 (prompt_specials): Added color support for prompt strings, so
2513 users can define arbitrary color setups for their prompts.
2524 users can define arbitrary color setups for their prompts.
2514
2525
2515 2004-06-05 Fernando Perez <fperez@colorado.edu>
2526 2004-06-05 Fernando Perez <fperez@colorado.edu>
2516
2527
2517 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
2528 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
2518 code to load Gary Bishop's readline and configure it
2529 code to load Gary Bishop's readline and configure it
2519 automatically. Thanks to Gary for help on this.
2530 automatically. Thanks to Gary for help on this.
2520
2531
2521 2004-06-01 Fernando Perez <fperez@colorado.edu>
2532 2004-06-01 Fernando Perez <fperez@colorado.edu>
2522
2533
2523 * IPython/Logger.py (Logger.create_log): fix bug for logging
2534 * IPython/Logger.py (Logger.create_log): fix bug for logging
2524 with no filename (previous fix was incomplete).
2535 with no filename (previous fix was incomplete).
2525
2536
2526 2004-05-25 Fernando Perez <fperez@colorado.edu>
2537 2004-05-25 Fernando Perez <fperez@colorado.edu>
2527
2538
2528 * IPython/Magic.py (Magic.parse_options): fix bug where naked
2539 * IPython/Magic.py (Magic.parse_options): fix bug where naked
2529 parens would get passed to the shell.
2540 parens would get passed to the shell.
2530
2541
2531 2004-05-20 Fernando Perez <fperez@colorado.edu>
2542 2004-05-20 Fernando Perez <fperez@colorado.edu>
2532
2543
2533 * IPython/Magic.py (Magic.magic_prun): changed default profile
2544 * IPython/Magic.py (Magic.magic_prun): changed default profile
2534 sort order to 'time' (the more common profiling need).
2545 sort order to 'time' (the more common profiling need).
2535
2546
2536 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
2547 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
2537 so that source code shown is guaranteed in sync with the file on
2548 so that source code shown is guaranteed in sync with the file on
2538 disk (also changed in psource). Similar fix to the one for
2549 disk (also changed in psource). Similar fix to the one for
2539 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2550 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2540 <yann.ledu-AT-noos.fr>.
2551 <yann.ledu-AT-noos.fr>.
2541
2552
2542 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2553 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2543 with a single option would not be correctly parsed. Closes
2554 with a single option would not be correctly parsed. Closes
2544 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2555 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2545 introduced in 0.6.0 (on 2004-05-06).
2556 introduced in 0.6.0 (on 2004-05-06).
2546
2557
2547 2004-05-13 *** Released version 0.6.0
2558 2004-05-13 *** Released version 0.6.0
2548
2559
2549 2004-05-13 Fernando Perez <fperez@colorado.edu>
2560 2004-05-13 Fernando Perez <fperez@colorado.edu>
2550
2561
2551 * debian/: Added debian/ directory to CVS, so that debian support
2562 * debian/: Added debian/ directory to CVS, so that debian support
2552 is publicly accessible. The debian package is maintained by Jack
2563 is publicly accessible. The debian package is maintained by Jack
2553 Moffit <jack-AT-xiph.org>.
2564 Moffit <jack-AT-xiph.org>.
2554
2565
2555 * Documentation: included the notes about an ipython-based system
2566 * Documentation: included the notes about an ipython-based system
2556 shell (the hypothetical 'pysh') into the new_design.pdf document,
2567 shell (the hypothetical 'pysh') into the new_design.pdf document,
2557 so that these ideas get distributed to users along with the
2568 so that these ideas get distributed to users along with the
2558 official documentation.
2569 official documentation.
2559
2570
2560 2004-05-10 Fernando Perez <fperez@colorado.edu>
2571 2004-05-10 Fernando Perez <fperez@colorado.edu>
2561
2572
2562 * IPython/Logger.py (Logger.create_log): fix recently introduced
2573 * IPython/Logger.py (Logger.create_log): fix recently introduced
2563 bug (misindented line) where logstart would fail when not given an
2574 bug (misindented line) where logstart would fail when not given an
2564 explicit filename.
2575 explicit filename.
2565
2576
2566 2004-05-09 Fernando Perez <fperez@colorado.edu>
2577 2004-05-09 Fernando Perez <fperez@colorado.edu>
2567
2578
2568 * IPython/Magic.py (Magic.parse_options): skip system call when
2579 * IPython/Magic.py (Magic.parse_options): skip system call when
2569 there are no options to look for. Faster, cleaner for the common
2580 there are no options to look for. Faster, cleaner for the common
2570 case.
2581 case.
2571
2582
2572 * Documentation: many updates to the manual: describing Windows
2583 * Documentation: many updates to the manual: describing Windows
2573 support better, Gnuplot updates, credits, misc small stuff. Also
2584 support better, Gnuplot updates, credits, misc small stuff. Also
2574 updated the new_design doc a bit.
2585 updated the new_design doc a bit.
2575
2586
2576 2004-05-06 *** Released version 0.6.0.rc1
2587 2004-05-06 *** Released version 0.6.0.rc1
2577
2588
2578 2004-05-06 Fernando Perez <fperez@colorado.edu>
2589 2004-05-06 Fernando Perez <fperez@colorado.edu>
2579
2590
2580 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2591 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2581 operations to use the vastly more efficient list/''.join() method.
2592 operations to use the vastly more efficient list/''.join() method.
2582 (FormattedTB.text): Fix
2593 (FormattedTB.text): Fix
2583 http://www.scipy.net/roundup/ipython/issue12 - exception source
2594 http://www.scipy.net/roundup/ipython/issue12 - exception source
2584 extract not updated after reload. Thanks to Mike Salib
2595 extract not updated after reload. Thanks to Mike Salib
2585 <msalib-AT-mit.edu> for pinning the source of the problem.
2596 <msalib-AT-mit.edu> for pinning the source of the problem.
2586 Fortunately, the solution works inside ipython and doesn't require
2597 Fortunately, the solution works inside ipython and doesn't require
2587 any changes to python proper.
2598 any changes to python proper.
2588
2599
2589 * IPython/Magic.py (Magic.parse_options): Improved to process the
2600 * IPython/Magic.py (Magic.parse_options): Improved to process the
2590 argument list as a true shell would (by actually using the
2601 argument list as a true shell would (by actually using the
2591 underlying system shell). This way, all @magics automatically get
2602 underlying system shell). This way, all @magics automatically get
2592 shell expansion for variables. Thanks to a comment by Alex
2603 shell expansion for variables. Thanks to a comment by Alex
2593 Schmolck.
2604 Schmolck.
2594
2605
2595 2004-04-04 Fernando Perez <fperez@colorado.edu>
2606 2004-04-04 Fernando Perez <fperez@colorado.edu>
2596
2607
2597 * IPython/iplib.py (InteractiveShell.interact): Added a special
2608 * IPython/iplib.py (InteractiveShell.interact): Added a special
2598 trap for a debugger quit exception, which is basically impossible
2609 trap for a debugger quit exception, which is basically impossible
2599 to handle by normal mechanisms, given what pdb does to the stack.
2610 to handle by normal mechanisms, given what pdb does to the stack.
2600 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2611 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2601
2612
2602 2004-04-03 Fernando Perez <fperez@colorado.edu>
2613 2004-04-03 Fernando Perez <fperez@colorado.edu>
2603
2614
2604 * IPython/genutils.py (Term): Standardized the names of the Term
2615 * IPython/genutils.py (Term): Standardized the names of the Term
2605 class streams to cin/cout/cerr, following C++ naming conventions
2616 class streams to cin/cout/cerr, following C++ naming conventions
2606 (I can't use in/out/err because 'in' is not a valid attribute
2617 (I can't use in/out/err because 'in' is not a valid attribute
2607 name).
2618 name).
2608
2619
2609 * IPython/iplib.py (InteractiveShell.interact): don't increment
2620 * IPython/iplib.py (InteractiveShell.interact): don't increment
2610 the prompt if there's no user input. By Daniel 'Dang' Griffith
2621 the prompt if there's no user input. By Daniel 'Dang' Griffith
2611 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2622 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2612 Francois Pinard.
2623 Francois Pinard.
2613
2624
2614 2004-04-02 Fernando Perez <fperez@colorado.edu>
2625 2004-04-02 Fernando Perez <fperez@colorado.edu>
2615
2626
2616 * IPython/genutils.py (Stream.__init__): Modified to survive at
2627 * IPython/genutils.py (Stream.__init__): Modified to survive at
2617 least importing in contexts where stdin/out/err aren't true file
2628 least importing in contexts where stdin/out/err aren't true file
2618 objects, such as PyCrust (they lack fileno() and mode). However,
2629 objects, such as PyCrust (they lack fileno() and mode). However,
2619 the recovery facilities which rely on these things existing will
2630 the recovery facilities which rely on these things existing will
2620 not work.
2631 not work.
2621
2632
2622 2004-04-01 Fernando Perez <fperez@colorado.edu>
2633 2004-04-01 Fernando Perez <fperez@colorado.edu>
2623
2634
2624 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2635 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2625 use the new getoutputerror() function, so it properly
2636 use the new getoutputerror() function, so it properly
2626 distinguishes stdout/err.
2637 distinguishes stdout/err.
2627
2638
2628 * IPython/genutils.py (getoutputerror): added a function to
2639 * IPython/genutils.py (getoutputerror): added a function to
2629 capture separately the standard output and error of a command.
2640 capture separately the standard output and error of a command.
2630 After a comment from dang on the mailing lists. This code is
2641 After a comment from dang on the mailing lists. This code is
2631 basically a modified version of commands.getstatusoutput(), from
2642 basically a modified version of commands.getstatusoutput(), from
2632 the standard library.
2643 the standard library.
2633
2644
2634 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2645 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2635 '!!' as a special syntax (shorthand) to access @sx.
2646 '!!' as a special syntax (shorthand) to access @sx.
2636
2647
2637 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2648 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2638 command and return its output as a list split on '\n'.
2649 command and return its output as a list split on '\n'.
2639
2650
2640 2004-03-31 Fernando Perez <fperez@colorado.edu>
2651 2004-03-31 Fernando Perez <fperez@colorado.edu>
2641
2652
2642 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2653 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2643 method to dictionaries used as FakeModule instances if they lack
2654 method to dictionaries used as FakeModule instances if they lack
2644 it. At least pydoc in python2.3 breaks for runtime-defined
2655 it. At least pydoc in python2.3 breaks for runtime-defined
2645 functions without this hack. At some point I need to _really_
2656 functions without this hack. At some point I need to _really_
2646 understand what FakeModule is doing, because it's a gross hack.
2657 understand what FakeModule is doing, because it's a gross hack.
2647 But it solves Arnd's problem for now...
2658 But it solves Arnd's problem for now...
2648
2659
2649 2004-02-27 Fernando Perez <fperez@colorado.edu>
2660 2004-02-27 Fernando Perez <fperez@colorado.edu>
2650
2661
2651 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2662 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2652 mode would behave erratically. Also increased the number of
2663 mode would behave erratically. Also increased the number of
2653 possible logs in rotate mod to 999. Thanks to Rod Holland
2664 possible logs in rotate mod to 999. Thanks to Rod Holland
2654 <rhh@StructureLABS.com> for the report and fixes.
2665 <rhh@StructureLABS.com> for the report and fixes.
2655
2666
2656 2004-02-26 Fernando Perez <fperez@colorado.edu>
2667 2004-02-26 Fernando Perez <fperez@colorado.edu>
2657
2668
2658 * IPython/genutils.py (page): Check that the curses module really
2669 * IPython/genutils.py (page): Check that the curses module really
2659 has the initscr attribute before trying to use it. For some
2670 has the initscr attribute before trying to use it. For some
2660 reason, the Solaris curses module is missing this. I think this
2671 reason, the Solaris curses module is missing this. I think this
2661 should be considered a Solaris python bug, but I'm not sure.
2672 should be considered a Solaris python bug, but I'm not sure.
2662
2673
2663 2004-01-17 Fernando Perez <fperez@colorado.edu>
2674 2004-01-17 Fernando Perez <fperez@colorado.edu>
2664
2675
2665 * IPython/genutils.py (Stream.__init__): Changes to try to make
2676 * IPython/genutils.py (Stream.__init__): Changes to try to make
2666 ipython robust against stdin/out/err being closed by the user.
2677 ipython robust against stdin/out/err being closed by the user.
2667 This is 'user error' (and blocks a normal python session, at least
2678 This is 'user error' (and blocks a normal python session, at least
2668 the stdout case). However, Ipython should be able to survive such
2679 the stdout case). However, Ipython should be able to survive such
2669 instances of abuse as gracefully as possible. To simplify the
2680 instances of abuse as gracefully as possible. To simplify the
2670 coding and maintain compatibility with Gary Bishop's Term
2681 coding and maintain compatibility with Gary Bishop's Term
2671 contributions, I've made use of classmethods for this. I think
2682 contributions, I've made use of classmethods for this. I think
2672 this introduces a dependency on python 2.2.
2683 this introduces a dependency on python 2.2.
2673
2684
2674 2004-01-13 Fernando Perez <fperez@colorado.edu>
2685 2004-01-13 Fernando Perez <fperez@colorado.edu>
2675
2686
2676 * IPython/numutils.py (exp_safe): simplified the code a bit and
2687 * IPython/numutils.py (exp_safe): simplified the code a bit and
2677 removed the need for importing the kinds module altogether.
2688 removed the need for importing the kinds module altogether.
2678
2689
2679 2004-01-06 Fernando Perez <fperez@colorado.edu>
2690 2004-01-06 Fernando Perez <fperez@colorado.edu>
2680
2691
2681 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2692 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2682 a magic function instead, after some community feedback. No
2693 a magic function instead, after some community feedback. No
2683 special syntax will exist for it, but its name is deliberately
2694 special syntax will exist for it, but its name is deliberately
2684 very short.
2695 very short.
2685
2696
2686 2003-12-20 Fernando Perez <fperez@colorado.edu>
2697 2003-12-20 Fernando Perez <fperez@colorado.edu>
2687
2698
2688 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2699 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2689 new functionality, to automagically assign the result of a shell
2700 new functionality, to automagically assign the result of a shell
2690 command to a variable. I'll solicit some community feedback on
2701 command to a variable. I'll solicit some community feedback on
2691 this before making it permanent.
2702 this before making it permanent.
2692
2703
2693 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2704 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2694 requested about callables for which inspect couldn't obtain a
2705 requested about callables for which inspect couldn't obtain a
2695 proper argspec. Thanks to a crash report sent by Etienne
2706 proper argspec. Thanks to a crash report sent by Etienne
2696 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2707 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2697
2708
2698 2003-12-09 Fernando Perez <fperez@colorado.edu>
2709 2003-12-09 Fernando Perez <fperez@colorado.edu>
2699
2710
2700 * IPython/genutils.py (page): patch for the pager to work across
2711 * IPython/genutils.py (page): patch for the pager to work across
2701 various versions of Windows. By Gary Bishop.
2712 various versions of Windows. By Gary Bishop.
2702
2713
2703 2003-12-04 Fernando Perez <fperez@colorado.edu>
2714 2003-12-04 Fernando Perez <fperez@colorado.edu>
2704
2715
2705 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2716 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2706 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2717 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2707 While I tested this and it looks ok, there may still be corner
2718 While I tested this and it looks ok, there may still be corner
2708 cases I've missed.
2719 cases I've missed.
2709
2720
2710 2003-12-01 Fernando Perez <fperez@colorado.edu>
2721 2003-12-01 Fernando Perez <fperez@colorado.edu>
2711
2722
2712 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2723 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2713 where a line like 'p,q=1,2' would fail because the automagic
2724 where a line like 'p,q=1,2' would fail because the automagic
2714 system would be triggered for @p.
2725 system would be triggered for @p.
2715
2726
2716 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2727 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2717 cleanups, code unmodified.
2728 cleanups, code unmodified.
2718
2729
2719 * IPython/genutils.py (Term): added a class for IPython to handle
2730 * IPython/genutils.py (Term): added a class for IPython to handle
2720 output. In most cases it will just be a proxy for stdout/err, but
2731 output. In most cases it will just be a proxy for stdout/err, but
2721 having this allows modifications to be made for some platforms,
2732 having this allows modifications to be made for some platforms,
2722 such as handling color escapes under Windows. All of this code
2733 such as handling color escapes under Windows. All of this code
2723 was contributed by Gary Bishop, with minor modifications by me.
2734 was contributed by Gary Bishop, with minor modifications by me.
2724 The actual changes affect many files.
2735 The actual changes affect many files.
2725
2736
2726 2003-11-30 Fernando Perez <fperez@colorado.edu>
2737 2003-11-30 Fernando Perez <fperez@colorado.edu>
2727
2738
2728 * IPython/iplib.py (file_matches): new completion code, courtesy
2739 * IPython/iplib.py (file_matches): new completion code, courtesy
2729 of Jeff Collins. This enables filename completion again under
2740 of Jeff Collins. This enables filename completion again under
2730 python 2.3, which disabled it at the C level.
2741 python 2.3, which disabled it at the C level.
2731
2742
2732 2003-11-11 Fernando Perez <fperez@colorado.edu>
2743 2003-11-11 Fernando Perez <fperez@colorado.edu>
2733
2744
2734 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2745 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2735 for Numeric.array(map(...)), but often convenient.
2746 for Numeric.array(map(...)), but often convenient.
2736
2747
2737 2003-11-05 Fernando Perez <fperez@colorado.edu>
2748 2003-11-05 Fernando Perez <fperez@colorado.edu>
2738
2749
2739 * IPython/numutils.py (frange): Changed a call from int() to
2750 * IPython/numutils.py (frange): Changed a call from int() to
2740 int(round()) to prevent a problem reported with arange() in the
2751 int(round()) to prevent a problem reported with arange() in the
2741 numpy list.
2752 numpy list.
2742
2753
2743 2003-10-06 Fernando Perez <fperez@colorado.edu>
2754 2003-10-06 Fernando Perez <fperez@colorado.edu>
2744
2755
2745 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2756 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2746 prevent crashes if sys lacks an argv attribute (it happens with
2757 prevent crashes if sys lacks an argv attribute (it happens with
2747 embedded interpreters which build a bare-bones sys module).
2758 embedded interpreters which build a bare-bones sys module).
2748 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2759 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2749
2760
2750 2003-09-24 Fernando Perez <fperez@colorado.edu>
2761 2003-09-24 Fernando Perez <fperez@colorado.edu>
2751
2762
2752 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2763 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2753 to protect against poorly written user objects where __getattr__
2764 to protect against poorly written user objects where __getattr__
2754 raises exceptions other than AttributeError. Thanks to a bug
2765 raises exceptions other than AttributeError. Thanks to a bug
2755 report by Oliver Sander <osander-AT-gmx.de>.
2766 report by Oliver Sander <osander-AT-gmx.de>.
2756
2767
2757 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2768 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2758 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2769 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2759
2770
2760 2003-09-09 Fernando Perez <fperez@colorado.edu>
2771 2003-09-09 Fernando Perez <fperez@colorado.edu>
2761
2772
2762 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2773 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2763 unpacking a list whith a callable as first element would
2774 unpacking a list whith a callable as first element would
2764 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2775 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2765 Collins.
2776 Collins.
2766
2777
2767 2003-08-25 *** Released version 0.5.0
2778 2003-08-25 *** Released version 0.5.0
2768
2779
2769 2003-08-22 Fernando Perez <fperez@colorado.edu>
2780 2003-08-22 Fernando Perez <fperez@colorado.edu>
2770
2781
2771 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2782 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2772 improperly defined user exceptions. Thanks to feedback from Mark
2783 improperly defined user exceptions. Thanks to feedback from Mark
2773 Russell <mrussell-AT-verio.net>.
2784 Russell <mrussell-AT-verio.net>.
2774
2785
2775 2003-08-20 Fernando Perez <fperez@colorado.edu>
2786 2003-08-20 Fernando Perez <fperez@colorado.edu>
2776
2787
2777 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2788 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2778 printing so that it would print multi-line string forms starting
2789 printing so that it would print multi-line string forms starting
2779 with a new line. This way the formatting is better respected for
2790 with a new line. This way the formatting is better respected for
2780 objects which work hard to make nice string forms.
2791 objects which work hard to make nice string forms.
2781
2792
2782 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2793 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2783 autocall would overtake data access for objects with both
2794 autocall would overtake data access for objects with both
2784 __getitem__ and __call__.
2795 __getitem__ and __call__.
2785
2796
2786 2003-08-19 *** Released version 0.5.0-rc1
2797 2003-08-19 *** Released version 0.5.0-rc1
2787
2798
2788 2003-08-19 Fernando Perez <fperez@colorado.edu>
2799 2003-08-19 Fernando Perez <fperez@colorado.edu>
2789
2800
2790 * IPython/deep_reload.py (load_tail): single tiny change here
2801 * IPython/deep_reload.py (load_tail): single tiny change here
2791 seems to fix the long-standing bug of dreload() failing to work
2802 seems to fix the long-standing bug of dreload() failing to work
2792 for dotted names. But this module is pretty tricky, so I may have
2803 for dotted names. But this module is pretty tricky, so I may have
2793 missed some subtlety. Needs more testing!.
2804 missed some subtlety. Needs more testing!.
2794
2805
2795 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2806 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2796 exceptions which have badly implemented __str__ methods.
2807 exceptions which have badly implemented __str__ methods.
2797 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2808 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2798 which I've been getting reports about from Python 2.3 users. I
2809 which I've been getting reports about from Python 2.3 users. I
2799 wish I had a simple test case to reproduce the problem, so I could
2810 wish I had a simple test case to reproduce the problem, so I could
2800 either write a cleaner workaround or file a bug report if
2811 either write a cleaner workaround or file a bug report if
2801 necessary.
2812 necessary.
2802
2813
2803 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2814 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2804 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2815 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2805 a bug report by Tjabo Kloppenburg.
2816 a bug report by Tjabo Kloppenburg.
2806
2817
2807 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2818 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2808 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2819 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2809 seems rather unstable. Thanks to a bug report by Tjabo
2820 seems rather unstable. Thanks to a bug report by Tjabo
2810 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2821 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2811
2822
2812 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2823 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2813 this out soon because of the critical fixes in the inner loop for
2824 this out soon because of the critical fixes in the inner loop for
2814 generators.
2825 generators.
2815
2826
2816 * IPython/Magic.py (Magic.getargspec): removed. This (and
2827 * IPython/Magic.py (Magic.getargspec): removed. This (and
2817 _get_def) have been obsoleted by OInspect for a long time, I
2828 _get_def) have been obsoleted by OInspect for a long time, I
2818 hadn't noticed that they were dead code.
2829 hadn't noticed that they were dead code.
2819 (Magic._ofind): restored _ofind functionality for a few literals
2830 (Magic._ofind): restored _ofind functionality for a few literals
2820 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2831 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2821 for things like "hello".capitalize?, since that would require a
2832 for things like "hello".capitalize?, since that would require a
2822 potentially dangerous eval() again.
2833 potentially dangerous eval() again.
2823
2834
2824 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2835 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2825 logic a bit more to clean up the escapes handling and minimize the
2836 logic a bit more to clean up the escapes handling and minimize the
2826 use of _ofind to only necessary cases. The interactive 'feel' of
2837 use of _ofind to only necessary cases. The interactive 'feel' of
2827 IPython should have improved quite a bit with the changes in
2838 IPython should have improved quite a bit with the changes in
2828 _prefilter and _ofind (besides being far safer than before).
2839 _prefilter and _ofind (besides being far safer than before).
2829
2840
2830 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2841 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2831 obscure, never reported). Edit would fail to find the object to
2842 obscure, never reported). Edit would fail to find the object to
2832 edit under some circumstances.
2843 edit under some circumstances.
2833 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2844 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2834 which were causing double-calling of generators. Those eval calls
2845 which were causing double-calling of generators. Those eval calls
2835 were _very_ dangerous, since code with side effects could be
2846 were _very_ dangerous, since code with side effects could be
2836 triggered. As they say, 'eval is evil'... These were the
2847 triggered. As they say, 'eval is evil'... These were the
2837 nastiest evals in IPython. Besides, _ofind is now far simpler,
2848 nastiest evals in IPython. Besides, _ofind is now far simpler,
2838 and it should also be quite a bit faster. Its use of inspect is
2849 and it should also be quite a bit faster. Its use of inspect is
2839 also safer, so perhaps some of the inspect-related crashes I've
2850 also safer, so perhaps some of the inspect-related crashes I've
2840 seen lately with Python 2.3 might be taken care of. That will
2851 seen lately with Python 2.3 might be taken care of. That will
2841 need more testing.
2852 need more testing.
2842
2853
2843 2003-08-17 Fernando Perez <fperez@colorado.edu>
2854 2003-08-17 Fernando Perez <fperez@colorado.edu>
2844
2855
2845 * IPython/iplib.py (InteractiveShell._prefilter): significant
2856 * IPython/iplib.py (InteractiveShell._prefilter): significant
2846 simplifications to the logic for handling user escapes. Faster
2857 simplifications to the logic for handling user escapes. Faster
2847 and simpler code.
2858 and simpler code.
2848
2859
2849 2003-08-14 Fernando Perez <fperez@colorado.edu>
2860 2003-08-14 Fernando Perez <fperez@colorado.edu>
2850
2861
2851 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2862 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2852 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2863 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2853 but it should be quite a bit faster. And the recursive version
2864 but it should be quite a bit faster. And the recursive version
2854 generated O(log N) intermediate storage for all rank>1 arrays,
2865 generated O(log N) intermediate storage for all rank>1 arrays,
2855 even if they were contiguous.
2866 even if they were contiguous.
2856 (l1norm): Added this function.
2867 (l1norm): Added this function.
2857 (norm): Added this function for arbitrary norms (including
2868 (norm): Added this function for arbitrary norms (including
2858 l-infinity). l1 and l2 are still special cases for convenience
2869 l-infinity). l1 and l2 are still special cases for convenience
2859 and speed.
2870 and speed.
2860
2871
2861 2003-08-03 Fernando Perez <fperez@colorado.edu>
2872 2003-08-03 Fernando Perez <fperez@colorado.edu>
2862
2873
2863 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2874 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2864 exceptions, which now raise PendingDeprecationWarnings in Python
2875 exceptions, which now raise PendingDeprecationWarnings in Python
2865 2.3. There were some in Magic and some in Gnuplot2.
2876 2.3. There were some in Magic and some in Gnuplot2.
2866
2877
2867 2003-06-30 Fernando Perez <fperez@colorado.edu>
2878 2003-06-30 Fernando Perez <fperez@colorado.edu>
2868
2879
2869 * IPython/genutils.py (page): modified to call curses only for
2880 * IPython/genutils.py (page): modified to call curses only for
2870 terminals where TERM=='xterm'. After problems under many other
2881 terminals where TERM=='xterm'. After problems under many other
2871 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2882 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2872
2883
2873 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2884 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2874 would be triggered when readline was absent. This was just an old
2885 would be triggered when readline was absent. This was just an old
2875 debugging statement I'd forgotten to take out.
2886 debugging statement I'd forgotten to take out.
2876
2887
2877 2003-06-20 Fernando Perez <fperez@colorado.edu>
2888 2003-06-20 Fernando Perez <fperez@colorado.edu>
2878
2889
2879 * IPython/genutils.py (clock): modified to return only user time
2890 * IPython/genutils.py (clock): modified to return only user time
2880 (not counting system time), after a discussion on scipy. While
2891 (not counting system time), after a discussion on scipy. While
2881 system time may be a useful quantity occasionally, it may much
2892 system time may be a useful quantity occasionally, it may much
2882 more easily be skewed by occasional swapping or other similar
2893 more easily be skewed by occasional swapping or other similar
2883 activity.
2894 activity.
2884
2895
2885 2003-06-05 Fernando Perez <fperez@colorado.edu>
2896 2003-06-05 Fernando Perez <fperez@colorado.edu>
2886
2897
2887 * IPython/numutils.py (identity): new function, for building
2898 * IPython/numutils.py (identity): new function, for building
2888 arbitrary rank Kronecker deltas (mostly backwards compatible with
2899 arbitrary rank Kronecker deltas (mostly backwards compatible with
2889 Numeric.identity)
2900 Numeric.identity)
2890
2901
2891 2003-06-03 Fernando Perez <fperez@colorado.edu>
2902 2003-06-03 Fernando Perez <fperez@colorado.edu>
2892
2903
2893 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2904 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2894 arguments passed to magics with spaces, to allow trailing '\' to
2905 arguments passed to magics with spaces, to allow trailing '\' to
2895 work normally (mainly for Windows users).
2906 work normally (mainly for Windows users).
2896
2907
2897 2003-05-29 Fernando Perez <fperez@colorado.edu>
2908 2003-05-29 Fernando Perez <fperez@colorado.edu>
2898
2909
2899 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2910 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2900 instead of pydoc.help. This fixes a bizarre behavior where
2911 instead of pydoc.help. This fixes a bizarre behavior where
2901 printing '%s' % locals() would trigger the help system. Now
2912 printing '%s' % locals() would trigger the help system. Now
2902 ipython behaves like normal python does.
2913 ipython behaves like normal python does.
2903
2914
2904 Note that if one does 'from pydoc import help', the bizarre
2915 Note that if one does 'from pydoc import help', the bizarre
2905 behavior returns, but this will also happen in normal python, so
2916 behavior returns, but this will also happen in normal python, so
2906 it's not an ipython bug anymore (it has to do with how pydoc.help
2917 it's not an ipython bug anymore (it has to do with how pydoc.help
2907 is implemented).
2918 is implemented).
2908
2919
2909 2003-05-22 Fernando Perez <fperez@colorado.edu>
2920 2003-05-22 Fernando Perez <fperez@colorado.edu>
2910
2921
2911 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2922 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2912 return [] instead of None when nothing matches, also match to end
2923 return [] instead of None when nothing matches, also match to end
2913 of line. Patch by Gary Bishop.
2924 of line. Patch by Gary Bishop.
2914
2925
2915 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2926 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2916 protection as before, for files passed on the command line. This
2927 protection as before, for files passed on the command line. This
2917 prevents the CrashHandler from kicking in if user files call into
2928 prevents the CrashHandler from kicking in if user files call into
2918 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2929 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2919 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2930 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2920
2931
2921 2003-05-20 *** Released version 0.4.0
2932 2003-05-20 *** Released version 0.4.0
2922
2933
2923 2003-05-20 Fernando Perez <fperez@colorado.edu>
2934 2003-05-20 Fernando Perez <fperez@colorado.edu>
2924
2935
2925 * setup.py: added support for manpages. It's a bit hackish b/c of
2936 * setup.py: added support for manpages. It's a bit hackish b/c of
2926 a bug in the way the bdist_rpm distutils target handles gzipped
2937 a bug in the way the bdist_rpm distutils target handles gzipped
2927 manpages, but it works. After a patch by Jack.
2938 manpages, but it works. After a patch by Jack.
2928
2939
2929 2003-05-19 Fernando Perez <fperez@colorado.edu>
2940 2003-05-19 Fernando Perez <fperez@colorado.edu>
2930
2941
2931 * IPython/numutils.py: added a mockup of the kinds module, since
2942 * IPython/numutils.py: added a mockup of the kinds module, since
2932 it was recently removed from Numeric. This way, numutils will
2943 it was recently removed from Numeric. This way, numutils will
2933 work for all users even if they are missing kinds.
2944 work for all users even if they are missing kinds.
2934
2945
2935 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2946 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2936 failure, which can occur with SWIG-wrapped extensions. After a
2947 failure, which can occur with SWIG-wrapped extensions. After a
2937 crash report from Prabhu.
2948 crash report from Prabhu.
2938
2949
2939 2003-05-16 Fernando Perez <fperez@colorado.edu>
2950 2003-05-16 Fernando Perez <fperez@colorado.edu>
2940
2951
2941 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2952 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2942 protect ipython from user code which may call directly
2953 protect ipython from user code which may call directly
2943 sys.excepthook (this looks like an ipython crash to the user, even
2954 sys.excepthook (this looks like an ipython crash to the user, even
2944 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2955 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2945 This is especially important to help users of WxWindows, but may
2956 This is especially important to help users of WxWindows, but may
2946 also be useful in other cases.
2957 also be useful in other cases.
2947
2958
2948 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2959 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2949 an optional tb_offset to be specified, and to preserve exception
2960 an optional tb_offset to be specified, and to preserve exception
2950 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2961 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2951
2962
2952 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2963 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2953
2964
2954 2003-05-15 Fernando Perez <fperez@colorado.edu>
2965 2003-05-15 Fernando Perez <fperez@colorado.edu>
2955
2966
2956 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2967 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2957 installing for a new user under Windows.
2968 installing for a new user under Windows.
2958
2969
2959 2003-05-12 Fernando Perez <fperez@colorado.edu>
2970 2003-05-12 Fernando Perez <fperez@colorado.edu>
2960
2971
2961 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2972 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2962 handler for Emacs comint-based lines. Currently it doesn't do
2973 handler for Emacs comint-based lines. Currently it doesn't do
2963 much (but importantly, it doesn't update the history cache). In
2974 much (but importantly, it doesn't update the history cache). In
2964 the future it may be expanded if Alex needs more functionality
2975 the future it may be expanded if Alex needs more functionality
2965 there.
2976 there.
2966
2977
2967 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2978 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2968 info to crash reports.
2979 info to crash reports.
2969
2980
2970 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2981 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2971 just like Python's -c. Also fixed crash with invalid -color
2982 just like Python's -c. Also fixed crash with invalid -color
2972 option value at startup. Thanks to Will French
2983 option value at startup. Thanks to Will French
2973 <wfrench-AT-bestweb.net> for the bug report.
2984 <wfrench-AT-bestweb.net> for the bug report.
2974
2985
2975 2003-05-09 Fernando Perez <fperez@colorado.edu>
2986 2003-05-09 Fernando Perez <fperez@colorado.edu>
2976
2987
2977 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2988 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2978 to EvalDict (it's a mapping, after all) and simplified its code
2989 to EvalDict (it's a mapping, after all) and simplified its code
2979 quite a bit, after a nice discussion on c.l.py where Gustavo
2990 quite a bit, after a nice discussion on c.l.py where Gustavo
2980 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
2991 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
2981
2992
2982 2003-04-30 Fernando Perez <fperez@colorado.edu>
2993 2003-04-30 Fernando Perez <fperez@colorado.edu>
2983
2994
2984 * IPython/genutils.py (timings_out): modified it to reduce its
2995 * IPython/genutils.py (timings_out): modified it to reduce its
2985 overhead in the common reps==1 case.
2996 overhead in the common reps==1 case.
2986
2997
2987 2003-04-29 Fernando Perez <fperez@colorado.edu>
2998 2003-04-29 Fernando Perez <fperez@colorado.edu>
2988
2999
2989 * IPython/genutils.py (timings_out): Modified to use the resource
3000 * IPython/genutils.py (timings_out): Modified to use the resource
2990 module, which avoids the wraparound problems of time.clock().
3001 module, which avoids the wraparound problems of time.clock().
2991
3002
2992 2003-04-17 *** Released version 0.2.15pre4
3003 2003-04-17 *** Released version 0.2.15pre4
2993
3004
2994 2003-04-17 Fernando Perez <fperez@colorado.edu>
3005 2003-04-17 Fernando Perez <fperez@colorado.edu>
2995
3006
2996 * setup.py (scriptfiles): Split windows-specific stuff over to a
3007 * setup.py (scriptfiles): Split windows-specific stuff over to a
2997 separate file, in an attempt to have a Windows GUI installer.
3008 separate file, in an attempt to have a Windows GUI installer.
2998 That didn't work, but part of the groundwork is done.
3009 That didn't work, but part of the groundwork is done.
2999
3010
3000 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3011 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
3001 indent/unindent with 4 spaces. Particularly useful in combination
3012 indent/unindent with 4 spaces. Particularly useful in combination
3002 with the new auto-indent option.
3013 with the new auto-indent option.
3003
3014
3004 2003-04-16 Fernando Perez <fperez@colorado.edu>
3015 2003-04-16 Fernando Perez <fperez@colorado.edu>
3005
3016
3006 * IPython/Magic.py: various replacements of self.rc for
3017 * IPython/Magic.py: various replacements of self.rc for
3007 self.shell.rc. A lot more remains to be done to fully disentangle
3018 self.shell.rc. A lot more remains to be done to fully disentangle
3008 this class from the main Shell class.
3019 this class from the main Shell class.
3009
3020
3010 * IPython/GnuplotRuntime.py: added checks for mouse support so
3021 * IPython/GnuplotRuntime.py: added checks for mouse support so
3011 that we don't try to enable it if the current gnuplot doesn't
3022 that we don't try to enable it if the current gnuplot doesn't
3012 really support it. Also added checks so that we don't try to
3023 really support it. Also added checks so that we don't try to
3013 enable persist under Windows (where Gnuplot doesn't recognize the
3024 enable persist under Windows (where Gnuplot doesn't recognize the
3014 option).
3025 option).
3015
3026
3016 * IPython/iplib.py (InteractiveShell.interact): Added optional
3027 * IPython/iplib.py (InteractiveShell.interact): Added optional
3017 auto-indenting code, after a patch by King C. Shu
3028 auto-indenting code, after a patch by King C. Shu
3018 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3029 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
3019 get along well with pasting indented code. If I ever figure out
3030 get along well with pasting indented code. If I ever figure out
3020 how to make that part go well, it will become on by default.
3031 how to make that part go well, it will become on by default.
3021
3032
3022 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3033 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
3023 crash ipython if there was an unmatched '%' in the user's prompt
3034 crash ipython if there was an unmatched '%' in the user's prompt
3024 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3035 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3025
3036
3026 * IPython/iplib.py (InteractiveShell.interact): removed the
3037 * IPython/iplib.py (InteractiveShell.interact): removed the
3027 ability to ask the user whether he wants to crash or not at the
3038 ability to ask the user whether he wants to crash or not at the
3028 'last line' exception handler. Calling functions at that point
3039 'last line' exception handler. Calling functions at that point
3029 changes the stack, and the error reports would have incorrect
3040 changes the stack, and the error reports would have incorrect
3030 tracebacks.
3041 tracebacks.
3031
3042
3032 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3043 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
3033 pass through a peger a pretty-printed form of any object. After a
3044 pass through a peger a pretty-printed form of any object. After a
3034 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3045 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
3035
3046
3036 2003-04-14 Fernando Perez <fperez@colorado.edu>
3047 2003-04-14 Fernando Perez <fperez@colorado.edu>
3037
3048
3038 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3049 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
3039 all files in ~ would be modified at first install (instead of
3050 all files in ~ would be modified at first install (instead of
3040 ~/.ipython). This could be potentially disastrous, as the
3051 ~/.ipython). This could be potentially disastrous, as the
3041 modification (make line-endings native) could damage binary files.
3052 modification (make line-endings native) could damage binary files.
3042
3053
3043 2003-04-10 Fernando Perez <fperez@colorado.edu>
3054 2003-04-10 Fernando Perez <fperez@colorado.edu>
3044
3055
3045 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3056 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
3046 handle only lines which are invalid python. This now means that
3057 handle only lines which are invalid python. This now means that
3047 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3058 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
3048 for the bug report.
3059 for the bug report.
3049
3060
3050 2003-04-01 Fernando Perez <fperez@colorado.edu>
3061 2003-04-01 Fernando Perez <fperez@colorado.edu>
3051
3062
3052 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3063 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
3053 where failing to set sys.last_traceback would crash pdb.pm().
3064 where failing to set sys.last_traceback would crash pdb.pm().
3054 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3065 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
3055 report.
3066 report.
3056
3067
3057 2003-03-25 Fernando Perez <fperez@colorado.edu>
3068 2003-03-25 Fernando Perez <fperez@colorado.edu>
3058
3069
3059 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3070 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
3060 before printing it (it had a lot of spurious blank lines at the
3071 before printing it (it had a lot of spurious blank lines at the
3061 end).
3072 end).
3062
3073
3063 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3074 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
3064 output would be sent 21 times! Obviously people don't use this
3075 output would be sent 21 times! Obviously people don't use this
3065 too often, or I would have heard about it.
3076 too often, or I would have heard about it.
3066
3077
3067 2003-03-24 Fernando Perez <fperez@colorado.edu>
3078 2003-03-24 Fernando Perez <fperez@colorado.edu>
3068
3079
3069 * setup.py (scriptfiles): renamed the data_files parameter from
3080 * setup.py (scriptfiles): renamed the data_files parameter from
3070 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3081 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
3071 for the patch.
3082 for the patch.
3072
3083
3073 2003-03-20 Fernando Perez <fperez@colorado.edu>
3084 2003-03-20 Fernando Perez <fperez@colorado.edu>
3074
3085
3075 * IPython/genutils.py (error): added error() and fatal()
3086 * IPython/genutils.py (error): added error() and fatal()
3076 functions.
3087 functions.
3077
3088
3078 2003-03-18 *** Released version 0.2.15pre3
3089 2003-03-18 *** Released version 0.2.15pre3
3079
3090
3080 2003-03-18 Fernando Perez <fperez@colorado.edu>
3091 2003-03-18 Fernando Perez <fperez@colorado.edu>
3081
3092
3082 * setupext/install_data_ext.py
3093 * setupext/install_data_ext.py
3083 (install_data_ext.initialize_options): Class contributed by Jack
3094 (install_data_ext.initialize_options): Class contributed by Jack
3084 Moffit for fixing the old distutils hack. He is sending this to
3095 Moffit for fixing the old distutils hack. He is sending this to
3085 the distutils folks so in the future we may not need it as a
3096 the distutils folks so in the future we may not need it as a
3086 private fix.
3097 private fix.
3087
3098
3088 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3099 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
3089 changes for Debian packaging. See his patch for full details.
3100 changes for Debian packaging. See his patch for full details.
3090 The old distutils hack of making the ipythonrc* files carry a
3101 The old distutils hack of making the ipythonrc* files carry a
3091 bogus .py extension is gone, at last. Examples were moved to a
3102 bogus .py extension is gone, at last. Examples were moved to a
3092 separate subdir under doc/, and the separate executable scripts
3103 separate subdir under doc/, and the separate executable scripts
3093 now live in their own directory. Overall a great cleanup. The
3104 now live in their own directory. Overall a great cleanup. The
3094 manual was updated to use the new files, and setup.py has been
3105 manual was updated to use the new files, and setup.py has been
3095 fixed for this setup.
3106 fixed for this setup.
3096
3107
3097 * IPython/PyColorize.py (Parser.usage): made non-executable and
3108 * IPython/PyColorize.py (Parser.usage): made non-executable and
3098 created a pycolor wrapper around it to be included as a script.
3109 created a pycolor wrapper around it to be included as a script.
3099
3110
3100 2003-03-12 *** Released version 0.2.15pre2
3111 2003-03-12 *** Released version 0.2.15pre2
3101
3112
3102 2003-03-12 Fernando Perez <fperez@colorado.edu>
3113 2003-03-12 Fernando Perez <fperez@colorado.edu>
3103
3114
3104 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3115 * IPython/ColorANSI.py (make_color_table): Finally fixed the
3105 long-standing problem with garbage characters in some terminals.
3116 long-standing problem with garbage characters in some terminals.
3106 The issue was really that the \001 and \002 escapes must _only_ be
3117 The issue was really that the \001 and \002 escapes must _only_ be
3107 passed to input prompts (which call readline), but _never_ to
3118 passed to input prompts (which call readline), but _never_ to
3108 normal text to be printed on screen. I changed ColorANSI to have
3119 normal text to be printed on screen. I changed ColorANSI to have
3109 two classes: TermColors and InputTermColors, each with the
3120 two classes: TermColors and InputTermColors, each with the
3110 appropriate escapes for input prompts or normal text. The code in
3121 appropriate escapes for input prompts or normal text. The code in
3111 Prompts.py got slightly more complicated, but this very old and
3122 Prompts.py got slightly more complicated, but this very old and
3112 annoying bug is finally fixed.
3123 annoying bug is finally fixed.
3113
3124
3114 All the credit for nailing down the real origin of this problem
3125 All the credit for nailing down the real origin of this problem
3115 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3126 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
3116 *Many* thanks to him for spending quite a bit of effort on this.
3127 *Many* thanks to him for spending quite a bit of effort on this.
3117
3128
3118 2003-03-05 *** Released version 0.2.15pre1
3129 2003-03-05 *** Released version 0.2.15pre1
3119
3130
3120 2003-03-03 Fernando Perez <fperez@colorado.edu>
3131 2003-03-03 Fernando Perez <fperez@colorado.edu>
3121
3132
3122 * IPython/FakeModule.py: Moved the former _FakeModule to a
3133 * IPython/FakeModule.py: Moved the former _FakeModule to a
3123 separate file, because it's also needed by Magic (to fix a similar
3134 separate file, because it's also needed by Magic (to fix a similar
3124 pickle-related issue in @run).
3135 pickle-related issue in @run).
3125
3136
3126 2003-03-02 Fernando Perez <fperez@colorado.edu>
3137 2003-03-02 Fernando Perez <fperez@colorado.edu>
3127
3138
3128 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3139 * IPython/Magic.py (Magic.magic_autocall): new magic to control
3129 the autocall option at runtime.
3140 the autocall option at runtime.
3130 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3141 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
3131 across Magic.py to start separating Magic from InteractiveShell.
3142 across Magic.py to start separating Magic from InteractiveShell.
3132 (Magic._ofind): Fixed to return proper namespace for dotted
3143 (Magic._ofind): Fixed to return proper namespace for dotted
3133 names. Before, a dotted name would always return 'not currently
3144 names. Before, a dotted name would always return 'not currently
3134 defined', because it would find the 'parent'. s.x would be found,
3145 defined', because it would find the 'parent'. s.x would be found,
3135 but since 'x' isn't defined by itself, it would get confused.
3146 but since 'x' isn't defined by itself, it would get confused.
3136 (Magic.magic_run): Fixed pickling problems reported by Ralf
3147 (Magic.magic_run): Fixed pickling problems reported by Ralf
3137 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3148 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
3138 that I'd used when Mike Heeter reported similar issues at the
3149 that I'd used when Mike Heeter reported similar issues at the
3139 top-level, but now for @run. It boils down to injecting the
3150 top-level, but now for @run. It boils down to injecting the
3140 namespace where code is being executed with something that looks
3151 namespace where code is being executed with something that looks
3141 enough like a module to fool pickle.dump(). Since a pickle stores
3152 enough like a module to fool pickle.dump(). Since a pickle stores
3142 a named reference to the importing module, we need this for
3153 a named reference to the importing module, we need this for
3143 pickles to save something sensible.
3154 pickles to save something sensible.
3144
3155
3145 * IPython/ipmaker.py (make_IPython): added an autocall option.
3156 * IPython/ipmaker.py (make_IPython): added an autocall option.
3146
3157
3147 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3158 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
3148 the auto-eval code. Now autocalling is an option, and the code is
3159 the auto-eval code. Now autocalling is an option, and the code is
3149 also vastly safer. There is no more eval() involved at all.
3160 also vastly safer. There is no more eval() involved at all.
3150
3161
3151 2003-03-01 Fernando Perez <fperez@colorado.edu>
3162 2003-03-01 Fernando Perez <fperez@colorado.edu>
3152
3163
3153 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3164 * IPython/Magic.py (Magic._ofind): Changed interface to return a
3154 dict with named keys instead of a tuple.
3165 dict with named keys instead of a tuple.
3155
3166
3156 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3167 * IPython: Started using CVS for IPython as of 0.2.15pre1.
3157
3168
3158 * setup.py (make_shortcut): Fixed message about directories
3169 * setup.py (make_shortcut): Fixed message about directories
3159 created during Windows installation (the directories were ok, just
3170 created during Windows installation (the directories were ok, just
3160 the printed message was misleading). Thanks to Chris Liechti
3171 the printed message was misleading). Thanks to Chris Liechti
3161 <cliechti-AT-gmx.net> for the heads up.
3172 <cliechti-AT-gmx.net> for the heads up.
3162
3173
3163 2003-02-21 Fernando Perez <fperez@colorado.edu>
3174 2003-02-21 Fernando Perez <fperez@colorado.edu>
3164
3175
3165 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3176 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
3166 of ValueError exception when checking for auto-execution. This
3177 of ValueError exception when checking for auto-execution. This
3167 one is raised by things like Numeric arrays arr.flat when the
3178 one is raised by things like Numeric arrays arr.flat when the
3168 array is non-contiguous.
3179 array is non-contiguous.
3169
3180
3170 2003-01-31 Fernando Perez <fperez@colorado.edu>
3181 2003-01-31 Fernando Perez <fperez@colorado.edu>
3171
3182
3172 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3183 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
3173 not return any value at all (even though the command would get
3184 not return any value at all (even though the command would get
3174 executed).
3185 executed).
3175 (xsys): Flush stdout right after printing the command to ensure
3186 (xsys): Flush stdout right after printing the command to ensure
3176 proper ordering of commands and command output in the total
3187 proper ordering of commands and command output in the total
3177 output.
3188 output.
3178 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3189 (SystemExec/xsys/bq): Switched the names of xsys/bq and
3179 system/getoutput as defaults. The old ones are kept for
3190 system/getoutput as defaults. The old ones are kept for
3180 compatibility reasons, so no code which uses this library needs
3191 compatibility reasons, so no code which uses this library needs
3181 changing.
3192 changing.
3182
3193
3183 2003-01-27 *** Released version 0.2.14
3194 2003-01-27 *** Released version 0.2.14
3184
3195
3185 2003-01-25 Fernando Perez <fperez@colorado.edu>
3196 2003-01-25 Fernando Perez <fperez@colorado.edu>
3186
3197
3187 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3198 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
3188 functions defined in previous edit sessions could not be re-edited
3199 functions defined in previous edit sessions could not be re-edited
3189 (because the temp files were immediately removed). Now temp files
3200 (because the temp files were immediately removed). Now temp files
3190 are removed only at IPython's exit.
3201 are removed only at IPython's exit.
3191 (Magic.magic_run): Improved @run to perform shell-like expansions
3202 (Magic.magic_run): Improved @run to perform shell-like expansions
3192 on its arguments (~users and $VARS). With this, @run becomes more
3203 on its arguments (~users and $VARS). With this, @run becomes more
3193 like a normal command-line.
3204 like a normal command-line.
3194
3205
3195 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3206 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
3196 bugs related to embedding and cleaned up that code. A fairly
3207 bugs related to embedding and cleaned up that code. A fairly
3197 important one was the impossibility to access the global namespace
3208 important one was the impossibility to access the global namespace
3198 through the embedded IPython (only local variables were visible).
3209 through the embedded IPython (only local variables were visible).
3199
3210
3200 2003-01-14 Fernando Perez <fperez@colorado.edu>
3211 2003-01-14 Fernando Perez <fperez@colorado.edu>
3201
3212
3202 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3213 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
3203 auto-calling to be a bit more conservative. Now it doesn't get
3214 auto-calling to be a bit more conservative. Now it doesn't get
3204 triggered if any of '!=()<>' are in the rest of the input line, to
3215 triggered if any of '!=()<>' are in the rest of the input line, to
3205 allow comparing callables. Thanks to Alex for the heads up.
3216 allow comparing callables. Thanks to Alex for the heads up.
3206
3217
3207 2003-01-07 Fernando Perez <fperez@colorado.edu>
3218 2003-01-07 Fernando Perez <fperez@colorado.edu>
3208
3219
3209 * IPython/genutils.py (page): fixed estimation of the number of
3220 * IPython/genutils.py (page): fixed estimation of the number of
3210 lines in a string to be paged to simply count newlines. This
3221 lines in a string to be paged to simply count newlines. This
3211 prevents over-guessing due to embedded escape sequences. A better
3222 prevents over-guessing due to embedded escape sequences. A better
3212 long-term solution would involve stripping out the control chars
3223 long-term solution would involve stripping out the control chars
3213 for the count, but it's potentially so expensive I just don't
3224 for the count, but it's potentially so expensive I just don't
3214 think it's worth doing.
3225 think it's worth doing.
3215
3226
3216 2002-12-19 *** Released version 0.2.14pre50
3227 2002-12-19 *** Released version 0.2.14pre50
3217
3228
3218 2002-12-19 Fernando Perez <fperez@colorado.edu>
3229 2002-12-19 Fernando Perez <fperez@colorado.edu>
3219
3230
3220 * tools/release (version): Changed release scripts to inform
3231 * tools/release (version): Changed release scripts to inform
3221 Andrea and build a NEWS file with a list of recent changes.
3232 Andrea and build a NEWS file with a list of recent changes.
3222
3233
3223 * IPython/ColorANSI.py (__all__): changed terminal detection
3234 * IPython/ColorANSI.py (__all__): changed terminal detection
3224 code. Seems to work better for xterms without breaking
3235 code. Seems to work better for xterms without breaking
3225 konsole. Will need more testing to determine if WinXP and Mac OSX
3236 konsole. Will need more testing to determine if WinXP and Mac OSX
3226 also work ok.
3237 also work ok.
3227
3238
3228 2002-12-18 *** Released version 0.2.14pre49
3239 2002-12-18 *** Released version 0.2.14pre49
3229
3240
3230 2002-12-18 Fernando Perez <fperez@colorado.edu>
3241 2002-12-18 Fernando Perez <fperez@colorado.edu>
3231
3242
3232 * Docs: added new info about Mac OSX, from Andrea.
3243 * Docs: added new info about Mac OSX, from Andrea.
3233
3244
3234 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3245 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
3235 allow direct plotting of python strings whose format is the same
3246 allow direct plotting of python strings whose format is the same
3236 of gnuplot data files.
3247 of gnuplot data files.
3237
3248
3238 2002-12-16 Fernando Perez <fperez@colorado.edu>
3249 2002-12-16 Fernando Perez <fperez@colorado.edu>
3239
3250
3240 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3251 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
3241 value of exit question to be acknowledged.
3252 value of exit question to be acknowledged.
3242
3253
3243 2002-12-03 Fernando Perez <fperez@colorado.edu>
3254 2002-12-03 Fernando Perez <fperez@colorado.edu>
3244
3255
3245 * IPython/ipmaker.py: removed generators, which had been added
3256 * IPython/ipmaker.py: removed generators, which had been added
3246 by mistake in an earlier debugging run. This was causing trouble
3257 by mistake in an earlier debugging run. This was causing trouble
3247 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3258 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
3248 for pointing this out.
3259 for pointing this out.
3249
3260
3250 2002-11-17 Fernando Perez <fperez@colorado.edu>
3261 2002-11-17 Fernando Perez <fperez@colorado.edu>
3251
3262
3252 * Manual: updated the Gnuplot section.
3263 * Manual: updated the Gnuplot section.
3253
3264
3254 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3265 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
3255 a much better split of what goes in Runtime and what goes in
3266 a much better split of what goes in Runtime and what goes in
3256 Interactive.
3267 Interactive.
3257
3268
3258 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3269 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
3259 being imported from iplib.
3270 being imported from iplib.
3260
3271
3261 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3272 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
3262 for command-passing. Now the global Gnuplot instance is called
3273 for command-passing. Now the global Gnuplot instance is called
3263 'gp' instead of 'g', which was really a far too fragile and
3274 'gp' instead of 'g', which was really a far too fragile and
3264 common name.
3275 common name.
3265
3276
3266 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3277 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
3267 bounding boxes generated by Gnuplot for square plots.
3278 bounding boxes generated by Gnuplot for square plots.
3268
3279
3269 * IPython/genutils.py (popkey): new function added. I should
3280 * IPython/genutils.py (popkey): new function added. I should
3270 suggest this on c.l.py as a dict method, it seems useful.
3281 suggest this on c.l.py as a dict method, it seems useful.
3271
3282
3272 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3283 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
3273 to transparently handle PostScript generation. MUCH better than
3284 to transparently handle PostScript generation. MUCH better than
3274 the previous plot_eps/replot_eps (which I removed now). The code
3285 the previous plot_eps/replot_eps (which I removed now). The code
3275 is also fairly clean and well documented now (including
3286 is also fairly clean and well documented now (including
3276 docstrings).
3287 docstrings).
3277
3288
3278 2002-11-13 Fernando Perez <fperez@colorado.edu>
3289 2002-11-13 Fernando Perez <fperez@colorado.edu>
3279
3290
3280 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3291 * IPython/Magic.py (Magic.magic_edit): fixed docstring
3281 (inconsistent with options).
3292 (inconsistent with options).
3282
3293
3283 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3294 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
3284 manually disabled, I don't know why. Fixed it.
3295 manually disabled, I don't know why. Fixed it.
3285 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3296 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
3286 eps output.
3297 eps output.
3287
3298
3288 2002-11-12 Fernando Perez <fperez@colorado.edu>
3299 2002-11-12 Fernando Perez <fperez@colorado.edu>
3289
3300
3290 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3301 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
3291 don't propagate up to caller. Fixes crash reported by François
3302 don't propagate up to caller. Fixes crash reported by François
3292 Pinard.
3303 Pinard.
3293
3304
3294 2002-11-09 Fernando Perez <fperez@colorado.edu>
3305 2002-11-09 Fernando Perez <fperez@colorado.edu>
3295
3306
3296 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3307 * IPython/ipmaker.py (make_IPython): fixed problem with writing
3297 history file for new users.
3308 history file for new users.
3298 (make_IPython): fixed bug where initial install would leave the
3309 (make_IPython): fixed bug where initial install would leave the
3299 user running in the .ipython dir.
3310 user running in the .ipython dir.
3300 (make_IPython): fixed bug where config dir .ipython would be
3311 (make_IPython): fixed bug where config dir .ipython would be
3301 created regardless of the given -ipythondir option. Thanks to Cory
3312 created regardless of the given -ipythondir option. Thanks to Cory
3302 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3313 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
3303
3314
3304 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3315 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
3305 type confirmations. Will need to use it in all of IPython's code
3316 type confirmations. Will need to use it in all of IPython's code
3306 consistently.
3317 consistently.
3307
3318
3308 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3319 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
3309 context to print 31 lines instead of the default 5. This will make
3320 context to print 31 lines instead of the default 5. This will make
3310 the crash reports extremely detailed in case the problem is in
3321 the crash reports extremely detailed in case the problem is in
3311 libraries I don't have access to.
3322 libraries I don't have access to.
3312
3323
3313 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3324 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
3314 line of defense' code to still crash, but giving users fair
3325 line of defense' code to still crash, but giving users fair
3315 warning. I don't want internal errors to go unreported: if there's
3326 warning. I don't want internal errors to go unreported: if there's
3316 an internal problem, IPython should crash and generate a full
3327 an internal problem, IPython should crash and generate a full
3317 report.
3328 report.
3318
3329
3319 2002-11-08 Fernando Perez <fperez@colorado.edu>
3330 2002-11-08 Fernando Perez <fperez@colorado.edu>
3320
3331
3321 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3332 * IPython/iplib.py (InteractiveShell.interact): added code to trap
3322 otherwise uncaught exceptions which can appear if people set
3333 otherwise uncaught exceptions which can appear if people set
3323 sys.stdout to something badly broken. Thanks to a crash report
3334 sys.stdout to something badly broken. Thanks to a crash report
3324 from henni-AT-mail.brainbot.com.
3335 from henni-AT-mail.brainbot.com.
3325
3336
3326 2002-11-04 Fernando Perez <fperez@colorado.edu>
3337 2002-11-04 Fernando Perez <fperez@colorado.edu>
3327
3338
3328 * IPython/iplib.py (InteractiveShell.interact): added
3339 * IPython/iplib.py (InteractiveShell.interact): added
3329 __IPYTHON__active to the builtins. It's a flag which goes on when
3340 __IPYTHON__active to the builtins. It's a flag which goes on when
3330 the interaction starts and goes off again when it stops. This
3341 the interaction starts and goes off again when it stops. This
3331 allows embedding code to detect being inside IPython. Before this
3342 allows embedding code to detect being inside IPython. Before this
3332 was done via __IPYTHON__, but that only shows that an IPython
3343 was done via __IPYTHON__, but that only shows that an IPython
3333 instance has been created.
3344 instance has been created.
3334
3345
3335 * IPython/Magic.py (Magic.magic_env): I realized that in a
3346 * IPython/Magic.py (Magic.magic_env): I realized that in a
3336 UserDict, instance.data holds the data as a normal dict. So I
3347 UserDict, instance.data holds the data as a normal dict. So I
3337 modified @env to return os.environ.data instead of rebuilding a
3348 modified @env to return os.environ.data instead of rebuilding a
3338 dict by hand.
3349 dict by hand.
3339
3350
3340 2002-11-02 Fernando Perez <fperez@colorado.edu>
3351 2002-11-02 Fernando Perez <fperez@colorado.edu>
3341
3352
3342 * IPython/genutils.py (warn): changed so that level 1 prints no
3353 * IPython/genutils.py (warn): changed so that level 1 prints no
3343 header. Level 2 is now the default (with 'WARNING' header, as
3354 header. Level 2 is now the default (with 'WARNING' header, as
3344 before). I think I tracked all places where changes were needed in
3355 before). I think I tracked all places where changes were needed in
3345 IPython, but outside code using the old level numbering may have
3356 IPython, but outside code using the old level numbering may have
3346 broken.
3357 broken.
3347
3358
3348 * IPython/iplib.py (InteractiveShell.runcode): added this to
3359 * IPython/iplib.py (InteractiveShell.runcode): added this to
3349 handle the tracebacks in SystemExit traps correctly. The previous
3360 handle the tracebacks in SystemExit traps correctly. The previous
3350 code (through interact) was printing more of the stack than
3361 code (through interact) was printing more of the stack than
3351 necessary, showing IPython internal code to the user.
3362 necessary, showing IPython internal code to the user.
3352
3363
3353 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3364 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
3354 default. Now that the default at the confirmation prompt is yes,
3365 default. Now that the default at the confirmation prompt is yes,
3355 it's not so intrusive. François' argument that ipython sessions
3366 it's not so intrusive. François' argument that ipython sessions
3356 tend to be complex enough not to lose them from an accidental C-d,
3367 tend to be complex enough not to lose them from an accidental C-d,
3357 is a valid one.
3368 is a valid one.
3358
3369
3359 * IPython/iplib.py (InteractiveShell.interact): added a
3370 * IPython/iplib.py (InteractiveShell.interact): added a
3360 showtraceback() call to the SystemExit trap, and modified the exit
3371 showtraceback() call to the SystemExit trap, and modified the exit
3361 confirmation to have yes as the default.
3372 confirmation to have yes as the default.
3362
3373
3363 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3374 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
3364 this file. It's been gone from the code for a long time, this was
3375 this file. It's been gone from the code for a long time, this was
3365 simply leftover junk.
3376 simply leftover junk.
3366
3377
3367 2002-11-01 Fernando Perez <fperez@colorado.edu>
3378 2002-11-01 Fernando Perez <fperez@colorado.edu>
3368
3379
3369 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3380 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
3370 added. If set, IPython now traps EOF and asks for
3381 added. If set, IPython now traps EOF and asks for
3371 confirmation. After a request by François Pinard.
3382 confirmation. After a request by François Pinard.
3372
3383
3373 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3384 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
3374 of @abort, and with a new (better) mechanism for handling the
3385 of @abort, and with a new (better) mechanism for handling the
3375 exceptions.
3386 exceptions.
3376
3387
3377 2002-10-27 Fernando Perez <fperez@colorado.edu>
3388 2002-10-27 Fernando Perez <fperez@colorado.edu>
3378
3389
3379 * IPython/usage.py (__doc__): updated the --help information and
3390 * IPython/usage.py (__doc__): updated the --help information and
3380 the ipythonrc file to indicate that -log generates
3391 the ipythonrc file to indicate that -log generates
3381 ./ipython.log. Also fixed the corresponding info in @logstart.
3392 ./ipython.log. Also fixed the corresponding info in @logstart.
3382 This and several other fixes in the manuals thanks to reports by
3393 This and several other fixes in the manuals thanks to reports by
3383 François Pinard <pinard-AT-iro.umontreal.ca>.
3394 François Pinard <pinard-AT-iro.umontreal.ca>.
3384
3395
3385 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3396 * IPython/Logger.py (Logger.switch_log): Fixed error message to
3386 refer to @logstart (instead of @log, which doesn't exist).
3397 refer to @logstart (instead of @log, which doesn't exist).
3387
3398
3388 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3399 * IPython/iplib.py (InteractiveShell._prefilter): fixed
3389 AttributeError crash. Thanks to Christopher Armstrong
3400 AttributeError crash. Thanks to Christopher Armstrong
3390 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3401 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
3391 introduced recently (in 0.2.14pre37) with the fix to the eval
3402 introduced recently (in 0.2.14pre37) with the fix to the eval
3392 problem mentioned below.
3403 problem mentioned below.
3393
3404
3394 2002-10-17 Fernando Perez <fperez@colorado.edu>
3405 2002-10-17 Fernando Perez <fperez@colorado.edu>
3395
3406
3396 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3407 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
3397 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3408 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
3398
3409
3399 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3410 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
3400 this function to fix a problem reported by Alex Schmolck. He saw
3411 this function to fix a problem reported by Alex Schmolck. He saw
3401 it with list comprehensions and generators, which were getting
3412 it with list comprehensions and generators, which were getting
3402 called twice. The real problem was an 'eval' call in testing for
3413 called twice. The real problem was an 'eval' call in testing for
3403 automagic which was evaluating the input line silently.
3414 automagic which was evaluating the input line silently.
3404
3415
3405 This is a potentially very nasty bug, if the input has side
3416 This is a potentially very nasty bug, if the input has side
3406 effects which must not be repeated. The code is much cleaner now,
3417 effects which must not be repeated. The code is much cleaner now,
3407 without any blanket 'except' left and with a regexp test for
3418 without any blanket 'except' left and with a regexp test for
3408 actual function names.
3419 actual function names.
3409
3420
3410 But an eval remains, which I'm not fully comfortable with. I just
3421 But an eval remains, which I'm not fully comfortable with. I just
3411 don't know how to find out if an expression could be a callable in
3422 don't know how to find out if an expression could be a callable in
3412 the user's namespace without doing an eval on the string. However
3423 the user's namespace without doing an eval on the string. However
3413 that string is now much more strictly checked so that no code
3424 that string is now much more strictly checked so that no code
3414 slips by, so the eval should only happen for things that can
3425 slips by, so the eval should only happen for things that can
3415 really be only function/method names.
3426 really be only function/method names.
3416
3427
3417 2002-10-15 Fernando Perez <fperez@colorado.edu>
3428 2002-10-15 Fernando Perez <fperez@colorado.edu>
3418
3429
3419 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3430 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
3420 OSX information to main manual, removed README_Mac_OSX file from
3431 OSX information to main manual, removed README_Mac_OSX file from
3421 distribution. Also updated credits for recent additions.
3432 distribution. Also updated credits for recent additions.
3422
3433
3423 2002-10-10 Fernando Perez <fperez@colorado.edu>
3434 2002-10-10 Fernando Perez <fperez@colorado.edu>
3424
3435
3425 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3436 * README_Mac_OSX: Added a README for Mac OSX users for fixing
3426 terminal-related issues. Many thanks to Andrea Riciputi
3437 terminal-related issues. Many thanks to Andrea Riciputi
3427 <andrea.riciputi-AT-libero.it> for writing it.
3438 <andrea.riciputi-AT-libero.it> for writing it.
3428
3439
3429 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3440 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
3430 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3441 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
3431
3442
3432 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
3443 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
3433 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
3444 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
3434 <syver-en-AT-online.no> who both submitted patches for this problem.
3445 <syver-en-AT-online.no> who both submitted patches for this problem.
3435
3446
3436 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
3447 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
3437 global embedding to make sure that things don't overwrite user
3448 global embedding to make sure that things don't overwrite user
3438 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
3449 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
3439
3450
3440 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
3451 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
3441 compatibility. Thanks to Hayden Callow
3452 compatibility. Thanks to Hayden Callow
3442 <h.callow-AT-elec.canterbury.ac.nz>
3453 <h.callow-AT-elec.canterbury.ac.nz>
3443
3454
3444 2002-10-04 Fernando Perez <fperez@colorado.edu>
3455 2002-10-04 Fernando Perez <fperez@colorado.edu>
3445
3456
3446 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
3457 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
3447 Gnuplot.File objects.
3458 Gnuplot.File objects.
3448
3459
3449 2002-07-23 Fernando Perez <fperez@colorado.edu>
3460 2002-07-23 Fernando Perez <fperez@colorado.edu>
3450
3461
3451 * IPython/genutils.py (timing): Added timings() and timing() for
3462 * IPython/genutils.py (timing): Added timings() and timing() for
3452 quick access to the most commonly needed data, the execution
3463 quick access to the most commonly needed data, the execution
3453 times. Old timing() renamed to timings_out().
3464 times. Old timing() renamed to timings_out().
3454
3465
3455 2002-07-18 Fernando Perez <fperez@colorado.edu>
3466 2002-07-18 Fernando Perez <fperez@colorado.edu>
3456
3467
3457 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
3468 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
3458 bug with nested instances disrupting the parent's tab completion.
3469 bug with nested instances disrupting the parent's tab completion.
3459
3470
3460 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3471 * IPython/iplib.py (all_completions): Added Alex Schmolck's
3461 all_completions code to begin the emacs integration.
3472 all_completions code to begin the emacs integration.
3462
3473
3463 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3474 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
3464 argument to allow titling individual arrays when plotting.
3475 argument to allow titling individual arrays when plotting.
3465
3476
3466 2002-07-15 Fernando Perez <fperez@colorado.edu>
3477 2002-07-15 Fernando Perez <fperez@colorado.edu>
3467
3478
3468 * setup.py (make_shortcut): changed to retrieve the value of
3479 * setup.py (make_shortcut): changed to retrieve the value of
3469 'Program Files' directory from the registry (this value changes in
3480 'Program Files' directory from the registry (this value changes in
3470 non-english versions of Windows). Thanks to Thomas Fanslau
3481 non-english versions of Windows). Thanks to Thomas Fanslau
3471 <tfanslau-AT-gmx.de> for the report.
3482 <tfanslau-AT-gmx.de> for the report.
3472
3483
3473 2002-07-10 Fernando Perez <fperez@colorado.edu>
3484 2002-07-10 Fernando Perez <fperez@colorado.edu>
3474
3485
3475 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3486 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3476 a bug in pdb, which crashes if a line with only whitespace is
3487 a bug in pdb, which crashes if a line with only whitespace is
3477 entered. Bug report submitted to sourceforge.
3488 entered. Bug report submitted to sourceforge.
3478
3489
3479 2002-07-09 Fernando Perez <fperez@colorado.edu>
3490 2002-07-09 Fernando Perez <fperez@colorado.edu>
3480
3491
3481 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3492 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3482 reporting exceptions (it's a bug in inspect.py, I just set a
3493 reporting exceptions (it's a bug in inspect.py, I just set a
3483 workaround).
3494 workaround).
3484
3495
3485 2002-07-08 Fernando Perez <fperez@colorado.edu>
3496 2002-07-08 Fernando Perez <fperez@colorado.edu>
3486
3497
3487 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3498 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3488 __IPYTHON__ in __builtins__ to show up in user_ns.
3499 __IPYTHON__ in __builtins__ to show up in user_ns.
3489
3500
3490 2002-07-03 Fernando Perez <fperez@colorado.edu>
3501 2002-07-03 Fernando Perez <fperez@colorado.edu>
3491
3502
3492 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3503 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3493 name from @gp_set_instance to @gp_set_default.
3504 name from @gp_set_instance to @gp_set_default.
3494
3505
3495 * IPython/ipmaker.py (make_IPython): default editor value set to
3506 * IPython/ipmaker.py (make_IPython): default editor value set to
3496 '0' (a string), to match the rc file. Otherwise will crash when
3507 '0' (a string), to match the rc file. Otherwise will crash when
3497 .strip() is called on it.
3508 .strip() is called on it.
3498
3509
3499
3510
3500 2002-06-28 Fernando Perez <fperez@colorado.edu>
3511 2002-06-28 Fernando Perez <fperez@colorado.edu>
3501
3512
3502 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3513 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3503 of files in current directory when a file is executed via
3514 of files in current directory when a file is executed via
3504 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3515 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3505
3516
3506 * setup.py (manfiles): fix for rpm builds, submitted by RA
3517 * setup.py (manfiles): fix for rpm builds, submitted by RA
3507 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3518 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3508
3519
3509 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3520 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3510 editor when set to '0'. Problem was, '0' evaluates to True (it's a
3521 editor when set to '0'. Problem was, '0' evaluates to True (it's a
3511 string!). A. Schmolck caught this one.
3522 string!). A. Schmolck caught this one.
3512
3523
3513 2002-06-27 Fernando Perez <fperez@colorado.edu>
3524 2002-06-27 Fernando Perez <fperez@colorado.edu>
3514
3525
3515 * IPython/ipmaker.py (make_IPython): fixed bug when running user
3526 * IPython/ipmaker.py (make_IPython): fixed bug when running user
3516 defined files at the cmd line. __name__ wasn't being set to
3527 defined files at the cmd line. __name__ wasn't being set to
3517 __main__.
3528 __main__.
3518
3529
3519 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
3530 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
3520 regular lists and tuples besides Numeric arrays.
3531 regular lists and tuples besides Numeric arrays.
3521
3532
3522 * IPython/Prompts.py (CachedOutput.__call__): Added output
3533 * IPython/Prompts.py (CachedOutput.__call__): Added output
3523 supression for input ending with ';'. Similar to Mathematica and
3534 supression for input ending with ';'. Similar to Mathematica and
3524 Matlab. The _* vars and Out[] list are still updated, just like
3535 Matlab. The _* vars and Out[] list are still updated, just like
3525 Mathematica behaves.
3536 Mathematica behaves.
3526
3537
3527 2002-06-25 Fernando Perez <fperez@colorado.edu>
3538 2002-06-25 Fernando Perez <fperez@colorado.edu>
3528
3539
3529 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
3540 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
3530 .ini extensions for profiels under Windows.
3541 .ini extensions for profiels under Windows.
3531
3542
3532 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
3543 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
3533 string form. Fix contributed by Alexander Schmolck
3544 string form. Fix contributed by Alexander Schmolck
3534 <a.schmolck-AT-gmx.net>
3545 <a.schmolck-AT-gmx.net>
3535
3546
3536 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
3547 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
3537 pre-configured Gnuplot instance.
3548 pre-configured Gnuplot instance.
3538
3549
3539 2002-06-21 Fernando Perez <fperez@colorado.edu>
3550 2002-06-21 Fernando Perez <fperez@colorado.edu>
3540
3551
3541 * IPython/numutils.py (exp_safe): new function, works around the
3552 * IPython/numutils.py (exp_safe): new function, works around the
3542 underflow problems in Numeric.
3553 underflow problems in Numeric.
3543 (log2): New fn. Safe log in base 2: returns exact integer answer
3554 (log2): New fn. Safe log in base 2: returns exact integer answer
3544 for exact integer powers of 2.
3555 for exact integer powers of 2.
3545
3556
3546 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3557 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3547 properly.
3558 properly.
3548
3559
3549 2002-06-20 Fernando Perez <fperez@colorado.edu>
3560 2002-06-20 Fernando Perez <fperez@colorado.edu>
3550
3561
3551 * IPython/genutils.py (timing): new function like
3562 * IPython/genutils.py (timing): new function like
3552 Mathematica's. Similar to time_test, but returns more info.
3563 Mathematica's. Similar to time_test, but returns more info.
3553
3564
3554 2002-06-18 Fernando Perez <fperez@colorado.edu>
3565 2002-06-18 Fernando Perez <fperez@colorado.edu>
3555
3566
3556 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3567 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3557 according to Mike Heeter's suggestions.
3568 according to Mike Heeter's suggestions.
3558
3569
3559 2002-06-16 Fernando Perez <fperez@colorado.edu>
3570 2002-06-16 Fernando Perez <fperez@colorado.edu>
3560
3571
3561 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3572 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3562 system. GnuplotMagic is gone as a user-directory option. New files
3573 system. GnuplotMagic is gone as a user-directory option. New files
3563 make it easier to use all the gnuplot stuff both from external
3574 make it easier to use all the gnuplot stuff both from external
3564 programs as well as from IPython. Had to rewrite part of
3575 programs as well as from IPython. Had to rewrite part of
3565 hardcopy() b/c of a strange bug: often the ps files simply don't
3576 hardcopy() b/c of a strange bug: often the ps files simply don't
3566 get created, and require a repeat of the command (often several
3577 get created, and require a repeat of the command (often several
3567 times).
3578 times).
3568
3579
3569 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3580 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3570 resolve output channel at call time, so that if sys.stderr has
3581 resolve output channel at call time, so that if sys.stderr has
3571 been redirected by user this gets honored.
3582 been redirected by user this gets honored.
3572
3583
3573 2002-06-13 Fernando Perez <fperez@colorado.edu>
3584 2002-06-13 Fernando Perez <fperez@colorado.edu>
3574
3585
3575 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3586 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3576 IPShell. Kept a copy with the old names to avoid breaking people's
3587 IPShell. Kept a copy with the old names to avoid breaking people's
3577 embedded code.
3588 embedded code.
3578
3589
3579 * IPython/ipython: simplified it to the bare minimum after
3590 * IPython/ipython: simplified it to the bare minimum after
3580 Holger's suggestions. Added info about how to use it in
3591 Holger's suggestions. Added info about how to use it in
3581 PYTHONSTARTUP.
3592 PYTHONSTARTUP.
3582
3593
3583 * IPython/Shell.py (IPythonShell): changed the options passing
3594 * IPython/Shell.py (IPythonShell): changed the options passing
3584 from a string with funky %s replacements to a straight list. Maybe
3595 from a string with funky %s replacements to a straight list. Maybe
3585 a bit more typing, but it follows sys.argv conventions, so there's
3596 a bit more typing, but it follows sys.argv conventions, so there's
3586 less special-casing to remember.
3597 less special-casing to remember.
3587
3598
3588 2002-06-12 Fernando Perez <fperez@colorado.edu>
3599 2002-06-12 Fernando Perez <fperez@colorado.edu>
3589
3600
3590 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3601 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3591 command. Thanks to a suggestion by Mike Heeter.
3602 command. Thanks to a suggestion by Mike Heeter.
3592 (Magic.magic_pfile): added behavior to look at filenames if given
3603 (Magic.magic_pfile): added behavior to look at filenames if given
3593 arg is not a defined object.
3604 arg is not a defined object.
3594 (Magic.magic_save): New @save function to save code snippets. Also
3605 (Magic.magic_save): New @save function to save code snippets. Also
3595 a Mike Heeter idea.
3606 a Mike Heeter idea.
3596
3607
3597 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3608 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3598 plot() and replot(). Much more convenient now, especially for
3609 plot() and replot(). Much more convenient now, especially for
3599 interactive use.
3610 interactive use.
3600
3611
3601 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3612 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3602 filenames.
3613 filenames.
3603
3614
3604 2002-06-02 Fernando Perez <fperez@colorado.edu>
3615 2002-06-02 Fernando Perez <fperez@colorado.edu>
3605
3616
3606 * IPython/Struct.py (Struct.__init__): modified to admit
3617 * IPython/Struct.py (Struct.__init__): modified to admit
3607 initialization via another struct.
3618 initialization via another struct.
3608
3619
3609 * IPython/genutils.py (SystemExec.__init__): New stateful
3620 * IPython/genutils.py (SystemExec.__init__): New stateful
3610 interface to xsys and bq. Useful for writing system scripts.
3621 interface to xsys and bq. Useful for writing system scripts.
3611
3622
3612 2002-05-30 Fernando Perez <fperez@colorado.edu>
3623 2002-05-30 Fernando Perez <fperez@colorado.edu>
3613
3624
3614 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3625 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3615 documents. This will make the user download smaller (it's getting
3626 documents. This will make the user download smaller (it's getting
3616 too big).
3627 too big).
3617
3628
3618 2002-05-29 Fernando Perez <fperez@colorado.edu>
3629 2002-05-29 Fernando Perez <fperez@colorado.edu>
3619
3630
3620 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3631 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3621 fix problems with shelve and pickle. Seems to work, but I don't
3632 fix problems with shelve and pickle. Seems to work, but I don't
3622 know if corner cases break it. Thanks to Mike Heeter
3633 know if corner cases break it. Thanks to Mike Heeter
3623 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3634 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3624
3635
3625 2002-05-24 Fernando Perez <fperez@colorado.edu>
3636 2002-05-24 Fernando Perez <fperez@colorado.edu>
3626
3637
3627 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3638 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3628 macros having broken.
3639 macros having broken.
3629
3640
3630 2002-05-21 Fernando Perez <fperez@colorado.edu>
3641 2002-05-21 Fernando Perez <fperez@colorado.edu>
3631
3642
3632 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3643 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3633 introduced logging bug: all history before logging started was
3644 introduced logging bug: all history before logging started was
3634 being written one character per line! This came from the redesign
3645 being written one character per line! This came from the redesign
3635 of the input history as a special list which slices to strings,
3646 of the input history as a special list which slices to strings,
3636 not to lists.
3647 not to lists.
3637
3648
3638 2002-05-20 Fernando Perez <fperez@colorado.edu>
3649 2002-05-20 Fernando Perez <fperez@colorado.edu>
3639
3650
3640 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3651 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3641 be an attribute of all classes in this module. The design of these
3652 be an attribute of all classes in this module. The design of these
3642 classes needs some serious overhauling.
3653 classes needs some serious overhauling.
3643
3654
3644 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3655 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3645 which was ignoring '_' in option names.
3656 which was ignoring '_' in option names.
3646
3657
3647 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3658 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3648 'Verbose_novars' to 'Context' and made it the new default. It's a
3659 'Verbose_novars' to 'Context' and made it the new default. It's a
3649 bit more readable and also safer than verbose.
3660 bit more readable and also safer than verbose.
3650
3661
3651 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3662 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3652 triple-quoted strings.
3663 triple-quoted strings.
3653
3664
3654 * IPython/OInspect.py (__all__): new module exposing the object
3665 * IPython/OInspect.py (__all__): new module exposing the object
3655 introspection facilities. Now the corresponding magics are dummy
3666 introspection facilities. Now the corresponding magics are dummy
3656 wrappers around this. Having this module will make it much easier
3667 wrappers around this. Having this module will make it much easier
3657 to put these functions into our modified pdb.
3668 to put these functions into our modified pdb.
3658 This new object inspector system uses the new colorizing module,
3669 This new object inspector system uses the new colorizing module,
3659 so source code and other things are nicely syntax highlighted.
3670 so source code and other things are nicely syntax highlighted.
3660
3671
3661 2002-05-18 Fernando Perez <fperez@colorado.edu>
3672 2002-05-18 Fernando Perez <fperez@colorado.edu>
3662
3673
3663 * IPython/ColorANSI.py: Split the coloring tools into a separate
3674 * IPython/ColorANSI.py: Split the coloring tools into a separate
3664 module so I can use them in other code easier (they were part of
3675 module so I can use them in other code easier (they were part of
3665 ultraTB).
3676 ultraTB).
3666
3677
3667 2002-05-17 Fernando Perez <fperez@colorado.edu>
3678 2002-05-17 Fernando Perez <fperez@colorado.edu>
3668
3679
3669 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3680 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3670 fixed it to set the global 'g' also to the called instance, as
3681 fixed it to set the global 'g' also to the called instance, as
3671 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3682 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3672 user's 'g' variables).
3683 user's 'g' variables).
3673
3684
3674 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3685 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3675 global variables (aliases to _ih,_oh) so that users which expect
3686 global variables (aliases to _ih,_oh) so that users which expect
3676 In[5] or Out[7] to work aren't unpleasantly surprised.
3687 In[5] or Out[7] to work aren't unpleasantly surprised.
3677 (InputList.__getslice__): new class to allow executing slices of
3688 (InputList.__getslice__): new class to allow executing slices of
3678 input history directly. Very simple class, complements the use of
3689 input history directly. Very simple class, complements the use of
3679 macros.
3690 macros.
3680
3691
3681 2002-05-16 Fernando Perez <fperez@colorado.edu>
3692 2002-05-16 Fernando Perez <fperez@colorado.edu>
3682
3693
3683 * setup.py (docdirbase): make doc directory be just doc/IPython
3694 * setup.py (docdirbase): make doc directory be just doc/IPython
3684 without version numbers, it will reduce clutter for users.
3695 without version numbers, it will reduce clutter for users.
3685
3696
3686 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3697 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3687 execfile call to prevent possible memory leak. See for details:
3698 execfile call to prevent possible memory leak. See for details:
3688 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3699 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3689
3700
3690 2002-05-15 Fernando Perez <fperez@colorado.edu>
3701 2002-05-15 Fernando Perez <fperez@colorado.edu>
3691
3702
3692 * IPython/Magic.py (Magic.magic_psource): made the object
3703 * IPython/Magic.py (Magic.magic_psource): made the object
3693 introspection names be more standard: pdoc, pdef, pfile and
3704 introspection names be more standard: pdoc, pdef, pfile and
3694 psource. They all print/page their output, and it makes
3705 psource. They all print/page their output, and it makes
3695 remembering them easier. Kept old names for compatibility as
3706 remembering them easier. Kept old names for compatibility as
3696 aliases.
3707 aliases.
3697
3708
3698 2002-05-14 Fernando Perez <fperez@colorado.edu>
3709 2002-05-14 Fernando Perez <fperez@colorado.edu>
3699
3710
3700 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3711 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3701 what the mouse problem was. The trick is to use gnuplot with temp
3712 what the mouse problem was. The trick is to use gnuplot with temp
3702 files and NOT with pipes (for data communication), because having
3713 files and NOT with pipes (for data communication), because having
3703 both pipes and the mouse on is bad news.
3714 both pipes and the mouse on is bad news.
3704
3715
3705 2002-05-13 Fernando Perez <fperez@colorado.edu>
3716 2002-05-13 Fernando Perez <fperez@colorado.edu>
3706
3717
3707 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3718 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3708 bug. Information would be reported about builtins even when
3719 bug. Information would be reported about builtins even when
3709 user-defined functions overrode them.
3720 user-defined functions overrode them.
3710
3721
3711 2002-05-11 Fernando Perez <fperez@colorado.edu>
3722 2002-05-11 Fernando Perez <fperez@colorado.edu>
3712
3723
3713 * IPython/__init__.py (__all__): removed FlexCompleter from
3724 * IPython/__init__.py (__all__): removed FlexCompleter from
3714 __all__ so that things don't fail in platforms without readline.
3725 __all__ so that things don't fail in platforms without readline.
3715
3726
3716 2002-05-10 Fernando Perez <fperez@colorado.edu>
3727 2002-05-10 Fernando Perez <fperez@colorado.edu>
3717
3728
3718 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3729 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3719 it requires Numeric, effectively making Numeric a dependency for
3730 it requires Numeric, effectively making Numeric a dependency for
3720 IPython.
3731 IPython.
3721
3732
3722 * Released 0.2.13
3733 * Released 0.2.13
3723
3734
3724 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3735 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3725 profiler interface. Now all the major options from the profiler
3736 profiler interface. Now all the major options from the profiler
3726 module are directly supported in IPython, both for single
3737 module are directly supported in IPython, both for single
3727 expressions (@prun) and for full programs (@run -p).
3738 expressions (@prun) and for full programs (@run -p).
3728
3739
3729 2002-05-09 Fernando Perez <fperez@colorado.edu>
3740 2002-05-09 Fernando Perez <fperez@colorado.edu>
3730
3741
3731 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3742 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3732 magic properly formatted for screen.
3743 magic properly formatted for screen.
3733
3744
3734 * setup.py (make_shortcut): Changed things to put pdf version in
3745 * setup.py (make_shortcut): Changed things to put pdf version in
3735 doc/ instead of doc/manual (had to change lyxport a bit).
3746 doc/ instead of doc/manual (had to change lyxport a bit).
3736
3747
3737 * IPython/Magic.py (Profile.string_stats): made profile runs go
3748 * IPython/Magic.py (Profile.string_stats): made profile runs go
3738 through pager (they are long and a pager allows searching, saving,
3749 through pager (they are long and a pager allows searching, saving,
3739 etc.)
3750 etc.)
3740
3751
3741 2002-05-08 Fernando Perez <fperez@colorado.edu>
3752 2002-05-08 Fernando Perez <fperez@colorado.edu>
3742
3753
3743 * Released 0.2.12
3754 * Released 0.2.12
3744
3755
3745 2002-05-06 Fernando Perez <fperez@colorado.edu>
3756 2002-05-06 Fernando Perez <fperez@colorado.edu>
3746
3757
3747 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3758 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3748 introduced); 'hist n1 n2' was broken.
3759 introduced); 'hist n1 n2' was broken.
3749 (Magic.magic_pdb): added optional on/off arguments to @pdb
3760 (Magic.magic_pdb): added optional on/off arguments to @pdb
3750 (Magic.magic_run): added option -i to @run, which executes code in
3761 (Magic.magic_run): added option -i to @run, which executes code in
3751 the IPython namespace instead of a clean one. Also added @irun as
3762 the IPython namespace instead of a clean one. Also added @irun as
3752 an alias to @run -i.
3763 an alias to @run -i.
3753
3764
3754 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3765 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3755 fixed (it didn't really do anything, the namespaces were wrong).
3766 fixed (it didn't really do anything, the namespaces were wrong).
3756
3767
3757 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3768 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3758
3769
3759 * IPython/__init__.py (__all__): Fixed package namespace, now
3770 * IPython/__init__.py (__all__): Fixed package namespace, now
3760 'import IPython' does give access to IPython.<all> as
3771 'import IPython' does give access to IPython.<all> as
3761 expected. Also renamed __release__ to Release.
3772 expected. Also renamed __release__ to Release.
3762
3773
3763 * IPython/Debugger.py (__license__): created new Pdb class which
3774 * IPython/Debugger.py (__license__): created new Pdb class which
3764 functions like a drop-in for the normal pdb.Pdb but does NOT
3775 functions like a drop-in for the normal pdb.Pdb but does NOT
3765 import readline by default. This way it doesn't muck up IPython's
3776 import readline by default. This way it doesn't muck up IPython's
3766 readline handling, and now tab-completion finally works in the
3777 readline handling, and now tab-completion finally works in the
3767 debugger -- sort of. It completes things globally visible, but the
3778 debugger -- sort of. It completes things globally visible, but the
3768 completer doesn't track the stack as pdb walks it. That's a bit
3779 completer doesn't track the stack as pdb walks it. That's a bit
3769 tricky, and I'll have to implement it later.
3780 tricky, and I'll have to implement it later.
3770
3781
3771 2002-05-05 Fernando Perez <fperez@colorado.edu>
3782 2002-05-05 Fernando Perez <fperez@colorado.edu>
3772
3783
3773 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3784 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3774 magic docstrings when printed via ? (explicit \'s were being
3785 magic docstrings when printed via ? (explicit \'s were being
3775 printed).
3786 printed).
3776
3787
3777 * IPython/ipmaker.py (make_IPython): fixed namespace
3788 * IPython/ipmaker.py (make_IPython): fixed namespace
3778 identification bug. Now variables loaded via logs or command-line
3789 identification bug. Now variables loaded via logs or command-line
3779 files are recognized in the interactive namespace by @who.
3790 files are recognized in the interactive namespace by @who.
3780
3791
3781 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3792 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3782 log replay system stemming from the string form of Structs.
3793 log replay system stemming from the string form of Structs.
3783
3794
3784 * IPython/Magic.py (Macro.__init__): improved macros to properly
3795 * IPython/Magic.py (Macro.__init__): improved macros to properly
3785 handle magic commands in them.
3796 handle magic commands in them.
3786 (Magic.magic_logstart): usernames are now expanded so 'logstart
3797 (Magic.magic_logstart): usernames are now expanded so 'logstart
3787 ~/mylog' now works.
3798 ~/mylog' now works.
3788
3799
3789 * IPython/iplib.py (complete): fixed bug where paths starting with
3800 * IPython/iplib.py (complete): fixed bug where paths starting with
3790 '/' would be completed as magic names.
3801 '/' would be completed as magic names.
3791
3802
3792 2002-05-04 Fernando Perez <fperez@colorado.edu>
3803 2002-05-04 Fernando Perez <fperez@colorado.edu>
3793
3804
3794 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3805 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3795 allow running full programs under the profiler's control.
3806 allow running full programs under the profiler's control.
3796
3807
3797 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3808 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3798 mode to report exceptions verbosely but without formatting
3809 mode to report exceptions verbosely but without formatting
3799 variables. This addresses the issue of ipython 'freezing' (it's
3810 variables. This addresses the issue of ipython 'freezing' (it's
3800 not frozen, but caught in an expensive formatting loop) when huge
3811 not frozen, but caught in an expensive formatting loop) when huge
3801 variables are in the context of an exception.
3812 variables are in the context of an exception.
3802 (VerboseTB.text): Added '--->' markers at line where exception was
3813 (VerboseTB.text): Added '--->' markers at line where exception was
3803 triggered. Much clearer to read, especially in NoColor modes.
3814 triggered. Much clearer to read, especially in NoColor modes.
3804
3815
3805 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3816 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3806 implemented in reverse when changing to the new parse_options().
3817 implemented in reverse when changing to the new parse_options().
3807
3818
3808 2002-05-03 Fernando Perez <fperez@colorado.edu>
3819 2002-05-03 Fernando Perez <fperez@colorado.edu>
3809
3820
3810 * IPython/Magic.py (Magic.parse_options): new function so that
3821 * IPython/Magic.py (Magic.parse_options): new function so that
3811 magics can parse options easier.
3822 magics can parse options easier.
3812 (Magic.magic_prun): new function similar to profile.run(),
3823 (Magic.magic_prun): new function similar to profile.run(),
3813 suggested by Chris Hart.
3824 suggested by Chris Hart.
3814 (Magic.magic_cd): fixed behavior so that it only changes if
3825 (Magic.magic_cd): fixed behavior so that it only changes if
3815 directory actually is in history.
3826 directory actually is in history.
3816
3827
3817 * IPython/usage.py (__doc__): added information about potential
3828 * IPython/usage.py (__doc__): added information about potential
3818 slowness of Verbose exception mode when there are huge data
3829 slowness of Verbose exception mode when there are huge data
3819 structures to be formatted (thanks to Archie Paulson).
3830 structures to be formatted (thanks to Archie Paulson).
3820
3831
3821 * IPython/ipmaker.py (make_IPython): Changed default logging
3832 * IPython/ipmaker.py (make_IPython): Changed default logging
3822 (when simply called with -log) to use curr_dir/ipython.log in
3833 (when simply called with -log) to use curr_dir/ipython.log in
3823 rotate mode. Fixed crash which was occuring with -log before
3834 rotate mode. Fixed crash which was occuring with -log before
3824 (thanks to Jim Boyle).
3835 (thanks to Jim Boyle).
3825
3836
3826 2002-05-01 Fernando Perez <fperez@colorado.edu>
3837 2002-05-01 Fernando Perez <fperez@colorado.edu>
3827
3838
3828 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3839 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3829 was nasty -- though somewhat of a corner case).
3840 was nasty -- though somewhat of a corner case).
3830
3841
3831 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3842 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3832 text (was a bug).
3843 text (was a bug).
3833
3844
3834 2002-04-30 Fernando Perez <fperez@colorado.edu>
3845 2002-04-30 Fernando Perez <fperez@colorado.edu>
3835
3846
3836 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3847 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3837 a print after ^D or ^C from the user so that the In[] prompt
3848 a print after ^D or ^C from the user so that the In[] prompt
3838 doesn't over-run the gnuplot one.
3849 doesn't over-run the gnuplot one.
3839
3850
3840 2002-04-29 Fernando Perez <fperez@colorado.edu>
3851 2002-04-29 Fernando Perez <fperez@colorado.edu>
3841
3852
3842 * Released 0.2.10
3853 * Released 0.2.10
3843
3854
3844 * IPython/__release__.py (version): get date dynamically.
3855 * IPython/__release__.py (version): get date dynamically.
3845
3856
3846 * Misc. documentation updates thanks to Arnd's comments. Also ran
3857 * Misc. documentation updates thanks to Arnd's comments. Also ran
3847 a full spellcheck on the manual (hadn't been done in a while).
3858 a full spellcheck on the manual (hadn't been done in a while).
3848
3859
3849 2002-04-27 Fernando Perez <fperez@colorado.edu>
3860 2002-04-27 Fernando Perez <fperez@colorado.edu>
3850
3861
3851 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3862 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3852 starting a log in mid-session would reset the input history list.
3863 starting a log in mid-session would reset the input history list.
3853
3864
3854 2002-04-26 Fernando Perez <fperez@colorado.edu>
3865 2002-04-26 Fernando Perez <fperez@colorado.edu>
3855
3866
3856 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3867 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3857 all files were being included in an update. Now anything in
3868 all files were being included in an update. Now anything in
3858 UserConfig that matches [A-Za-z]*.py will go (this excludes
3869 UserConfig that matches [A-Za-z]*.py will go (this excludes
3859 __init__.py)
3870 __init__.py)
3860
3871
3861 2002-04-25 Fernando Perez <fperez@colorado.edu>
3872 2002-04-25 Fernando Perez <fperez@colorado.edu>
3862
3873
3863 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3874 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3864 to __builtins__ so that any form of embedded or imported code can
3875 to __builtins__ so that any form of embedded or imported code can
3865 test for being inside IPython.
3876 test for being inside IPython.
3866
3877
3867 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3878 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3868 changed to GnuplotMagic because it's now an importable module,
3879 changed to GnuplotMagic because it's now an importable module,
3869 this makes the name follow that of the standard Gnuplot module.
3880 this makes the name follow that of the standard Gnuplot module.
3870 GnuplotMagic can now be loaded at any time in mid-session.
3881 GnuplotMagic can now be loaded at any time in mid-session.
3871
3882
3872 2002-04-24 Fernando Perez <fperez@colorado.edu>
3883 2002-04-24 Fernando Perez <fperez@colorado.edu>
3873
3884
3874 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3885 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3875 the globals (IPython has its own namespace) and the
3886 the globals (IPython has its own namespace) and the
3876 PhysicalQuantity stuff is much better anyway.
3887 PhysicalQuantity stuff is much better anyway.
3877
3888
3878 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3889 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3879 embedding example to standard user directory for
3890 embedding example to standard user directory for
3880 distribution. Also put it in the manual.
3891 distribution. Also put it in the manual.
3881
3892
3882 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3893 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3883 instance as first argument (so it doesn't rely on some obscure
3894 instance as first argument (so it doesn't rely on some obscure
3884 hidden global).
3895 hidden global).
3885
3896
3886 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3897 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3887 delimiters. While it prevents ().TAB from working, it allows
3898 delimiters. While it prevents ().TAB from working, it allows
3888 completions in open (... expressions. This is by far a more common
3899 completions in open (... expressions. This is by far a more common
3889 case.
3900 case.
3890
3901
3891 2002-04-23 Fernando Perez <fperez@colorado.edu>
3902 2002-04-23 Fernando Perez <fperez@colorado.edu>
3892
3903
3893 * IPython/Extensions/InterpreterPasteInput.py: new
3904 * IPython/Extensions/InterpreterPasteInput.py: new
3894 syntax-processing module for pasting lines with >>> or ... at the
3905 syntax-processing module for pasting lines with >>> or ... at the
3895 start.
3906 start.
3896
3907
3897 * IPython/Extensions/PhysicalQ_Interactive.py
3908 * IPython/Extensions/PhysicalQ_Interactive.py
3898 (PhysicalQuantityInteractive.__int__): fixed to work with either
3909 (PhysicalQuantityInteractive.__int__): fixed to work with either
3899 Numeric or math.
3910 Numeric or math.
3900
3911
3901 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3912 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3902 provided profiles. Now we have:
3913 provided profiles. Now we have:
3903 -math -> math module as * and cmath with its own namespace.
3914 -math -> math module as * and cmath with its own namespace.
3904 -numeric -> Numeric as *, plus gnuplot & grace
3915 -numeric -> Numeric as *, plus gnuplot & grace
3905 -physics -> same as before
3916 -physics -> same as before
3906
3917
3907 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3918 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3908 user-defined magics wouldn't be found by @magic if they were
3919 user-defined magics wouldn't be found by @magic if they were
3909 defined as class methods. Also cleaned up the namespace search
3920 defined as class methods. Also cleaned up the namespace search
3910 logic and the string building (to use %s instead of many repeated
3921 logic and the string building (to use %s instead of many repeated
3911 string adds).
3922 string adds).
3912
3923
3913 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3924 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3914 of user-defined magics to operate with class methods (cleaner, in
3925 of user-defined magics to operate with class methods (cleaner, in
3915 line with the gnuplot code).
3926 line with the gnuplot code).
3916
3927
3917 2002-04-22 Fernando Perez <fperez@colorado.edu>
3928 2002-04-22 Fernando Perez <fperez@colorado.edu>
3918
3929
3919 * setup.py: updated dependency list so that manual is updated when
3930 * setup.py: updated dependency list so that manual is updated when
3920 all included files change.
3931 all included files change.
3921
3932
3922 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3933 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3923 the delimiter removal option (the fix is ugly right now).
3934 the delimiter removal option (the fix is ugly right now).
3924
3935
3925 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3936 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3926 all of the math profile (quicker loading, no conflict between
3937 all of the math profile (quicker loading, no conflict between
3927 g-9.8 and g-gnuplot).
3938 g-9.8 and g-gnuplot).
3928
3939
3929 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3940 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3930 name of post-mortem files to IPython_crash_report.txt.
3941 name of post-mortem files to IPython_crash_report.txt.
3931
3942
3932 * Cleanup/update of the docs. Added all the new readline info and
3943 * Cleanup/update of the docs. Added all the new readline info and
3933 formatted all lists as 'real lists'.
3944 formatted all lists as 'real lists'.
3934
3945
3935 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3946 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3936 tab-completion options, since the full readline parse_and_bind is
3947 tab-completion options, since the full readline parse_and_bind is
3937 now accessible.
3948 now accessible.
3938
3949
3939 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3950 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3940 handling of readline options. Now users can specify any string to
3951 handling of readline options. Now users can specify any string to
3941 be passed to parse_and_bind(), as well as the delimiters to be
3952 be passed to parse_and_bind(), as well as the delimiters to be
3942 removed.
3953 removed.
3943 (InteractiveShell.__init__): Added __name__ to the global
3954 (InteractiveShell.__init__): Added __name__ to the global
3944 namespace so that things like Itpl which rely on its existence
3955 namespace so that things like Itpl which rely on its existence
3945 don't crash.
3956 don't crash.
3946 (InteractiveShell._prefilter): Defined the default with a _ so
3957 (InteractiveShell._prefilter): Defined the default with a _ so
3947 that prefilter() is easier to override, while the default one
3958 that prefilter() is easier to override, while the default one
3948 remains available.
3959 remains available.
3949
3960
3950 2002-04-18 Fernando Perez <fperez@colorado.edu>
3961 2002-04-18 Fernando Perez <fperez@colorado.edu>
3951
3962
3952 * Added information about pdb in the docs.
3963 * Added information about pdb in the docs.
3953
3964
3954 2002-04-17 Fernando Perez <fperez@colorado.edu>
3965 2002-04-17 Fernando Perez <fperez@colorado.edu>
3955
3966
3956 * IPython/ipmaker.py (make_IPython): added rc_override option to
3967 * IPython/ipmaker.py (make_IPython): added rc_override option to
3957 allow passing config options at creation time which may override
3968 allow passing config options at creation time which may override
3958 anything set in the config files or command line. This is
3969 anything set in the config files or command line. This is
3959 particularly useful for configuring embedded instances.
3970 particularly useful for configuring embedded instances.
3960
3971
3961 2002-04-15 Fernando Perez <fperez@colorado.edu>
3972 2002-04-15 Fernando Perez <fperez@colorado.edu>
3962
3973
3963 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3974 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3964 crash embedded instances because of the input cache falling out of
3975 crash embedded instances because of the input cache falling out of
3965 sync with the output counter.
3976 sync with the output counter.
3966
3977
3967 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3978 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3968 mode which calls pdb after an uncaught exception in IPython itself.
3979 mode which calls pdb after an uncaught exception in IPython itself.
3969
3980
3970 2002-04-14 Fernando Perez <fperez@colorado.edu>
3981 2002-04-14 Fernando Perez <fperez@colorado.edu>
3971
3982
3972 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3983 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3973 readline, fix it back after each call.
3984 readline, fix it back after each call.
3974
3985
3975 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3986 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3976 method to force all access via __call__(), which guarantees that
3987 method to force all access via __call__(), which guarantees that
3977 traceback references are properly deleted.
3988 traceback references are properly deleted.
3978
3989
3979 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3990 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3980 improve printing when pprint is in use.
3991 improve printing when pprint is in use.
3981
3992
3982 2002-04-13 Fernando Perez <fperez@colorado.edu>
3993 2002-04-13 Fernando Perez <fperez@colorado.edu>
3983
3994
3984 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3995 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3985 exceptions aren't caught anymore. If the user triggers one, he
3996 exceptions aren't caught anymore. If the user triggers one, he
3986 should know why he's doing it and it should go all the way up,
3997 should know why he's doing it and it should go all the way up,
3987 just like any other exception. So now @abort will fully kill the
3998 just like any other exception. So now @abort will fully kill the
3988 embedded interpreter and the embedding code (unless that happens
3999 embedded interpreter and the embedding code (unless that happens
3989 to catch SystemExit).
4000 to catch SystemExit).
3990
4001
3991 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
4002 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
3992 and a debugger() method to invoke the interactive pdb debugger
4003 and a debugger() method to invoke the interactive pdb debugger
3993 after printing exception information. Also added the corresponding
4004 after printing exception information. Also added the corresponding
3994 -pdb option and @pdb magic to control this feature, and updated
4005 -pdb option and @pdb magic to control this feature, and updated
3995 the docs. After a suggestion from Christopher Hart
4006 the docs. After a suggestion from Christopher Hart
3996 (hart-AT-caltech.edu).
4007 (hart-AT-caltech.edu).
3997
4008
3998 2002-04-12 Fernando Perez <fperez@colorado.edu>
4009 2002-04-12 Fernando Perez <fperez@colorado.edu>
3999
4010
4000 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4011 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
4001 the exception handlers defined by the user (not the CrashHandler)
4012 the exception handlers defined by the user (not the CrashHandler)
4002 so that user exceptions don't trigger an ipython bug report.
4013 so that user exceptions don't trigger an ipython bug report.
4003
4014
4004 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4015 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
4005 configurable (it should have always been so).
4016 configurable (it should have always been so).
4006
4017
4007 2002-03-26 Fernando Perez <fperez@colorado.edu>
4018 2002-03-26 Fernando Perez <fperez@colorado.edu>
4008
4019
4009 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4020 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
4010 and there to fix embedding namespace issues. This should all be
4021 and there to fix embedding namespace issues. This should all be
4011 done in a more elegant way.
4022 done in a more elegant way.
4012
4023
4013 2002-03-25 Fernando Perez <fperez@colorado.edu>
4024 2002-03-25 Fernando Perez <fperez@colorado.edu>
4014
4025
4015 * IPython/genutils.py (get_home_dir): Try to make it work under
4026 * IPython/genutils.py (get_home_dir): Try to make it work under
4016 win9x also.
4027 win9x also.
4017
4028
4018 2002-03-20 Fernando Perez <fperez@colorado.edu>
4029 2002-03-20 Fernando Perez <fperez@colorado.edu>
4019
4030
4020 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4031 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
4021 sys.displayhook untouched upon __init__.
4032 sys.displayhook untouched upon __init__.
4022
4033
4023 2002-03-19 Fernando Perez <fperez@colorado.edu>
4034 2002-03-19 Fernando Perez <fperez@colorado.edu>
4024
4035
4025 * Released 0.2.9 (for embedding bug, basically).
4036 * Released 0.2.9 (for embedding bug, basically).
4026
4037
4027 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4038 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
4028 exceptions so that enclosing shell's state can be restored.
4039 exceptions so that enclosing shell's state can be restored.
4029
4040
4030 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4041 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
4031 naming conventions in the .ipython/ dir.
4042 naming conventions in the .ipython/ dir.
4032
4043
4033 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4044 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
4034 from delimiters list so filenames with - in them get expanded.
4045 from delimiters list so filenames with - in them get expanded.
4035
4046
4036 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4047 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
4037 sys.displayhook not being properly restored after an embedded call.
4048 sys.displayhook not being properly restored after an embedded call.
4038
4049
4039 2002-03-18 Fernando Perez <fperez@colorado.edu>
4050 2002-03-18 Fernando Perez <fperez@colorado.edu>
4040
4051
4041 * Released 0.2.8
4052 * Released 0.2.8
4042
4053
4043 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4054 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
4044 some files weren't being included in a -upgrade.
4055 some files weren't being included in a -upgrade.
4045 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4056 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
4046 on' so that the first tab completes.
4057 on' so that the first tab completes.
4047 (InteractiveShell.handle_magic): fixed bug with spaces around
4058 (InteractiveShell.handle_magic): fixed bug with spaces around
4048 quotes breaking many magic commands.
4059 quotes breaking many magic commands.
4049
4060
4050 * setup.py: added note about ignoring the syntax error messages at
4061 * setup.py: added note about ignoring the syntax error messages at
4051 installation.
4062 installation.
4052
4063
4053 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4064 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
4054 streamlining the gnuplot interface, now there's only one magic @gp.
4065 streamlining the gnuplot interface, now there's only one magic @gp.
4055
4066
4056 2002-03-17 Fernando Perez <fperez@colorado.edu>
4067 2002-03-17 Fernando Perez <fperez@colorado.edu>
4057
4068
4058 * IPython/UserConfig/magic_gnuplot.py: new name for the
4069 * IPython/UserConfig/magic_gnuplot.py: new name for the
4059 example-magic_pm.py file. Much enhanced system, now with a shell
4070 example-magic_pm.py file. Much enhanced system, now with a shell
4060 for communicating directly with gnuplot, one command at a time.
4071 for communicating directly with gnuplot, one command at a time.
4061
4072
4062 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4073 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
4063 setting __name__=='__main__'.
4074 setting __name__=='__main__'.
4064
4075
4065 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4076 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
4066 mini-shell for accessing gnuplot from inside ipython. Should
4077 mini-shell for accessing gnuplot from inside ipython. Should
4067 extend it later for grace access too. Inspired by Arnd's
4078 extend it later for grace access too. Inspired by Arnd's
4068 suggestion.
4079 suggestion.
4069
4080
4070 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4081 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
4071 calling magic functions with () in their arguments. Thanks to Arnd
4082 calling magic functions with () in their arguments. Thanks to Arnd
4072 Baecker for pointing this to me.
4083 Baecker for pointing this to me.
4073
4084
4074 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4085 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
4075 infinitely for integer or complex arrays (only worked with floats).
4086 infinitely for integer or complex arrays (only worked with floats).
4076
4087
4077 2002-03-16 Fernando Perez <fperez@colorado.edu>
4088 2002-03-16 Fernando Perez <fperez@colorado.edu>
4078
4089
4079 * setup.py: Merged setup and setup_windows into a single script
4090 * setup.py: Merged setup and setup_windows into a single script
4080 which properly handles things for windows users.
4091 which properly handles things for windows users.
4081
4092
4082 2002-03-15 Fernando Perez <fperez@colorado.edu>
4093 2002-03-15 Fernando Perez <fperez@colorado.edu>
4083
4094
4084 * Big change to the manual: now the magics are all automatically
4095 * Big change to the manual: now the magics are all automatically
4085 documented. This information is generated from their docstrings
4096 documented. This information is generated from their docstrings
4086 and put in a latex file included by the manual lyx file. This way
4097 and put in a latex file included by the manual lyx file. This way
4087 we get always up to date information for the magics. The manual
4098 we get always up to date information for the magics. The manual
4088 now also has proper version information, also auto-synced.
4099 now also has proper version information, also auto-synced.
4089
4100
4090 For this to work, an undocumented --magic_docstrings option was added.
4101 For this to work, an undocumented --magic_docstrings option was added.
4091
4102
4092 2002-03-13 Fernando Perez <fperez@colorado.edu>
4103 2002-03-13 Fernando Perez <fperez@colorado.edu>
4093
4104
4094 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4105 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
4095 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4106 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
4096
4107
4097 2002-03-12 Fernando Perez <fperez@colorado.edu>
4108 2002-03-12 Fernando Perez <fperez@colorado.edu>
4098
4109
4099 * IPython/ultraTB.py (TermColors): changed color escapes again to
4110 * IPython/ultraTB.py (TermColors): changed color escapes again to
4100 fix the (old, reintroduced) line-wrapping bug. Basically, if
4111 fix the (old, reintroduced) line-wrapping bug. Basically, if
4101 \001..\002 aren't given in the color escapes, lines get wrapped
4112 \001..\002 aren't given in the color escapes, lines get wrapped
4102 weirdly. But giving those screws up old xterms and emacs terms. So
4113 weirdly. But giving those screws up old xterms and emacs terms. So
4103 I added some logic for emacs terms to be ok, but I can't identify old
4114 I added some logic for emacs terms to be ok, but I can't identify old
4104 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4115 xterms separately ($TERM=='xterm' for many terminals, like konsole).
4105
4116
4106 2002-03-10 Fernando Perez <fperez@colorado.edu>
4117 2002-03-10 Fernando Perez <fperez@colorado.edu>
4107
4118
4108 * IPython/usage.py (__doc__): Various documentation cleanups and
4119 * IPython/usage.py (__doc__): Various documentation cleanups and
4109 updates, both in usage docstrings and in the manual.
4120 updates, both in usage docstrings and in the manual.
4110
4121
4111 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4122 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
4112 handling of caching. Set minimum acceptabe value for having a
4123 handling of caching. Set minimum acceptabe value for having a
4113 cache at 20 values.
4124 cache at 20 values.
4114
4125
4115 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4126 * IPython/iplib.py (InteractiveShell.user_setup): moved the
4116 install_first_time function to a method, renamed it and added an
4127 install_first_time function to a method, renamed it and added an
4117 'upgrade' mode. Now people can update their config directory with
4128 'upgrade' mode. Now people can update their config directory with
4118 a simple command line switch (-upgrade, also new).
4129 a simple command line switch (-upgrade, also new).
4119
4130
4120 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4131 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
4121 @file (convenient for automagic users under Python >= 2.2).
4132 @file (convenient for automagic users under Python >= 2.2).
4122 Removed @files (it seemed more like a plural than an abbrev. of
4133 Removed @files (it seemed more like a plural than an abbrev. of
4123 'file show').
4134 'file show').
4124
4135
4125 * IPython/iplib.py (install_first_time): Fixed crash if there were
4136 * IPython/iplib.py (install_first_time): Fixed crash if there were
4126 backup files ('~') in .ipython/ install directory.
4137 backup files ('~') in .ipython/ install directory.
4127
4138
4128 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4139 * IPython/ipmaker.py (make_IPython): fixes for new prompt
4129 system. Things look fine, but these changes are fairly
4140 system. Things look fine, but these changes are fairly
4130 intrusive. Test them for a few days.
4141 intrusive. Test them for a few days.
4131
4142
4132 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4143 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
4133 the prompts system. Now all in/out prompt strings are user
4144 the prompts system. Now all in/out prompt strings are user
4134 controllable. This is particularly useful for embedding, as one
4145 controllable. This is particularly useful for embedding, as one
4135 can tag embedded instances with particular prompts.
4146 can tag embedded instances with particular prompts.
4136
4147
4137 Also removed global use of sys.ps1/2, which now allows nested
4148 Also removed global use of sys.ps1/2, which now allows nested
4138 embeddings without any problems. Added command-line options for
4149 embeddings without any problems. Added command-line options for
4139 the prompt strings.
4150 the prompt strings.
4140
4151
4141 2002-03-08 Fernando Perez <fperez@colorado.edu>
4152 2002-03-08 Fernando Perez <fperez@colorado.edu>
4142
4153
4143 * IPython/UserConfig/example-embed-short.py (ipshell): added
4154 * IPython/UserConfig/example-embed-short.py (ipshell): added
4144 example file with the bare minimum code for embedding.
4155 example file with the bare minimum code for embedding.
4145
4156
4146 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4157 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
4147 functionality for the embeddable shell to be activated/deactivated
4158 functionality for the embeddable shell to be activated/deactivated
4148 either globally or at each call.
4159 either globally or at each call.
4149
4160
4150 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4161 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
4151 rewriting the prompt with '--->' for auto-inputs with proper
4162 rewriting the prompt with '--->' for auto-inputs with proper
4152 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4163 coloring. Now the previous UGLY hack in handle_auto() is gone, and
4153 this is handled by the prompts class itself, as it should.
4164 this is handled by the prompts class itself, as it should.
4154
4165
4155 2002-03-05 Fernando Perez <fperez@colorado.edu>
4166 2002-03-05 Fernando Perez <fperez@colorado.edu>
4156
4167
4157 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4168 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
4158 @logstart to avoid name clashes with the math log function.
4169 @logstart to avoid name clashes with the math log function.
4159
4170
4160 * Big updates to X/Emacs section of the manual.
4171 * Big updates to X/Emacs section of the manual.
4161
4172
4162 * Removed ipython_emacs. Milan explained to me how to pass
4173 * Removed ipython_emacs. Milan explained to me how to pass
4163 arguments to ipython through Emacs. Some day I'm going to end up
4174 arguments to ipython through Emacs. Some day I'm going to end up
4164 learning some lisp...
4175 learning some lisp...
4165
4176
4166 2002-03-04 Fernando Perez <fperez@colorado.edu>
4177 2002-03-04 Fernando Perez <fperez@colorado.edu>
4167
4178
4168 * IPython/ipython_emacs: Created script to be used as the
4179 * IPython/ipython_emacs: Created script to be used as the
4169 py-python-command Emacs variable so we can pass IPython
4180 py-python-command Emacs variable so we can pass IPython
4170 parameters. I can't figure out how to tell Emacs directly to pass
4181 parameters. I can't figure out how to tell Emacs directly to pass
4171 parameters to IPython, so a dummy shell script will do it.
4182 parameters to IPython, so a dummy shell script will do it.
4172
4183
4173 Other enhancements made for things to work better under Emacs'
4184 Other enhancements made for things to work better under Emacs'
4174 various types of terminals. Many thanks to Milan Zamazal
4185 various types of terminals. Many thanks to Milan Zamazal
4175 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4186 <pdm-AT-zamazal.org> for all the suggestions and pointers.
4176
4187
4177 2002-03-01 Fernando Perez <fperez@colorado.edu>
4188 2002-03-01 Fernando Perez <fperez@colorado.edu>
4178
4189
4179 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4190 * IPython/ipmaker.py (make_IPython): added a --readline! option so
4180 that loading of readline is now optional. This gives better
4191 that loading of readline is now optional. This gives better
4181 control to emacs users.
4192 control to emacs users.
4182
4193
4183 * IPython/ultraTB.py (__date__): Modified color escape sequences
4194 * IPython/ultraTB.py (__date__): Modified color escape sequences
4184 and now things work fine under xterm and in Emacs' term buffers
4195 and now things work fine under xterm and in Emacs' term buffers
4185 (though not shell ones). Well, in emacs you get colors, but all
4196 (though not shell ones). Well, in emacs you get colors, but all
4186 seem to be 'light' colors (no difference between dark and light
4197 seem to be 'light' colors (no difference between dark and light
4187 ones). But the garbage chars are gone, and also in xterms. It
4198 ones). But the garbage chars are gone, and also in xterms. It
4188 seems that now I'm using 'cleaner' ansi sequences.
4199 seems that now I'm using 'cleaner' ansi sequences.
4189
4200
4190 2002-02-21 Fernando Perez <fperez@colorado.edu>
4201 2002-02-21 Fernando Perez <fperez@colorado.edu>
4191
4202
4192 * Released 0.2.7 (mainly to publish the scoping fix).
4203 * Released 0.2.7 (mainly to publish the scoping fix).
4193
4204
4194 * IPython/Logger.py (Logger.logstate): added. A corresponding
4205 * IPython/Logger.py (Logger.logstate): added. A corresponding
4195 @logstate magic was created.
4206 @logstate magic was created.
4196
4207
4197 * IPython/Magic.py: fixed nested scoping problem under Python
4208 * IPython/Magic.py: fixed nested scoping problem under Python
4198 2.1.x (automagic wasn't working).
4209 2.1.x (automagic wasn't working).
4199
4210
4200 2002-02-20 Fernando Perez <fperez@colorado.edu>
4211 2002-02-20 Fernando Perez <fperez@colorado.edu>
4201
4212
4202 * Released 0.2.6.
4213 * Released 0.2.6.
4203
4214
4204 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4215 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
4205 option so that logs can come out without any headers at all.
4216 option so that logs can come out without any headers at all.
4206
4217
4207 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4218 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
4208 SciPy.
4219 SciPy.
4209
4220
4210 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4221 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
4211 that embedded IPython calls don't require vars() to be explicitly
4222 that embedded IPython calls don't require vars() to be explicitly
4212 passed. Now they are extracted from the caller's frame (code
4223 passed. Now they are extracted from the caller's frame (code
4213 snatched from Eric Jones' weave). Added better documentation to
4224 snatched from Eric Jones' weave). Added better documentation to
4214 the section on embedding and the example file.
4225 the section on embedding and the example file.
4215
4226
4216 * IPython/genutils.py (page): Changed so that under emacs, it just
4227 * IPython/genutils.py (page): Changed so that under emacs, it just
4217 prints the string. You can then page up and down in the emacs
4228 prints the string. You can then page up and down in the emacs
4218 buffer itself. This is how the builtin help() works.
4229 buffer itself. This is how the builtin help() works.
4219
4230
4220 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4231 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
4221 macro scoping: macros need to be executed in the user's namespace
4232 macro scoping: macros need to be executed in the user's namespace
4222 to work as if they had been typed by the user.
4233 to work as if they had been typed by the user.
4223
4234
4224 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4235 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
4225 execute automatically (no need to type 'exec...'). They then
4236 execute automatically (no need to type 'exec...'). They then
4226 behave like 'true macros'. The printing system was also modified
4237 behave like 'true macros'. The printing system was also modified
4227 for this to work.
4238 for this to work.
4228
4239
4229 2002-02-19 Fernando Perez <fperez@colorado.edu>
4240 2002-02-19 Fernando Perez <fperez@colorado.edu>
4230
4241
4231 * IPython/genutils.py (page_file): new function for paging files
4242 * IPython/genutils.py (page_file): new function for paging files
4232 in an OS-independent way. Also necessary for file viewing to work
4243 in an OS-independent way. Also necessary for file viewing to work
4233 well inside Emacs buffers.
4244 well inside Emacs buffers.
4234 (page): Added checks for being in an emacs buffer.
4245 (page): Added checks for being in an emacs buffer.
4235 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4246 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
4236 same bug in iplib.
4247 same bug in iplib.
4237
4248
4238 2002-02-18 Fernando Perez <fperez@colorado.edu>
4249 2002-02-18 Fernando Perez <fperez@colorado.edu>
4239
4250
4240 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4251 * IPython/iplib.py (InteractiveShell.init_readline): modified use
4241 of readline so that IPython can work inside an Emacs buffer.
4252 of readline so that IPython can work inside an Emacs buffer.
4242
4253
4243 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4254 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
4244 method signatures (they weren't really bugs, but it looks cleaner
4255 method signatures (they weren't really bugs, but it looks cleaner
4245 and keeps PyChecker happy).
4256 and keeps PyChecker happy).
4246
4257
4247 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4258 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
4248 for implementing various user-defined hooks. Currently only
4259 for implementing various user-defined hooks. Currently only
4249 display is done.
4260 display is done.
4250
4261
4251 * IPython/Prompts.py (CachedOutput._display): changed display
4262 * IPython/Prompts.py (CachedOutput._display): changed display
4252 functions so that they can be dynamically changed by users easily.
4263 functions so that they can be dynamically changed by users easily.
4253
4264
4254 * IPython/Extensions/numeric_formats.py (num_display): added an
4265 * IPython/Extensions/numeric_formats.py (num_display): added an
4255 extension for printing NumPy arrays in flexible manners. It
4266 extension for printing NumPy arrays in flexible manners. It
4256 doesn't do anything yet, but all the structure is in
4267 doesn't do anything yet, but all the structure is in
4257 place. Ultimately the plan is to implement output format control
4268 place. Ultimately the plan is to implement output format control
4258 like in Octave.
4269 like in Octave.
4259
4270
4260 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4271 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
4261 methods are found at run-time by all the automatic machinery.
4272 methods are found at run-time by all the automatic machinery.
4262
4273
4263 2002-02-17 Fernando Perez <fperez@colorado.edu>
4274 2002-02-17 Fernando Perez <fperez@colorado.edu>
4264
4275
4265 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4276 * setup_Windows.py (make_shortcut): documented. Cleaned up the
4266 whole file a little.
4277 whole file a little.
4267
4278
4268 * ToDo: closed this document. Now there's a new_design.lyx
4279 * ToDo: closed this document. Now there's a new_design.lyx
4269 document for all new ideas. Added making a pdf of it for the
4280 document for all new ideas. Added making a pdf of it for the
4270 end-user distro.
4281 end-user distro.
4271
4282
4272 * IPython/Logger.py (Logger.switch_log): Created this to replace
4283 * IPython/Logger.py (Logger.switch_log): Created this to replace
4273 logon() and logoff(). It also fixes a nasty crash reported by
4284 logon() and logoff(). It also fixes a nasty crash reported by
4274 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4285 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
4275
4286
4276 * IPython/iplib.py (complete): got auto-completion to work with
4287 * IPython/iplib.py (complete): got auto-completion to work with
4277 automagic (I had wanted this for a long time).
4288 automagic (I had wanted this for a long time).
4278
4289
4279 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4290 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
4280 to @file, since file() is now a builtin and clashes with automagic
4291 to @file, since file() is now a builtin and clashes with automagic
4281 for @file.
4292 for @file.
4282
4293
4283 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4294 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
4284 of this was previously in iplib, which had grown to more than 2000
4295 of this was previously in iplib, which had grown to more than 2000
4285 lines, way too long. No new functionality, but it makes managing
4296 lines, way too long. No new functionality, but it makes managing
4286 the code a bit easier.
4297 the code a bit easier.
4287
4298
4288 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4299 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
4289 information to crash reports.
4300 information to crash reports.
4290
4301
4291 2002-02-12 Fernando Perez <fperez@colorado.edu>
4302 2002-02-12 Fernando Perez <fperez@colorado.edu>
4292
4303
4293 * Released 0.2.5.
4304 * Released 0.2.5.
4294
4305
4295 2002-02-11 Fernando Perez <fperez@colorado.edu>
4306 2002-02-11 Fernando Perez <fperez@colorado.edu>
4296
4307
4297 * Wrote a relatively complete Windows installer. It puts
4308 * Wrote a relatively complete Windows installer. It puts
4298 everything in place, creates Start Menu entries and fixes the
4309 everything in place, creates Start Menu entries and fixes the
4299 color issues. Nothing fancy, but it works.
4310 color issues. Nothing fancy, but it works.
4300
4311
4301 2002-02-10 Fernando Perez <fperez@colorado.edu>
4312 2002-02-10 Fernando Perez <fperez@colorado.edu>
4302
4313
4303 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4314 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
4304 os.path.expanduser() call so that we can type @run ~/myfile.py and
4315 os.path.expanduser() call so that we can type @run ~/myfile.py and
4305 have thigs work as expected.
4316 have thigs work as expected.
4306
4317
4307 * IPython/genutils.py (page): fixed exception handling so things
4318 * IPython/genutils.py (page): fixed exception handling so things
4308 work both in Unix and Windows correctly. Quitting a pager triggers
4319 work both in Unix and Windows correctly. Quitting a pager triggers
4309 an IOError/broken pipe in Unix, and in windows not finding a pager
4320 an IOError/broken pipe in Unix, and in windows not finding a pager
4310 is also an IOError, so I had to actually look at the return value
4321 is also an IOError, so I had to actually look at the return value
4311 of the exception, not just the exception itself. Should be ok now.
4322 of the exception, not just the exception itself. Should be ok now.
4312
4323
4313 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4324 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
4314 modified to allow case-insensitive color scheme changes.
4325 modified to allow case-insensitive color scheme changes.
4315
4326
4316 2002-02-09 Fernando Perez <fperez@colorado.edu>
4327 2002-02-09 Fernando Perez <fperez@colorado.edu>
4317
4328
4318 * IPython/genutils.py (native_line_ends): new function to leave
4329 * IPython/genutils.py (native_line_ends): new function to leave
4319 user config files with os-native line-endings.
4330 user config files with os-native line-endings.
4320
4331
4321 * README and manual updates.
4332 * README and manual updates.
4322
4333
4323 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4334 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
4324 instead of StringType to catch Unicode strings.
4335 instead of StringType to catch Unicode strings.
4325
4336
4326 * IPython/genutils.py (filefind): fixed bug for paths with
4337 * IPython/genutils.py (filefind): fixed bug for paths with
4327 embedded spaces (very common in Windows).
4338 embedded spaces (very common in Windows).
4328
4339
4329 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4340 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
4330 files under Windows, so that they get automatically associated
4341 files under Windows, so that they get automatically associated
4331 with a text editor. Windows makes it a pain to handle
4342 with a text editor. Windows makes it a pain to handle
4332 extension-less files.
4343 extension-less files.
4333
4344
4334 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4345 * IPython/iplib.py (InteractiveShell.init_readline): Made the
4335 warning about readline only occur for Posix. In Windows there's no
4346 warning about readline only occur for Posix. In Windows there's no
4336 way to get readline, so why bother with the warning.
4347 way to get readline, so why bother with the warning.
4337
4348
4338 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4349 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
4339 for __str__ instead of dir(self), since dir() changed in 2.2.
4350 for __str__ instead of dir(self), since dir() changed in 2.2.
4340
4351
4341 * Ported to Windows! Tested on XP, I suspect it should work fine
4352 * Ported to Windows! Tested on XP, I suspect it should work fine
4342 on NT/2000, but I don't think it will work on 98 et al. That
4353 on NT/2000, but I don't think it will work on 98 et al. That
4343 series of Windows is such a piece of junk anyway that I won't try
4354 series of Windows is such a piece of junk anyway that I won't try
4344 porting it there. The XP port was straightforward, showed a few
4355 porting it there. The XP port was straightforward, showed a few
4345 bugs here and there (fixed all), in particular some string
4356 bugs here and there (fixed all), in particular some string
4346 handling stuff which required considering Unicode strings (which
4357 handling stuff which required considering Unicode strings (which
4347 Windows uses). This is good, but hasn't been too tested :) No
4358 Windows uses). This is good, but hasn't been too tested :) No
4348 fancy installer yet, I'll put a note in the manual so people at
4359 fancy installer yet, I'll put a note in the manual so people at
4349 least make manually a shortcut.
4360 least make manually a shortcut.
4350
4361
4351 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4362 * IPython/iplib.py (Magic.magic_colors): Unified the color options
4352 into a single one, "colors". This now controls both prompt and
4363 into a single one, "colors". This now controls both prompt and
4353 exception color schemes, and can be changed both at startup
4364 exception color schemes, and can be changed both at startup
4354 (either via command-line switches or via ipythonrc files) and at
4365 (either via command-line switches or via ipythonrc files) and at
4355 runtime, with @colors.
4366 runtime, with @colors.
4356 (Magic.magic_run): renamed @prun to @run and removed the old
4367 (Magic.magic_run): renamed @prun to @run and removed the old
4357 @run. The two were too similar to warrant keeping both.
4368 @run. The two were too similar to warrant keeping both.
4358
4369
4359 2002-02-03 Fernando Perez <fperez@colorado.edu>
4370 2002-02-03 Fernando Perez <fperez@colorado.edu>
4360
4371
4361 * IPython/iplib.py (install_first_time): Added comment on how to
4372 * IPython/iplib.py (install_first_time): Added comment on how to
4362 configure the color options for first-time users. Put a <return>
4373 configure the color options for first-time users. Put a <return>
4363 request at the end so that small-terminal users get a chance to
4374 request at the end so that small-terminal users get a chance to
4364 read the startup info.
4375 read the startup info.
4365
4376
4366 2002-01-23 Fernando Perez <fperez@colorado.edu>
4377 2002-01-23 Fernando Perez <fperez@colorado.edu>
4367
4378
4368 * IPython/iplib.py (CachedOutput.update): Changed output memory
4379 * IPython/iplib.py (CachedOutput.update): Changed output memory
4369 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4380 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
4370 input history we still use _i. Did this b/c these variable are
4381 input history we still use _i. Did this b/c these variable are
4371 very commonly used in interactive work, so the less we need to
4382 very commonly used in interactive work, so the less we need to
4372 type the better off we are.
4383 type the better off we are.
4373 (Magic.magic_prun): updated @prun to better handle the namespaces
4384 (Magic.magic_prun): updated @prun to better handle the namespaces
4374 the file will run in, including a fix for __name__ not being set
4385 the file will run in, including a fix for __name__ not being set
4375 before.
4386 before.
4376
4387
4377 2002-01-20 Fernando Perez <fperez@colorado.edu>
4388 2002-01-20 Fernando Perez <fperez@colorado.edu>
4378
4389
4379 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4390 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
4380 extra garbage for Python 2.2. Need to look more carefully into
4391 extra garbage for Python 2.2. Need to look more carefully into
4381 this later.
4392 this later.
4382
4393
4383 2002-01-19 Fernando Perez <fperez@colorado.edu>
4394 2002-01-19 Fernando Perez <fperez@colorado.edu>
4384
4395
4385 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4396 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
4386 display SyntaxError exceptions properly formatted when they occur
4397 display SyntaxError exceptions properly formatted when they occur
4387 (they can be triggered by imported code).
4398 (they can be triggered by imported code).
4388
4399
4389 2002-01-18 Fernando Perez <fperez@colorado.edu>
4400 2002-01-18 Fernando Perez <fperez@colorado.edu>
4390
4401
4391 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4402 * IPython/iplib.py (InteractiveShell.safe_execfile): now
4392 SyntaxError exceptions are reported nicely formatted, instead of
4403 SyntaxError exceptions are reported nicely formatted, instead of
4393 spitting out only offset information as before.
4404 spitting out only offset information as before.
4394 (Magic.magic_prun): Added the @prun function for executing
4405 (Magic.magic_prun): Added the @prun function for executing
4395 programs with command line args inside IPython.
4406 programs with command line args inside IPython.
4396
4407
4397 2002-01-16 Fernando Perez <fperez@colorado.edu>
4408 2002-01-16 Fernando Perez <fperez@colorado.edu>
4398
4409
4399 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4410 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
4400 to *not* include the last item given in a range. This brings their
4411 to *not* include the last item given in a range. This brings their
4401 behavior in line with Python's slicing:
4412 behavior in line with Python's slicing:
4402 a[n1:n2] -> a[n1]...a[n2-1]
4413 a[n1:n2] -> a[n1]...a[n2-1]
4403 It may be a bit less convenient, but I prefer to stick to Python's
4414 It may be a bit less convenient, but I prefer to stick to Python's
4404 conventions *everywhere*, so users never have to wonder.
4415 conventions *everywhere*, so users never have to wonder.
4405 (Magic.magic_macro): Added @macro function to ease the creation of
4416 (Magic.magic_macro): Added @macro function to ease the creation of
4406 macros.
4417 macros.
4407
4418
4408 2002-01-05 Fernando Perez <fperez@colorado.edu>
4419 2002-01-05 Fernando Perez <fperez@colorado.edu>
4409
4420
4410 * Released 0.2.4.
4421 * Released 0.2.4.
4411
4422
4412 * IPython/iplib.py (Magic.magic_pdef):
4423 * IPython/iplib.py (Magic.magic_pdef):
4413 (InteractiveShell.safe_execfile): report magic lines and error
4424 (InteractiveShell.safe_execfile): report magic lines and error
4414 lines without line numbers so one can easily copy/paste them for
4425 lines without line numbers so one can easily copy/paste them for
4415 re-execution.
4426 re-execution.
4416
4427
4417 * Updated manual with recent changes.
4428 * Updated manual with recent changes.
4418
4429
4419 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4430 * IPython/iplib.py (Magic.magic_oinfo): added constructor
4420 docstring printing when class? is called. Very handy for knowing
4431 docstring printing when class? is called. Very handy for knowing
4421 how to create class instances (as long as __init__ is well
4432 how to create class instances (as long as __init__ is well
4422 documented, of course :)
4433 documented, of course :)
4423 (Magic.magic_doc): print both class and constructor docstrings.
4434 (Magic.magic_doc): print both class and constructor docstrings.
4424 (Magic.magic_pdef): give constructor info if passed a class and
4435 (Magic.magic_pdef): give constructor info if passed a class and
4425 __call__ info for callable object instances.
4436 __call__ info for callable object instances.
4426
4437
4427 2002-01-04 Fernando Perez <fperez@colorado.edu>
4438 2002-01-04 Fernando Perez <fperez@colorado.edu>
4428
4439
4429 * Made deep_reload() off by default. It doesn't always work
4440 * Made deep_reload() off by default. It doesn't always work
4430 exactly as intended, so it's probably safer to have it off. It's
4441 exactly as intended, so it's probably safer to have it off. It's
4431 still available as dreload() anyway, so nothing is lost.
4442 still available as dreload() anyway, so nothing is lost.
4432
4443
4433 2002-01-02 Fernando Perez <fperez@colorado.edu>
4444 2002-01-02 Fernando Perez <fperez@colorado.edu>
4434
4445
4435 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
4446 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
4436 so I wanted an updated release).
4447 so I wanted an updated release).
4437
4448
4438 2001-12-27 Fernando Perez <fperez@colorado.edu>
4449 2001-12-27 Fernando Perez <fperez@colorado.edu>
4439
4450
4440 * IPython/iplib.py (InteractiveShell.interact): Added the original
4451 * IPython/iplib.py (InteractiveShell.interact): Added the original
4441 code from 'code.py' for this module in order to change the
4452 code from 'code.py' for this module in order to change the
4442 handling of a KeyboardInterrupt. This was necessary b/c otherwise
4453 handling of a KeyboardInterrupt. This was necessary b/c otherwise
4443 the history cache would break when the user hit Ctrl-C, and
4454 the history cache would break when the user hit Ctrl-C, and
4444 interact() offers no way to add any hooks to it.
4455 interact() offers no way to add any hooks to it.
4445
4456
4446 2001-12-23 Fernando Perez <fperez@colorado.edu>
4457 2001-12-23 Fernando Perez <fperez@colorado.edu>
4447
4458
4448 * setup.py: added check for 'MANIFEST' before trying to remove
4459 * setup.py: added check for 'MANIFEST' before trying to remove
4449 it. Thanks to Sean Reifschneider.
4460 it. Thanks to Sean Reifschneider.
4450
4461
4451 2001-12-22 Fernando Perez <fperez@colorado.edu>
4462 2001-12-22 Fernando Perez <fperez@colorado.edu>
4452
4463
4453 * Released 0.2.2.
4464 * Released 0.2.2.
4454
4465
4455 * Finished (reasonably) writing the manual. Later will add the
4466 * Finished (reasonably) writing the manual. Later will add the
4456 python-standard navigation stylesheets, but for the time being
4467 python-standard navigation stylesheets, but for the time being
4457 it's fairly complete. Distribution will include html and pdf
4468 it's fairly complete. Distribution will include html and pdf
4458 versions.
4469 versions.
4459
4470
4460 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4471 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
4461 (MayaVi author).
4472 (MayaVi author).
4462
4473
4463 2001-12-21 Fernando Perez <fperez@colorado.edu>
4474 2001-12-21 Fernando Perez <fperez@colorado.edu>
4464
4475
4465 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4476 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4466 good public release, I think (with the manual and the distutils
4477 good public release, I think (with the manual and the distutils
4467 installer). The manual can use some work, but that can go
4478 installer). The manual can use some work, but that can go
4468 slowly. Otherwise I think it's quite nice for end users. Next
4479 slowly. Otherwise I think it's quite nice for end users. Next
4469 summer, rewrite the guts of it...
4480 summer, rewrite the guts of it...
4470
4481
4471 * Changed format of ipythonrc files to use whitespace as the
4482 * Changed format of ipythonrc files to use whitespace as the
4472 separator instead of an explicit '='. Cleaner.
4483 separator instead of an explicit '='. Cleaner.
4473
4484
4474 2001-12-20 Fernando Perez <fperez@colorado.edu>
4485 2001-12-20 Fernando Perez <fperez@colorado.edu>
4475
4486
4476 * Started a manual in LyX. For now it's just a quick merge of the
4487 * Started a manual in LyX. For now it's just a quick merge of the
4477 various internal docstrings and READMEs. Later it may grow into a
4488 various internal docstrings and READMEs. Later it may grow into a
4478 nice, full-blown manual.
4489 nice, full-blown manual.
4479
4490
4480 * Set up a distutils based installer. Installation should now be
4491 * Set up a distutils based installer. Installation should now be
4481 trivially simple for end-users.
4492 trivially simple for end-users.
4482
4493
4483 2001-12-11 Fernando Perez <fperez@colorado.edu>
4494 2001-12-11 Fernando Perez <fperez@colorado.edu>
4484
4495
4485 * Released 0.2.0. First public release, announced it at
4496 * Released 0.2.0. First public release, announced it at
4486 comp.lang.python. From now on, just bugfixes...
4497 comp.lang.python. From now on, just bugfixes...
4487
4498
4488 * Went through all the files, set copyright/license notices and
4499 * Went through all the files, set copyright/license notices and
4489 cleaned up things. Ready for release.
4500 cleaned up things. Ready for release.
4490
4501
4491 2001-12-10 Fernando Perez <fperez@colorado.edu>
4502 2001-12-10 Fernando Perez <fperez@colorado.edu>
4492
4503
4493 * Changed the first-time installer not to use tarfiles. It's more
4504 * Changed the first-time installer not to use tarfiles. It's more
4494 robust now and less unix-dependent. Also makes it easier for
4505 robust now and less unix-dependent. Also makes it easier for
4495 people to later upgrade versions.
4506 people to later upgrade versions.
4496
4507
4497 * Changed @exit to @abort to reflect the fact that it's pretty
4508 * Changed @exit to @abort to reflect the fact that it's pretty
4498 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4509 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4499 becomes significant only when IPyhton is embedded: in that case,
4510 becomes significant only when IPyhton is embedded: in that case,
4500 C-D closes IPython only, but @abort kills the enclosing program
4511 C-D closes IPython only, but @abort kills the enclosing program
4501 too (unless it had called IPython inside a try catching
4512 too (unless it had called IPython inside a try catching
4502 SystemExit).
4513 SystemExit).
4503
4514
4504 * Created Shell module which exposes the actuall IPython Shell
4515 * Created Shell module which exposes the actuall IPython Shell
4505 classes, currently the normal and the embeddable one. This at
4516 classes, currently the normal and the embeddable one. This at
4506 least offers a stable interface we won't need to change when
4517 least offers a stable interface we won't need to change when
4507 (later) the internals are rewritten. That rewrite will be confined
4518 (later) the internals are rewritten. That rewrite will be confined
4508 to iplib and ipmaker, but the Shell interface should remain as is.
4519 to iplib and ipmaker, but the Shell interface should remain as is.
4509
4520
4510 * Added embed module which offers an embeddable IPShell object,
4521 * Added embed module which offers an embeddable IPShell object,
4511 useful to fire up IPython *inside* a running program. Great for
4522 useful to fire up IPython *inside* a running program. Great for
4512 debugging or dynamical data analysis.
4523 debugging or dynamical data analysis.
4513
4524
4514 2001-12-08 Fernando Perez <fperez@colorado.edu>
4525 2001-12-08 Fernando Perez <fperez@colorado.edu>
4515
4526
4516 * Fixed small bug preventing seeing info from methods of defined
4527 * Fixed small bug preventing seeing info from methods of defined
4517 objects (incorrect namespace in _ofind()).
4528 objects (incorrect namespace in _ofind()).
4518
4529
4519 * Documentation cleanup. Moved the main usage docstrings to a
4530 * Documentation cleanup. Moved the main usage docstrings to a
4520 separate file, usage.py (cleaner to maintain, and hopefully in the
4531 separate file, usage.py (cleaner to maintain, and hopefully in the
4521 future some perlpod-like way of producing interactive, man and
4532 future some perlpod-like way of producing interactive, man and
4522 html docs out of it will be found).
4533 html docs out of it will be found).
4523
4534
4524 * Added @profile to see your profile at any time.
4535 * Added @profile to see your profile at any time.
4525
4536
4526 * Added @p as an alias for 'print'. It's especially convenient if
4537 * Added @p as an alias for 'print'. It's especially convenient if
4527 using automagic ('p x' prints x).
4538 using automagic ('p x' prints x).
4528
4539
4529 * Small cleanups and fixes after a pychecker run.
4540 * Small cleanups and fixes after a pychecker run.
4530
4541
4531 * Changed the @cd command to handle @cd - and @cd -<n> for
4542 * Changed the @cd command to handle @cd - and @cd -<n> for
4532 visiting any directory in _dh.
4543 visiting any directory in _dh.
4533
4544
4534 * Introduced _dh, a history of visited directories. @dhist prints
4545 * Introduced _dh, a history of visited directories. @dhist prints
4535 it out with numbers.
4546 it out with numbers.
4536
4547
4537 2001-12-07 Fernando Perez <fperez@colorado.edu>
4548 2001-12-07 Fernando Perez <fperez@colorado.edu>
4538
4549
4539 * Released 0.1.22
4550 * Released 0.1.22
4540
4551
4541 * Made initialization a bit more robust against invalid color
4552 * Made initialization a bit more robust against invalid color
4542 options in user input (exit, not traceback-crash).
4553 options in user input (exit, not traceback-crash).
4543
4554
4544 * Changed the bug crash reporter to write the report only in the
4555 * Changed the bug crash reporter to write the report only in the
4545 user's .ipython directory. That way IPython won't litter people's
4556 user's .ipython directory. That way IPython won't litter people's
4546 hard disks with crash files all over the place. Also print on
4557 hard disks with crash files all over the place. Also print on
4547 screen the necessary mail command.
4558 screen the necessary mail command.
4548
4559
4549 * With the new ultraTB, implemented LightBG color scheme for light
4560 * With the new ultraTB, implemented LightBG color scheme for light
4550 background terminals. A lot of people like white backgrounds, so I
4561 background terminals. A lot of people like white backgrounds, so I
4551 guess we should at least give them something readable.
4562 guess we should at least give them something readable.
4552
4563
4553 2001-12-06 Fernando Perez <fperez@colorado.edu>
4564 2001-12-06 Fernando Perez <fperez@colorado.edu>
4554
4565
4555 * Modified the structure of ultraTB. Now there's a proper class
4566 * Modified the structure of ultraTB. Now there's a proper class
4556 for tables of color schemes which allow adding schemes easily and
4567 for tables of color schemes which allow adding schemes easily and
4557 switching the active scheme without creating a new instance every
4568 switching the active scheme without creating a new instance every
4558 time (which was ridiculous). The syntax for creating new schemes
4569 time (which was ridiculous). The syntax for creating new schemes
4559 is also cleaner. I think ultraTB is finally done, with a clean
4570 is also cleaner. I think ultraTB is finally done, with a clean
4560 class structure. Names are also much cleaner (now there's proper
4571 class structure. Names are also much cleaner (now there's proper
4561 color tables, no need for every variable to also have 'color' in
4572 color tables, no need for every variable to also have 'color' in
4562 its name).
4573 its name).
4563
4574
4564 * Broke down genutils into separate files. Now genutils only
4575 * Broke down genutils into separate files. Now genutils only
4565 contains utility functions, and classes have been moved to their
4576 contains utility functions, and classes have been moved to their
4566 own files (they had enough independent functionality to warrant
4577 own files (they had enough independent functionality to warrant
4567 it): ConfigLoader, OutputTrap, Struct.
4578 it): ConfigLoader, OutputTrap, Struct.
4568
4579
4569 2001-12-05 Fernando Perez <fperez@colorado.edu>
4580 2001-12-05 Fernando Perez <fperez@colorado.edu>
4570
4581
4571 * IPython turns 21! Released version 0.1.21, as a candidate for
4582 * IPython turns 21! Released version 0.1.21, as a candidate for
4572 public consumption. If all goes well, release in a few days.
4583 public consumption. If all goes well, release in a few days.
4573
4584
4574 * Fixed path bug (files in Extensions/ directory wouldn't be found
4585 * Fixed path bug (files in Extensions/ directory wouldn't be found
4575 unless IPython/ was explicitly in sys.path).
4586 unless IPython/ was explicitly in sys.path).
4576
4587
4577 * Extended the FlexCompleter class as MagicCompleter to allow
4588 * Extended the FlexCompleter class as MagicCompleter to allow
4578 completion of @-starting lines.
4589 completion of @-starting lines.
4579
4590
4580 * Created __release__.py file as a central repository for release
4591 * Created __release__.py file as a central repository for release
4581 info that other files can read from.
4592 info that other files can read from.
4582
4593
4583 * Fixed small bug in logging: when logging was turned on in
4594 * Fixed small bug in logging: when logging was turned on in
4584 mid-session, old lines with special meanings (!@?) were being
4595 mid-session, old lines with special meanings (!@?) were being
4585 logged without the prepended comment, which is necessary since
4596 logged without the prepended comment, which is necessary since
4586 they are not truly valid python syntax. This should make session
4597 they are not truly valid python syntax. This should make session
4587 restores produce less errors.
4598 restores produce less errors.
4588
4599
4589 * The namespace cleanup forced me to make a FlexCompleter class
4600 * The namespace cleanup forced me to make a FlexCompleter class
4590 which is nothing but a ripoff of rlcompleter, but with selectable
4601 which is nothing but a ripoff of rlcompleter, but with selectable
4591 namespace (rlcompleter only works in __main__.__dict__). I'll try
4602 namespace (rlcompleter only works in __main__.__dict__). I'll try
4592 to submit a note to the authors to see if this change can be
4603 to submit a note to the authors to see if this change can be
4593 incorporated in future rlcompleter releases (Dec.6: done)
4604 incorporated in future rlcompleter releases (Dec.6: done)
4594
4605
4595 * More fixes to namespace handling. It was a mess! Now all
4606 * More fixes to namespace handling. It was a mess! Now all
4596 explicit references to __main__.__dict__ are gone (except when
4607 explicit references to __main__.__dict__ are gone (except when
4597 really needed) and everything is handled through the namespace
4608 really needed) and everything is handled through the namespace
4598 dicts in the IPython instance. We seem to be getting somewhere
4609 dicts in the IPython instance. We seem to be getting somewhere
4599 with this, finally...
4610 with this, finally...
4600
4611
4601 * Small documentation updates.
4612 * Small documentation updates.
4602
4613
4603 * Created the Extensions directory under IPython (with an
4614 * Created the Extensions directory under IPython (with an
4604 __init__.py). Put the PhysicalQ stuff there. This directory should
4615 __init__.py). Put the PhysicalQ stuff there. This directory should
4605 be used for all special-purpose extensions.
4616 be used for all special-purpose extensions.
4606
4617
4607 * File renaming:
4618 * File renaming:
4608 ipythonlib --> ipmaker
4619 ipythonlib --> ipmaker
4609 ipplib --> iplib
4620 ipplib --> iplib
4610 This makes a bit more sense in terms of what these files actually do.
4621 This makes a bit more sense in terms of what these files actually do.
4611
4622
4612 * Moved all the classes and functions in ipythonlib to ipplib, so
4623 * Moved all the classes and functions in ipythonlib to ipplib, so
4613 now ipythonlib only has make_IPython(). This will ease up its
4624 now ipythonlib only has make_IPython(). This will ease up its
4614 splitting in smaller functional chunks later.
4625 splitting in smaller functional chunks later.
4615
4626
4616 * Cleaned up (done, I think) output of @whos. Better column
4627 * Cleaned up (done, I think) output of @whos. Better column
4617 formatting, and now shows str(var) for as much as it can, which is
4628 formatting, and now shows str(var) for as much as it can, which is
4618 typically what one gets with a 'print var'.
4629 typically what one gets with a 'print var'.
4619
4630
4620 2001-12-04 Fernando Perez <fperez@colorado.edu>
4631 2001-12-04 Fernando Perez <fperez@colorado.edu>
4621
4632
4622 * Fixed namespace problems. Now builtin/IPyhton/user names get
4633 * Fixed namespace problems. Now builtin/IPyhton/user names get
4623 properly reported in their namespace. Internal namespace handling
4634 properly reported in their namespace. Internal namespace handling
4624 is finally getting decent (not perfect yet, but much better than
4635 is finally getting decent (not perfect yet, but much better than
4625 the ad-hoc mess we had).
4636 the ad-hoc mess we had).
4626
4637
4627 * Removed -exit option. If people just want to run a python
4638 * Removed -exit option. If people just want to run a python
4628 script, that's what the normal interpreter is for. Less
4639 script, that's what the normal interpreter is for. Less
4629 unnecessary options, less chances for bugs.
4640 unnecessary options, less chances for bugs.
4630
4641
4631 * Added a crash handler which generates a complete post-mortem if
4642 * Added a crash handler which generates a complete post-mortem if
4632 IPython crashes. This will help a lot in tracking bugs down the
4643 IPython crashes. This will help a lot in tracking bugs down the
4633 road.
4644 road.
4634
4645
4635 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4646 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4636 which were boud to functions being reassigned would bypass the
4647 which were boud to functions being reassigned would bypass the
4637 logger, breaking the sync of _il with the prompt counter. This
4648 logger, breaking the sync of _il with the prompt counter. This
4638 would then crash IPython later when a new line was logged.
4649 would then crash IPython later when a new line was logged.
4639
4650
4640 2001-12-02 Fernando Perez <fperez@colorado.edu>
4651 2001-12-02 Fernando Perez <fperez@colorado.edu>
4641
4652
4642 * Made IPython a package. This means people don't have to clutter
4653 * Made IPython a package. This means people don't have to clutter
4643 their sys.path with yet another directory. Changed the INSTALL
4654 their sys.path with yet another directory. Changed the INSTALL
4644 file accordingly.
4655 file accordingly.
4645
4656
4646 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4657 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4647 sorts its output (so @who shows it sorted) and @whos formats the
4658 sorts its output (so @who shows it sorted) and @whos formats the
4648 table according to the width of the first column. Nicer, easier to
4659 table according to the width of the first column. Nicer, easier to
4649 read. Todo: write a generic table_format() which takes a list of
4660 read. Todo: write a generic table_format() which takes a list of
4650 lists and prints it nicely formatted, with optional row/column
4661 lists and prints it nicely formatted, with optional row/column
4651 separators and proper padding and justification.
4662 separators and proper padding and justification.
4652
4663
4653 * Released 0.1.20
4664 * Released 0.1.20
4654
4665
4655 * Fixed bug in @log which would reverse the inputcache list (a
4666 * Fixed bug in @log which would reverse the inputcache list (a
4656 copy operation was missing).
4667 copy operation was missing).
4657
4668
4658 * Code cleanup. @config was changed to use page(). Better, since
4669 * Code cleanup. @config was changed to use page(). Better, since
4659 its output is always quite long.
4670 its output is always quite long.
4660
4671
4661 * Itpl is back as a dependency. I was having too many problems
4672 * Itpl is back as a dependency. I was having too many problems
4662 getting the parametric aliases to work reliably, and it's just
4673 getting the parametric aliases to work reliably, and it's just
4663 easier to code weird string operations with it than playing %()s
4674 easier to code weird string operations with it than playing %()s
4664 games. It's only ~6k, so I don't think it's too big a deal.
4675 games. It's only ~6k, so I don't think it's too big a deal.
4665
4676
4666 * Found (and fixed) a very nasty bug with history. !lines weren't
4677 * Found (and fixed) a very nasty bug with history. !lines weren't
4667 getting cached, and the out of sync caches would crash
4678 getting cached, and the out of sync caches would crash
4668 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4679 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4669 division of labor a bit better. Bug fixed, cleaner structure.
4680 division of labor a bit better. Bug fixed, cleaner structure.
4670
4681
4671 2001-12-01 Fernando Perez <fperez@colorado.edu>
4682 2001-12-01 Fernando Perez <fperez@colorado.edu>
4672
4683
4673 * Released 0.1.19
4684 * Released 0.1.19
4674
4685
4675 * Added option -n to @hist to prevent line number printing. Much
4686 * Added option -n to @hist to prevent line number printing. Much
4676 easier to copy/paste code this way.
4687 easier to copy/paste code this way.
4677
4688
4678 * Created global _il to hold the input list. Allows easy
4689 * Created global _il to hold the input list. Allows easy
4679 re-execution of blocks of code by slicing it (inspired by Janko's
4690 re-execution of blocks of code by slicing it (inspired by Janko's
4680 comment on 'macros').
4691 comment on 'macros').
4681
4692
4682 * Small fixes and doc updates.
4693 * Small fixes and doc updates.
4683
4694
4684 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4695 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4685 much too fragile with automagic. Handles properly multi-line
4696 much too fragile with automagic. Handles properly multi-line
4686 statements and takes parameters.
4697 statements and takes parameters.
4687
4698
4688 2001-11-30 Fernando Perez <fperez@colorado.edu>
4699 2001-11-30 Fernando Perez <fperez@colorado.edu>
4689
4700
4690 * Version 0.1.18 released.
4701 * Version 0.1.18 released.
4691
4702
4692 * Fixed nasty namespace bug in initial module imports.
4703 * Fixed nasty namespace bug in initial module imports.
4693
4704
4694 * Added copyright/license notes to all code files (except
4705 * Added copyright/license notes to all code files (except
4695 DPyGetOpt). For the time being, LGPL. That could change.
4706 DPyGetOpt). For the time being, LGPL. That could change.
4696
4707
4697 * Rewrote a much nicer README, updated INSTALL, cleaned up
4708 * Rewrote a much nicer README, updated INSTALL, cleaned up
4698 ipythonrc-* samples.
4709 ipythonrc-* samples.
4699
4710
4700 * Overall code/documentation cleanup. Basically ready for
4711 * Overall code/documentation cleanup. Basically ready for
4701 release. Only remaining thing: licence decision (LGPL?).
4712 release. Only remaining thing: licence decision (LGPL?).
4702
4713
4703 * Converted load_config to a class, ConfigLoader. Now recursion
4714 * Converted load_config to a class, ConfigLoader. Now recursion
4704 control is better organized. Doesn't include the same file twice.
4715 control is better organized. Doesn't include the same file twice.
4705
4716
4706 2001-11-29 Fernando Perez <fperez@colorado.edu>
4717 2001-11-29 Fernando Perez <fperez@colorado.edu>
4707
4718
4708 * Got input history working. Changed output history variables from
4719 * Got input history working. Changed output history variables from
4709 _p to _o so that _i is for input and _o for output. Just cleaner
4720 _p to _o so that _i is for input and _o for output. Just cleaner
4710 convention.
4721 convention.
4711
4722
4712 * Implemented parametric aliases. This pretty much allows the
4723 * Implemented parametric aliases. This pretty much allows the
4713 alias system to offer full-blown shell convenience, I think.
4724 alias system to offer full-blown shell convenience, I think.
4714
4725
4715 * Version 0.1.17 released, 0.1.18 opened.
4726 * Version 0.1.17 released, 0.1.18 opened.
4716
4727
4717 * dot_ipython/ipythonrc (alias): added documentation.
4728 * dot_ipython/ipythonrc (alias): added documentation.
4718 (xcolor): Fixed small bug (xcolors -> xcolor)
4729 (xcolor): Fixed small bug (xcolors -> xcolor)
4719
4730
4720 * Changed the alias system. Now alias is a magic command to define
4731 * Changed the alias system. Now alias is a magic command to define
4721 aliases just like the shell. Rationale: the builtin magics should
4732 aliases just like the shell. Rationale: the builtin magics should
4722 be there for things deeply connected to IPython's
4733 be there for things deeply connected to IPython's
4723 architecture. And this is a much lighter system for what I think
4734 architecture. And this is a much lighter system for what I think
4724 is the really important feature: allowing users to define quickly
4735 is the really important feature: allowing users to define quickly
4725 magics that will do shell things for them, so they can customize
4736 magics that will do shell things for them, so they can customize
4726 IPython easily to match their work habits. If someone is really
4737 IPython easily to match their work habits. If someone is really
4727 desperate to have another name for a builtin alias, they can
4738 desperate to have another name for a builtin alias, they can
4728 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4739 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4729 works.
4740 works.
4730
4741
4731 2001-11-28 Fernando Perez <fperez@colorado.edu>
4742 2001-11-28 Fernando Perez <fperez@colorado.edu>
4732
4743
4733 * Changed @file so that it opens the source file at the proper
4744 * Changed @file so that it opens the source file at the proper
4734 line. Since it uses less, if your EDITOR environment is
4745 line. Since it uses less, if your EDITOR environment is
4735 configured, typing v will immediately open your editor of choice
4746 configured, typing v will immediately open your editor of choice
4736 right at the line where the object is defined. Not as quick as
4747 right at the line where the object is defined. Not as quick as
4737 having a direct @edit command, but for all intents and purposes it
4748 having a direct @edit command, but for all intents and purposes it
4738 works. And I don't have to worry about writing @edit to deal with
4749 works. And I don't have to worry about writing @edit to deal with
4739 all the editors, less does that.
4750 all the editors, less does that.
4740
4751
4741 * Version 0.1.16 released, 0.1.17 opened.
4752 * Version 0.1.16 released, 0.1.17 opened.
4742
4753
4743 * Fixed some nasty bugs in the page/page_dumb combo that could
4754 * Fixed some nasty bugs in the page/page_dumb combo that could
4744 crash IPython.
4755 crash IPython.
4745
4756
4746 2001-11-27 Fernando Perez <fperez@colorado.edu>
4757 2001-11-27 Fernando Perez <fperez@colorado.edu>
4747
4758
4748 * Version 0.1.15 released, 0.1.16 opened.
4759 * Version 0.1.15 released, 0.1.16 opened.
4749
4760
4750 * Finally got ? and ?? to work for undefined things: now it's
4761 * Finally got ? and ?? to work for undefined things: now it's
4751 possible to type {}.get? and get information about the get method
4762 possible to type {}.get? and get information about the get method
4752 of dicts, or os.path? even if only os is defined (so technically
4763 of dicts, or os.path? even if only os is defined (so technically
4753 os.path isn't). Works at any level. For example, after import os,
4764 os.path isn't). Works at any level. For example, after import os,
4754 os?, os.path?, os.path.abspath? all work. This is great, took some
4765 os?, os.path?, os.path.abspath? all work. This is great, took some
4755 work in _ofind.
4766 work in _ofind.
4756
4767
4757 * Fixed more bugs with logging. The sanest way to do it was to add
4768 * Fixed more bugs with logging. The sanest way to do it was to add
4758 to @log a 'mode' parameter. Killed two in one shot (this mode
4769 to @log a 'mode' parameter. Killed two in one shot (this mode
4759 option was a request of Janko's). I think it's finally clean
4770 option was a request of Janko's). I think it's finally clean
4760 (famous last words).
4771 (famous last words).
4761
4772
4762 * Added a page_dumb() pager which does a decent job of paging on
4773 * Added a page_dumb() pager which does a decent job of paging on
4763 screen, if better things (like less) aren't available. One less
4774 screen, if better things (like less) aren't available. One less
4764 unix dependency (someday maybe somebody will port this to
4775 unix dependency (someday maybe somebody will port this to
4765 windows).
4776 windows).
4766
4777
4767 * Fixed problem in magic_log: would lock of logging out if log
4778 * Fixed problem in magic_log: would lock of logging out if log
4768 creation failed (because it would still think it had succeeded).
4779 creation failed (because it would still think it had succeeded).
4769
4780
4770 * Improved the page() function using curses to auto-detect screen
4781 * Improved the page() function using curses to auto-detect screen
4771 size. Now it can make a much better decision on whether to print
4782 size. Now it can make a much better decision on whether to print
4772 or page a string. Option screen_length was modified: a value 0
4783 or page a string. Option screen_length was modified: a value 0
4773 means auto-detect, and that's the default now.
4784 means auto-detect, and that's the default now.
4774
4785
4775 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4786 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4776 go out. I'll test it for a few days, then talk to Janko about
4787 go out. I'll test it for a few days, then talk to Janko about
4777 licences and announce it.
4788 licences and announce it.
4778
4789
4779 * Fixed the length of the auto-generated ---> prompt which appears
4790 * Fixed the length of the auto-generated ---> prompt which appears
4780 for auto-parens and auto-quotes. Getting this right isn't trivial,
4791 for auto-parens and auto-quotes. Getting this right isn't trivial,
4781 with all the color escapes, different prompt types and optional
4792 with all the color escapes, different prompt types and optional
4782 separators. But it seems to be working in all the combinations.
4793 separators. But it seems to be working in all the combinations.
4783
4794
4784 2001-11-26 Fernando Perez <fperez@colorado.edu>
4795 2001-11-26 Fernando Perez <fperez@colorado.edu>
4785
4796
4786 * Wrote a regexp filter to get option types from the option names
4797 * Wrote a regexp filter to get option types from the option names
4787 string. This eliminates the need to manually keep two duplicate
4798 string. This eliminates the need to manually keep two duplicate
4788 lists.
4799 lists.
4789
4800
4790 * Removed the unneeded check_option_names. Now options are handled
4801 * Removed the unneeded check_option_names. Now options are handled
4791 in a much saner manner and it's easy to visually check that things
4802 in a much saner manner and it's easy to visually check that things
4792 are ok.
4803 are ok.
4793
4804
4794 * Updated version numbers on all files I modified to carry a
4805 * Updated version numbers on all files I modified to carry a
4795 notice so Janko and Nathan have clear version markers.
4806 notice so Janko and Nathan have clear version markers.
4796
4807
4797 * Updated docstring for ultraTB with my changes. I should send
4808 * Updated docstring for ultraTB with my changes. I should send
4798 this to Nathan.
4809 this to Nathan.
4799
4810
4800 * Lots of small fixes. Ran everything through pychecker again.
4811 * Lots of small fixes. Ran everything through pychecker again.
4801
4812
4802 * Made loading of deep_reload an cmd line option. If it's not too
4813 * Made loading of deep_reload an cmd line option. If it's not too
4803 kosher, now people can just disable it. With -nodeep_reload it's
4814 kosher, now people can just disable it. With -nodeep_reload it's
4804 still available as dreload(), it just won't overwrite reload().
4815 still available as dreload(), it just won't overwrite reload().
4805
4816
4806 * Moved many options to the no| form (-opt and -noopt
4817 * Moved many options to the no| form (-opt and -noopt
4807 accepted). Cleaner.
4818 accepted). Cleaner.
4808
4819
4809 * Changed magic_log so that if called with no parameters, it uses
4820 * Changed magic_log so that if called with no parameters, it uses
4810 'rotate' mode. That way auto-generated logs aren't automatically
4821 'rotate' mode. That way auto-generated logs aren't automatically
4811 over-written. For normal logs, now a backup is made if it exists
4822 over-written. For normal logs, now a backup is made if it exists
4812 (only 1 level of backups). A new 'backup' mode was added to the
4823 (only 1 level of backups). A new 'backup' mode was added to the
4813 Logger class to support this. This was a request by Janko.
4824 Logger class to support this. This was a request by Janko.
4814
4825
4815 * Added @logoff/@logon to stop/restart an active log.
4826 * Added @logoff/@logon to stop/restart an active log.
4816
4827
4817 * Fixed a lot of bugs in log saving/replay. It was pretty
4828 * Fixed a lot of bugs in log saving/replay. It was pretty
4818 broken. Now special lines (!@,/) appear properly in the command
4829 broken. Now special lines (!@,/) appear properly in the command
4819 history after a log replay.
4830 history after a log replay.
4820
4831
4821 * Tried and failed to implement full session saving via pickle. My
4832 * Tried and failed to implement full session saving via pickle. My
4822 idea was to pickle __main__.__dict__, but modules can't be
4833 idea was to pickle __main__.__dict__, but modules can't be
4823 pickled. This would be a better alternative to replaying logs, but
4834 pickled. This would be a better alternative to replaying logs, but
4824 seems quite tricky to get to work. Changed -session to be called
4835 seems quite tricky to get to work. Changed -session to be called
4825 -logplay, which more accurately reflects what it does. And if we
4836 -logplay, which more accurately reflects what it does. And if we
4826 ever get real session saving working, -session is now available.
4837 ever get real session saving working, -session is now available.
4827
4838
4828 * Implemented color schemes for prompts also. As for tracebacks,
4839 * Implemented color schemes for prompts also. As for tracebacks,
4829 currently only NoColor and Linux are supported. But now the
4840 currently only NoColor and Linux are supported. But now the
4830 infrastructure is in place, based on a generic ColorScheme
4841 infrastructure is in place, based on a generic ColorScheme
4831 class. So writing and activating new schemes both for the prompts
4842 class. So writing and activating new schemes both for the prompts
4832 and the tracebacks should be straightforward.
4843 and the tracebacks should be straightforward.
4833
4844
4834 * Version 0.1.13 released, 0.1.14 opened.
4845 * Version 0.1.13 released, 0.1.14 opened.
4835
4846
4836 * Changed handling of options for output cache. Now counter is
4847 * Changed handling of options for output cache. Now counter is
4837 hardwired starting at 1 and one specifies the maximum number of
4848 hardwired starting at 1 and one specifies the maximum number of
4838 entries *in the outcache* (not the max prompt counter). This is
4849 entries *in the outcache* (not the max prompt counter). This is
4839 much better, since many statements won't increase the cache
4850 much better, since many statements won't increase the cache
4840 count. It also eliminated some confusing options, now there's only
4851 count. It also eliminated some confusing options, now there's only
4841 one: cache_size.
4852 one: cache_size.
4842
4853
4843 * Added 'alias' magic function and magic_alias option in the
4854 * Added 'alias' magic function and magic_alias option in the
4844 ipythonrc file. Now the user can easily define whatever names he
4855 ipythonrc file. Now the user can easily define whatever names he
4845 wants for the magic functions without having to play weird
4856 wants for the magic functions without having to play weird
4846 namespace games. This gives IPython a real shell-like feel.
4857 namespace games. This gives IPython a real shell-like feel.
4847
4858
4848 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4859 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4849 @ or not).
4860 @ or not).
4850
4861
4851 This was one of the last remaining 'visible' bugs (that I know
4862 This was one of the last remaining 'visible' bugs (that I know
4852 of). I think if I can clean up the session loading so it works
4863 of). I think if I can clean up the session loading so it works
4853 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4864 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4854 about licensing).
4865 about licensing).
4855
4866
4856 2001-11-25 Fernando Perez <fperez@colorado.edu>
4867 2001-11-25 Fernando Perez <fperez@colorado.edu>
4857
4868
4858 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4869 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4859 there's a cleaner distinction between what ? and ?? show.
4870 there's a cleaner distinction between what ? and ?? show.
4860
4871
4861 * Added screen_length option. Now the user can define his own
4872 * Added screen_length option. Now the user can define his own
4862 screen size for page() operations.
4873 screen size for page() operations.
4863
4874
4864 * Implemented magic shell-like functions with automatic code
4875 * Implemented magic shell-like functions with automatic code
4865 generation. Now adding another function is just a matter of adding
4876 generation. Now adding another function is just a matter of adding
4866 an entry to a dict, and the function is dynamically generated at
4877 an entry to a dict, and the function is dynamically generated at
4867 run-time. Python has some really cool features!
4878 run-time. Python has some really cool features!
4868
4879
4869 * Renamed many options to cleanup conventions a little. Now all
4880 * Renamed many options to cleanup conventions a little. Now all
4870 are lowercase, and only underscores where needed. Also in the code
4881 are lowercase, and only underscores where needed. Also in the code
4871 option name tables are clearer.
4882 option name tables are clearer.
4872
4883
4873 * Changed prompts a little. Now input is 'In [n]:' instead of
4884 * Changed prompts a little. Now input is 'In [n]:' instead of
4874 'In[n]:='. This allows it the numbers to be aligned with the
4885 'In[n]:='. This allows it the numbers to be aligned with the
4875 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4886 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4876 Python (it was a Mathematica thing). The '...' continuation prompt
4887 Python (it was a Mathematica thing). The '...' continuation prompt
4877 was also changed a little to align better.
4888 was also changed a little to align better.
4878
4889
4879 * Fixed bug when flushing output cache. Not all _p<n> variables
4890 * Fixed bug when flushing output cache. Not all _p<n> variables
4880 exist, so their deletion needs to be wrapped in a try:
4891 exist, so their deletion needs to be wrapped in a try:
4881
4892
4882 * Figured out how to properly use inspect.formatargspec() (it
4893 * Figured out how to properly use inspect.formatargspec() (it
4883 requires the args preceded by *). So I removed all the code from
4894 requires the args preceded by *). So I removed all the code from
4884 _get_pdef in Magic, which was just replicating that.
4895 _get_pdef in Magic, which was just replicating that.
4885
4896
4886 * Added test to prefilter to allow redefining magic function names
4897 * Added test to prefilter to allow redefining magic function names
4887 as variables. This is ok, since the @ form is always available,
4898 as variables. This is ok, since the @ form is always available,
4888 but whe should allow the user to define a variable called 'ls' if
4899 but whe should allow the user to define a variable called 'ls' if
4889 he needs it.
4900 he needs it.
4890
4901
4891 * Moved the ToDo information from README into a separate ToDo.
4902 * Moved the ToDo information from README into a separate ToDo.
4892
4903
4893 * General code cleanup and small bugfixes. I think it's close to a
4904 * General code cleanup and small bugfixes. I think it's close to a
4894 state where it can be released, obviously with a big 'beta'
4905 state where it can be released, obviously with a big 'beta'
4895 warning on it.
4906 warning on it.
4896
4907
4897 * Got the magic function split to work. Now all magics are defined
4908 * Got the magic function split to work. Now all magics are defined
4898 in a separate class. It just organizes things a bit, and now
4909 in a separate class. It just organizes things a bit, and now
4899 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4910 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4900 was too long).
4911 was too long).
4901
4912
4902 * Changed @clear to @reset to avoid potential confusions with
4913 * Changed @clear to @reset to avoid potential confusions with
4903 the shell command clear. Also renamed @cl to @clear, which does
4914 the shell command clear. Also renamed @cl to @clear, which does
4904 exactly what people expect it to from their shell experience.
4915 exactly what people expect it to from their shell experience.
4905
4916
4906 Added a check to the @reset command (since it's so
4917 Added a check to the @reset command (since it's so
4907 destructive, it's probably a good idea to ask for confirmation).
4918 destructive, it's probably a good idea to ask for confirmation).
4908 But now reset only works for full namespace resetting. Since the
4919 But now reset only works for full namespace resetting. Since the
4909 del keyword is already there for deleting a few specific
4920 del keyword is already there for deleting a few specific
4910 variables, I don't see the point of having a redundant magic
4921 variables, I don't see the point of having a redundant magic
4911 function for the same task.
4922 function for the same task.
4912
4923
4913 2001-11-24 Fernando Perez <fperez@colorado.edu>
4924 2001-11-24 Fernando Perez <fperez@colorado.edu>
4914
4925
4915 * Updated the builtin docs (esp. the ? ones).
4926 * Updated the builtin docs (esp. the ? ones).
4916
4927
4917 * Ran all the code through pychecker. Not terribly impressed with
4928 * Ran all the code through pychecker. Not terribly impressed with
4918 it: lots of spurious warnings and didn't really find anything of
4929 it: lots of spurious warnings and didn't really find anything of
4919 substance (just a few modules being imported and not used).
4930 substance (just a few modules being imported and not used).
4920
4931
4921 * Implemented the new ultraTB functionality into IPython. New
4932 * Implemented the new ultraTB functionality into IPython. New
4922 option: xcolors. This chooses color scheme. xmode now only selects
4933 option: xcolors. This chooses color scheme. xmode now only selects
4923 between Plain and Verbose. Better orthogonality.
4934 between Plain and Verbose. Better orthogonality.
4924
4935
4925 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4936 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4926 mode and color scheme for the exception handlers. Now it's
4937 mode and color scheme for the exception handlers. Now it's
4927 possible to have the verbose traceback with no coloring.
4938 possible to have the verbose traceback with no coloring.
4928
4939
4929 2001-11-23 Fernando Perez <fperez@colorado.edu>
4940 2001-11-23 Fernando Perez <fperez@colorado.edu>
4930
4941
4931 * Version 0.1.12 released, 0.1.13 opened.
4942 * Version 0.1.12 released, 0.1.13 opened.
4932
4943
4933 * Removed option to set auto-quote and auto-paren escapes by
4944 * Removed option to set auto-quote and auto-paren escapes by
4934 user. The chances of breaking valid syntax are just too high. If
4945 user. The chances of breaking valid syntax are just too high. If
4935 someone *really* wants, they can always dig into the code.
4946 someone *really* wants, they can always dig into the code.
4936
4947
4937 * Made prompt separators configurable.
4948 * Made prompt separators configurable.
4938
4949
4939 2001-11-22 Fernando Perez <fperez@colorado.edu>
4950 2001-11-22 Fernando Perez <fperez@colorado.edu>
4940
4951
4941 * Small bugfixes in many places.
4952 * Small bugfixes in many places.
4942
4953
4943 * Removed the MyCompleter class from ipplib. It seemed redundant
4954 * Removed the MyCompleter class from ipplib. It seemed redundant
4944 with the C-p,C-n history search functionality. Less code to
4955 with the C-p,C-n history search functionality. Less code to
4945 maintain.
4956 maintain.
4946
4957
4947 * Moved all the original ipython.py code into ipythonlib.py. Right
4958 * Moved all the original ipython.py code into ipythonlib.py. Right
4948 now it's just one big dump into a function called make_IPython, so
4959 now it's just one big dump into a function called make_IPython, so
4949 no real modularity has been gained. But at least it makes the
4960 no real modularity has been gained. But at least it makes the
4950 wrapper script tiny, and since ipythonlib is a module, it gets
4961 wrapper script tiny, and since ipythonlib is a module, it gets
4951 compiled and startup is much faster.
4962 compiled and startup is much faster.
4952
4963
4953 This is a reasobably 'deep' change, so we should test it for a
4964 This is a reasobably 'deep' change, so we should test it for a
4954 while without messing too much more with the code.
4965 while without messing too much more with the code.
4955
4966
4956 2001-11-21 Fernando Perez <fperez@colorado.edu>
4967 2001-11-21 Fernando Perez <fperez@colorado.edu>
4957
4968
4958 * Version 0.1.11 released, 0.1.12 opened for further work.
4969 * Version 0.1.11 released, 0.1.12 opened for further work.
4959
4970
4960 * Removed dependency on Itpl. It was only needed in one place. It
4971 * Removed dependency on Itpl. It was only needed in one place. It
4961 would be nice if this became part of python, though. It makes life
4972 would be nice if this became part of python, though. It makes life
4962 *a lot* easier in some cases.
4973 *a lot* easier in some cases.
4963
4974
4964 * Simplified the prefilter code a bit. Now all handlers are
4975 * Simplified the prefilter code a bit. Now all handlers are
4965 expected to explicitly return a value (at least a blank string).
4976 expected to explicitly return a value (at least a blank string).
4966
4977
4967 * Heavy edits in ipplib. Removed the help system altogether. Now
4978 * Heavy edits in ipplib. Removed the help system altogether. Now
4968 obj?/?? is used for inspecting objects, a magic @doc prints
4979 obj?/?? is used for inspecting objects, a magic @doc prints
4969 docstrings, and full-blown Python help is accessed via the 'help'
4980 docstrings, and full-blown Python help is accessed via the 'help'
4970 keyword. This cleans up a lot of code (less to maintain) and does
4981 keyword. This cleans up a lot of code (less to maintain) and does
4971 the job. Since 'help' is now a standard Python component, might as
4982 the job. Since 'help' is now a standard Python component, might as
4972 well use it and remove duplicate functionality.
4983 well use it and remove duplicate functionality.
4973
4984
4974 Also removed the option to use ipplib as a standalone program. By
4985 Also removed the option to use ipplib as a standalone program. By
4975 now it's too dependent on other parts of IPython to function alone.
4986 now it's too dependent on other parts of IPython to function alone.
4976
4987
4977 * Fixed bug in genutils.pager. It would crash if the pager was
4988 * Fixed bug in genutils.pager. It would crash if the pager was
4978 exited immediately after opening (broken pipe).
4989 exited immediately after opening (broken pipe).
4979
4990
4980 * Trimmed down the VerboseTB reporting a little. The header is
4991 * Trimmed down the VerboseTB reporting a little. The header is
4981 much shorter now and the repeated exception arguments at the end
4992 much shorter now and the repeated exception arguments at the end
4982 have been removed. For interactive use the old header seemed a bit
4993 have been removed. For interactive use the old header seemed a bit
4983 excessive.
4994 excessive.
4984
4995
4985 * Fixed small bug in output of @whos for variables with multi-word
4996 * Fixed small bug in output of @whos for variables with multi-word
4986 types (only first word was displayed).
4997 types (only first word was displayed).
4987
4998
4988 2001-11-17 Fernando Perez <fperez@colorado.edu>
4999 2001-11-17 Fernando Perez <fperez@colorado.edu>
4989
5000
4990 * Version 0.1.10 released, 0.1.11 opened for further work.
5001 * Version 0.1.10 released, 0.1.11 opened for further work.
4991
5002
4992 * Modified dirs and friends. dirs now *returns* the stack (not
5003 * Modified dirs and friends. dirs now *returns* the stack (not
4993 prints), so one can manipulate it as a variable. Convenient to
5004 prints), so one can manipulate it as a variable. Convenient to
4994 travel along many directories.
5005 travel along many directories.
4995
5006
4996 * Fixed bug in magic_pdef: would only work with functions with
5007 * Fixed bug in magic_pdef: would only work with functions with
4997 arguments with default values.
5008 arguments with default values.
4998
5009
4999 2001-11-14 Fernando Perez <fperez@colorado.edu>
5010 2001-11-14 Fernando Perez <fperez@colorado.edu>
5000
5011
5001 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5012 * Added the PhysicsInput stuff to dot_ipython so it ships as an
5002 example with IPython. Various other minor fixes and cleanups.
5013 example with IPython. Various other minor fixes and cleanups.
5003
5014
5004 * Version 0.1.9 released, 0.1.10 opened for further work.
5015 * Version 0.1.9 released, 0.1.10 opened for further work.
5005
5016
5006 * Added sys.path to the list of directories searched in the
5017 * Added sys.path to the list of directories searched in the
5007 execfile= option. It used to be the current directory and the
5018 execfile= option. It used to be the current directory and the
5008 user's IPYTHONDIR only.
5019 user's IPYTHONDIR only.
5009
5020
5010 2001-11-13 Fernando Perez <fperez@colorado.edu>
5021 2001-11-13 Fernando Perez <fperez@colorado.edu>
5011
5022
5012 * Reinstated the raw_input/prefilter separation that Janko had
5023 * Reinstated the raw_input/prefilter separation that Janko had
5013 initially. This gives a more convenient setup for extending the
5024 initially. This gives a more convenient setup for extending the
5014 pre-processor from the outside: raw_input always gets a string,
5025 pre-processor from the outside: raw_input always gets a string,
5015 and prefilter has to process it. We can then redefine prefilter
5026 and prefilter has to process it. We can then redefine prefilter
5016 from the outside and implement extensions for special
5027 from the outside and implement extensions for special
5017 purposes.
5028 purposes.
5018
5029
5019 Today I got one for inputting PhysicalQuantity objects
5030 Today I got one for inputting PhysicalQuantity objects
5020 (from Scientific) without needing any function calls at
5031 (from Scientific) without needing any function calls at
5021 all. Extremely convenient, and it's all done as a user-level
5032 all. Extremely convenient, and it's all done as a user-level
5022 extension (no IPython code was touched). Now instead of:
5033 extension (no IPython code was touched). Now instead of:
5023 a = PhysicalQuantity(4.2,'m/s**2')
5034 a = PhysicalQuantity(4.2,'m/s**2')
5024 one can simply say
5035 one can simply say
5025 a = 4.2 m/s**2
5036 a = 4.2 m/s**2
5026 or even
5037 or even
5027 a = 4.2 m/s^2
5038 a = 4.2 m/s^2
5028
5039
5029 I use this, but it's also a proof of concept: IPython really is
5040 I use this, but it's also a proof of concept: IPython really is
5030 fully user-extensible, even at the level of the parsing of the
5041 fully user-extensible, even at the level of the parsing of the
5031 command line. It's not trivial, but it's perfectly doable.
5042 command line. It's not trivial, but it's perfectly doable.
5032
5043
5033 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5044 * Added 'add_flip' method to inclusion conflict resolver. Fixes
5034 the problem of modules being loaded in the inverse order in which
5045 the problem of modules being loaded in the inverse order in which
5035 they were defined in
5046 they were defined in
5036
5047
5037 * Version 0.1.8 released, 0.1.9 opened for further work.
5048 * Version 0.1.8 released, 0.1.9 opened for further work.
5038
5049
5039 * Added magics pdef, source and file. They respectively show the
5050 * Added magics pdef, source and file. They respectively show the
5040 definition line ('prototype' in C), source code and full python
5051 definition line ('prototype' in C), source code and full python
5041 file for any callable object. The object inspector oinfo uses
5052 file for any callable object. The object inspector oinfo uses
5042 these to show the same information.
5053 these to show the same information.
5043
5054
5044 * Version 0.1.7 released, 0.1.8 opened for further work.
5055 * Version 0.1.7 released, 0.1.8 opened for further work.
5045
5056
5046 * Separated all the magic functions into a class called Magic. The
5057 * Separated all the magic functions into a class called Magic. The
5047 InteractiveShell class was becoming too big for Xemacs to handle
5058 InteractiveShell class was becoming too big for Xemacs to handle
5048 (de-indenting a line would lock it up for 10 seconds while it
5059 (de-indenting a line would lock it up for 10 seconds while it
5049 backtracked on the whole class!)
5060 backtracked on the whole class!)
5050
5061
5051 FIXME: didn't work. It can be done, but right now namespaces are
5062 FIXME: didn't work. It can be done, but right now namespaces are
5052 all messed up. Do it later (reverted it for now, so at least
5063 all messed up. Do it later (reverted it for now, so at least
5053 everything works as before).
5064 everything works as before).
5054
5065
5055 * Got the object introspection system (magic_oinfo) working! I
5066 * Got the object introspection system (magic_oinfo) working! I
5056 think this is pretty much ready for release to Janko, so he can
5067 think this is pretty much ready for release to Janko, so he can
5057 test it for a while and then announce it. Pretty much 100% of what
5068 test it for a while and then announce it. Pretty much 100% of what
5058 I wanted for the 'phase 1' release is ready. Happy, tired.
5069 I wanted for the 'phase 1' release is ready. Happy, tired.
5059
5070
5060 2001-11-12 Fernando Perez <fperez@colorado.edu>
5071 2001-11-12 Fernando Perez <fperez@colorado.edu>
5061
5072
5062 * Version 0.1.6 released, 0.1.7 opened for further work.
5073 * Version 0.1.6 released, 0.1.7 opened for further work.
5063
5074
5064 * Fixed bug in printing: it used to test for truth before
5075 * Fixed bug in printing: it used to test for truth before
5065 printing, so 0 wouldn't print. Now checks for None.
5076 printing, so 0 wouldn't print. Now checks for None.
5066
5077
5067 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5078 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
5068 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5079 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
5069 reaches by hand into the outputcache. Think of a better way to do
5080 reaches by hand into the outputcache. Think of a better way to do
5070 this later.
5081 this later.
5071
5082
5072 * Various small fixes thanks to Nathan's comments.
5083 * Various small fixes thanks to Nathan's comments.
5073
5084
5074 * Changed magic_pprint to magic_Pprint. This way it doesn't
5085 * Changed magic_pprint to magic_Pprint. This way it doesn't
5075 collide with pprint() and the name is consistent with the command
5086 collide with pprint() and the name is consistent with the command
5076 line option.
5087 line option.
5077
5088
5078 * Changed prompt counter behavior to be fully like
5089 * Changed prompt counter behavior to be fully like
5079 Mathematica's. That is, even input that doesn't return a result
5090 Mathematica's. That is, even input that doesn't return a result
5080 raises the prompt counter. The old behavior was kind of confusing
5091 raises the prompt counter. The old behavior was kind of confusing
5081 (getting the same prompt number several times if the operation
5092 (getting the same prompt number several times if the operation
5082 didn't return a result).
5093 didn't return a result).
5083
5094
5084 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5095 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
5085
5096
5086 * Fixed -Classic mode (wasn't working anymore).
5097 * Fixed -Classic mode (wasn't working anymore).
5087
5098
5088 * Added colored prompts using Nathan's new code. Colors are
5099 * Added colored prompts using Nathan's new code. Colors are
5089 currently hardwired, they can be user-configurable. For
5100 currently hardwired, they can be user-configurable. For
5090 developers, they can be chosen in file ipythonlib.py, at the
5101 developers, they can be chosen in file ipythonlib.py, at the
5091 beginning of the CachedOutput class def.
5102 beginning of the CachedOutput class def.
5092
5103
5093 2001-11-11 Fernando Perez <fperez@colorado.edu>
5104 2001-11-11 Fernando Perez <fperez@colorado.edu>
5094
5105
5095 * Version 0.1.5 released, 0.1.6 opened for further work.
5106 * Version 0.1.5 released, 0.1.6 opened for further work.
5096
5107
5097 * Changed magic_env to *return* the environment as a dict (not to
5108 * Changed magic_env to *return* the environment as a dict (not to
5098 print it). This way it prints, but it can also be processed.
5109 print it). This way it prints, but it can also be processed.
5099
5110
5100 * Added Verbose exception reporting to interactive
5111 * Added Verbose exception reporting to interactive
5101 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5112 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
5102 traceback. Had to make some changes to the ultraTB file. This is
5113 traceback. Had to make some changes to the ultraTB file. This is
5103 probably the last 'big' thing in my mental todo list. This ties
5114 probably the last 'big' thing in my mental todo list. This ties
5104 in with the next entry:
5115 in with the next entry:
5105
5116
5106 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5117 * Changed -Xi and -Xf to a single -xmode option. Now all the user
5107 has to specify is Plain, Color or Verbose for all exception
5118 has to specify is Plain, Color or Verbose for all exception
5108 handling.
5119 handling.
5109
5120
5110 * Removed ShellServices option. All this can really be done via
5121 * Removed ShellServices option. All this can really be done via
5111 the magic system. It's easier to extend, cleaner and has automatic
5122 the magic system. It's easier to extend, cleaner and has automatic
5112 namespace protection and documentation.
5123 namespace protection and documentation.
5113
5124
5114 2001-11-09 Fernando Perez <fperez@colorado.edu>
5125 2001-11-09 Fernando Perez <fperez@colorado.edu>
5115
5126
5116 * Fixed bug in output cache flushing (missing parameter to
5127 * Fixed bug in output cache flushing (missing parameter to
5117 __init__). Other small bugs fixed (found using pychecker).
5128 __init__). Other small bugs fixed (found using pychecker).
5118
5129
5119 * Version 0.1.4 opened for bugfixing.
5130 * Version 0.1.4 opened for bugfixing.
5120
5131
5121 2001-11-07 Fernando Perez <fperez@colorado.edu>
5132 2001-11-07 Fernando Perez <fperez@colorado.edu>
5122
5133
5123 * Version 0.1.3 released, mainly because of the raw_input bug.
5134 * Version 0.1.3 released, mainly because of the raw_input bug.
5124
5135
5125 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5136 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
5126 and when testing for whether things were callable, a call could
5137 and when testing for whether things were callable, a call could
5127 actually be made to certain functions. They would get called again
5138 actually be made to certain functions. They would get called again
5128 once 'really' executed, with a resulting double call. A disaster
5139 once 'really' executed, with a resulting double call. A disaster
5129 in many cases (list.reverse() would never work!).
5140 in many cases (list.reverse() would never work!).
5130
5141
5131 * Removed prefilter() function, moved its code to raw_input (which
5142 * Removed prefilter() function, moved its code to raw_input (which
5132 after all was just a near-empty caller for prefilter). This saves
5143 after all was just a near-empty caller for prefilter). This saves
5133 a function call on every prompt, and simplifies the class a tiny bit.
5144 a function call on every prompt, and simplifies the class a tiny bit.
5134
5145
5135 * Fix _ip to __ip name in magic example file.
5146 * Fix _ip to __ip name in magic example file.
5136
5147
5137 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5148 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
5138 work with non-gnu versions of tar.
5149 work with non-gnu versions of tar.
5139
5150
5140 2001-11-06 Fernando Perez <fperez@colorado.edu>
5151 2001-11-06 Fernando Perez <fperez@colorado.edu>
5141
5152
5142 * Version 0.1.2. Just to keep track of the recent changes.
5153 * Version 0.1.2. Just to keep track of the recent changes.
5143
5154
5144 * Fixed nasty bug in output prompt routine. It used to check 'if
5155 * Fixed nasty bug in output prompt routine. It used to check 'if
5145 arg != None...'. Problem is, this fails if arg implements a
5156 arg != None...'. Problem is, this fails if arg implements a
5146 special comparison (__cmp__) which disallows comparing to
5157 special comparison (__cmp__) which disallows comparing to
5147 None. Found it when trying to use the PhysicalQuantity module from
5158 None. Found it when trying to use the PhysicalQuantity module from
5148 ScientificPython.
5159 ScientificPython.
5149
5160
5150 2001-11-05 Fernando Perez <fperez@colorado.edu>
5161 2001-11-05 Fernando Perez <fperez@colorado.edu>
5151
5162
5152 * Also added dirs. Now the pushd/popd/dirs family functions
5163 * Also added dirs. Now the pushd/popd/dirs family functions
5153 basically like the shell, with the added convenience of going home
5164 basically like the shell, with the added convenience of going home
5154 when called with no args.
5165 when called with no args.
5155
5166
5156 * pushd/popd slightly modified to mimic shell behavior more
5167 * pushd/popd slightly modified to mimic shell behavior more
5157 closely.
5168 closely.
5158
5169
5159 * Added env,pushd,popd from ShellServices as magic functions. I
5170 * Added env,pushd,popd from ShellServices as magic functions. I
5160 think the cleanest will be to port all desired functions from
5171 think the cleanest will be to port all desired functions from
5161 ShellServices as magics and remove ShellServices altogether. This
5172 ShellServices as magics and remove ShellServices altogether. This
5162 will provide a single, clean way of adding functionality
5173 will provide a single, clean way of adding functionality
5163 (shell-type or otherwise) to IP.
5174 (shell-type or otherwise) to IP.
5164
5175
5165 2001-11-04 Fernando Perez <fperez@colorado.edu>
5176 2001-11-04 Fernando Perez <fperez@colorado.edu>
5166
5177
5167 * Added .ipython/ directory to sys.path. This way users can keep
5178 * Added .ipython/ directory to sys.path. This way users can keep
5168 customizations there and access them via import.
5179 customizations there and access them via import.
5169
5180
5170 2001-11-03 Fernando Perez <fperez@colorado.edu>
5181 2001-11-03 Fernando Perez <fperez@colorado.edu>
5171
5182
5172 * Opened version 0.1.1 for new changes.
5183 * Opened version 0.1.1 for new changes.
5173
5184
5174 * Changed version number to 0.1.0: first 'public' release, sent to
5185 * Changed version number to 0.1.0: first 'public' release, sent to
5175 Nathan and Janko.
5186 Nathan and Janko.
5176
5187
5177 * Lots of small fixes and tweaks.
5188 * Lots of small fixes and tweaks.
5178
5189
5179 * Minor changes to whos format. Now strings are shown, snipped if
5190 * Minor changes to whos format. Now strings are shown, snipped if
5180 too long.
5191 too long.
5181
5192
5182 * Changed ShellServices to work on __main__ so they show up in @who
5193 * Changed ShellServices to work on __main__ so they show up in @who
5183
5194
5184 * Help also works with ? at the end of a line:
5195 * Help also works with ? at the end of a line:
5185 ?sin and sin?
5196 ?sin and sin?
5186 both produce the same effect. This is nice, as often I use the
5197 both produce the same effect. This is nice, as often I use the
5187 tab-complete to find the name of a method, but I used to then have
5198 tab-complete to find the name of a method, but I used to then have
5188 to go to the beginning of the line to put a ? if I wanted more
5199 to go to the beginning of the line to put a ? if I wanted more
5189 info. Now I can just add the ? and hit return. Convenient.
5200 info. Now I can just add the ? and hit return. Convenient.
5190
5201
5191 2001-11-02 Fernando Perez <fperez@colorado.edu>
5202 2001-11-02 Fernando Perez <fperez@colorado.edu>
5192
5203
5193 * Python version check (>=2.1) added.
5204 * Python version check (>=2.1) added.
5194
5205
5195 * Added LazyPython documentation. At this point the docs are quite
5206 * Added LazyPython documentation. At this point the docs are quite
5196 a mess. A cleanup is in order.
5207 a mess. A cleanup is in order.
5197
5208
5198 * Auto-installer created. For some bizarre reason, the zipfiles
5209 * Auto-installer created. For some bizarre reason, the zipfiles
5199 module isn't working on my system. So I made a tar version
5210 module isn't working on my system. So I made a tar version
5200 (hopefully the command line options in various systems won't kill
5211 (hopefully the command line options in various systems won't kill
5201 me).
5212 me).
5202
5213
5203 * Fixes to Struct in genutils. Now all dictionary-like methods are
5214 * Fixes to Struct in genutils. Now all dictionary-like methods are
5204 protected (reasonably).
5215 protected (reasonably).
5205
5216
5206 * Added pager function to genutils and changed ? to print usage
5217 * Added pager function to genutils and changed ? to print usage
5207 note through it (it was too long).
5218 note through it (it was too long).
5208
5219
5209 * Added the LazyPython functionality. Works great! I changed the
5220 * Added the LazyPython functionality. Works great! I changed the
5210 auto-quote escape to ';', it's on home row and next to '. But
5221 auto-quote escape to ';', it's on home row and next to '. But
5211 both auto-quote and auto-paren (still /) escapes are command-line
5222 both auto-quote and auto-paren (still /) escapes are command-line
5212 parameters.
5223 parameters.
5213
5224
5214
5225
5215 2001-11-01 Fernando Perez <fperez@colorado.edu>
5226 2001-11-01 Fernando Perez <fperez@colorado.edu>
5216
5227
5217 * Version changed to 0.0.7. Fairly large change: configuration now
5228 * Version changed to 0.0.7. Fairly large change: configuration now
5218 is all stored in a directory, by default .ipython. There, all
5229 is all stored in a directory, by default .ipython. There, all
5219 config files have normal looking names (not .names)
5230 config files have normal looking names (not .names)
5220
5231
5221 * Version 0.0.6 Released first to Lucas and Archie as a test
5232 * Version 0.0.6 Released first to Lucas and Archie as a test
5222 run. Since it's the first 'semi-public' release, change version to
5233 run. Since it's the first 'semi-public' release, change version to
5223 > 0.0.6 for any changes now.
5234 > 0.0.6 for any changes now.
5224
5235
5225 * Stuff I had put in the ipplib.py changelog:
5236 * Stuff I had put in the ipplib.py changelog:
5226
5237
5227 Changes to InteractiveShell:
5238 Changes to InteractiveShell:
5228
5239
5229 - Made the usage message a parameter.
5240 - Made the usage message a parameter.
5230
5241
5231 - Require the name of the shell variable to be given. It's a bit
5242 - Require the name of the shell variable to be given. It's a bit
5232 of a hack, but allows the name 'shell' not to be hardwire in the
5243 of a hack, but allows the name 'shell' not to be hardwire in the
5233 magic (@) handler, which is problematic b/c it requires
5244 magic (@) handler, which is problematic b/c it requires
5234 polluting the global namespace with 'shell'. This in turn is
5245 polluting the global namespace with 'shell'. This in turn is
5235 fragile: if a user redefines a variable called shell, things
5246 fragile: if a user redefines a variable called shell, things
5236 break.
5247 break.
5237
5248
5238 - magic @: all functions available through @ need to be defined
5249 - magic @: all functions available through @ need to be defined
5239 as magic_<name>, even though they can be called simply as
5250 as magic_<name>, even though they can be called simply as
5240 @<name>. This allows the special command @magic to gather
5251 @<name>. This allows the special command @magic to gather
5241 information automatically about all existing magic functions,
5252 information automatically about all existing magic functions,
5242 even if they are run-time user extensions, by parsing the shell
5253 even if they are run-time user extensions, by parsing the shell
5243 instance __dict__ looking for special magic_ names.
5254 instance __dict__ looking for special magic_ names.
5244
5255
5245 - mainloop: added *two* local namespace parameters. This allows
5256 - mainloop: added *two* local namespace parameters. This allows
5246 the class to differentiate between parameters which were there
5257 the class to differentiate between parameters which were there
5247 before and after command line initialization was processed. This
5258 before and after command line initialization was processed. This
5248 way, later @who can show things loaded at startup by the
5259 way, later @who can show things loaded at startup by the
5249 user. This trick was necessary to make session saving/reloading
5260 user. This trick was necessary to make session saving/reloading
5250 really work: ideally after saving/exiting/reloading a session,
5261 really work: ideally after saving/exiting/reloading a session,
5251 *everythin* should look the same, including the output of @who. I
5262 *everythin* should look the same, including the output of @who. I
5252 was only able to make this work with this double namespace
5263 was only able to make this work with this double namespace
5253 trick.
5264 trick.
5254
5265
5255 - added a header to the logfile which allows (almost) full
5266 - added a header to the logfile which allows (almost) full
5256 session restoring.
5267 session restoring.
5257
5268
5258 - prepend lines beginning with @ or !, with a and log
5269 - prepend lines beginning with @ or !, with a and log
5259 them. Why? !lines: may be useful to know what you did @lines:
5270 them. Why? !lines: may be useful to know what you did @lines:
5260 they may affect session state. So when restoring a session, at
5271 they may affect session state. So when restoring a session, at
5261 least inform the user of their presence. I couldn't quite get
5272 least inform the user of their presence. I couldn't quite get
5262 them to properly re-execute, but at least the user is warned.
5273 them to properly re-execute, but at least the user is warned.
5263
5274
5264 * Started ChangeLog.
5275 * Started ChangeLog.
@@ -1,398 +1,402 b''
1 ;;; ipython.el --- Adds support for IPython to python-mode.el
1 ;;; ipython.el --- Adds support for IPython to python-mode.el
2
2
3 ;; Copyright (C) 2002, 2003, 2004, 2005 Alexander Schmolck
3 ;; Copyright (C) 2002, 2003, 2004, 2005 Alexander Schmolck
4 ;; Author: Alexander Schmolck
4 ;; Author: Alexander Schmolck
5 ;; Keywords: ipython python languages oop
5 ;; Keywords: ipython python languages oop
6 ;; URL: http://ipython.scipy.org
6 ;; URL: http://ipython.scipy.org
7 ;; Compatibility: Emacs21, XEmacs21
7 ;; Compatibility: Emacs21, XEmacs21
8 ;; FIXME: #$@! INPUT RING
8 ;; FIXME: #$@! INPUT RING
9 (defconst ipython-version "$Revision: 565 $"
9 (defconst ipython-version "$Revision: 1211 $"
10 "VC version number.")
10 "VC version number.")
11
11
12 ;;; Commentary
12 ;;; Commentary
13 ;; This library makes all the functionality python-mode has when running with
13 ;; This library makes all the functionality python-mode has when running with
14 ;; the normal python-interpreter available for ipython, too. It also enables a
14 ;; the normal python-interpreter available for ipython, too. It also enables a
15 ;; persistent py-shell command history accross sessions (if you exit python
15 ;; persistent py-shell command history accross sessions (if you exit python
16 ;; with C-d in py-shell) and defines the command `ipython-to-doctest', which
16 ;; with C-d in py-shell) and defines the command `ipython-to-doctest', which
17 ;; can be used to convert bits of a ipython session into something that can be
17 ;; can be used to convert bits of a ipython session into something that can be
18 ;; used for doctests. To install, put this file somewhere in your emacs
18 ;; used for doctests. To install, put this file somewhere in your emacs
19 ;; `load-path' [1] and add the following line to your ~/.emacs file (the first
19 ;; `load-path' [1] and add the following line to your ~/.emacs file (the first
20 ;; line only needed if the default (``"ipython"``) is wrong)::
20 ;; line only needed if the default (``"ipython"``) is wrong)::
21 ;;
21 ;;
22 ;; (setq ipython-command "/SOME-PATH/ipython")
22 ;; (setq ipython-command "/SOME-PATH/ipython")
23 ;; (require 'ipython)
23 ;; (require 'ipython)
24 ;;
24 ;;
25 ;; Ipython will be set as the default python shell, but only if the ipython
25 ;; Ipython will be set as the default python shell, but only if the ipython
26 ;; executable is in the path. For ipython sessions autocompletion with <tab>
26 ;; executable is in the path. For ipython sessions autocompletion with <tab>
27 ;; is also enabled (experimental feature!). Please also note that all the
27 ;; is also enabled (experimental feature!). Please also note that all the
28 ;; terminal functions in py-shell are handled by emacs's comint, **not** by
28 ;; terminal functions in py-shell are handled by emacs's comint, **not** by
29 ;; (i)python, so importing readline etc. will have 0 effect.
29 ;; (i)python, so importing readline etc. will have 0 effect.
30 ;;
30 ;;
31 ;; To start an interactive ipython session run `py-shell' with ``M-x py-shell``
31 ;; To start an interactive ipython session run `py-shell' with ``M-x py-shell``
32 ;; (or the default keybinding ``C-c C-!``).
32 ;; (or the default keybinding ``C-c C-!``).
33 ;;
33 ;;
34 ;; NOTE: This mode is currently somewhat alpha and although I hope that it
34 ;; NOTE: This mode is currently somewhat alpha and although I hope that it
35 ;; will work fine for most cases, doing certain things (like the
35 ;; will work fine for most cases, doing certain things (like the
36 ;; autocompletion and a decent scheme to switch between python interpreters)
36 ;; autocompletion and a decent scheme to switch between python interpreters)
37 ;; properly will also require changes to ipython that will likely have to wait
37 ;; properly will also require changes to ipython that will likely have to wait
38 ;; for a larger rewrite scheduled some time in the future.
38 ;; for a larger rewrite scheduled some time in the future.
39 ;;
39 ;;
40 ;; Also note that you currently NEED THE CVS VERSION OF PYTHON.EL.
40 ;; Also note that you currently NEED THE CVS VERSION OF PYTHON.EL.
41 ;;
41 ;;
42 ;; Further note that I don't know whether this runs under windows or not and
42 ;; Further note that I don't know whether this runs under windows or not and
43 ;; that if it doesn't I can't really help much, not being afflicted myself.
43 ;; that if it doesn't I can't really help much, not being afflicted myself.
44 ;;
44 ;;
45 ;;
45 ;;
46 ;; Hints for effective usage
46 ;; Hints for effective usage
47 ;; -------------------------
47 ;; -------------------------
48 ;;
48 ;;
49 ;; - IMO the best feature by far of the ipython/emacs combo is how much easier it
49 ;; - IMO the best feature by far of the ipython/emacs combo is how much easier it
50 ;; makes it to find and fix bugs thanks to the ``@pdb on``/ pdbtrack combo. Try
50 ;; makes it to find and fix bugs thanks to the ``@pdb on``/ pdbtrack combo. Try
51 ;; it: first in the ipython to shell do ``@pdb on`` then do something that will
51 ;; it: first in the ipython to shell do ``@pdb on`` then do something that will
52 ;; raise an exception (FIXME nice example) -- and be amazed how easy it is to
52 ;; raise an exception (FIXME nice example) -- and be amazed how easy it is to
53 ;; inspect the live objects in each stack frames and to jump to the
53 ;; inspect the live objects in each stack frames and to jump to the
54 ;; corresponding sourcecode locations as you walk up and down the stack trace
54 ;; corresponding sourcecode locations as you walk up and down the stack trace
55 ;; (even without ``%pdb on`` you can always use ``C-c -`` (`py-up-exception')
55 ;; (even without ``%pdb on`` you can always use ``C-c -`` (`py-up-exception')
56 ;; to jump to the corresponding source code locations).
56 ;; to jump to the corresponding source code locations).
57 ;;
57 ;;
58 ;; - emacs gives you much more powerful commandline editing and output searching
58 ;; - emacs gives you much more powerful commandline editing and output searching
59 ;; capabilities than ipython-standalone -- isearch is your friend if you
59 ;; capabilities than ipython-standalone -- isearch is your friend if you
60 ;; quickly want to print 'DEBUG ...' to stdout out etc.
60 ;; quickly want to print 'DEBUG ...' to stdout out etc.
61 ;;
61 ;;
62 ;; - This is not really specific to ipython, but for more convenient history
62 ;; - This is not really specific to ipython, but for more convenient history
63 ;; access you might want to add something like the following to *the beggining*
63 ;; access you might want to add something like the following to *the beggining*
64 ;; of your ``.emacs`` (if you want behavior that's more similar to stand-alone
64 ;; of your ``.emacs`` (if you want behavior that's more similar to stand-alone
65 ;; ipython, you can change ``meta p`` etc. for ``control p``)::
65 ;; ipython, you can change ``meta p`` etc. for ``control p``)::
66 ;;
66 ;;
67 ;; (require 'comint)
67 ;; (require 'comint)
68 ;; (define-key comint-mode-map [(meta p)]
68 ;; (define-key comint-mode-map [(meta p)]
69 ;; 'comint-previous-matching-input-from-input)
69 ;; 'comint-previous-matching-input-from-input)
70 ;; (define-key comint-mode-map [(meta n)]
70 ;; (define-key comint-mode-map [(meta n)]
71 ;; 'comint-next-matching-input-from-input)
71 ;; 'comint-next-matching-input-from-input)
72 ;; (define-key comint-mode-map [(control meta n)]
72 ;; (define-key comint-mode-map [(control meta n)]
73 ;; 'comint-next-input)
73 ;; 'comint-next-input)
74 ;; (define-key comint-mode-map [(control meta p)]
74 ;; (define-key comint-mode-map [(control meta p)]
75 ;; 'comint-previous-input)
75 ;; 'comint-previous-input)
76 ;;
76 ;;
77 ;; - Be aware that if you customize py-python-command previously, this value
77 ;; - Be aware that if you customize py-python-command previously, this value
78 ;; will override what ipython.el does (because loading the customization
78 ;; will override what ipython.el does (because loading the customization
79 ;; variables comes later).
79 ;; variables comes later).
80 ;;
80 ;;
81 ;; Please send comments and feedback to the ipython-list
81 ;; Please send comments and feedback to the ipython-list
82 ;; (<ipython-user@scipy.net>) where I (a.s.) or someone else will try to
82 ;; (<ipython-user@scipy.net>) where I (a.s.) or someone else will try to
83 ;; answer them (it helps if you specify your emacs version, OS etc;
83 ;; answer them (it helps if you specify your emacs version, OS etc;
84 ;; familiarity with <http://www.catb.org/~esr/faqs/smart-questions.html> might
84 ;; familiarity with <http://www.catb.org/~esr/faqs/smart-questions.html> might
85 ;; speed up things further).
85 ;; speed up things further).
86 ;;
86 ;;
87 ;; Footnotes:
87 ;; Footnotes:
88 ;;
88 ;;
89 ;; [1] If you don't know what `load-path' is, C-h v load-path will tell
89 ;; [1] If you don't know what `load-path' is, C-h v load-path will tell
90 ;; you; if required you can also add a new directory. So assuming that
90 ;; you; if required you can also add a new directory. So assuming that
91 ;; ipython.el resides in ~/el/, put this in your emacs:
91 ;; ipython.el resides in ~/el/, put this in your emacs:
92 ;;
92 ;;
93 ;;
93 ;;
94 ;; (add-to-list 'load-path "~/el")
94 ;; (add-to-list 'load-path "~/el")
95 ;; (setq ipython-command "/some-path/ipython")
95 ;; (setq ipython-command "/some-path/ipython")
96 ;; (require 'ipython)
96 ;; (require 'ipython)
97 ;;
97 ;;
98 ;;
98 ;;
99 ;;
99 ;;
100 ;;
100 ;;
101 ;; TODO:
101 ;; TODO:
102 ;; - do autocompletion properly
102 ;; - do autocompletion properly
103 ;; - implement a proper switching between python interpreters
103 ;; - implement a proper switching between python interpreters
104 ;;
104 ;;
105 ;; BUGS:
105 ;; BUGS:
106 ;; - neither::
106 ;; - neither::
107 ;;
107 ;;
108 ;; (py-shell "-c print 'FOOBAR'")
108 ;; (py-shell "-c print 'FOOBAR'")
109 ;;
109 ;;
110 ;; nor::
110 ;; nor::
111 ;;
111 ;;
112 ;; (let ((py-python-command-args (append py-python-command-args
112 ;; (let ((py-python-command-args (append py-python-command-args
113 ;; '("-c" "print 'FOOBAR'"))))
113 ;; '("-c" "print 'FOOBAR'"))))
114 ;; (py-shell))
114 ;; (py-shell))
115 ;;
115 ;;
116 ;; seem to print anything as they should
116 ;; seem to print anything as they should
117 ;;
117 ;;
118 ;; - look into init priority issues with `py-python-command' (if it's set
118 ;; - look into init priority issues with `py-python-command' (if it's set
119 ;; via custom)
119 ;; via custom)
120
120
121
121
122 ;;; Code
122 ;;; Code
123 (require 'cl)
123 (require 'cl)
124 (require 'shell)
124 (require 'shell)
125 (require 'executable)
125 (require 'executable)
126 (require 'ansi-color)
126 (require 'ansi-color)
127
127
128 (defcustom ipython-command "ipython"
128 (defcustom ipython-command "ipython"
129 "*Shell command used to start ipython."
129 "*Shell command used to start ipython."
130 :type 'string
130 :type 'string
131 :group 'python)
131 :group 'python)
132
132
133 ;; Users can set this to nil
133 ;; Users can set this to nil
134 (defvar py-shell-initial-switch-buffers t
134 (defvar py-shell-initial-switch-buffers t
135 "If nil, don't switch to the *Python* buffer on the first call to
135 "If nil, don't switch to the *Python* buffer on the first call to
136 `py-shell'.")
136 `py-shell'.")
137
137
138 (defvar ipython-backup-of-py-python-command nil
138 (defvar ipython-backup-of-py-python-command nil
139 "HACK")
139 "HACK")
140
140
141
141
142 (defvar ipython-de-input-prompt-regexp "\\(?:
142 (defvar ipython-de-input-prompt-regexp "\\(?:
143 In \\[[0-9]+\\]: *.*
143 In \\[[0-9]+\\]: *.*
144 ----+> \\(.*
144 ----+> \\(.*
145 \\)[\n]?\\)\\|\\(?:
145 \\)[\n]?\\)\\|\\(?:
146 In \\[[0-9]+\\]: *\\(.*
146 In \\[[0-9]+\\]: *\\(.*
147 \\)\\)\\|^[ ]\\{3\\}[.]\\{3,\\}: *\\(.*
147 \\)\\)\\|^[ ]\\{3\\}[.]\\{3,\\}: *\\(.*
148 \\)"
148 \\)"
149 "A regular expression to match the IPython input prompt and the python
149 "A regular expression to match the IPython input prompt and the python
150 command after it. The first match group is for a command that is rewritten,
150 command after it. The first match group is for a command that is rewritten,
151 the second for a 'normal' command, and the third for a multiline command.")
151 the second for a 'normal' command, and the third for a multiline command.")
152 (defvar ipython-de-output-prompt-regexp "^Out\\[[0-9]+\\]: "
152 (defvar ipython-de-output-prompt-regexp "^Out\\[[0-9]+\\]: "
153 "A regular expression to match the output prompt of IPython.")
153 "A regular expression to match the output prompt of IPython.")
154
154
155
155
156 (if (not (executable-find ipython-command))
156 (if (not (executable-find ipython-command))
157 (message (format "Can't find executable %s - ipython.el *NOT* activated!!!"
157 (message (format "Can't find executable %s - ipython.el *NOT* activated!!!"
158 ipython-command))
158 ipython-command))
159 ;; XXX load python-mode, so that we can screw around with its variables
159 ;; XXX load python-mode, so that we can screw around with its variables
160 ;; this has the disadvantage that python-mode is loaded even if no
160 ;; this has the disadvantage that python-mode is loaded even if no
161 ;; python-file is ever edited etc. but it means that `py-shell' works
161 ;; python-file is ever edited etc. but it means that `py-shell' works
162 ;; without loading a python-file first. Obviously screwing around with
162 ;; without loading a python-file first. Obviously screwing around with
163 ;; python-mode's variables like this is a mess, but well.
163 ;; python-mode's variables like this is a mess, but well.
164 (require 'python-mode)
164 (require 'python-mode)
165 ;; turn on ansi colors for ipython and activate completion
165 ;; turn on ansi colors for ipython and activate completion
166 (defun ipython-shell-hook ()
166 (defun ipython-shell-hook ()
167 ;; the following is to synchronize dir-changes
167 ;; the following is to synchronize dir-changes
168 (make-local-variable 'shell-dirstack)
168 (make-local-variable 'shell-dirstack)
169 (setq shell-dirstack nil)
169 (setq shell-dirstack nil)
170 (make-local-variable 'shell-last-dir)
170 (make-local-variable 'shell-last-dir)
171 (setq shell-last-dir nil)
171 (setq shell-last-dir nil)
172 (make-local-variable 'shell-dirtrackp)
172 (make-local-variable 'shell-dirtrackp)
173 (setq shell-dirtrackp t)
173 (setq shell-dirtrackp t)
174 (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t)
174 (add-hook 'comint-input-filter-functions 'shell-directory-tracker nil t)
175
175
176 (ansi-color-for-comint-mode-on)
176 (ansi-color-for-comint-mode-on)
177 (define-key py-shell-map [tab] 'ipython-complete)
177 (define-key py-shell-map [tab] 'ipython-complete)
178 ;;XXX this is really just a cheap hack, it only completes symbols in the
178 ;;XXX this is really just a cheap hack, it only completes symbols in the
179 ;;interactive session -- useful nonetheless.
179 ;;interactive session -- useful nonetheless.
180 (define-key py-mode-map [(meta tab)] 'ipython-complete))
180 (define-key py-mode-map [(meta tab)] 'ipython-complete))
181 (add-hook 'py-shell-hook 'ipython-shell-hook)
181 (add-hook 'py-shell-hook 'ipython-shell-hook)
182 ;; Regular expression that describes tracebacks for IPython in context and
182 ;; Regular expression that describes tracebacks for IPython in context and
183 ;; verbose mode.
183 ;; verbose mode.
184
184
185 ;;Adapt python-mode settings for ipython.
185 ;;Adapt python-mode settings for ipython.
186 ;; (this works for %xmode 'verbose' or 'context')
186 ;; (this works for %xmode 'verbose' or 'context')
187
187
188 ;; XXX putative regexps for syntax errors; unfortunately the
188 ;; XXX putative regexps for syntax errors; unfortunately the
189 ;; current python-mode traceback-line-re scheme is too primitive,
189 ;; current python-mode traceback-line-re scheme is too primitive,
190 ;; so it's either matching syntax errors, *or* everything else
190 ;; so it's either matching syntax errors, *or* everything else
191 ;; (XXX: should ask Fernando for a change)
191 ;; (XXX: should ask Fernando for a change)
192 ;;"^ File \"\\(.*?\\)\", line \\([0-9]+\\).*\n.*\n.*\nSyntaxError:"
192 ;;"^ File \"\\(.*?\\)\", line \\([0-9]+\\).*\n.*\n.*\nSyntaxError:"
193 ;;^ File \"\\(.*?\\)\", line \\([0-9]+\\)"
193 ;;^ File \"\\(.*?\\)\", line \\([0-9]+\\)"
194 (setq py-traceback-line-re
194 (setq py-traceback-line-re
195 "\\(^[^\t ].+?\\.py\\).*\n +[0-9]+[^\00]*?\n-+> \\([0-9]+\\) +")
195 "\\(^[^\t ].+?\\.py\\).*\n +[0-9]+[^\00]*?\n-+> \\([0-9]+\\) +")
196
196
197 (setq py-shell-input-prompt-1-regexp "^In \\[[0-9]+\\]: *"
197 (setq py-shell-input-prompt-1-regexp "^In \\[[0-9]+\\]: *"
198 py-shell-input-prompt-2-regexp "^ [.][.][.]+: *" )
198 py-shell-input-prompt-2-regexp "^ [.][.][.]+: *" )
199 ;; select a suitable color-scheme
199 ;; select a suitable color-scheme
200 (unless (member "-colors" py-python-command-args)
200 (unless (member "-colors" py-python-command-args)
201 (setq py-python-command-args
201 (setq py-python-command-args
202 (nconc py-python-command-args
202 (nconc py-python-command-args
203 (list "-colors"
203 (list "-colors"
204 (cond
204 (cond
205 ((eq frame-background-mode 'dark)
205 ((eq frame-background-mode 'dark)
206 "DarkBG")
206 "DarkBG")
207 ((eq frame-background-mode 'light)
207 ((eq frame-background-mode 'light)
208 "LightBG")
208 "LightBG")
209 (t ; default (backg-mode isn't always set by XEmacs)
209 (t ; default (backg-mode isn't always set by XEmacs)
210 "LightBG"))))))
210 "LightBG"))))))
211 (unless (equal ipython-backup-of-py-python-command py-python-command)
211 (unless (equal ipython-backup-of-py-python-command py-python-command)
212 (setq ipython-backup-of-py-python-command py-python-command))
212 (setq ipython-backup-of-py-python-command py-python-command))
213 (setq py-python-command ipython-command))
213 (setq py-python-command ipython-command))
214
214
215
215
216 ;; MODIFY py-shell so that it loads the editing history
216 ;; MODIFY py-shell so that it loads the editing history
217 (defadvice py-shell (around py-shell-with-history)
217 (defadvice py-shell (around py-shell-with-history)
218 "Add persistent command-history support (in
218 "Add persistent command-history support (in
219 $PYTHONHISTORY (or \"~/.ipython/history\", if we use IPython)). Also, if
219 $PYTHONHISTORY (or \"~/.ipython/history\", if we use IPython)). Also, if
220 `py-shell-initial-switch-buffers' is nil, it only switches to *Python* if that
220 `py-shell-initial-switch-buffers' is nil, it only switches to *Python* if that
221 buffer already exists."
221 buffer already exists."
222 (if (comint-check-proc "*Python*")
222 (if (comint-check-proc "*Python*")
223 ad-do-it
223 ad-do-it
224 (setq comint-input-ring-file-name
224 (setq comint-input-ring-file-name
225 (if (string-equal py-python-command ipython-command)
225 (if (string-equal py-python-command ipython-command)
226 (concat (or (getenv "IPYTHONDIR") "~/.ipython") "/history")
226 (concat (or (getenv "IPYTHONDIR") "~/.ipython") "/history")
227 (or (getenv "PYTHONHISTORY") "~/.python-history.py")))
227 (or (getenv "PYTHONHISTORY") "~/.python-history.py")))
228 (comint-read-input-ring t)
228 (comint-read-input-ring t)
229 (let ((buf (current-buffer)))
229 (let ((buf (current-buffer)))
230 ad-do-it
230 ad-do-it
231 (unless py-shell-initial-switch-buffers
231 (unless py-shell-initial-switch-buffers
232 (switch-to-buffer-other-window buf)))))
232 (switch-to-buffer-other-window buf)))))
233 (ad-activate 'py-shell)
233 (ad-activate 'py-shell)
234 ;; (defadvice py-execute-region (before py-execute-buffer-ensure-process)
234 ;; (defadvice py-execute-region (before py-execute-buffer-ensure-process)
235 ;; "HACK: test that ipython is already running before executing something.
235 ;; "HACK: test that ipython is already running before executing something.
236 ;; Doing this properly seems not worth the bother (unless people actually
236 ;; Doing this properly seems not worth the bother (unless people actually
237 ;; request it)."
237 ;; request it)."
238 ;; (unless (comint-check-proc "*Python*")
238 ;; (unless (comint-check-proc "*Python*")
239 ;; (error "Sorry you have to first do M-x py-shell to send something to ipython.")))
239 ;; (error "Sorry you have to first do M-x py-shell to send something to ipython.")))
240 ;; (ad-activate 'py-execute-region)
240 ;; (ad-activate 'py-execute-region)
241
241
242 (defadvice py-execute-region (around py-execute-buffer-ensure-process)
242 (defadvice py-execute-region (around py-execute-buffer-ensure-process)
243 "HACK: if `py-shell' is not active or ASYNC is explicitly desired, fall back
243 "HACK: if `py-shell' is not active or ASYNC is explicitly desired, fall back
244 to python instead of ipython."
244 to python instead of ipython."
245 (let ((py-python-command (if (and (comint-check-proc "*Python*") (not async))
245 (let ((py-python-command (if (and (comint-check-proc "*Python*") (not async))
246 py-python-command
246 py-python-command
247 ipython-backup-of-py-python-command)))
247 ipython-backup-of-py-python-command)))
248 ad-do-it))
248 ad-do-it))
249 (ad-activate 'py-execute-region)
249 (ad-activate 'py-execute-region)
250
250
251 (defun ipython-to-doctest (start end)
251 (defun ipython-to-doctest (start end)
252 "Transform a cut-and-pasted bit from an IPython session into something that
252 "Transform a cut-and-pasted bit from an IPython session into something that
253 looks like it came from a normal interactive python session, so that it can
253 looks like it came from a normal interactive python session, so that it can
254 be used in doctests. Example:
254 be used in doctests. Example:
255
255
256
256
257 In [1]: import sys
257 In [1]: import sys
258
258
259 In [2]: sys.stdout.write 'Hi!\n'
259 In [2]: sys.stdout.write 'Hi!\n'
260 ------> sys.stdout.write ('Hi!\n')
260 ------> sys.stdout.write ('Hi!\n')
261 Hi!
261 Hi!
262
262
263 In [3]: 3 + 4
263 In [3]: 3 + 4
264 Out[3]: 7
264 Out[3]: 7
265
265
266 gets converted to:
266 gets converted to:
267
267
268 >>> import sys
268 >>> import sys
269 >>> sys.stdout.write ('Hi!\n')
269 >>> sys.stdout.write ('Hi!\n')
270 Hi!
270 Hi!
271 >>> 3 + 4
271 >>> 3 + 4
272 7
272 7
273
273
274 "
274 "
275 (interactive "*r\n")
275 (interactive "*r\n")
276 ;(message (format "###DEBUG s:%de:%d" start end))
276 ;(message (format "###DEBUG s:%de:%d" start end))
277 (save-excursion
277 (save-excursion
278 (save-match-data
278 (save-match-data
279 ;; replace ``In [3]: bla`` with ``>>> bla`` and
279 ;; replace ``In [3]: bla`` with ``>>> bla`` and
280 ;; ``... : bla`` with ``... bla``
280 ;; ``... : bla`` with ``... bla``
281 (goto-char start)
281 (goto-char start)
282 (while (re-search-forward ipython-de-input-prompt-regexp end t)
282 (while (re-search-forward ipython-de-input-prompt-regexp end t)
283 ;(message "finding 1")
283 ;(message "finding 1")
284 (cond ((match-string 3) ;continued
284 (cond ((match-string 3) ;continued
285 (replace-match "... \\3" t nil))
285 (replace-match "... \\3" t nil))
286 (t
286 (t
287 (replace-match ">>> \\1\\2" t nil))))
287 (replace-match ">>> \\1\\2" t nil))))
288 ;; replace ``
288 ;; replace ``
289 (goto-char start)
289 (goto-char start)
290 (while (re-search-forward ipython-de-output-prompt-regexp end t)
290 (while (re-search-forward ipython-de-output-prompt-regexp end t)
291 (replace-match "" t nil)))))
291 (replace-match "" t nil)))))
292
292
293 (defvar ipython-completion-command-string
293 (defvar ipython-completion-command-string
294 "print ';'.join(__IP.Completer.all_completions('%s')) #PYTHON-MODE SILENT\n"
294 "print ';'.join(__IP.Completer.all_completions('%s')) #PYTHON-MODE SILENT\n"
295 "The string send to ipython to query for all possible completions")
295 "The string send to ipython to query for all possible completions")
296
296
297
297
298 ;; xemacs doesn't have `comint-preoutput-filter-functions' so we'll try the
298 ;; xemacs doesn't have `comint-preoutput-filter-functions' so we'll try the
299 ;; following wonderful hack to work around this case
299 ;; following wonderful hack to work around this case
300 (if (featurep 'xemacs)
300 (if (featurep 'xemacs)
301 ;;xemacs
301 ;;xemacs
302 (defun ipython-complete ()
302 (defun ipython-complete ()
303 "Try to complete the python symbol before point. Only knows about the stuff
303 "Try to complete the python symbol before point. Only knows about the stuff
304 in the current *Python* session."
304 in the current *Python* session."
305 (interactive)
305 (interactive)
306 (let* ((ugly-return nil)
306 (let* ((ugly-return nil)
307 (sep ";")
307 (sep ";")
308 (python-process (or (get-buffer-process (current-buffer))
309 ;XXX hack for .py buffers
310 (get-process py-which-bufname)))
308 ;; XXX currently we go backwards to find the beginning of an
311 ;; XXX currently we go backwards to find the beginning of an
309 ;; expression part; a more powerful approach in the future might be
312 ;; expression part; a more powerful approach in the future might be
310 ;; to let ipython have the complete line, so that context can be used
313 ;; to let ipython have the complete line, so that context can be used
311 ;; to do things like filename completion etc.
314 ;; to do things like filename completion etc.
312 (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))
315 (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))
313 (point)))
316 (point)))
314 (end (point))
317 (end (point))
315 (pattern (buffer-substring-no-properties beg end))
318 (pattern (buffer-substring-no-properties beg end))
316 (completions nil)
319 (completions nil)
317 (completion-table nil)
320 (completion-table nil)
318 completion
321 completion
319 (comint-output-filter-functions
322 (comint-output-filter-functions
320 (append comint-output-filter-functions
323 (append comint-output-filter-functions
321 '(ansi-color-filter-apply
324 '(ansi-color-filter-apply
322 (lambda (string)
325 (lambda (string)
323 ;(message (format "DEBUG filtering: %s" string))
326 ;(message (format "DEBUG filtering: %s" string))
324 (setq ugly-return (concat ugly-return string))
327 (setq ugly-return (concat ugly-return string))
325 (delete-region comint-last-output-start
328 (delete-region comint-last-output-start
326 (process-mark (get-buffer-process (current-buffer)))))))))
329 (process-mark (get-buffer-process (current-buffer)))))))))
327 ;(message (format "#DEBUG pattern: '%s'" pattern))
330 ;(message (format "#DEBUG pattern: '%s'" pattern))
328 (process-send-string (or (get-buffer-process (current-buffer))
331 (process-send-string python-process
329 (get-process py-which-bufname)) ;XXX hack for .py buffers
330 (format ipython-completion-command-string pattern))
332 (format ipython-completion-command-string pattern))
331 (accept-process-output (get-buffer-process (current-buffer)))
333 (accept-process-output python-process)
332 ;(message (format "DEBUG return: %s" ugly-return))
334 ;(message (format "DEBUG return: %s" ugly-return))
333 (setq completions
335 (setq completions
334 (split-string (substring ugly-return 0 (position ?\n ugly-return)) sep))
336 (split-string (substring ugly-return 0 (position ?\n ugly-return)) sep))
335 (setq completion-table (loop for str in completions
337 (setq completion-table (loop for str in completions
336 collect (list str nil)))
338 collect (list str nil)))
337 (setq completion (try-completion pattern completion-table))
339 (setq completion (try-completion pattern completion-table))
338 (cond ((eq completion t))
340 (cond ((eq completion t))
339 ((null completion)
341 ((null completion)
340 (message "Can't find completion for \"%s\"" pattern)
342 (message "Can't find completion for \"%s\"" pattern)
341 (ding))
343 (ding))
342 ((not (string= pattern completion))
344 ((not (string= pattern completion))
343 (delete-region beg end)
345 (delete-region beg end)
344 (insert completion))
346 (insert completion))
345 (t
347 (t
346 (message "Making completion list...")
348 (message "Making completion list...")
347 (with-output-to-temp-buffer "*Python Completions*"
349 (with-output-to-temp-buffer "*Python Completions*"
348 (display-completion-list (all-completions pattern completion-table)))
350 (display-completion-list (all-completions pattern completion-table)))
349 (message "Making completion list...%s" "done")))))
351 (message "Making completion list...%s" "done")))))
350 ;; emacs
352 ;; emacs
351 (defun ipython-complete ()
353 (defun ipython-complete ()
352 "Try to complete the python symbol before point. Only knows about the stuff
354 "Try to complete the python symbol before point. Only knows about the stuff
353 in the current *Python* session."
355 in the current *Python* session."
354 (interactive)
356 (interactive)
355 (let* ((ugly-return nil)
357 (let* ((ugly-return nil)
356 (sep ";")
358 (sep ";")
359 (python-process (or (get-buffer-process (current-buffer))
360 ;XXX hack for .py buffers
361 (get-process py-which-bufname)))
357 ;; XXX currently we go backwards to find the beginning of an
362 ;; XXX currently we go backwards to find the beginning of an
358 ;; expression part; a more powerful approach in the future might be
363 ;; expression part; a more powerful approach in the future might be
359 ;; to let ipython have the complete line, so that context can be used
364 ;; to let ipython have the complete line, so that context can be used
360 ;; to do things like filename completion etc.
365 ;; to do things like filename completion etc.
361 (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))
366 (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))
362 (point)))
367 (point)))
363 (end (point))
368 (end (point))
364 (pattern (buffer-substring-no-properties beg end))
369 (pattern (buffer-substring-no-properties beg end))
365 (completions nil)
370 (completions nil)
366 (completion-table nil)
371 (completion-table nil)
367 completion
372 completion
368 (comint-preoutput-filter-functions
373 (comint-preoutput-filter-functions
369 (append comint-preoutput-filter-functions
374 (append comint-preoutput-filter-functions
370 '(ansi-color-filter-apply
375 '(ansi-color-filter-apply
371 (lambda (string)
376 (lambda (string)
372 (setq ugly-return (concat ugly-return string))
377 (setq ugly-return (concat ugly-return string))
373 "")))))
378 "")))))
374 (process-send-string (or (get-buffer-process (current-buffer))
379 (process-send-string python-process
375 (get-process py-which-bufname)) ;XXX hack for .py buffers
376 (format ipython-completion-command-string pattern))
380 (format ipython-completion-command-string pattern))
377 (accept-process-output (get-buffer-process (current-buffer)))
381 (accept-process-output python-process)
378 (setq completions
382 (setq completions
379 (split-string (substring ugly-return 0 (position ?\n ugly-return)) sep))
383 (split-string (substring ugly-return 0 (position ?\n ugly-return)) sep))
380 ;(message (format "DEBUG completions: %S" completions))
384 ;(message (format "DEBUG completions: %S" completions))
381 (setq completion-table (loop for str in completions
385 (setq completion-table (loop for str in completions
382 collect (list str nil)))
386 collect (list str nil)))
383 (setq completion (try-completion pattern completion-table))
387 (setq completion (try-completion pattern completion-table))
384 (cond ((eq completion t))
388 (cond ((eq completion t))
385 ((null completion)
389 ((null completion)
386 (message "Can't find completion for \"%s\"" pattern)
390 (message "Can't find completion for \"%s\"" pattern)
387 (ding))
391 (ding))
388 ((not (string= pattern completion))
392 ((not (string= pattern completion))
389 (delete-region beg end)
393 (delete-region beg end)
390 (insert completion))
394 (insert completion))
391 (t
395 (t
392 (message "Making completion list...")
396 (message "Making completion list...")
393 (with-output-to-temp-buffer "*IPython Completions*"
397 (with-output-to-temp-buffer "*IPython Completions*"
394 (display-completion-list (all-completions pattern completion-table)))
398 (display-completion-list (all-completions pattern completion-table)))
395 (message "Making completion list...%s" "done")))))
399 (message "Making completion list...%s" "done")))))
396 )
400 )
397
401
398 (provide 'ipython)
402 (provide 'ipython)
@@ -1,9505 +1,9515 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 11
52 \paperfontsize 11
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 1in
61 \leftmargin 1in
62 \topmargin 1in
62 \topmargin 1in
63 \rightmargin 1in
63 \rightmargin 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 2
72 \papersides 2
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 \begin_inset Foot
90 \begin_inset Foot
91 collapsed true
91 collapsed true
92
92
93 \layout Standard
93 \layout Standard
94
94
95
95
96 \size scriptsize
96 \size scriptsize
97 Department of Applied Mathematics, University of Colorado at Boulder.
97 Department of Applied Mathematics, University of Colorado at Boulder.
98
98
99 \family typewriter
99 \family typewriter
100 <Fernando.Perez@colorado.edu>
100 <Fernando.Perez@colorado.edu>
101 \end_inset
101 \end_inset
102
102
103
103
104 \layout Standard
104 \layout Standard
105
105
106
106
107 \begin_inset ERT
107 \begin_inset ERT
108 status Collapsed
108 status Collapsed
109
109
110 \layout Standard
110 \layout Standard
111
111
112 \backslash
112 \backslash
113 latex{
113 latex{
114 \end_inset
114 \end_inset
115
115
116
116
117 \begin_inset LatexCommand \tableofcontents{}
117 \begin_inset LatexCommand \tableofcontents{}
118
118
119 \end_inset
119 \end_inset
120
120
121
121
122 \begin_inset ERT
122 \begin_inset ERT
123 status Collapsed
123 status Collapsed
124
124
125 \layout Standard
125 \layout Standard
126 }
126 }
127 \end_inset
127 \end_inset
128
128
129
129
130 \layout Standard
130 \layout Standard
131
131
132
132
133 \begin_inset ERT
133 \begin_inset ERT
134 status Open
134 status Open
135
135
136 \layout Standard
136 \layout Standard
137
137
138 \backslash
138 \backslash
139 html{
139 html{
140 \backslash
140 \backslash
141 bodytext{bgcolor=#ffffff}}
141 bodytext{bgcolor=#ffffff}}
142 \end_inset
142 \end_inset
143
143
144
144
145 \layout Section
145 \layout Section
146 \pagebreak_top
146 \pagebreak_top
147 Overview
147 Overview
148 \layout Standard
148 \layout Standard
149
149
150 One of Python's most useful features is its interactive interpreter.
150 One of Python's most useful features is its interactive interpreter.
151 This system allows very fast testing of ideas without the overhead of creating
151 This system allows very fast testing of ideas without the overhead of creating
152 test files as is typical in most programming languages.
152 test files as is typical in most programming languages.
153 However, the interpreter supplied with the standard Python distribution
153 However, the interpreter supplied with the standard Python distribution
154 is somewhat limited for extended interactive use.
154 is somewhat limited for extended interactive use.
155 \layout Standard
155 \layout Standard
156
156
157 IPython is a free software project (released under the BSD license) which
157 IPython is a free software project (released under the BSD license) which
158 tries to:
158 tries to:
159 \layout Enumerate
159 \layout Enumerate
160
160
161 Provide an interactive shell superior to Python's default.
161 Provide an interactive shell superior to Python's default.
162 IPython has many features for object introspection, system shell access,
162 IPython has many features for object introspection, system shell access,
163 and its own special command system for adding functionality when working
163 and its own special command system for adding functionality when working
164 interactively.
164 interactively.
165 It tries to be a very efficient environment both for Python code development
165 It tries to be a very efficient environment both for Python code development
166 and for exploration of problems using Python objects (in situations like
166 and for exploration of problems using Python objects (in situations like
167 data analysis).
167 data analysis).
168 \layout Enumerate
168 \layout Enumerate
169
169
170 Serve as an embeddable, ready to use interpreter for your own programs.
170 Serve as an embeddable, ready to use interpreter for your own programs.
171 IPython can be started with a single call from inside another program,
171 IPython can be started with a single call from inside another program,
172 providing access to the current namespace.
172 providing access to the current namespace.
173 This can be very useful both for debugging purposes and for situations
173 This can be very useful both for debugging purposes and for situations
174 where a blend of batch-processing and interactive exploration are needed.
174 where a blend of batch-processing and interactive exploration are needed.
175 \layout Enumerate
175 \layout Enumerate
176
176
177 Offer a flexible framework which can be used as the base environment for
177 Offer a flexible framework which can be used as the base environment for
178 other systems with Python as the underlying language.
178 other systems with Python as the underlying language.
179 Specifically scientific environments like Mathematica, IDL and Matlab inspired
179 Specifically scientific environments like Mathematica, IDL and Matlab inspired
180 its design, but similar ideas can be useful in many fields.
180 its design, but similar ideas can be useful in many fields.
181 \layout Enumerate
181 \layout Enumerate
182
182
183 Allow interactive testing of threaded graphical toolkits.
183 Allow interactive testing of threaded graphical toolkits.
184 IPython has support for interactive, non-blocking control of GTK, Qt and
184 IPython has support for interactive, non-blocking control of GTK, Qt and
185 WX applications via special threading flags.
185 WX applications via special threading flags.
186 The normal Python shell can only do this for Tkinter applications.
186 The normal Python shell can only do this for Tkinter applications.
187 \layout Subsection
187 \layout Subsection
188
188
189 Main features
189 Main features
190 \layout Itemize
190 \layout Itemize
191
191
192 Dynamic object introspection.
192 Dynamic object introspection.
193 One can access docstrings, function definition prototypes, source code,
193 One can access docstrings, function definition prototypes, source code,
194 source files and other details of any object accessible to the interpreter
194 source files and other details of any object accessible to the interpreter
195 with a single keystroke (`
195 with a single keystroke (`
196 \family typewriter
196 \family typewriter
197 ?
197 ?
198 \family default
198 \family default
199 ', and using `
199 ', and using `
200 \family typewriter
200 \family typewriter
201 ??
201 ??
202 \family default
202 \family default
203 ' provides additional detail).
203 ' provides additional detail).
204 \layout Itemize
204 \layout Itemize
205
205
206 Searching through modules and namespaces with `
206 Searching through modules and namespaces with `
207 \family typewriter
207 \family typewriter
208 *
208 *
209 \family default
209 \family default
210 ' wildcards, both when using the `
210 ' wildcards, both when using the `
211 \family typewriter
211 \family typewriter
212 ?
212 ?
213 \family default
213 \family default
214 ' system and via the
214 ' system and via the
215 \family typewriter
215 \family typewriter
216 %psearch
216 %psearch
217 \family default
217 \family default
218 command.
218 command.
219 \layout Itemize
219 \layout Itemize
220
220
221 Completion in the local namespace, by typing TAB at the prompt.
221 Completion in the local namespace, by typing TAB at the prompt.
222 This works for keywords, methods, variables and files in the current directory.
222 This works for keywords, methods, variables and files in the current directory.
223 This is supported via the readline library, and full access to configuring
223 This is supported via the readline library, and full access to configuring
224 readline's behavior is provided.
224 readline's behavior is provided.
225 \layout Itemize
225 \layout Itemize
226
226
227 Numbered input/output prompts with command history (persistent across sessions
227 Numbered input/output prompts with command history (persistent across sessions
228 and tied to each profile), full searching in this history and caching of
228 and tied to each profile), full searching in this history and caching of
229 all input and output.
229 all input and output.
230 \layout Itemize
230 \layout Itemize
231
231
232 User-extensible `magic' commands.
232 User-extensible `magic' commands.
233 A set of commands prefixed with
233 A set of commands prefixed with
234 \family typewriter
234 \family typewriter
235 %
235 %
236 \family default
236 \family default
237 is available for controlling IPython itself and provides directory control,
237 is available for controlling IPython itself and provides directory control,
238 namespace information and many aliases to common system shell commands.
238 namespace information and many aliases to common system shell commands.
239 \layout Itemize
239 \layout Itemize
240
240
241 Alias facility for defining your own system aliases.
241 Alias facility for defining your own system aliases.
242 \layout Itemize
242 \layout Itemize
243
243
244 Complete system shell access.
244 Complete system shell access.
245 Lines starting with ! are passed directly to the system shell, and using
245 Lines starting with ! are passed directly to the system shell, and using
246 !! captures shell output into python variables for further use.
246 !! captures shell output into python variables for further use.
247 \layout Itemize
247 \layout Itemize
248
248
249 Background execution of Python commands in a separate thread.
249 Background execution of Python commands in a separate thread.
250 IPython has an internal job manager called
250 IPython has an internal job manager called
251 \family typewriter
251 \family typewriter
252 jobs
252 jobs
253 \family default
253 \family default
254 , and a conveninence backgrounding magic function called
254 , and a conveninence backgrounding magic function called
255 \family typewriter
255 \family typewriter
256 %bg
256 %bg
257 \family default
257 \family default
258 .
258 .
259 \layout Itemize
259 \layout Itemize
260
260
261 The ability to expand python variables when calling the system shell.
261 The ability to expand python variables when calling the system shell.
262 In a shell command, any python variable prefixed with
262 In a shell command, any python variable prefixed with
263 \family typewriter
263 \family typewriter
264 $
264 $
265 \family default
265 \family default
266 is expanded.
266 is expanded.
267 A double
267 A double
268 \family typewriter
268 \family typewriter
269 $$
269 $$
270 \family default
270 \family default
271 allows passing a literal
271 allows passing a literal
272 \family typewriter
272 \family typewriter
273 $
273 $
274 \family default
274 \family default
275 to the shell (for access to shell and environment variables like
275 to the shell (for access to shell and environment variables like
276 \family typewriter
276 \family typewriter
277 $PATH
277 $PATH
278 \family default
278 \family default
279 ).
279 ).
280 \layout Itemize
280 \layout Itemize
281
281
282 Filesystem navigation, via a magic
282 Filesystem navigation, via a magic
283 \family typewriter
283 \family typewriter
284 %cd
284 %cd
285 \family default
285 \family default
286 command, along with a persistent bookmark system (using
286 command, along with a persistent bookmark system (using
287 \family typewriter
287 \family typewriter
288 %bookmark
288 %bookmark
289 \family default
289 \family default
290 ) for fast access to frequently visited directories.
290 ) for fast access to frequently visited directories.
291 \layout Itemize
291 \layout Itemize
292
292
293 A lightweight persistence framework via the
293 A lightweight persistence framework via the
294 \family typewriter
294 \family typewriter
295 %store
295 %store
296 \family default
296 \family default
297 command, which allows you to save arbitrary Python variables.
297 command, which allows you to save arbitrary Python variables.
298 These get restored automatically when your session restarts.
298 These get restored automatically when your session restarts.
299 \layout Itemize
299 \layout Itemize
300
300
301 Automatic indentation (optional) of code as you type (through the readline
301 Automatic indentation (optional) of code as you type (through the readline
302 library).
302 library).
303 \layout Itemize
303 \layout Itemize
304
304
305 Macro system for quickly re-executing multiple lines of previous input with
305 Macro system for quickly re-executing multiple lines of previous input with
306 a single name.
306 a single name.
307 Macros can be stored persistently via
307 Macros can be stored persistently via
308 \family typewriter
308 \family typewriter
309 %store
309 %store
310 \family default
310 \family default
311 and edited via
311 and edited via
312 \family typewriter
312 \family typewriter
313 %edit
313 %edit
314 \family default
314 \family default
315 .
315 .
316
316
317 \layout Itemize
317 \layout Itemize
318
318
319 Session logging (you can then later use these logs as code in your programs).
319 Session logging (you can then later use these logs as code in your programs).
320 Logs can optionally timestamp all input, and also store session output
320 Logs can optionally timestamp all input, and also store session output
321 (marked as comments, so the log remains valid Python source code).
321 (marked as comments, so the log remains valid Python source code).
322 \layout Itemize
322 \layout Itemize
323
323
324 Session restoring: logs can be replayed to restore a previous session to
324 Session restoring: logs can be replayed to restore a previous session to
325 the state where you left it.
325 the state where you left it.
326 \layout Itemize
326 \layout Itemize
327
327
328 Verbose and colored exception traceback printouts.
328 Verbose and colored exception traceback printouts.
329 Easier to parse visually, and in verbose mode they produce a lot of useful
329 Easier to parse visually, and in verbose mode they produce a lot of useful
330 debugging information (basically a terminal version of the cgitb module).
330 debugging information (basically a terminal version of the cgitb module).
331 \layout Itemize
331 \layout Itemize
332
332
333 Auto-parentheses: callable objects can be executed without parentheses:
333 Auto-parentheses: callable objects can be executed without parentheses:
334
334
335 \family typewriter
335 \family typewriter
336 `sin 3'
336 `sin 3'
337 \family default
337 \family default
338 is automatically converted to
338 is automatically converted to
339 \family typewriter
339 \family typewriter
340 `sin(3)
340 `sin(3)
341 \family default
341 \family default
342 '.
342 '.
343 \layout Itemize
343 \layout Itemize
344
344
345 Auto-quoting: using `
345 Auto-quoting: using `
346 \family typewriter
346 \family typewriter
347 ,
347 ,
348 \family default
348 \family default
349 ' or `
349 ' or `
350 \family typewriter
350 \family typewriter
351 ;
351 ;
352 \family default
352 \family default
353 ' as the first character forces auto-quoting of the rest of the line:
353 ' as the first character forces auto-quoting of the rest of the line:
354 \family typewriter
354 \family typewriter
355 `,my_function a\SpecialChar ~
355 `,my_function a\SpecialChar ~
356 b'
356 b'
357 \family default
357 \family default
358 becomes automatically
358 becomes automatically
359 \family typewriter
359 \family typewriter
360 `my_function("a","b")'
360 `my_function("a","b")'
361 \family default
361 \family default
362 , while
362 , while
363 \family typewriter
363 \family typewriter
364 `;my_function a\SpecialChar ~
364 `;my_function a\SpecialChar ~
365 b'
365 b'
366 \family default
366 \family default
367 becomes
367 becomes
368 \family typewriter
368 \family typewriter
369 `my_function("a b")'
369 `my_function("a b")'
370 \family default
370 \family default
371 .
371 .
372 \layout Itemize
372 \layout Itemize
373
373
374 Extensible input syntax.
374 Extensible input syntax.
375 You can define filters that pre-process user input to simplify input in
375 You can define filters that pre-process user input to simplify input in
376 special situations.
376 special situations.
377 This allows for example pasting multi-line code fragments which start with
377 This allows for example pasting multi-line code fragments which start with
378
378
379 \family typewriter
379 \family typewriter
380 `>>>'
380 `>>>'
381 \family default
381 \family default
382 or
382 or
383 \family typewriter
383 \family typewriter
384 `...'
384 `...'
385 \family default
385 \family default
386 such as those from other python sessions or the standard Python documentation.
386 such as those from other python sessions or the standard Python documentation.
387 \layout Itemize
387 \layout Itemize
388
388
389 Flexible configuration system.
389 Flexible configuration system.
390 It uses a configuration file which allows permanent setting of all command-line
390 It uses a configuration file which allows permanent setting of all command-line
391 options, module loading, code and file execution.
391 options, module loading, code and file execution.
392 The system allows recursive file inclusion, so you can have a base file
392 The system allows recursive file inclusion, so you can have a base file
393 with defaults and layers which load other customizations for particular
393 with defaults and layers which load other customizations for particular
394 projects.
394 projects.
395 \layout Itemize
395 \layout Itemize
396
396
397 Embeddable.
397 Embeddable.
398 You can call IPython as a python shell inside your own python programs.
398 You can call IPython as a python shell inside your own python programs.
399 This can be used both for debugging code or for providing interactive abilities
399 This can be used both for debugging code or for providing interactive abilities
400 to your programs with knowledge about the local namespaces (very useful
400 to your programs with knowledge about the local namespaces (very useful
401 in debugging and data analysis situations).
401 in debugging and data analysis situations).
402 \layout Itemize
402 \layout Itemize
403
403
404 Easy debugger access.
404 Easy debugger access.
405 You can set IPython to call up an enhanced version of the Python debugger
405 You can set IPython to call up an enhanced version of the Python debugger
406 (
406 (
407 \family typewriter
407 \family typewriter
408 pdb
408 pdb
409 \family default
409 \family default
410 ) every time there is an uncaught exception.
410 ) every time there is an uncaught exception.
411 This drops you inside the code which triggered the exception with all the
411 This drops you inside the code which triggered the exception with all the
412 data live and it is possible to navigate the stack to rapidly isolate the
412 data live and it is possible to navigate the stack to rapidly isolate the
413 source of a bug.
413 source of a bug.
414 The
414 The
415 \family typewriter
415 \family typewriter
416 %run
416 %run
417 \family default
417 \family default
418 magic command --with the
418 magic command --with the
419 \family typewriter
419 \family typewriter
420 -d
420 -d
421 \family default
421 \family default
422 option-- can run any script under
422 option-- can run any script under
423 \family typewriter
423 \family typewriter
424 pdb
424 pdb
425 \family default
425 \family default
426 's control, automatically setting initial breakpoints for you.
426 's control, automatically setting initial breakpoints for you.
427 This version of
427 This version of
428 \family typewriter
428 \family typewriter
429 pdb
429 pdb
430 \family default
430 \family default
431 has IPython-specific improvements, including tab-completion and traceback
431 has IPython-specific improvements, including tab-completion and traceback
432 coloring support.
432 coloring support.
433 \layout Itemize
433 \layout Itemize
434
434
435 Profiler support.
435 Profiler support.
436 You can run single statements (similar to
436 You can run single statements (similar to
437 \family typewriter
437 \family typewriter
438 profile.run()
438 profile.run()
439 \family default
439 \family default
440 ) or complete programs under the profiler's control.
440 ) or complete programs under the profiler's control.
441 While this is possible with the standard
441 While this is possible with the standard
442 \family typewriter
442 \family typewriter
443 profile
443 profile
444 \family default
444 \family default
445 module, IPython wraps this functionality with magic commands (see
445 module, IPython wraps this functionality with magic commands (see
446 \family typewriter
446 \family typewriter
447 `%prun'
447 `%prun'
448 \family default
448 \family default
449 and
449 and
450 \family typewriter
450 \family typewriter
451 `%run -p
451 `%run -p
452 \family default
452 \family default
453 ') convenient for rapid interactive work.
453 ') convenient for rapid interactive work.
454 \layout Subsection
454 \layout Subsection
455
455
456 Portability and Python requirements
456 Portability and Python requirements
457 \layout Standard
457 \layout Standard
458
458
459
459
460 \series bold
460 \series bold
461 Python requirements:
461 Python requirements:
462 \series default
462 \series default
463 IPython requires with Python version 2.3 or newer.
463 IPython requires with Python version 2.3 or newer.
464 If you are still using Python 2.2 and can not upgrade, the last version
464 If you are still using Python 2.2 and can not upgrade, the last version
465 of IPython which worked with Python 2.2 was 0.6.15, so you will have to use
465 of IPython which worked with Python 2.2 was 0.6.15, so you will have to use
466 that.
466 that.
467 \layout Standard
467 \layout Standard
468
468
469 IPython is developed under
469 IPython is developed under
470 \series bold
470 \series bold
471 Linux
471 Linux
472 \series default
472 \series default
473 , but it should work in any reasonable Unix-type system (tested OK under
473 , but it should work in any reasonable Unix-type system (tested OK under
474 Solaris and the *BSD family, for which a port exists thanks to Dryice Liu).
474 Solaris and the *BSD family, for which a port exists thanks to Dryice Liu).
475 \layout Standard
475 \layout Standard
476
476
477
477
478 \series bold
478 \series bold
479 Mac OS X
479 Mac OS X
480 \series default
480 \series default
481 : it works, apparently without any problems (thanks to Jim Boyle at Lawrence
481 : it works, apparently without any problems (thanks to Jim Boyle at Lawrence
482 Livermore for the information).
482 Livermore for the information).
483 Thanks to Andrea Riciputi, Fink support is available.
483 Thanks to Andrea Riciputi, Fink support is available.
484 \layout Standard
484 \layout Standard
485
485
486
486
487 \series bold
487 \series bold
488 CygWin
488 CygWin
489 \series default
489 \series default
490 : it works mostly OK, though some users have reported problems with prompt
490 : it works mostly OK, though some users have reported problems with prompt
491 coloring.
491 coloring.
492 No satisfactory solution to this has been found so far, you may want to
492 No satisfactory solution to this has been found so far, you may want to
493 disable colors permanently in the
493 disable colors permanently in the
494 \family typewriter
494 \family typewriter
495 ipythonrc
495 ipythonrc
496 \family default
496 \family default
497 configuration file if you experience problems.
497 configuration file if you experience problems.
498 If you have proper color support under cygwin, please post to the IPython
498 If you have proper color support under cygwin, please post to the IPython
499 mailing list so this issue can be resolved for all users.
499 mailing list so this issue can be resolved for all users.
500 \layout Standard
500 \layout Standard
501
501
502
502
503 \series bold
503 \series bold
504 Windows
504 Windows
505 \series default
505 \series default
506 : it works well under Windows XP/2k, and I suspect NT should behave similarly.
506 : it works well under Windows XP/2k, and I suspect NT should behave similarly.
507 Section\SpecialChar ~
507 Section\SpecialChar ~
508
508
509 \begin_inset LatexCommand \ref{sub:Under-Windows}
509 \begin_inset LatexCommand \ref{sub:Under-Windows}
510
510
511 \end_inset
511 \end_inset
512
512
513 describes installation details for Windows, including some additional tools
513 describes installation details for Windows, including some additional tools
514 needed on this platform.
514 needed on this platform.
515 \layout Standard
515 \layout Standard
516
516
517 Windows 9x support is present, and has been reported to work fine (at least
517 Windows 9x support is present, and has been reported to work fine (at least
518 on WinME).
518 on WinME).
519 \layout Standard
519 \layout Standard
520
520
521 Note, that I have very little access to and experience with Windows development.
521 Note, that I have very little access to and experience with Windows development.
522 However, an excellent group of Win32 users (led by Ville Vainio), consistenly
522 However, an excellent group of Win32 users (led by Ville Vainio), consistenly
523 contribute bugfixes and platform-specific enhancements, so they more than
523 contribute bugfixes and platform-specific enhancements, so they more than
524 make up for my deficiencies on that front.
524 make up for my deficiencies on that front.
525 In fact, Win32 users report using IPython as a system shell (see Sec.\SpecialChar ~
525 In fact, Win32 users report using IPython as a system shell (see Sec.\SpecialChar ~
526
526
527 \begin_inset LatexCommand \ref{sec:IPython-as-shell}
527 \begin_inset LatexCommand \ref{sec:IPython-as-shell}
528
528
529 \end_inset
529 \end_inset
530
530
531 for details), as it offers a level of control and features which the default
531 for details), as it offers a level of control and features which the default
532
532
533 \family typewriter
533 \family typewriter
534 cmd.exe
534 cmd.exe
535 \family default
535 \family default
536 doesn't provide.
536 doesn't provide.
537 \layout Subsection
537 \layout Subsection
538
538
539 Location
539 Location
540 \layout Standard
540 \layout Standard
541
541
542 IPython is generously hosted at
542 IPython is generously hosted at
543 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
543 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
544
544
545 \end_inset
545 \end_inset
546
546
547 by the Enthought, Inc and the SciPy project.
547 by the Enthought, Inc and the SciPy project.
548 This site offers downloads, subversion access, mailing lists and a bug
548 This site offers downloads, subversion access, mailing lists and a bug
549 tracking system.
549 tracking system.
550 I am very grateful to Enthought (
550 I am very grateful to Enthought (
551 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
551 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
552
552
553 \end_inset
553 \end_inset
554
554
555 ) and all of the SciPy team for their contribution.
555 ) and all of the SciPy team for their contribution.
556 \layout Section
556 \layout Section
557
557
558
558
559 \begin_inset LatexCommand \label{sec:install}
559 \begin_inset LatexCommand \label{sec:install}
560
560
561 \end_inset
561 \end_inset
562
562
563 Installation
563 Installation
564 \layout Subsection
564 \layout Subsection
565
565
566 Instant instructions
566 Instant instructions
567 \layout Standard
567 \layout Standard
568
568
569 If you are of the impatient kind, under Linux/Unix simply untar/unzip the
569 If you are of the impatient kind, under Linux/Unix simply untar/unzip the
570 download, then install with
570 download, then install with
571 \family typewriter
571 \family typewriter
572 `python setup.py install'
572 `python setup.py install'
573 \family default
573 \family default
574 .
574 .
575 Under Windows, double-click on the provided
575 Under Windows, double-click on the provided
576 \family typewriter
576 \family typewriter
577 .exe
577 .exe
578 \family default
578 \family default
579 binary installer.
579 binary installer.
580 \layout Standard
580 \layout Standard
581
581
582 Then, take a look at Sections
582 Then, take a look at Sections
583 \begin_inset LatexCommand \ref{sec:good_config}
583 \begin_inset LatexCommand \ref{sec:good_config}
584
584
585 \end_inset
585 \end_inset
586
586
587 for configuring things optimally and
587 for configuring things optimally and
588 \begin_inset LatexCommand \ref{sec:quick_tips}
588 \begin_inset LatexCommand \ref{sec:quick_tips}
589
589
590 \end_inset
590 \end_inset
591
591
592 for quick tips on efficient use of IPython.
592 for quick tips on efficient use of IPython.
593 You can later refer to the rest of the manual for all the gory details.
593 You can later refer to the rest of the manual for all the gory details.
594 \layout Standard
594 \layout Standard
595
595
596 See the notes in sec.
596 See the notes in sec.
597
597
598 \begin_inset LatexCommand \ref{sec:upgrade}
598 \begin_inset LatexCommand \ref{sec:upgrade}
599
599
600 \end_inset
600 \end_inset
601
601
602 for upgrading IPython versions.
602 for upgrading IPython versions.
603 \layout Subsection
603 \layout Subsection
604
604
605 Detailed Unix instructions (Linux, Mac OS X, etc.)
605 Detailed Unix instructions (Linux, Mac OS X, etc.)
606 \layout Standard
606 \layout Standard
607
607
608 For RPM based systems, simply install the supplied package in the usual
608 For RPM based systems, simply install the supplied package in the usual
609 manner.
609 manner.
610 If you download the tar archive, the process is:
610 If you download the tar archive, the process is:
611 \layout Enumerate
611 \layout Enumerate
612
612
613 Unzip/untar the
613 Unzip/untar the
614 \family typewriter
614 \family typewriter
615 ipython-XXX.tar.gz
615 ipython-XXX.tar.gz
616 \family default
616 \family default
617 file wherever you want (
617 file wherever you want (
618 \family typewriter
618 \family typewriter
619 XXX
619 XXX
620 \family default
620 \family default
621 is the version number).
621 is the version number).
622 It will make a directory called
622 It will make a directory called
623 \family typewriter
623 \family typewriter
624 ipython-XXX.
624 ipython-XXX.
625
625
626 \family default
626 \family default
627 Change into that directory where you will find the files
627 Change into that directory where you will find the files
628 \family typewriter
628 \family typewriter
629 README
629 README
630 \family default
630 \family default
631 and
631 and
632 \family typewriter
632 \family typewriter
633 setup.py
633 setup.py
634 \family default
634 \family default
635 .
635 .
636
636
637 \family typewriter
637 \family typewriter
638 O
638 O
639 \family default
639 \family default
640 nce you've completed the installation, you can safely remove this directory.
640 nce you've completed the installation, you can safely remove this directory.
641
641
642 \layout Enumerate
642 \layout Enumerate
643
643
644 If you are installing over a previous installation of version 0.2.0 or earlier,
644 If you are installing over a previous installation of version 0.2.0 or earlier,
645 first remove your
645 first remove your
646 \family typewriter
646 \family typewriter
647 $HOME/.ipython
647 $HOME/.ipython
648 \family default
648 \family default
649 directory, since the configuration file format has changed somewhat (the
649 directory, since the configuration file format has changed somewhat (the
650 '=' were removed from all option specifications).
650 '=' were removed from all option specifications).
651 Or you can call ipython with the
651 Or you can call ipython with the
652 \family typewriter
652 \family typewriter
653 -upgrade
653 -upgrade
654 \family default
654 \family default
655 option and it will do this automatically for you.
655 option and it will do this automatically for you.
656 \layout Enumerate
656 \layout Enumerate
657
657
658 IPython uses distutils, so you can install it by simply typing at the system
658 IPython uses distutils, so you can install it by simply typing at the system
659 prompt (don't type the
659 prompt (don't type the
660 \family typewriter
660 \family typewriter
661 $
661 $
662 \family default
662 \family default
663 )
663 )
664 \newline
664 \newline
665
665
666 \family typewriter
666 \family typewriter
667 $ python setup.py install
667 $ python setup.py install
668 \family default
668 \family default
669
669
670 \newline
670 \newline
671 Note that this assumes you have root access to your machine.
671 Note that this assumes you have root access to your machine.
672 If you don't have root access or don't want IPython to go in the default
672 If you don't have root access or don't want IPython to go in the default
673 python directories, you'll need to use the
673 python directories, you'll need to use the
674 \begin_inset ERT
674 \begin_inset ERT
675 status Collapsed
675 status Collapsed
676
676
677 \layout Standard
677 \layout Standard
678
678
679 \backslash
679 \backslash
680 verb|--home|
680 verb|--home|
681 \end_inset
681 \end_inset
682
682
683 option (or
683 option (or
684 \begin_inset ERT
684 \begin_inset ERT
685 status Collapsed
685 status Collapsed
686
686
687 \layout Standard
687 \layout Standard
688
688
689 \backslash
689 \backslash
690 verb|--prefix|
690 verb|--prefix|
691 \end_inset
691 \end_inset
692
692
693 ).
693 ).
694 For example:
694 For example:
695 \newline
695 \newline
696
696
697 \begin_inset ERT
697 \begin_inset ERT
698 status Collapsed
698 status Collapsed
699
699
700 \layout Standard
700 \layout Standard
701
701
702 \backslash
702 \backslash
703 verb|$ python setup.py install --home $HOME/local|
703 verb|$ python setup.py install --home $HOME/local|
704 \end_inset
704 \end_inset
705
705
706
706
707 \newline
707 \newline
708 will install IPython into
708 will install IPython into
709 \family typewriter
709 \family typewriter
710 $HOME/local
710 $HOME/local
711 \family default
711 \family default
712 and its subdirectories (creating them if necessary).
712 and its subdirectories (creating them if necessary).
713 \newline
713 \newline
714 You can type
714 You can type
715 \newline
715 \newline
716
716
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|$ python setup.py --help|
723 verb|$ python setup.py --help|
724 \end_inset
724 \end_inset
725
725
726
726
727 \newline
727 \newline
728 for more details.
728 for more details.
729 \newline
729 \newline
730 Note that if you change the default location for
730 Note that if you change the default location for
731 \begin_inset ERT
731 \begin_inset ERT
732 status Collapsed
732 status Collapsed
733
733
734 \layout Standard
734 \layout Standard
735
735
736 \backslash
736 \backslash
737 verb|--home|
737 verb|--home|
738 \end_inset
738 \end_inset
739
739
740 at installation, IPython may end up installed at a location which is not
740 at installation, IPython may end up installed at a location which is not
741 part of your
741 part of your
742 \family typewriter
742 \family typewriter
743 $PYTHONPATH
743 $PYTHONPATH
744 \family default
744 \family default
745 environment variable.
745 environment variable.
746 In this case, you'll need to configure this variable to include the actual
746 In this case, you'll need to configure this variable to include the actual
747 directory where the
747 directory where the
748 \family typewriter
748 \family typewriter
749 IPython/
749 IPython/
750 \family default
750 \family default
751 directory ended (typically the value you give to
751 directory ended (typically the value you give to
752 \begin_inset ERT
752 \begin_inset ERT
753 status Collapsed
753 status Collapsed
754
754
755 \layout Standard
755 \layout Standard
756
756
757 \backslash
757 \backslash
758 verb|--home|
758 verb|--home|
759 \end_inset
759 \end_inset
760
760
761 plus
761 plus
762 \family typewriter
762 \family typewriter
763 /lib/python
763 /lib/python
764 \family default
764 \family default
765 ).
765 ).
766 \layout Subsubsection
766 \layout Subsubsection
767
767
768 Mac OSX information
768 Mac OSX information
769 \layout Standard
769 \layout Standard
770
770
771 Under OSX, there is a choice you need to make.
771 Under OSX, there is a choice you need to make.
772 Apple ships its own build of Python, which lives in the core OSX filesystem
772 Apple ships its own build of Python, which lives in the core OSX filesystem
773 hierarchy.
773 hierarchy.
774 You can also manually install a separate Python, either purely by hand
774 You can also manually install a separate Python, either purely by hand
775 (typically in
775 (typically in
776 \family typewriter
776 \family typewriter
777 /usr/local
777 /usr/local
778 \family default
778 \family default
779 ) or by using Fink, which puts everything under
779 ) or by using Fink, which puts everything under
780 \family typewriter
780 \family typewriter
781 /sw
781 /sw
782 \family default
782 \family default
783 .
783 .
784 Which route to follow is a matter of personal preference, as I've seen
784 Which route to follow is a matter of personal preference, as I've seen
785 users who favor each of the approaches.
785 users who favor each of the approaches.
786 Here I will simply list the known installation issues under OSX, along
786 Here I will simply list the known installation issues under OSX, along
787 with their solutions.
787 with their solutions.
788 \layout Standard
788 \layout Standard
789
789
790 This page:
790 This page:
791 \begin_inset LatexCommand \htmlurl{http://geosci.uchicago.edu/~tobis/pylab.html}
791 \begin_inset LatexCommand \htmlurl{http://geosci.uchicago.edu/~tobis/pylab.html}
792
792
793 \end_inset
793 \end_inset
794
794
795 contains information on this topic, with additional details on how to make
795 contains information on this topic, with additional details on how to make
796 IPython and matplotlib play nicely under OSX.
796 IPython and matplotlib play nicely under OSX.
797 \layout Subsubsection*
797 \layout Subsubsection*
798
798
799 GUI problems
799 GUI problems
800 \layout Standard
800 \layout Standard
801
801
802 The following instructions apply to an install of IPython under OSX from
802 The following instructions apply to an install of IPython under OSX from
803 unpacking the
803 unpacking the
804 \family typewriter
804 \family typewriter
805 .tar.gz
805 .tar.gz
806 \family default
806 \family default
807 distribution and installing it for the default Python interpreter shipped
807 distribution and installing it for the default Python interpreter shipped
808 by Apple.
808 by Apple.
809 If you are using a fink install, fink will take care of these details for
809 If you are using a fink install, fink will take care of these details for
810 you, by installing IPython against fink's Python.
810 you, by installing IPython against fink's Python.
811 \layout Standard
811 \layout Standard
812
812
813 IPython offers various forms of support for interacting with graphical applicati
813 IPython offers various forms of support for interacting with graphical applicati
814 ons from the command line, from simple Tk apps (which are in principle always
814 ons from the command line, from simple Tk apps (which are in principle always
815 supported by Python) to interactive control of WX, Qt and GTK apps.
815 supported by Python) to interactive control of WX, Qt and GTK apps.
816 Under OSX, however, this requires that ipython is installed by calling
816 Under OSX, however, this requires that ipython is installed by calling
817 the special
817 the special
818 \family typewriter
818 \family typewriter
819 pythonw
819 pythonw
820 \family default
820 \family default
821 script at installation time, which takes care of coordinating things with
821 script at installation time, which takes care of coordinating things with
822 Apple's graphical environment.
822 Apple's graphical environment.
823 \layout Standard
823 \layout Standard
824
824
825 So when installing under OSX, it is best to use the following command:
825 So when installing under OSX, it is best to use the following command:
826 \family typewriter
826 \family typewriter
827
827
828 \newline
828 \newline
829
829
830 \family default
830 \family default
831
831
832 \begin_inset ERT
832 \begin_inset ERT
833 status Collapsed
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/local/bin|
838 verb| $ sudo pythonw setup.py install --install-scripts=/usr/local/bin|
839 \end_inset
839 \end_inset
840
840
841
841
842 \newline
842 \newline
843 or
843 or
844 \newline
844 \newline
845
845
846 \begin_inset ERT
846 \begin_inset ERT
847 status Collapsed
847 status Collapsed
848
848
849 \layout Standard
849 \layout Standard
850
850
851 \backslash
851 \backslash
852 verb| $ sudo pythonw setup.py install --install-scripts=/usr/bin|
852 verb| $ sudo pythonw setup.py install --install-scripts=/usr/bin|
853 \end_inset
853 \end_inset
854
854
855
855
856 \newline
856 \newline
857 depending on where you like to keep hand-installed executables.
857 depending on where you like to keep hand-installed executables.
858 \layout Standard
858 \layout Standard
859
859
860 The resulting script will have an appropriate shebang line (the first line
860 The resulting script will have an appropriate shebang line (the first line
861 in the script whic begins with
861 in the script whic begins with
862 \family typewriter
862 \family typewriter
863 #!...
863 #!...
864 \family default
864 \family default
865 ) such that the ipython interpreter can interact with the OS X GUI.
865 ) such that the ipython interpreter can interact with the OS X GUI.
866 If the installed version does not work and has a shebang line that points
866 If the installed version does not work and has a shebang line that points
867 to, for example, just
867 to, for example, just
868 \family typewriter
868 \family typewriter
869 /usr/bin/python
869 /usr/bin/python
870 \family default
870 \family default
871 , then you might have a stale, cached version in your
871 , then you might have a stale, cached version in your
872 \family typewriter
872 \family typewriter
873 build/scripts-<python-version>
873 build/scripts-<python-version>
874 \family default
874 \family default
875 directory.
875 directory.
876 Delete that directory and rerun the
876 Delete that directory and rerun the
877 \family typewriter
877 \family typewriter
878 setup.py
878 setup.py
879 \family default
879 \family default
880 .
880 .
881
881
882 \layout Standard
882 \layout Standard
883
883
884 It is also a good idea to use the special flag
884 It is also a good idea to use the special flag
885 \begin_inset ERT
885 \begin_inset ERT
886 status Collapsed
886 status Collapsed
887
887
888 \layout Standard
888 \layout Standard
889
889
890 \backslash
890 \backslash
891 verb|--install-scripts|
891 verb|--install-scripts|
892 \end_inset
892 \end_inset
893
893
894 as indicated above, to ensure that the ipython scripts end up in a location
894 as indicated above, to ensure that the ipython scripts end up in a location
895 which is part of your
895 which is part of your
896 \family typewriter
896 \family typewriter
897 $PATH
897 $PATH
898 \family default
898 \family default
899 .
899 .
900 Otherwise Apple's Python will put the scripts in an internal directory
900 Otherwise Apple's Python will put the scripts in an internal directory
901 not available by default at the command line (if you use
901 not available by default at the command line (if you use
902 \family typewriter
902 \family typewriter
903 /usr/local/bin
903 /usr/local/bin
904 \family default
904 \family default
905 , you need to make sure this is in your
905 , you need to make sure this is in your
906 \family typewriter
906 \family typewriter
907 $PATH
907 $PATH
908 \family default
908 \family default
909 , which may not be true by default).
909 , which may not be true by default).
910 \layout Subsubsection*
910 \layout Subsubsection*
911
911
912 Readline problems
912 Readline problems
913 \layout Standard
913 \layout Standard
914
914
915 By default, the Python version shipped by Apple does
915 By default, the Python version shipped by Apple does
916 \emph on
916 \emph on
917 not
917 not
918 \emph default
918 \emph default
919 include the readline library, so central to IPython's behavior.
919 include the readline library, so central to IPython's behavior.
920 If you install IPython against Apple's Python, you will not have arrow
920 If you install IPython against Apple's Python, you will not have arrow
921 keys, tab completion, etc.
921 keys, tab completion, etc.
922 For Mac OSX 10.3 (Panther), you can find a prebuilt readline library here:
922 For Mac OSX 10.3 (Panther), you can find a prebuilt readline library here:
923 \newline
923 \newline
924
924
925 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip}
925 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip}
926
926
927 \end_inset
927 \end_inset
928
928
929
929
930 \layout Standard
930 \layout Standard
931
931
932 If you are using OSX 10.4 (Tiger), after installing this package you need
932 If you are using OSX 10.4 (Tiger), after installing this package you need
933 to either:
933 to either:
934 \layout Enumerate
934 \layout Enumerate
935
935
936 move
936 move
937 \family typewriter
937 \family typewriter
938 readline.so
938 readline.so
939 \family default
939 \family default
940 from
940 from
941 \family typewriter
941 \family typewriter
942 /Library/Python/2.3
942 /Library/Python/2.3
943 \family default
943 \family default
944 to
944 to
945 \family typewriter
945 \family typewriter
946 /Library/Python/2.3/site-packages
946 /Library/Python/2.3/site-packages
947 \family default
947 \family default
948 , or
948 , or
949 \layout Enumerate
949 \layout Enumerate
950
950
951 install
951 install
952 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/TigerPython23Compat.pkg.zip}
952 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/TigerPython23Compat.pkg.zip}
953
953
954 \end_inset
954 \end_inset
955
955
956
956
957 \layout Standard
957 \layout Standard
958
958
959 Users installing against Fink's Python or a properly hand-built one should
959 Users installing against Fink's Python or a properly hand-built one should
960 not have this problem.
960 not have this problem.
961 \layout Subsubsection*
961 \layout Subsubsection*
962
962
963 DarwinPorts
963 DarwinPorts
964 \layout Standard
964 \layout Standard
965
965
966 I report here a message from an OSX user, who suggests an alternative means
966 I report here a message from an OSX user, who suggests an alternative means
967 of using IPython under this operating system with good results.
967 of using IPython under this operating system with good results.
968 Please let me know of any updates that may be useful for this section.
968 Please let me know of any updates that may be useful for this section.
969 His message is reproduced verbatim below:
969 His message is reproduced verbatim below:
970 \layout Quote
970 \layout Quote
971
971
972 From: Markus Banfi
972 From: Markus Banfi
973 \family typewriter
973 \family typewriter
974 <markus.banfi-AT-mospheira.net>
974 <markus.banfi-AT-mospheira.net>
975 \layout Quote
975 \layout Quote
976
976
977 As a MacOS X (10.4.2) user I prefer to install software using DawinPorts instead
977 As a MacOS X (10.4.2) user I prefer to install software using DawinPorts instead
978 of Fink.
978 of Fink.
979 I had no problems installing ipython with DarwinPorts.
979 I had no problems installing ipython with DarwinPorts.
980 It's just:
980 It's just:
981 \layout Quote
981 \layout Quote
982
982
983
983
984 \family typewriter
984 \family typewriter
985 sudo port install py-ipython
985 sudo port install py-ipython
986 \layout Quote
986 \layout Quote
987
987
988 It automatically resolved all dependencies (python24, readline, py-readline).
988 It automatically resolved all dependencies (python24, readline, py-readline).
989 So far I did not encounter any problems with the DarwinPorts port of ipython.
989 So far I did not encounter any problems with the DarwinPorts port of ipython.
990
990
991 \layout Subsection
991 \layout Subsection
992
992
993
993
994 \begin_inset LatexCommand \label{sub:Under-Windows}
994 \begin_inset LatexCommand \label{sub:Under-Windows}
995
995
996 \end_inset
996 \end_inset
997
997
998 Windows instructions
998 Windows instructions
999 \layout Standard
999 \layout Standard
1000
1000
1001 Some of IPython's very useful features are:
1001 Some of IPython's very useful features are:
1002 \layout Itemize
1002 \layout Itemize
1003
1003
1004 Integrated readline support (Tab-based file, object and attribute completion,
1004 Integrated readline support (Tab-based file, object and attribute completion,
1005 input history across sessions, editable command line, etc.)
1005 input history across sessions, editable command line, etc.)
1006 \layout Itemize
1006 \layout Itemize
1007
1007
1008 Coloring of prompts, code and tracebacks.
1008 Coloring of prompts, code and tracebacks.
1009 \layout Standard
1009 \layout Standard
1010
1010
1011 These, by default, are only available under Unix-like operating systems.
1011 These, by default, are only available under Unix-like operating systems.
1012 However, thanks to Gary Bishop's work, Windows XP/2k users can also benefit
1012 However, thanks to Gary Bishop's work, Windows XP/2k users can also benefit
1013 from them.
1013 from them.
1014 His readline library implements both GNU readline functionality and color
1014 His readline library implements both GNU readline functionality and color
1015 support, so that IPython under Windows XP/2k can be as friendly and powerful
1015 support, so that IPython under Windows XP/2k can be as friendly and powerful
1016 as under Unix-like environments.
1016 as under Unix-like environments.
1017 \layout Standard
1017 \layout Standard
1018
1018
1019 The
1019 The
1020 \family typewriter
1020 \family typewriter
1021 readline
1021 readline
1022 \family default
1022 \family default
1023 extension needs two other libraries to work, so in all you need:
1023 extension needs two other libraries to work, so in all you need:
1024 \layout Enumerate
1024 \layout Enumerate
1025
1025
1026
1026
1027 \family typewriter
1027 \family typewriter
1028 PyWin32
1028 PyWin32
1029 \family default
1029 \family default
1030 from
1030 from
1031 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/mhammond}
1031 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/mhammond}
1032
1032
1033 \end_inset
1033 \end_inset
1034
1034
1035 .
1035 .
1036 \layout Enumerate
1036 \layout Enumerate
1037
1037
1038
1038
1039 \family typewriter
1039 \family typewriter
1040 CTypes
1040 CTypes
1041 \family default
1041 \family default
1042 from
1042 from
1043 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/theller/ctypes}
1043 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/theller/ctypes}
1044
1044
1045 \end_inset
1045 \end_inset
1046
1046
1047 (you
1047 (you
1048 \emph on
1048 \emph on
1049 must
1049 must
1050 \emph default
1050 \emph default
1051 use version 0.9.1 or newer).
1051 use version 0.9.1 or newer).
1052 \layout Enumerate
1052 \layout Enumerate
1053
1053
1054
1054
1055 \family typewriter
1055 \family typewriter
1056 Readline
1056 Readline
1057 \family default
1057 \family default
1058 for Windows from
1058 for Windows from
1059 \begin_inset LatexCommand \htmlurl{http://sourceforge.net/projects/uncpythontools}
1059 \begin_inset LatexCommand \htmlurl{http://sourceforge.net/projects/uncpythontools}
1060
1060
1061 \end_inset
1061 \end_inset
1062
1062
1063 .
1063 .
1064 \layout Standard
1064 \layout Standard
1065
1065
1066
1066
1067 \series bold
1067 \series bold
1068 Warning about a broken readline-like library:
1068 Warning about a broken readline-like library:
1069 \series default
1069 \series default
1070 several users have reported problems stemming from using the pseudo-readline
1070 several users have reported problems stemming from using the pseudo-readline
1071 library at
1071 library at
1072 \begin_inset LatexCommand \htmlurl{http://newcenturycomputers.net/projects/readline.html}
1072 \begin_inset LatexCommand \htmlurl{http://newcenturycomputers.net/projects/readline.html}
1073
1073
1074 \end_inset
1074 \end_inset
1075
1075
1076 .
1076 .
1077 This is a broken library which, while called readline, only implements
1077 This is a broken library which, while called readline, only implements
1078 an incomplete subset of the readline API.
1078 an incomplete subset of the readline API.
1079 Since it is still called readline, it fools IPython's detection mechanisms
1079 Since it is still called readline, it fools IPython's detection mechanisms
1080 and causes unpredictable crashes later.
1080 and causes unpredictable crashes later.
1081 If you wish to use IPython under Windows, you must NOT use this library,
1081 If you wish to use IPython under Windows, you must NOT use this library,
1082 which for all purposes is (at least as of version 1.6) terminally broken.
1082 which for all purposes is (at least as of version 1.6) terminally broken.
1083 \layout Subsubsection
1083 \layout Subsubsection
1084
1084
1085 Installation procedure
1085 Installation procedure
1086 \layout Standard
1086 \layout Standard
1087
1087
1088 Once you have the above installed, from the IPython download directory grab
1088 Once you have the above installed, from the IPython download directory grab
1089 the
1089 the
1090 \family typewriter
1090 \family typewriter
1091 ipython-XXX.win32.exe
1091 ipython-XXX.win32.exe
1092 \family default
1092 \family default
1093 file, where
1093 file, where
1094 \family typewriter
1094 \family typewriter
1095 XXX
1095 XXX
1096 \family default
1096 \family default
1097 represents the version number.
1097 represents the version number.
1098 This is a regular windows executable installer, which you can simply double-cli
1098 This is a regular windows executable installer, which you can simply double-cli
1099 ck to install.
1099 ck to install.
1100 It will add an entry for IPython to your Start Menu, as well as registering
1100 It will add an entry for IPython to your Start Menu, as well as registering
1101 IPython in the Windows list of applications, so you can later uninstall
1101 IPython in the Windows list of applications, so you can later uninstall
1102 it from the Control Panel.
1102 it from the Control Panel.
1103
1103
1104 \layout Standard
1104 \layout Standard
1105
1105
1106 IPython tries to install the configuration information in a directory named
1106 IPython tries to install the configuration information in a directory named
1107
1107
1108 \family typewriter
1108 \family typewriter
1109 .ipython
1109 .ipython
1110 \family default
1110 \family default
1111 (
1111 (
1112 \family typewriter
1112 \family typewriter
1113 _ipython
1113 _ipython
1114 \family default
1114 \family default
1115 under Windows) located in your `home' directory.
1115 under Windows) located in your `home' directory.
1116 IPython sets this directory by looking for a
1116 IPython sets this directory by looking for a
1117 \family typewriter
1117 \family typewriter
1118 HOME
1118 HOME
1119 \family default
1119 \family default
1120 environment variable; if such a variable does not exist, it uses
1120 environment variable; if such a variable does not exist, it uses
1121 \family typewriter
1121 \family typewriter
1122 HOMEDRIVE
1122 HOMEDRIVE
1123 \backslash
1123 \backslash
1124 HOMEPATH
1124 HOMEPATH
1125 \family default
1125 \family default
1126 (these are always defined by Windows).
1126 (these are always defined by Windows).
1127 This typically gives something like
1127 This typically gives something like
1128 \family typewriter
1128 \family typewriter
1129 C:
1129 C:
1130 \backslash
1130 \backslash
1131 Documents and Settings
1131 Documents and Settings
1132 \backslash
1132 \backslash
1133 YourUserName
1133 YourUserName
1134 \family default
1134 \family default
1135 , but your local details may vary.
1135 , but your local details may vary.
1136 In this directory you will find all the files that configure IPython's
1136 In this directory you will find all the files that configure IPython's
1137 defaults, and you can put there your profiles and extensions.
1137 defaults, and you can put there your profiles and extensions.
1138 This directory is automatically added by IPython to
1138 This directory is automatically added by IPython to
1139 \family typewriter
1139 \family typewriter
1140 sys.path
1140 sys.path
1141 \family default
1141 \family default
1142 , so anything you place there can be found by
1142 , so anything you place there can be found by
1143 \family typewriter
1143 \family typewriter
1144 import
1144 import
1145 \family default
1145 \family default
1146 statements.
1146 statements.
1147 \layout Paragraph
1147 \layout Paragraph
1148
1148
1149 Upgrading
1149 Upgrading
1150 \layout Standard
1150 \layout Standard
1151
1151
1152 For an IPython upgrade, you should first uninstall the previous version.
1152 For an IPython upgrade, you should first uninstall the previous version.
1153 This will ensure that all files and directories (such as the documentation)
1153 This will ensure that all files and directories (such as the documentation)
1154 which carry embedded version strings in their names are properly removed.
1154 which carry embedded version strings in their names are properly removed.
1155 \layout Paragraph
1155 \layout Paragraph
1156
1156
1157 Manual installation under Win32
1157 Manual installation under Win32
1158 \layout Standard
1158 \layout Standard
1159
1159
1160 In case the automatic installer does not work for some reason, you can download
1160 In case the automatic installer does not work for some reason, you can download
1161 the
1161 the
1162 \family typewriter
1162 \family typewriter
1163 ipython-XXX.tar.gz
1163 ipython-XXX.tar.gz
1164 \family default
1164 \family default
1165 file, which contains the full IPython source distribution (the popular
1165 file, which contains the full IPython source distribution (the popular
1166 WinZip can read
1166 WinZip can read
1167 \family typewriter
1167 \family typewriter
1168 .tar.gz
1168 .tar.gz
1169 \family default
1169 \family default
1170 files).
1170 files).
1171 After uncompressing the archive, you can install it at a command terminal
1171 After uncompressing the archive, you can install it at a command terminal
1172 just like any other Python module, by using
1172 just like any other Python module, by using
1173 \family typewriter
1173 \family typewriter
1174 `python setup.py install'
1174 `python setup.py install'
1175 \family default
1175 \family default
1176 .
1176 .
1177
1177
1178 \layout Standard
1178 \layout Standard
1179
1179
1180 After the installation, run the supplied
1180 After the installation, run the supplied
1181 \family typewriter
1181 \family typewriter
1182 win32_manual_post_install.py
1182 win32_manual_post_install.py
1183 \family default
1183 \family default
1184 script, which creates the necessary Start Menu shortcuts for you.
1184 script, which creates the necessary Start Menu shortcuts for you.
1185 \layout Subsection
1185 \layout Subsection
1186
1186
1187
1187
1188 \begin_inset LatexCommand \label{sec:upgrade}
1188 \begin_inset LatexCommand \label{sec:upgrade}
1189
1189
1190 \end_inset
1190 \end_inset
1191
1191
1192 Upgrading from a previous version
1192 Upgrading from a previous version
1193 \layout Standard
1193 \layout Standard
1194
1194
1195 If you are upgrading from a previous version of IPython, after doing the
1195 If you are upgrading from a previous version of IPython, after doing the
1196 routine installation described above, you should call IPython with the
1196 routine installation described above, you should call IPython with the
1197
1197
1198 \family typewriter
1198 \family typewriter
1199 -upgrade
1199 -upgrade
1200 \family default
1200 \family default
1201 option the first time you run your new copy.
1201 option the first time you run your new copy.
1202 This will automatically update your configuration directory while preserving
1202 This will automatically update your configuration directory while preserving
1203 copies of your old files.
1203 copies of your old files.
1204 You can then later merge back any personal customizations you may have
1204 You can then later merge back any personal customizations you may have
1205 made into the new files.
1205 made into the new files.
1206 It is a good idea to do this as there may be new options available in the
1206 It is a good idea to do this as there may be new options available in the
1207 new configuration files which you will not have.
1207 new configuration files which you will not have.
1208 \layout Standard
1208 \layout Standard
1209
1209
1210 Under Windows, if you don't know how to call python scripts with arguments
1210 Under Windows, if you don't know how to call python scripts with arguments
1211 from a command line, simply delete the old config directory and IPython
1211 from a command line, simply delete the old config directory and IPython
1212 will make a new one.
1212 will make a new one.
1213 Win2k and WinXP users will find it in
1213 Win2k and WinXP users will find it in
1214 \family typewriter
1214 \family typewriter
1215 C:
1215 C:
1216 \backslash
1216 \backslash
1217 Documents and Settings
1217 Documents and Settings
1218 \backslash
1218 \backslash
1219 YourUserName
1219 YourUserName
1220 \backslash
1220 \backslash
1221 _ipython
1221 _ipython
1222 \family default
1222 \family default
1223 , and Win 9x users under
1223 , and Win 9x users under
1224 \family typewriter
1224 \family typewriter
1225 C:
1225 C:
1226 \backslash
1226 \backslash
1227 Program Files
1227 Program Files
1228 \backslash
1228 \backslash
1229 IPython
1229 IPython
1230 \backslash
1230 \backslash
1231 _ipython.
1231 _ipython.
1232 \layout Section
1232 \layout Section
1233
1233
1234
1234
1235 \begin_inset LatexCommand \label{sec:good_config}
1235 \begin_inset LatexCommand \label{sec:good_config}
1236
1236
1237 \end_inset
1237 \end_inset
1238
1238
1239
1239
1240 \begin_inset OptArg
1240 \begin_inset OptArg
1241 collapsed true
1241 collapsed true
1242
1242
1243 \layout Standard
1243 \layout Standard
1244
1244
1245 Initial configuration
1245 Initial configuration
1246 \begin_inset ERT
1246 \begin_inset ERT
1247 status Collapsed
1247 status Collapsed
1248
1248
1249 \layout Standard
1249 \layout Standard
1250
1250
1251 \backslash
1251 \backslash
1252 ldots
1252 ldots
1253 \end_inset
1253 \end_inset
1254
1254
1255
1255
1256 \end_inset
1256 \end_inset
1257
1257
1258 Initial configuration of your environment
1258 Initial configuration of your environment
1259 \layout Standard
1259 \layout Standard
1260
1260
1261 This section will help you set various things in your environment for your
1261 This section will help you set various things in your environment for your
1262 IPython sessions to be as efficient as possible.
1262 IPython sessions to be as efficient as possible.
1263 All of IPython's configuration information, along with several example
1263 All of IPython's configuration information, along with several example
1264 files, is stored in a directory named by default
1264 files, is stored in a directory named by default
1265 \family typewriter
1265 \family typewriter
1266 $HOME/.ipython
1266 $HOME/.ipython
1267 \family default
1267 \family default
1268 .
1268 .
1269 You can change this by defining the environment variable
1269 You can change this by defining the environment variable
1270 \family typewriter
1270 \family typewriter
1271 IPYTHONDIR
1271 IPYTHONDIR
1272 \family default
1272 \family default
1273 , or at runtime with the command line option
1273 , or at runtime with the command line option
1274 \family typewriter
1274 \family typewriter
1275 -ipythondir
1275 -ipythondir
1276 \family default
1276 \family default
1277 .
1277 .
1278 \layout Standard
1278 \layout Standard
1279
1279
1280 If all goes well, the first time you run IPython it should automatically
1280 If all goes well, the first time you run IPython it should automatically
1281 create a user copy of the config directory for you, based on its builtin
1281 create a user copy of the config directory for you, based on its builtin
1282 defaults.
1282 defaults.
1283 You can look at the files it creates to learn more about configuring the
1283 You can look at the files it creates to learn more about configuring the
1284 system.
1284 system.
1285 The main file you will modify to configure IPython's behavior is called
1285 The main file you will modify to configure IPython's behavior is called
1286
1286
1287 \family typewriter
1287 \family typewriter
1288 ipythonrc
1288 ipythonrc
1289 \family default
1289 \family default
1290 (with a
1290 (with a
1291 \family typewriter
1291 \family typewriter
1292 .ini
1292 .ini
1293 \family default
1293 \family default
1294 extension under Windows), included for reference in Sec.
1294 extension under Windows), included for reference in Sec.
1295
1295
1296 \begin_inset LatexCommand \ref{sec:ipytonrc-sample}
1296 \begin_inset LatexCommand \ref{sec:ipytonrc-sample}
1297
1297
1298 \end_inset
1298 \end_inset
1299
1299
1300 .
1300 .
1301 This file is very commented and has many variables you can change to suit
1301 This file is very commented and has many variables you can change to suit
1302 your taste, you can find more details in Sec.
1302 your taste, you can find more details in Sec.
1303
1303
1304 \begin_inset LatexCommand \ref{sec:customization}
1304 \begin_inset LatexCommand \ref{sec:customization}
1305
1305
1306 \end_inset
1306 \end_inset
1307
1307
1308 .
1308 .
1309 Here we discuss the basic things you will want to make sure things are
1309 Here we discuss the basic things you will want to make sure things are
1310 working properly from the beginning.
1310 working properly from the beginning.
1311 \layout Subsection
1311 \layout Subsection
1312
1312
1313
1313
1314 \begin_inset LatexCommand \label{sec:help-access}
1314 \begin_inset LatexCommand \label{sec:help-access}
1315
1315
1316 \end_inset
1316 \end_inset
1317
1317
1318 Access to the Python help system
1318 Access to the Python help system
1319 \layout Standard
1319 \layout Standard
1320
1320
1321 This is true for Python in general (not just for IPython): you should have
1321 This is true for Python in general (not just for IPython): you should have
1322 an environment variable called
1322 an environment variable called
1323 \family typewriter
1323 \family typewriter
1324 PYTHONDOCS
1324 PYTHONDOCS
1325 \family default
1325 \family default
1326 pointing to the directory where your HTML Python documentation lives.
1326 pointing to the directory where your HTML Python documentation lives.
1327 In my system it's
1327 In my system it's
1328 \family typewriter
1328 \family typewriter
1329 /usr/share/doc/python-docs-2.3.4/html
1329 /usr/share/doc/python-docs-2.3.4/html
1330 \family default
1330 \family default
1331 , check your local details or ask your systems administrator.
1331 , check your local details or ask your systems administrator.
1332
1332
1333 \layout Standard
1333 \layout Standard
1334
1334
1335 This is the directory which holds the HTML version of the Python manuals.
1335 This is the directory which holds the HTML version of the Python manuals.
1336 Unfortunately it seems that different Linux distributions package these
1336 Unfortunately it seems that different Linux distributions package these
1337 files differently, so you may have to look around a bit.
1337 files differently, so you may have to look around a bit.
1338 Below I show the contents of this directory on my system for reference:
1338 Below I show the contents of this directory on my system for reference:
1339 \layout Standard
1339 \layout Standard
1340
1340
1341
1341
1342 \family typewriter
1342 \family typewriter
1343 [html]> ls
1343 [html]> ls
1344 \newline
1344 \newline
1345 about.dat acks.html dist/ ext/ index.html lib/ modindex.html stdabout.dat tut/
1345 about.dat acks.html dist/ ext/ index.html lib/ modindex.html stdabout.dat tut/
1346 about.html api/ doc/ icons/ inst/ mac/ ref/ style.css
1346 about.html api/ doc/ icons/ inst/ mac/ ref/ style.css
1347 \layout Standard
1347 \layout Standard
1348
1348
1349 You should really make sure this variable is correctly set so that Python's
1349 You should really make sure this variable is correctly set so that Python's
1350 pydoc-based help system works.
1350 pydoc-based help system works.
1351 It is a powerful and convenient system with full access to the Python manuals
1351 It is a powerful and convenient system with full access to the Python manuals
1352 and all modules accessible to you.
1352 and all modules accessible to you.
1353 \layout Standard
1353 \layout Standard
1354
1354
1355 Under Windows it seems that pydoc finds the documentation automatically,
1355 Under Windows it seems that pydoc finds the documentation automatically,
1356 so no extra setup appears necessary.
1356 so no extra setup appears necessary.
1357 \layout Subsection
1357 \layout Subsection
1358
1358
1359 Editor
1359 Editor
1360 \layout Standard
1360 \layout Standard
1361
1361
1362 The
1362 The
1363 \family typewriter
1363 \family typewriter
1364 %edit
1364 %edit
1365 \family default
1365 \family default
1366 command (and its alias
1366 command (and its alias
1367 \family typewriter
1367 \family typewriter
1368 %ed
1368 %ed
1369 \family default
1369 \family default
1370 ) will invoke the editor set in your environment as
1370 ) will invoke the editor set in your environment as
1371 \family typewriter
1371 \family typewriter
1372 EDITOR
1372 EDITOR
1373 \family default
1373 \family default
1374 .
1374 .
1375 If this variable is not set, it will default to
1375 If this variable is not set, it will default to
1376 \family typewriter
1376 \family typewriter
1377 vi
1377 vi
1378 \family default
1378 \family default
1379 under Linux/Unix and to
1379 under Linux/Unix and to
1380 \family typewriter
1380 \family typewriter
1381 notepad
1381 notepad
1382 \family default
1382 \family default
1383 under Windows.
1383 under Windows.
1384 You may want to set this variable properly and to a lightweight editor
1384 You may want to set this variable properly and to a lightweight editor
1385 which doesn't take too long to start (that is, something other than a new
1385 which doesn't take too long to start (that is, something other than a new
1386 instance of
1386 instance of
1387 \family typewriter
1387 \family typewriter
1388 Emacs
1388 Emacs
1389 \family default
1389 \family default
1390 ).
1390 ).
1391 This way you can edit multi-line code quickly and with the power of a real
1391 This way you can edit multi-line code quickly and with the power of a real
1392 editor right inside IPython.
1392 editor right inside IPython.
1393
1393
1394 \layout Standard
1394 \layout Standard
1395
1395
1396 If you are a dedicated
1396 If you are a dedicated
1397 \family typewriter
1397 \family typewriter
1398 Emacs
1398 Emacs
1399 \family default
1399 \family default
1400 user, you should set up the
1400 user, you should set up the
1401 \family typewriter
1401 \family typewriter
1402 Emacs
1402 Emacs
1403 \family default
1403 \family default
1404 server so that new requests are handled by the original process.
1404 server so that new requests are handled by the original process.
1405 This means that almost no time is spent in handling the request (assuming
1405 This means that almost no time is spent in handling the request (assuming
1406 an
1406 an
1407 \family typewriter
1407 \family typewriter
1408 Emacs
1408 Emacs
1409 \family default
1409 \family default
1410 process is already running).
1410 process is already running).
1411 For this to work, you need to set your
1411 For this to work, you need to set your
1412 \family typewriter
1412 \family typewriter
1413 EDITOR
1413 EDITOR
1414 \family default
1414 \family default
1415 environment variable to
1415 environment variable to
1416 \family typewriter
1416 \family typewriter
1417 'emacsclient'
1417 'emacsclient'
1418 \family default
1418 \family default
1419 .
1419 .
1420
1420
1421 \family typewriter
1421 \family typewriter
1422
1422
1423 \family default
1423 \family default
1424 The code below, supplied by Francois Pinard, can then be used in your
1424 The code below, supplied by Francois Pinard, can then be used in your
1425 \family typewriter
1425 \family typewriter
1426 .emacs
1426 .emacs
1427 \family default
1427 \family default
1428 file to enable the server:
1428 file to enable the server:
1429 \layout Standard
1429 \layout Standard
1430
1430
1431
1431
1432 \family typewriter
1432 \family typewriter
1433 (defvar server-buffer-clients)
1433 (defvar server-buffer-clients)
1434 \newline
1434 \newline
1435 (when (and (fboundp 'server-start) (string-equal (getenv "TERM") 'xterm))
1435 (when (and (fboundp 'server-start) (string-equal (getenv "TERM") 'xterm))
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 (server-start)
1449 (server-start)
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 (defun fp-kill-server-with-buffer-routine ()
1463 (defun fp-kill-server-with-buffer-routine ()
1464 \newline
1464 \newline
1465
1465
1466 \begin_inset ERT
1466 \begin_inset ERT
1467 status Collapsed
1467 status Collapsed
1468
1468
1469 \layout Standard
1469 \layout Standard
1470
1470
1471 \backslash
1471 \backslash
1472 hspace*{0mm}
1472 hspace*{0mm}
1473 \end_inset
1473 \end_inset
1474
1474
1475 \SpecialChar ~
1475 \SpecialChar ~
1476 \SpecialChar ~
1476 \SpecialChar ~
1477 \SpecialChar ~
1477 \SpecialChar ~
1478 \SpecialChar ~
1478 \SpecialChar ~
1479 (and server-buffer-clients (server-done)))
1479 (and server-buffer-clients (server-done)))
1480 \newline
1480 \newline
1481
1481
1482 \begin_inset ERT
1482 \begin_inset ERT
1483 status Collapsed
1483 status Collapsed
1484
1484
1485 \layout Standard
1485 \layout Standard
1486
1486
1487 \backslash
1487 \backslash
1488 hspace*{0mm}
1488 hspace*{0mm}
1489 \end_inset
1489 \end_inset
1490
1490
1491 \SpecialChar ~
1491 \SpecialChar ~
1492 \SpecialChar ~
1492 \SpecialChar ~
1493 (add-hook 'kill-buffer-hook 'fp-kill-server-with-buffer-routine))
1493 (add-hook 'kill-buffer-hook 'fp-kill-server-with-buffer-routine))
1494 \layout Standard
1494 \layout Standard
1495
1495
1496 You can also set the value of this editor via the commmand-line option '-
1496 You can also set the value of this editor via the commmand-line option '-
1497 \family typewriter
1497 \family typewriter
1498 editor'
1498 editor'
1499 \family default
1499 \family default
1500 or in your
1500 or in your
1501 \family typewriter
1501 \family typewriter
1502 ipythonrc
1502 ipythonrc
1503 \family default
1503 \family default
1504 file.
1504 file.
1505 This is useful if you wish to use specifically for IPython an editor different
1505 This is useful if you wish to use specifically for IPython an editor different
1506 from your typical default (and for Windows users who tend to use fewer
1506 from your typical default (and for Windows users who tend to use fewer
1507 environment variables).
1507 environment variables).
1508 \layout Subsection
1508 \layout Subsection
1509
1509
1510 Color
1510 Color
1511 \layout Standard
1511 \layout Standard
1512
1512
1513 The default IPython configuration has most bells and whistles turned on
1513 The default IPython configuration has most bells and whistles turned on
1514 (they're pretty safe).
1514 (they're pretty safe).
1515 But there's one that
1515 But there's one that
1516 \emph on
1516 \emph on
1517 may
1517 may
1518 \emph default
1518 \emph default
1519 cause problems on some systems: the use of color on screen for displaying
1519 cause problems on some systems: the use of color on screen for displaying
1520 information.
1520 information.
1521 This is very useful, since IPython can show prompts and exception tracebacks
1521 This is very useful, since IPython can show prompts and exception tracebacks
1522 with various colors, display syntax-highlighted source code, and in general
1522 with various colors, display syntax-highlighted source code, and in general
1523 make it easier to visually parse information.
1523 make it easier to visually parse information.
1524 \layout Standard
1524 \layout Standard
1525
1525
1526 The following terminals seem to handle the color sequences fine:
1526 The following terminals seem to handle the color sequences fine:
1527 \layout Itemize
1527 \layout Itemize
1528
1528
1529 Linux main text console, KDE Konsole, Gnome Terminal, E-term, rxvt, xterm.
1529 Linux main text console, KDE Konsole, Gnome Terminal, E-term, rxvt, xterm.
1530 \layout Itemize
1530 \layout Itemize
1531
1531
1532 CDE terminal (tested under Solaris).
1532 CDE terminal (tested under Solaris).
1533 This one boldfaces light colors.
1533 This one boldfaces light colors.
1534 \layout Itemize
1534 \layout Itemize
1535
1535
1536 (X)Emacs buffers.
1536 (X)Emacs buffers.
1537 See sec.
1537 See sec.
1538 \begin_inset LatexCommand \ref{sec:emacs}
1538 \begin_inset LatexCommand \ref{sec:emacs}
1539
1539
1540 \end_inset
1540 \end_inset
1541
1541
1542 for more details on using IPython with (X)Emacs.
1542 for more details on using IPython with (X)Emacs.
1543 \layout Itemize
1543 \layout Itemize
1544
1544
1545 A Windows (XP/2k) command prompt
1545 A Windows (XP/2k) command prompt
1546 \emph on
1546 \emph on
1547 with Gary Bishop's support extensions
1547 with Gary Bishop's support extensions
1548 \emph default
1548 \emph default
1549 .
1549 .
1550 Gary's extensions are discussed in Sec.\SpecialChar ~
1550 Gary's extensions are discussed in Sec.\SpecialChar ~
1551
1551
1552 \begin_inset LatexCommand \ref{sub:Under-Windows}
1552 \begin_inset LatexCommand \ref{sub:Under-Windows}
1553
1553
1554 \end_inset
1554 \end_inset
1555
1555
1556 .
1556 .
1557 \layout Itemize
1557 \layout Itemize
1558
1558
1559 A Windows (XP/2k) CygWin shell.
1559 A Windows (XP/2k) CygWin shell.
1560 Although some users have reported problems; it is not clear whether there
1560 Although some users have reported problems; it is not clear whether there
1561 is an issue for everyone or only under specific configurations.
1561 is an issue for everyone or only under specific configurations.
1562 If you have full color support under cygwin, please post to the IPython
1562 If you have full color support under cygwin, please post to the IPython
1563 mailing list so this issue can be resolved for all users.
1563 mailing list so this issue can be resolved for all users.
1564 \layout Standard
1564 \layout Standard
1565
1565
1566 These have shown problems:
1566 These have shown problems:
1567 \layout Itemize
1567 \layout Itemize
1568
1568
1569 Windows command prompt in WinXP/2k logged into a Linux machine via telnet
1569 Windows command prompt in WinXP/2k logged into a Linux machine via telnet
1570 or ssh.
1570 or ssh.
1571 \layout Itemize
1571 \layout Itemize
1572
1572
1573 Windows native command prompt in WinXP/2k,
1573 Windows native command prompt in WinXP/2k,
1574 \emph on
1574 \emph on
1575 without
1575 without
1576 \emph default
1576 \emph default
1577 Gary Bishop's extensions.
1577 Gary Bishop's extensions.
1578 Once Gary's readline library is installed, the normal WinXP/2k command
1578 Once Gary's readline library is installed, the normal WinXP/2k command
1579 prompt works perfectly.
1579 prompt works perfectly.
1580 \layout Standard
1580 \layout Standard
1581
1581
1582 Currently the following color schemes are available:
1582 Currently the following color schemes are available:
1583 \layout Itemize
1583 \layout Itemize
1584
1584
1585
1585
1586 \family typewriter
1586 \family typewriter
1587 NoColor
1587 NoColor
1588 \family default
1588 \family default
1589 : uses no color escapes at all (all escapes are empty
1589 : uses no color escapes at all (all escapes are empty
1590 \begin_inset Quotes eld
1590 \begin_inset Quotes eld
1591 \end_inset
1591 \end_inset
1592
1592
1593
1593
1594 \begin_inset Quotes eld
1594 \begin_inset Quotes eld
1595 \end_inset
1595 \end_inset
1596
1596
1597 strings).
1597 strings).
1598 This 'scheme' is thus fully safe to use in any terminal.
1598 This 'scheme' is thus fully safe to use in any terminal.
1599 \layout Itemize
1599 \layout Itemize
1600
1600
1601
1601
1602 \family typewriter
1602 \family typewriter
1603 Linux
1603 Linux
1604 \family default
1604 \family default
1605 : works well in Linux console type environments: dark background with light
1605 : works well in Linux console type environments: dark background with light
1606 fonts.
1606 fonts.
1607 It uses bright colors for information, so it is difficult to read if you
1607 It uses bright colors for information, so it is difficult to read if you
1608 have a light colored background.
1608 have a light colored background.
1609 \layout Itemize
1609 \layout Itemize
1610
1610
1611
1611
1612 \family typewriter
1612 \family typewriter
1613 LightBG
1613 LightBG
1614 \family default
1614 \family default
1615 : the basic colors are similar to those in the
1615 : the basic colors are similar to those in the
1616 \family typewriter
1616 \family typewriter
1617 Linux
1617 Linux
1618 \family default
1618 \family default
1619 scheme but darker.
1619 scheme but darker.
1620 It is easy to read in terminals with light backgrounds.
1620 It is easy to read in terminals with light backgrounds.
1621 \layout Standard
1621 \layout Standard
1622
1622
1623 IPython uses colors for two main groups of things: prompts and tracebacks
1623 IPython uses colors for two main groups of things: prompts and tracebacks
1624 which are directly printed to the terminal, and the object introspection
1624 which are directly printed to the terminal, and the object introspection
1625 system which passes large sets of data through a pager.
1625 system which passes large sets of data through a pager.
1626 \layout Subsubsection
1626 \layout Subsubsection
1627
1627
1628 Input/Output prompts and exception tracebacks
1628 Input/Output prompts and exception tracebacks
1629 \layout Standard
1629 \layout Standard
1630
1630
1631 You can test whether the colored prompts and tracebacks work on your system
1631 You can test whether the colored prompts and tracebacks work on your system
1632 interactively by typing
1632 interactively by typing
1633 \family typewriter
1633 \family typewriter
1634 '%colors Linux'
1634 '%colors Linux'
1635 \family default
1635 \family default
1636 at the prompt (use '
1636 at the prompt (use '
1637 \family typewriter
1637 \family typewriter
1638 %colors LightBG'
1638 %colors LightBG'
1639 \family default
1639 \family default
1640 if your terminal has a light background).
1640 if your terminal has a light background).
1641 If the input prompt shows garbage like:
1641 If the input prompt shows garbage like:
1642 \newline
1642 \newline
1643
1643
1644 \family typewriter
1644 \family typewriter
1645 [0;32mIn [[1;32m1[0;32m]: [0;00m
1645 [0;32mIn [[1;32m1[0;32m]: [0;00m
1646 \family default
1646 \family default
1647
1647
1648 \newline
1648 \newline
1649 instead of (in color) something like:
1649 instead of (in color) something like:
1650 \newline
1650 \newline
1651
1651
1652 \family typewriter
1652 \family typewriter
1653 In [1]:
1653 In [1]:
1654 \family default
1654 \family default
1655
1655
1656 \newline
1656 \newline
1657 this means that your terminal doesn't properly handle color escape sequences.
1657 this means that your terminal doesn't properly handle color escape sequences.
1658 You can go to a 'no color' mode by typing '
1658 You can go to a 'no color' mode by typing '
1659 \family typewriter
1659 \family typewriter
1660 %colors NoColor
1660 %colors NoColor
1661 \family default
1661 \family default
1662 '.
1662 '.
1663
1663
1664 \layout Standard
1664 \layout Standard
1665
1665
1666 You can try using a different terminal emulator program.
1666 You can try using a different terminal emulator program (Emacs users, see
1667 below).
1667 To permanently set your color preferences, edit the file
1668 To permanently set your color preferences, edit the file
1668 \family typewriter
1669 \family typewriter
1669 $HOME/.ipython/ipythonrc
1670 $HOME/.ipython/ipythonrc
1670 \family default
1671 \family default
1671 and set the
1672 and set the
1672 \family typewriter
1673 \family typewriter
1673 colors
1674 colors
1674 \family default
1675 \family default
1675 option to the desired value.
1676 option to the desired value.
1676 \layout Subsubsection
1677 \layout Subsubsection
1677
1678
1678 Object details (types, docstrings, source code, etc.)
1679 Object details (types, docstrings, source code, etc.)
1679 \layout Standard
1680 \layout Standard
1680
1681
1681 IPython has a set of special functions for studying the objects you are
1682 IPython has a set of special functions for studying the objects you are
1682 working with, discussed in detail in Sec.
1683 working with, discussed in detail in Sec.
1683
1684
1684 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1685 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1685
1686
1686 \end_inset
1687 \end_inset
1687
1688
1688 .
1689 .
1689 But this system relies on passing information which is longer than your
1690 But this system relies on passing information which is longer than your
1690 screen through a data pager, such as the common Unix
1691 screen through a data pager, such as the common Unix
1691 \family typewriter
1692 \family typewriter
1692 less
1693 less
1693 \family default
1694 \family default
1694 and
1695 and
1695 \family typewriter
1696 \family typewriter
1696 more
1697 more
1697 \family default
1698 \family default
1698 programs.
1699 programs.
1699 In order to be able to see this information in color, your pager needs
1700 In order to be able to see this information in color, your pager needs
1700 to be properly configured.
1701 to be properly configured.
1701 I strongly recommend using
1702 I strongly recommend using
1702 \family typewriter
1703 \family typewriter
1703 less
1704 less
1704 \family default
1705 \family default
1705 instead of
1706 instead of
1706 \family typewriter
1707 \family typewriter
1707 more
1708 more
1708 \family default
1709 \family default
1709 , as it seems that
1710 , as it seems that
1710 \family typewriter
1711 \family typewriter
1711 more
1712 more
1712 \family default
1713 \family default
1713 simply can not understand colored text correctly.
1714 simply can not understand colored text correctly.
1714 \layout Standard
1715 \layout Standard
1715
1716
1716 In order to configure
1717 In order to configure
1717 \family typewriter
1718 \family typewriter
1718 less
1719 less
1719 \family default
1720 \family default
1720 as your default pager, do the following:
1721 as your default pager, do the following:
1721 \layout Enumerate
1722 \layout Enumerate
1722
1723
1723 Set the environment
1724 Set the environment
1724 \family typewriter
1725 \family typewriter
1725 PAGER
1726 PAGER
1726 \family default
1727 \family default
1727 variable to
1728 variable to
1728 \family typewriter
1729 \family typewriter
1729 less
1730 less
1730 \family default
1731 \family default
1731 .
1732 .
1732 \layout Enumerate
1733 \layout Enumerate
1733
1734
1734 Set the environment
1735 Set the environment
1735 \family typewriter
1736 \family typewriter
1736 LESS
1737 LESS
1737 \family default
1738 \family default
1738 variable to
1739 variable to
1739 \family typewriter
1740 \family typewriter
1740 -r
1741 -r
1741 \family default
1742 \family default
1742 (plus any other options you always want to pass to
1743 (plus any other options you always want to pass to
1743 \family typewriter
1744 \family typewriter
1744 less
1745 less
1745 \family default
1746 \family default
1746 by default).
1747 by default).
1747 This tells
1748 This tells
1748 \family typewriter
1749 \family typewriter
1749 less
1750 less
1750 \family default
1751 \family default
1751 to properly interpret control sequences, which is how color information
1752 to properly interpret control sequences, which is how color information
1752 is given to your terminal.
1753 is given to your terminal.
1753 \layout Standard
1754 \layout Standard
1754
1755
1755 For the
1756 For the
1756 \family typewriter
1757 \family typewriter
1757 csh
1758 csh
1758 \family default
1759 \family default
1759 or
1760 or
1760 \family typewriter
1761 \family typewriter
1761 tcsh
1762 tcsh
1762 \family default
1763 \family default
1763 shells, add to your
1764 shells, add to your
1764 \family typewriter
1765 \family typewriter
1765 ~/.cshrc
1766 ~/.cshrc
1766 \family default
1767 \family default
1767 file the lines:
1768 file the lines:
1768 \layout Standard
1769 \layout Standard
1769
1770
1770
1771
1771 \family typewriter
1772 \family typewriter
1772 setenv PAGER less
1773 setenv PAGER less
1773 \newline
1774 \newline
1774 setenv LESS -r
1775 setenv LESS -r
1775 \layout Standard
1776 \layout Standard
1776
1777
1777 There is similar syntax for other Unix shells, look at your system documentation
1778 There is similar syntax for other Unix shells, look at your system documentation
1778 for details.
1779 for details.
1779 \layout Standard
1780 \layout Standard
1780
1781
1781 If you are on a system which lacks proper data pagers (such as Windows),
1782 If you are on a system which lacks proper data pagers (such as Windows),
1782 IPython will use a very limited builtin pager.
1783 IPython will use a very limited builtin pager.
1783 \layout Subsection
1784 \layout Subsection
1784
1785
1785
1786
1786 \begin_inset LatexCommand \label{sec:emacs}
1787 \begin_inset LatexCommand \label{sec:emacs}
1787
1788
1788 \end_inset
1789 \end_inset
1789
1790
1790 (X)Emacs configuration
1791 (X)Emacs configuration
1791 \layout Standard
1792 \layout Standard
1792
1793
1793 Thanks to the work of Alexander Schmolck and Prabhu Ramachandran, currently
1794 Thanks to the work of Alexander Schmolck and Prabhu Ramachandran, currently
1794 (X)Emacs and IPython get along very well.
1795 (X)Emacs and IPython get along very well.
1795
1796
1796 \layout Standard
1797 \layout Standard
1797
1798
1798
1799
1799 \series bold
1800 \series bold
1800 Important note:
1801 Important note:
1801 \series default
1802 \series default
1802 You will need to use a recent enough version of
1803 You will need to use a recent enough version of
1803 \family typewriter
1804 \family typewriter
1804 python-mode.el
1805 python-mode.el
1805 \family default
1806 \family default
1806 , along with the file
1807 , along with the file
1807 \family typewriter
1808 \family typewriter
1808 ipython.el
1809 ipython.el
1809 \family default
1810 \family default
1810 .
1811 .
1811 You can check that the version you have of
1812 You can check that the version you have of
1812 \family typewriter
1813 \family typewriter
1813 python-mode.el
1814 python-mode.el
1814 \family default
1815 \family default
1815 is new enough by either looking at the revision number in the file itself,
1816 is new enough by either looking at the revision number in the file itself,
1816 or asking for it in (X)Emacs via
1817 or asking for it in (X)Emacs via
1817 \family typewriter
1818 \family typewriter
1818 M-x py-version
1819 M-x py-version
1819 \family default
1820 \family default
1820 .
1821 .
1821 Versions 4.68 and newer contain the necessary fixes for proper IPython support.
1822 Versions 4.68 and newer contain the necessary fixes for proper IPython support.
1822 \layout Standard
1823 \layout Standard
1823
1824
1824 The file
1825 The file
1825 \family typewriter
1826 \family typewriter
1826 ipython.el
1827 ipython.el
1827 \family default
1828 \family default
1828 is included with the IPython distribution, in the documentation directory
1829 is included with the IPython distribution, in the documentation directory
1829 (where this manual resides in PDF and HTML formats).
1830 (where this manual resides in PDF and HTML formats).
1830 \layout Standard
1831 \layout Standard
1831
1832
1832 Once you put these files in your Emacs path, all you need in your
1833 Once you put these files in your Emacs path, all you need in your
1833 \family typewriter
1834 \family typewriter
1834 .emacs
1835 .emacs
1835 \family default
1836 \family default
1836 file is:
1837 file is:
1837 \layout Standard
1838 \layout LyX-Code
1838
1839
1839
1840 \family typewriter
1841 (require 'ipython)
1840 (require 'ipython)
1842 \layout Standard
1841 \layout Standard
1843
1842
1844 This should give you full support for executing code snippets via IPython,
1843 This should give you full support for executing code snippets via IPython,
1845 opening IPython as your Python shell via
1844 opening IPython as your Python shell via
1846 \family typewriter
1845 \family typewriter
1847 C-c\SpecialChar ~
1846 C-c\SpecialChar ~
1848 !
1847 !
1849 \family default
1848 \family default
1850 , etc.
1849 , etc.
1851
1850
1851 \layout Standard
1852
1853 If you happen to get garbage instead of colored prompts as described in
1854 the previous section, you may need to set also in your
1855 \family typewriter
1856 .emacs
1857 \family default
1858 file:
1859 \layout LyX-Code
1860
1861 (setq ansi-color-for-comint-mode t)
1852 \layout Subsubsection*
1862 \layout Subsubsection*
1853
1863
1854 Notes
1864 Notes
1855 \layout Itemize
1865 \layout Itemize
1856
1866
1857 There is one caveat you should be aware of: you must start the IPython shell
1867 There is one caveat you should be aware of: you must start the IPython shell
1858
1868
1859 \emph on
1869 \emph on
1860 before
1870 before
1861 \emph default
1871 \emph default
1862 attempting to execute any code regions via
1872 attempting to execute any code regions via
1863 \family typewriter
1873 \family typewriter
1864 C-c\SpecialChar ~
1874 C-c\SpecialChar ~
1865 |
1875 |
1866 \family default
1876 \family default
1867 .
1877 .
1868 Simply type
1878 Simply type
1869 \family typewriter
1879 \family typewriter
1870 C-c\SpecialChar ~
1880 C-c\SpecialChar ~
1871 !
1881 !
1872 \family default
1882 \family default
1873 to start IPython before passing any code regions to the interpreter, and
1883 to start IPython before passing any code regions to the interpreter, and
1874 you shouldn't experience any problems.
1884 you shouldn't experience any problems.
1875 \newline
1885 \newline
1876 This is due to a bug in Python itself, which has been fixed for Python 2.3,
1886 This is due to a bug in Python itself, which has been fixed for Python 2.3,
1877 but exists as of Python 2.2.2 (reported as SF bug [ 737947 ]).
1887 but exists as of Python 2.2.2 (reported as SF bug [ 737947 ]).
1878 \layout Itemize
1888 \layout Itemize
1879
1889
1880 The (X)Emacs support is maintained by Alexander Schmolck, so all comments/reques
1890 The (X)Emacs support is maintained by Alexander Schmolck, so all comments/reques
1881 ts should be directed to him through the IPython mailing lists.
1891 ts should be directed to him through the IPython mailing lists.
1882
1892
1883 \layout Itemize
1893 \layout Itemize
1884
1894
1885 This code is still somewhat experimental so it's a bit rough around the
1895 This code is still somewhat experimental so it's a bit rough around the
1886 edges (although in practice, it works quite well).
1896 edges (although in practice, it works quite well).
1887 \layout Itemize
1897 \layout Itemize
1888
1898
1889 Be aware that if you customize
1899 Be aware that if you customize
1890 \family typewriter
1900 \family typewriter
1891 py-python-command
1901 py-python-command
1892 \family default
1902 \family default
1893 previously, this value will override what
1903 previously, this value will override what
1894 \family typewriter
1904 \family typewriter
1895 ipython.el
1905 ipython.el
1896 \family default
1906 \family default
1897 does (because loading the customization variables comes later).
1907 does (because loading the customization variables comes later).
1898 \layout Section
1908 \layout Section
1899
1909
1900
1910
1901 \begin_inset LatexCommand \label{sec:quick_tips}
1911 \begin_inset LatexCommand \label{sec:quick_tips}
1902
1912
1903 \end_inset
1913 \end_inset
1904
1914
1905 Quick tips
1915 Quick tips
1906 \layout Standard
1916 \layout Standard
1907
1917
1908 IPython can be used as an improved replacement for the Python prompt, and
1918 IPython can be used as an improved replacement for the Python prompt, and
1909 for that you don't really need to read any more of this manual.
1919 for that you don't really need to read any more of this manual.
1910 But in this section we'll try to summarize a few tips on how to make the
1920 But in this section we'll try to summarize a few tips on how to make the
1911 most effective use of it for everyday Python development, highlighting
1921 most effective use of it for everyday Python development, highlighting
1912 things you might miss in the rest of the manual (which is getting long).
1922 things you might miss in the rest of the manual (which is getting long).
1913 We'll give references to parts in the manual which provide more detail
1923 We'll give references to parts in the manual which provide more detail
1914 when appropriate.
1924 when appropriate.
1915 \layout Standard
1925 \layout Standard
1916
1926
1917 The following article by Jeremy Jones provides an introductory tutorial
1927 The following article by Jeremy Jones provides an introductory tutorial
1918 about IPython:
1928 about IPython:
1919 \newline
1929 \newline
1920
1930
1921 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html}
1931 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html}
1922
1932
1923 \end_inset
1933 \end_inset
1924
1934
1925
1935
1926 \layout Itemize
1936 \layout Itemize
1927
1937
1928 The TAB key.
1938 The TAB key.
1929 TAB-completion, especially for attributes, is a convenient way to explore
1939 TAB-completion, especially for attributes, is a convenient way to explore
1930 the structure of any object you're dealing with.
1940 the structure of any object you're dealing with.
1931 Simply type
1941 Simply type
1932 \family typewriter
1942 \family typewriter
1933 object_name.<TAB>
1943 object_name.<TAB>
1934 \family default
1944 \family default
1935 and a list of the object's attributes will be printed (see sec.
1945 and a list of the object's attributes will be printed (see sec.
1936
1946
1937 \begin_inset LatexCommand \ref{sec:readline}
1947 \begin_inset LatexCommand \ref{sec:readline}
1938
1948
1939 \end_inset
1949 \end_inset
1940
1950
1941 for more).
1951 for more).
1942 Tab completion also works on file and directory names, which combined with
1952 Tab completion also works on file and directory names, which combined with
1943 IPython's alias system allows you to do from within IPython many of the
1953 IPython's alias system allows you to do from within IPython many of the
1944 things you normally would need the system shell for.
1954 things you normally would need the system shell for.
1945
1955
1946 \layout Itemize
1956 \layout Itemize
1947
1957
1948 Explore your objects.
1958 Explore your objects.
1949 Typing
1959 Typing
1950 \family typewriter
1960 \family typewriter
1951 object_name?
1961 object_name?
1952 \family default
1962 \family default
1953 will print all sorts of details about any object, including docstrings,
1963 will print all sorts of details about any object, including docstrings,
1954 function definition lines (for call arguments) and constructor details
1964 function definition lines (for call arguments) and constructor details
1955 for classes.
1965 for classes.
1956 The magic commands
1966 The magic commands
1957 \family typewriter
1967 \family typewriter
1958 %pdoc
1968 %pdoc
1959 \family default
1969 \family default
1960 ,
1970 ,
1961 \family typewriter
1971 \family typewriter
1962 %pdef
1972 %pdef
1963 \family default
1973 \family default
1964 ,
1974 ,
1965 \family typewriter
1975 \family typewriter
1966 %psource
1976 %psource
1967 \family default
1977 \family default
1968 and
1978 and
1969 \family typewriter
1979 \family typewriter
1970 %pfile
1980 %pfile
1971 \family default
1981 \family default
1972 will respectively print the docstring, function definition line, full source
1982 will respectively print the docstring, function definition line, full source
1973 code and the complete file for any object (when they can be found).
1983 code and the complete file for any object (when they can be found).
1974 If automagic is on (it is by default), you don't need to type the '
1984 If automagic is on (it is by default), you don't need to type the '
1975 \family typewriter
1985 \family typewriter
1976 %
1986 %
1977 \family default
1987 \family default
1978 ' explicitly.
1988 ' explicitly.
1979 See sec.
1989 See sec.
1980
1990
1981 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1991 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1982
1992
1983 \end_inset
1993 \end_inset
1984
1994
1985 for more.
1995 for more.
1986 \layout Itemize
1996 \layout Itemize
1987
1997
1988 The
1998 The
1989 \family typewriter
1999 \family typewriter
1990 %run
2000 %run
1991 \family default
2001 \family default
1992 magic command allows you to run any python script and load all of its data
2002 magic command allows you to run any python script and load all of its data
1993 directly into the interactive namespace.
2003 directly into the interactive namespace.
1994 Since the file is re-read from disk each time, changes you make to it are
2004 Since the file is re-read from disk each time, changes you make to it are
1995 reflected immediately (in contrast to the behavior of
2005 reflected immediately (in contrast to the behavior of
1996 \family typewriter
2006 \family typewriter
1997 import
2007 import
1998 \family default
2008 \family default
1999 ).
2009 ).
2000 I rarely use
2010 I rarely use
2001 \family typewriter
2011 \family typewriter
2002 import
2012 import
2003 \family default
2013 \family default
2004 for code I am testing, relying on
2014 for code I am testing, relying on
2005 \family typewriter
2015 \family typewriter
2006 %run
2016 %run
2007 \family default
2017 \family default
2008 instead.
2018 instead.
2009 See sec.
2019 See sec.
2010
2020
2011 \begin_inset LatexCommand \ref{sec:magic}
2021 \begin_inset LatexCommand \ref{sec:magic}
2012
2022
2013 \end_inset
2023 \end_inset
2014
2024
2015 for more on this and other magic commands, or type the name of any magic
2025 for more on this and other magic commands, or type the name of any magic
2016 command and ? to get details on it.
2026 command and ? to get details on it.
2017 See also sec.
2027 See also sec.
2018
2028
2019 \begin_inset LatexCommand \ref{sec:dreload}
2029 \begin_inset LatexCommand \ref{sec:dreload}
2020
2030
2021 \end_inset
2031 \end_inset
2022
2032
2023 for a recursive reload command.
2033 for a recursive reload command.
2024 \newline
2034 \newline
2025
2035
2026 \family typewriter
2036 \family typewriter
2027 %run
2037 %run
2028 \family default
2038 \family default
2029 also has special flags for timing the execution of your scripts (
2039 also has special flags for timing the execution of your scripts (
2030 \family typewriter
2040 \family typewriter
2031 -t
2041 -t
2032 \family default
2042 \family default
2033 ) and for executing them under the control of either Python's
2043 ) and for executing them under the control of either Python's
2034 \family typewriter
2044 \family typewriter
2035 pdb
2045 pdb
2036 \family default
2046 \family default
2037 debugger (
2047 debugger (
2038 \family typewriter
2048 \family typewriter
2039 -d
2049 -d
2040 \family default
2050 \family default
2041 ) or profiler (
2051 ) or profiler (
2042 \family typewriter
2052 \family typewriter
2043 -p
2053 -p
2044 \family default
2054 \family default
2045 ).
2055 ).
2046 With all of these,
2056 With all of these,
2047 \family typewriter
2057 \family typewriter
2048 %run
2058 %run
2049 \family default
2059 \family default
2050 can be used as the main tool for efficient interactive development of code
2060 can be used as the main tool for efficient interactive development of code
2051 which you write in your editor of choice.
2061 which you write in your editor of choice.
2052 \layout Itemize
2062 \layout Itemize
2053
2063
2054 Use the Python debugger,
2064 Use the Python debugger,
2055 \family typewriter
2065 \family typewriter
2056 pdb
2066 pdb
2057 \family default
2067 \family default
2058
2068
2059 \begin_inset Foot
2069 \begin_inset Foot
2060 collapsed true
2070 collapsed true
2061
2071
2062 \layout Standard
2072 \layout Standard
2063
2073
2064 Thanks to Christian Hart and Matthew Arnison for the suggestions leading
2074 Thanks to Christian Hart and Matthew Arnison for the suggestions leading
2065 to IPython's improved debugger and profiler support.
2075 to IPython's improved debugger and profiler support.
2066 \end_inset
2076 \end_inset
2067
2077
2068 .
2078 .
2069 The
2079 The
2070 \family typewriter
2080 \family typewriter
2071 %pdb
2081 %pdb
2072 \family default
2082 \family default
2073 command allows you to toggle on and off the automatic invocation of an
2083 command allows you to toggle on and off the automatic invocation of an
2074 IPython-enhanced
2084 IPython-enhanced
2075 \family typewriter
2085 \family typewriter
2076 pdb
2086 pdb
2077 \family default
2087 \family default
2078 debugger (with coloring, tab completion and more) at any uncaught exception.
2088 debugger (with coloring, tab completion and more) at any uncaught exception.
2079 The advantage of this is that
2089 The advantage of this is that
2080 \family typewriter
2090 \family typewriter
2081 pdb
2091 pdb
2082 \family default
2092 \family default
2083 starts
2093 starts
2084 \emph on
2094 \emph on
2085 inside
2095 inside
2086 \emph default
2096 \emph default
2087 the function where the exception occurred, with all data still available.
2097 the function where the exception occurred, with all data still available.
2088 You can print variables, see code, execute statements and even walk up
2098 You can print variables, see code, execute statements and even walk up
2089 and down the call stack to track down the true source of the problem (which
2099 and down the call stack to track down the true source of the problem (which
2090 often is many layers in the stack above where the exception gets triggered).
2100 often is many layers in the stack above where the exception gets triggered).
2091 \newline
2101 \newline
2092 Running programs with
2102 Running programs with
2093 \family typewriter
2103 \family typewriter
2094 %run
2104 %run
2095 \family default
2105 \family default
2096 and pdb active can be an efficient to develop and debug code, in many cases
2106 and pdb active can be an efficient to develop and debug code, in many cases
2097 eliminating the need for
2107 eliminating the need for
2098 \family typewriter
2108 \family typewriter
2099 print
2109 print
2100 \family default
2110 \family default
2101 statements or external debugging tools.
2111 statements or external debugging tools.
2102 I often simply put a
2112 I often simply put a
2103 \family typewriter
2113 \family typewriter
2104 1/0
2114 1/0
2105 \family default
2115 \family default
2106 in a place where I want to take a look so that pdb gets called, quickly
2116 in a place where I want to take a look so that pdb gets called, quickly
2107 view whatever variables I need to or test various pieces of code and then
2117 view whatever variables I need to or test various pieces of code and then
2108 remove the
2118 remove the
2109 \family typewriter
2119 \family typewriter
2110 1/0
2120 1/0
2111 \family default
2121 \family default
2112 .
2122 .
2113 \newline
2123 \newline
2114 Note also that `
2124 Note also that `
2115 \family typewriter
2125 \family typewriter
2116 %run -d
2126 %run -d
2117 \family default
2127 \family default
2118 ' activates
2128 ' activates
2119 \family typewriter
2129 \family typewriter
2120 pdb
2130 pdb
2121 \family default
2131 \family default
2122 and automatically sets initial breakpoints for you to step through your
2132 and automatically sets initial breakpoints for you to step through your
2123 code, watch variables, etc.
2133 code, watch variables, etc.
2124 See Sec.\SpecialChar ~
2134 See Sec.\SpecialChar ~
2125
2135
2126 \begin_inset LatexCommand \ref{sec:cache_output}
2136 \begin_inset LatexCommand \ref{sec:cache_output}
2127
2137
2128 \end_inset
2138 \end_inset
2129
2139
2130 for details.
2140 for details.
2131 \layout Itemize
2141 \layout Itemize
2132
2142
2133 Use the output cache.
2143 Use the output cache.
2134 All output results are automatically stored in a global dictionary named
2144 All output results are automatically stored in a global dictionary named
2135
2145
2136 \family typewriter
2146 \family typewriter
2137 Out
2147 Out
2138 \family default
2148 \family default
2139 and variables named
2149 and variables named
2140 \family typewriter
2150 \family typewriter
2141 _1
2151 _1
2142 \family default
2152 \family default
2143 ,
2153 ,
2144 \family typewriter
2154 \family typewriter
2145 _2
2155 _2
2146 \family default
2156 \family default
2147 , etc.
2157 , etc.
2148 alias them.
2158 alias them.
2149 For example, the result of input line 4 is available either as
2159 For example, the result of input line 4 is available either as
2150 \family typewriter
2160 \family typewriter
2151 Out[4]
2161 Out[4]
2152 \family default
2162 \family default
2153 or as
2163 or as
2154 \family typewriter
2164 \family typewriter
2155 _4
2165 _4
2156 \family default
2166 \family default
2157 .
2167 .
2158 Additionally, three variables named
2168 Additionally, three variables named
2159 \family typewriter
2169 \family typewriter
2160 _
2170 _
2161 \family default
2171 \family default
2162 ,
2172 ,
2163 \family typewriter
2173 \family typewriter
2164 __
2174 __
2165 \family default
2175 \family default
2166 and
2176 and
2167 \family typewriter
2177 \family typewriter
2168 ___
2178 ___
2169 \family default
2179 \family default
2170 are always kept updated with the for the last three results.
2180 are always kept updated with the for the last three results.
2171 This allows you to recall any previous result and further use it for new
2181 This allows you to recall any previous result and further use it for new
2172 calculations.
2182 calculations.
2173 See Sec.\SpecialChar ~
2183 See Sec.\SpecialChar ~
2174
2184
2175 \begin_inset LatexCommand \ref{sec:cache_output}
2185 \begin_inset LatexCommand \ref{sec:cache_output}
2176
2186
2177 \end_inset
2187 \end_inset
2178
2188
2179 for more.
2189 for more.
2180 \layout Itemize
2190 \layout Itemize
2181
2191
2182 Put a '
2192 Put a '
2183 \family typewriter
2193 \family typewriter
2184 ;
2194 ;
2185 \family default
2195 \family default
2186 ' at the end of a line to supress the printing of output.
2196 ' at the end of a line to supress the printing of output.
2187 This is useful when doing calculations which generate long output you are
2197 This is useful when doing calculations which generate long output you are
2188 not interested in seeing.
2198 not interested in seeing.
2189 The
2199 The
2190 \family typewriter
2200 \family typewriter
2191 _*
2201 _*
2192 \family default
2202 \family default
2193 variables and the
2203 variables and the
2194 \family typewriter
2204 \family typewriter
2195 Out[]
2205 Out[]
2196 \family default
2206 \family default
2197 list do get updated with the contents of the output, even if it is not
2207 list do get updated with the contents of the output, even if it is not
2198 printed.
2208 printed.
2199 You can thus still access the generated results this way for further processing.
2209 You can thus still access the generated results this way for further processing.
2200 \layout Itemize
2210 \layout Itemize
2201
2211
2202 A similar system exists for caching input.
2212 A similar system exists for caching input.
2203 All input is stored in a global list called
2213 All input is stored in a global list called
2204 \family typewriter
2214 \family typewriter
2205 In
2215 In
2206 \family default
2216 \family default
2207 , so you can re-execute lines 22 through 28 plus line 34 by typing
2217 , so you can re-execute lines 22 through 28 plus line 34 by typing
2208 \family typewriter
2218 \family typewriter
2209 'exec In[22:29]+In[34]'
2219 'exec In[22:29]+In[34]'
2210 \family default
2220 \family default
2211 (using Python slicing notation).
2221 (using Python slicing notation).
2212 If you need to execute the same set of lines often, you can assign them
2222 If you need to execute the same set of lines often, you can assign them
2213 to a macro with the
2223 to a macro with the
2214 \family typewriter
2224 \family typewriter
2215 %macro
2225 %macro
2216 \family default
2226 \family default
2217
2227
2218 \family typewriter
2228 \family typewriter
2219 function.
2229 function.
2220
2230
2221 \family default
2231 \family default
2222 See sec.
2232 See sec.
2223
2233
2224 \begin_inset LatexCommand \ref{sec:cache_input}
2234 \begin_inset LatexCommand \ref{sec:cache_input}
2225
2235
2226 \end_inset
2236 \end_inset
2227
2237
2228 for more.
2238 for more.
2229 \layout Itemize
2239 \layout Itemize
2230
2240
2231 Use your input history.
2241 Use your input history.
2232 The
2242 The
2233 \family typewriter
2243 \family typewriter
2234 %hist
2244 %hist
2235 \family default
2245 \family default
2236 command can show you all previous input, without line numbers if desired
2246 command can show you all previous input, without line numbers if desired
2237 (option
2247 (option
2238 \family typewriter
2248 \family typewriter
2239 -n
2249 -n
2240 \family default
2250 \family default
2241 ) so you can directly copy and paste code either back in IPython or in a
2251 ) so you can directly copy and paste code either back in IPython or in a
2242 text editor.
2252 text editor.
2243 You can also save all your history by turning on logging via
2253 You can also save all your history by turning on logging via
2244 \family typewriter
2254 \family typewriter
2245 %logstart
2255 %logstart
2246 \family default
2256 \family default
2247 ; these logs can later be either reloaded as IPython sessions or used as
2257 ; these logs can later be either reloaded as IPython sessions or used as
2248 code for your programs.
2258 code for your programs.
2249 \layout Itemize
2259 \layout Itemize
2250
2260
2251 Define your own system aliases.
2261 Define your own system aliases.
2252 Even though IPython gives you access to your system shell via the
2262 Even though IPython gives you access to your system shell via the
2253 \family typewriter
2263 \family typewriter
2254 !
2264 !
2255 \family default
2265 \family default
2256 prefix, it is convenient to have aliases to the system commands you use
2266 prefix, it is convenient to have aliases to the system commands you use
2257 most often.
2267 most often.
2258 This allows you to work seamlessly from inside IPython with the same commands
2268 This allows you to work seamlessly from inside IPython with the same commands
2259 you are used to in your system shell.
2269 you are used to in your system shell.
2260 \newline
2270 \newline
2261 IPython comes with some pre-defined aliases and a complete system for changing
2271 IPython comes with some pre-defined aliases and a complete system for changing
2262 directories, both via a stack (see
2272 directories, both via a stack (see
2263 \family typewriter
2273 \family typewriter
2264 %pushd
2274 %pushd
2265 \family default
2275 \family default
2266 ,
2276 ,
2267 \family typewriter
2277 \family typewriter
2268 %popd
2278 %popd
2269 \family default
2279 \family default
2270 and
2280 and
2271 \family typewriter
2281 \family typewriter
2272 %ds
2282 %ds
2273 \family default
2283 \family default
2274 ) and via direct
2284 ) and via direct
2275 \family typewriter
2285 \family typewriter
2276 %cd
2286 %cd
2277 \family default
2287 \family default
2278 .
2288 .
2279 The latter keeps a history of visited directories and allows you to go
2289 The latter keeps a history of visited directories and allows you to go
2280 to any previously visited one.
2290 to any previously visited one.
2281 \layout Itemize
2291 \layout Itemize
2282
2292
2283 Use Python to manipulate the results of system commands.
2293 Use Python to manipulate the results of system commands.
2284 The `
2294 The `
2285 \family typewriter
2295 \family typewriter
2286 !!
2296 !!
2287 \family default
2297 \family default
2288 ' special syntax, and the
2298 ' special syntax, and the
2289 \family typewriter
2299 \family typewriter
2290 %sc
2300 %sc
2291 \family default
2301 \family default
2292 and
2302 and
2293 \family typewriter
2303 \family typewriter
2294 %sx
2304 %sx
2295 \family default
2305 \family default
2296 magic commands allow you to capture system output into Python variables.
2306 magic commands allow you to capture system output into Python variables.
2297 \layout Itemize
2307 \layout Itemize
2298
2308
2299 Expand python variables when calling the shell (either via
2309 Expand python variables when calling the shell (either via
2300 \family typewriter
2310 \family typewriter
2301 `!'
2311 `!'
2302 \family default
2312 \family default
2303 and
2313 and
2304 \family typewriter
2314 \family typewriter
2305 `!!'
2315 `!!'
2306 \family default
2316 \family default
2307 or via aliases) by prepending a
2317 or via aliases) by prepending a
2308 \family typewriter
2318 \family typewriter
2309 $
2319 $
2310 \family default
2320 \family default
2311 in front of them.
2321 in front of them.
2312 You can also expand complete python expressions.
2322 You can also expand complete python expressions.
2313 See sec.\SpecialChar ~
2323 See sec.\SpecialChar ~
2314
2324
2315 \begin_inset LatexCommand \ref{sub:System-shell-access}
2325 \begin_inset LatexCommand \ref{sub:System-shell-access}
2316
2326
2317 \end_inset
2327 \end_inset
2318
2328
2319 for more.
2329 for more.
2320 \layout Itemize
2330 \layout Itemize
2321
2331
2322 Use profiles to maintain different configurations (modules to load, function
2332 Use profiles to maintain different configurations (modules to load, function
2323 definitions, option settings) for particular tasks.
2333 definitions, option settings) for particular tasks.
2324 You can then have customized versions of IPython for specific purposes.
2334 You can then have customized versions of IPython for specific purposes.
2325 See sec.\SpecialChar ~
2335 See sec.\SpecialChar ~
2326
2336
2327 \begin_inset LatexCommand \ref{sec:profiles}
2337 \begin_inset LatexCommand \ref{sec:profiles}
2328
2338
2329 \end_inset
2339 \end_inset
2330
2340
2331 for more.
2341 for more.
2332 \layout Itemize
2342 \layout Itemize
2333
2343
2334 Embed IPython in your programs.
2344 Embed IPython in your programs.
2335 A few lines of code are enough to load a complete IPython inside your own
2345 A few lines of code are enough to load a complete IPython inside your own
2336 programs, giving you the ability to work with your data interactively after
2346 programs, giving you the ability to work with your data interactively after
2337 automatic processing has been completed.
2347 automatic processing has been completed.
2338 See sec.\SpecialChar ~
2348 See sec.\SpecialChar ~
2339
2349
2340 \begin_inset LatexCommand \ref{sec:embed}
2350 \begin_inset LatexCommand \ref{sec:embed}
2341
2351
2342 \end_inset
2352 \end_inset
2343
2353
2344 for more.
2354 for more.
2345 \layout Itemize
2355 \layout Itemize
2346
2356
2347 Use the Python profiler.
2357 Use the Python profiler.
2348 When dealing with performance issues, the
2358 When dealing with performance issues, the
2349 \family typewriter
2359 \family typewriter
2350 %run
2360 %run
2351 \family default
2361 \family default
2352 command with a
2362 command with a
2353 \family typewriter
2363 \family typewriter
2354 -p
2364 -p
2355 \family default
2365 \family default
2356 option allows you to run complete programs under the control of the Python
2366 option allows you to run complete programs under the control of the Python
2357 profiler.
2367 profiler.
2358 The
2368 The
2359 \family typewriter
2369 \family typewriter
2360 %prun
2370 %prun
2361 \family default
2371 \family default
2362 command does a similar job for single Python expressions (like function
2372 command does a similar job for single Python expressions (like function
2363 calls).
2373 calls).
2364 \layout Itemize
2374 \layout Itemize
2365
2375
2366 Use the IPython.demo.Demo class to load any Python script as an interactive
2376 Use the IPython.demo.Demo class to load any Python script as an interactive
2367 demo.
2377 demo.
2368 With a minimal amount of simple markup, you can control the execution of
2378 With a minimal amount of simple markup, you can control the execution of
2369 the script, stopping as needed.
2379 the script, stopping as needed.
2370 See sec.\SpecialChar ~
2380 See sec.\SpecialChar ~
2371
2381
2372 \begin_inset LatexCommand \ref{sec:interactive-demos}
2382 \begin_inset LatexCommand \ref{sec:interactive-demos}
2373
2383
2374 \end_inset
2384 \end_inset
2375
2385
2376 for more.
2386 for more.
2377 \layout Subsection
2387 \layout Subsection
2378
2388
2379 Source code handling tips
2389 Source code handling tips
2380 \layout Standard
2390 \layout Standard
2381
2391
2382 IPython is a line-oriented program, without full control of the terminal.
2392 IPython is a line-oriented program, without full control of the terminal.
2383 Therefore, it doesn't support true multiline editing.
2393 Therefore, it doesn't support true multiline editing.
2384 However, it has a number of useful tools to help you in dealing effectively
2394 However, it has a number of useful tools to help you in dealing effectively
2385 with more complex editing.
2395 with more complex editing.
2386 \layout Standard
2396 \layout Standard
2387
2397
2388 The
2398 The
2389 \family typewriter
2399 \family typewriter
2390 %edit
2400 %edit
2391 \family default
2401 \family default
2392 command gives a reasonable approximation of multiline editing, by invoking
2402 command gives a reasonable approximation of multiline editing, by invoking
2393 your favorite editor on the spot.
2403 your favorite editor on the spot.
2394 IPython will execute the code you type in there as if it were typed interactive
2404 IPython will execute the code you type in there as if it were typed interactive
2395 ly.
2405 ly.
2396 Type
2406 Type
2397 \family typewriter
2407 \family typewriter
2398 %edit?
2408 %edit?
2399 \family default
2409 \family default
2400 for the full details on the edit command.
2410 for the full details on the edit command.
2401 \layout Standard
2411 \layout Standard
2402
2412
2403 If you have typed various commands during a session, which you'd like to
2413 If you have typed various commands during a session, which you'd like to
2404 reuse, IPython provides you with a number of tools.
2414 reuse, IPython provides you with a number of tools.
2405 Start by using
2415 Start by using
2406 \family typewriter
2416 \family typewriter
2407 %hist
2417 %hist
2408 \family default
2418 \family default
2409 to see your input history, so you can see the line numbers of all input.
2419 to see your input history, so you can see the line numbers of all input.
2410 Let us say that you'd like to reuse lines 10 through 20, plus lines 24
2420 Let us say that you'd like to reuse lines 10 through 20, plus lines 24
2411 and 28.
2421 and 28.
2412 All the commands below can operate on these with the syntax
2422 All the commands below can operate on these with the syntax
2413 \layout LyX-Code
2423 \layout LyX-Code
2414
2424
2415 %command 10-20 24 28
2425 %command 10-20 24 28
2416 \layout Standard
2426 \layout Standard
2417
2427
2418 where the command given can be:
2428 where the command given can be:
2419 \layout Itemize
2429 \layout Itemize
2420
2430
2421
2431
2422 \family typewriter
2432 \family typewriter
2423 %macro <macroname>
2433 %macro <macroname>
2424 \family default
2434 \family default
2425 : this stores the lines into a variable which, when called at the prompt,
2435 : this stores the lines into a variable which, when called at the prompt,
2426 re-executes the input.
2436 re-executes the input.
2427 Macros can be edited later using
2437 Macros can be edited later using
2428 \family typewriter
2438 \family typewriter
2429 `%edit macroname
2439 `%edit macroname
2430 \family default
2440 \family default
2431 ', and they can be stored persistently across sessions with `
2441 ', and they can be stored persistently across sessions with `
2432 \family typewriter
2442 \family typewriter
2433 %store macroname
2443 %store macroname
2434 \family default
2444 \family default
2435 ' (the storage system is per-profile).
2445 ' (the storage system is per-profile).
2436 The combination of quick macros, persistent storage and editing, allows
2446 The combination of quick macros, persistent storage and editing, allows
2437 you to easily refine quick-and-dirty interactive input into permanent utilities
2447 you to easily refine quick-and-dirty interactive input into permanent utilities
2438 , always available both in IPython and as files for general reuse.
2448 , always available both in IPython and as files for general reuse.
2439 \layout Itemize
2449 \layout Itemize
2440
2450
2441
2451
2442 \family typewriter
2452 \family typewriter
2443 %edit
2453 %edit
2444 \family default
2454 \family default
2445 : this will open a text editor with those lines pre-loaded for further modificat
2455 : this will open a text editor with those lines pre-loaded for further modificat
2446 ion.
2456 ion.
2447 It will then execute the resulting file's contents as if you had typed
2457 It will then execute the resulting file's contents as if you had typed
2448 it at the prompt.
2458 it at the prompt.
2449 \layout Itemize
2459 \layout Itemize
2450
2460
2451
2461
2452 \family typewriter
2462 \family typewriter
2453 %save <filename>
2463 %save <filename>
2454 \family default
2464 \family default
2455 : this saves the lines directly to a named file on disk.
2465 : this saves the lines directly to a named file on disk.
2456 \layout Standard
2466 \layout Standard
2457
2467
2458 While
2468 While
2459 \family typewriter
2469 \family typewriter
2460 %macro
2470 %macro
2461 \family default
2471 \family default
2462 saves input lines into memory for interactive re-execution, sometimes you'd
2472 saves input lines into memory for interactive re-execution, sometimes you'd
2463 like to save your input directly to a file.
2473 like to save your input directly to a file.
2464 The
2474 The
2465 \family typewriter
2475 \family typewriter
2466 %save
2476 %save
2467 \family default
2477 \family default
2468 magic does this: its input sytnax is the same as
2478 magic does this: its input sytnax is the same as
2469 \family typewriter
2479 \family typewriter
2470 %macro
2480 %macro
2471 \family default
2481 \family default
2472 , but it saves your input directly to a Python file.
2482 , but it saves your input directly to a Python file.
2473 Note that the
2483 Note that the
2474 \family typewriter
2484 \family typewriter
2475 %logstart
2485 %logstart
2476 \family default
2486 \family default
2477 command also saves input, but it logs
2487 command also saves input, but it logs
2478 \emph on
2488 \emph on
2479 all
2489 all
2480 \emph default
2490 \emph default
2481 input to disk (though you can temporarily suspend it and reactivate it
2491 input to disk (though you can temporarily suspend it and reactivate it
2482 with
2492 with
2483 \family typewriter
2493 \family typewriter
2484 %logoff/%logon
2494 %logoff/%logon
2485 \family default
2495 \family default
2486 );
2496 );
2487 \family typewriter
2497 \family typewriter
2488 %save
2498 %save
2489 \family default
2499 \family default
2490 allows you to select which lines of input you need to save.
2500 allows you to select which lines of input you need to save.
2491 \layout Subsubsection*
2501 \layout Subsubsection*
2492
2502
2493 Lightweight 'version control'
2503 Lightweight 'version control'
2494 \layout Standard
2504 \layout Standard
2495
2505
2496 When you call
2506 When you call
2497 \family typewriter
2507 \family typewriter
2498 %edit
2508 %edit
2499 \family default
2509 \family default
2500 with no arguments, IPython opens an empty editor with a temporary file,
2510 with no arguments, IPython opens an empty editor with a temporary file,
2501 and it returns the contents of your editing session as a string variable.
2511 and it returns the contents of your editing session as a string variable.
2502 Thanks to IPython's output caching mechanism, this is automatically stored:
2512 Thanks to IPython's output caching mechanism, this is automatically stored:
2503 \layout LyX-Code
2513 \layout LyX-Code
2504
2514
2505 In [1]: %edit
2515 In [1]: %edit
2506 \layout LyX-Code
2516 \layout LyX-Code
2507
2517
2508 IPython will make a temporary file named: /tmp/ipython_edit_yR-HCN.py
2518 IPython will make a temporary file named: /tmp/ipython_edit_yR-HCN.py
2509 \layout LyX-Code
2519 \layout LyX-Code
2510
2520
2511 Editing...
2521 Editing...
2512 done.
2522 done.
2513 Executing edited code...
2523 Executing edited code...
2514 \layout LyX-Code
2524 \layout LyX-Code
2515
2525
2516 hello - this is a temporary file
2526 hello - this is a temporary file
2517 \layout LyX-Code
2527 \layout LyX-Code
2518
2528
2519 Out[1]: "print 'hello - this is a temporary file'
2529 Out[1]: "print 'hello - this is a temporary file'
2520 \backslash
2530 \backslash
2521 n"
2531 n"
2522 \layout Standard
2532 \layout Standard
2523
2533
2524 Now, if you call
2534 Now, if you call
2525 \family typewriter
2535 \family typewriter
2526 `%edit -p'
2536 `%edit -p'
2527 \family default
2537 \family default
2528 , IPython tries to open an editor with the same data as the last time you
2538 , IPython tries to open an editor with the same data as the last time you
2529 used
2539 used
2530 \family typewriter
2540 \family typewriter
2531 %edit
2541 %edit
2532 \family default
2542 \family default
2533 .
2543 .
2534 So if you haven't used
2544 So if you haven't used
2535 \family typewriter
2545 \family typewriter
2536 %edit
2546 %edit
2537 \family default
2547 \family default
2538 in the meantime, this same contents will reopen; however, it will be done
2548 in the meantime, this same contents will reopen; however, it will be done
2539 in a
2549 in a
2540 \emph on
2550 \emph on
2541 new file
2551 new file
2542 \emph default
2552 \emph default
2543 .
2553 .
2544 This means that if you make changes and you later want to find an old version,
2554 This means that if you make changes and you later want to find an old version,
2545 you can always retrieve it by using its output number, via
2555 you can always retrieve it by using its output number, via
2546 \family typewriter
2556 \family typewriter
2547 `%edit _NN'
2557 `%edit _NN'
2548 \family default
2558 \family default
2549 , where
2559 , where
2550 \family typewriter
2560 \family typewriter
2551 NN
2561 NN
2552 \family default
2562 \family default
2553 is the number of the output prompt.
2563 is the number of the output prompt.
2554 \layout Standard
2564 \layout Standard
2555
2565
2556 Continuing with the example above, this should illustrate this idea:
2566 Continuing with the example above, this should illustrate this idea:
2557 \layout LyX-Code
2567 \layout LyX-Code
2558
2568
2559 In [2]: edit -p
2569 In [2]: edit -p
2560 \layout LyX-Code
2570 \layout LyX-Code
2561
2571
2562 IPython will make a temporary file named: /tmp/ipython_edit_nA09Qk.py
2572 IPython will make a temporary file named: /tmp/ipython_edit_nA09Qk.py
2563 \layout LyX-Code
2573 \layout LyX-Code
2564
2574
2565 Editing...
2575 Editing...
2566 done.
2576 done.
2567 Executing edited code...
2577 Executing edited code...
2568 \layout LyX-Code
2578 \layout LyX-Code
2569
2579
2570 hello - now I made some changes
2580 hello - now I made some changes
2571 \layout LyX-Code
2581 \layout LyX-Code
2572
2582
2573 Out[2]: "print 'hello - now I made some changes'
2583 Out[2]: "print 'hello - now I made some changes'
2574 \backslash
2584 \backslash
2575 n"
2585 n"
2576 \layout LyX-Code
2586 \layout LyX-Code
2577
2587
2578 In [3]: edit _1
2588 In [3]: edit _1
2579 \layout LyX-Code
2589 \layout LyX-Code
2580
2590
2581 IPython will make a temporary file named: /tmp/ipython_edit_gy6-zD.py
2591 IPython will make a temporary file named: /tmp/ipython_edit_gy6-zD.py
2582 \layout LyX-Code
2592 \layout LyX-Code
2583
2593
2584 Editing...
2594 Editing...
2585 done.
2595 done.
2586 Executing edited code...
2596 Executing edited code...
2587 \layout LyX-Code
2597 \layout LyX-Code
2588
2598
2589 hello - this is a temporary file
2599 hello - this is a temporary file
2590 \layout LyX-Code
2600 \layout LyX-Code
2591
2601
2592 IPython version control at work :)
2602 IPython version control at work :)
2593 \layout LyX-Code
2603 \layout LyX-Code
2594
2604
2595 Out[3]: "print 'hello - this is a temporary file'
2605 Out[3]: "print 'hello - this is a temporary file'
2596 \backslash
2606 \backslash
2597 nprint 'IPython version control at work :)'
2607 nprint 'IPython version control at work :)'
2598 \backslash
2608 \backslash
2599 n"
2609 n"
2600 \layout Standard
2610 \layout Standard
2601
2611
2602 This section was written after a contribution by Alexander Belchenko on
2612 This section was written after a contribution by Alexander Belchenko on
2603 the IPython user list.
2613 the IPython user list.
2604 \layout LyX-Code
2614 \layout LyX-Code
2605
2615
2606 \layout Subsection
2616 \layout Subsection
2607
2617
2608 Effective logging
2618 Effective logging
2609 \layout Standard
2619 \layout Standard
2610
2620
2611 A very useful suggestion sent in by Robert Kern follows:
2621 A very useful suggestion sent in by Robert Kern follows:
2612 \layout Standard
2622 \layout Standard
2613
2623
2614 I recently happened on a nifty way to keep tidy per-project log files.
2624 I recently happened on a nifty way to keep tidy per-project log files.
2615 I made a profile for my project (which is called "parkfield").
2625 I made a profile for my project (which is called "parkfield").
2616 \layout LyX-Code
2626 \layout LyX-Code
2617
2627
2618 include ipythonrc
2628 include ipythonrc
2619 \layout LyX-Code
2629 \layout LyX-Code
2620
2630
2621 # cancel earlier logfile invocation:
2631 # cancel earlier logfile invocation:
2622 \layout LyX-Code
2632 \layout LyX-Code
2623
2633
2624 logfile ''
2634 logfile ''
2625 \layout LyX-Code
2635 \layout LyX-Code
2626
2636
2627 execute import time
2637 execute import time
2628 \layout LyX-Code
2638 \layout LyX-Code
2629
2639
2630 execute __cmd = '/Users/kern/research/logfiles/parkfield-%s.log rotate'
2640 execute __cmd = '/Users/kern/research/logfiles/parkfield-%s.log rotate'
2631 \layout LyX-Code
2641 \layout LyX-Code
2632
2642
2633 execute __IP.magic_logstart(__cmd % time.strftime('%Y-%m-%d'))
2643 execute __IP.magic_logstart(__cmd % time.strftime('%Y-%m-%d'))
2634 \layout Standard
2644 \layout Standard
2635
2645
2636 I also added a shell alias for convenience:
2646 I also added a shell alias for convenience:
2637 \layout LyX-Code
2647 \layout LyX-Code
2638
2648
2639 alias parkfield="ipython -pylab -profile parkfield"
2649 alias parkfield="ipython -pylab -profile parkfield"
2640 \layout Standard
2650 \layout Standard
2641
2651
2642 Now I have a nice little directory with everything I ever type in, organized
2652 Now I have a nice little directory with everything I ever type in, organized
2643 by project and date.
2653 by project and date.
2644 \layout Standard
2654 \layout Standard
2645
2655
2646
2656
2647 \series bold
2657 \series bold
2648 Contribute your own:
2658 Contribute your own:
2649 \series default
2659 \series default
2650 If you have your own favorite tip on using IPython efficiently for a certain
2660 If you have your own favorite tip on using IPython efficiently for a certain
2651 task (especially things which can't be done in the normal Python interpreter),
2661 task (especially things which can't be done in the normal Python interpreter),
2652 don't hesitate to send it!
2662 don't hesitate to send it!
2653 \layout Section
2663 \layout Section
2654
2664
2655 Command-line use
2665 Command-line use
2656 \layout Standard
2666 \layout Standard
2657
2667
2658 You start IPython with the command:
2668 You start IPython with the command:
2659 \layout Standard
2669 \layout Standard
2660
2670
2661
2671
2662 \family typewriter
2672 \family typewriter
2663 $ ipython [options] files
2673 $ ipython [options] files
2664 \layout Standard
2674 \layout Standard
2665
2675
2666 If invoked with no options, it executes all the files listed in sequence
2676 If invoked with no options, it executes all the files listed in sequence
2667 and drops you into the interpreter while still acknowledging any options
2677 and drops you into the interpreter while still acknowledging any options
2668 you may have set in your ipythonrc file.
2678 you may have set in your ipythonrc file.
2669 This behavior is different from standard Python, which when called as
2679 This behavior is different from standard Python, which when called as
2670 \family typewriter
2680 \family typewriter
2671 python -i
2681 python -i
2672 \family default
2682 \family default
2673 will only execute one file and ignore your configuration setup.
2683 will only execute one file and ignore your configuration setup.
2674 \layout Standard
2684 \layout Standard
2675
2685
2676 Please note that some of the configuration options are not available at
2686 Please note that some of the configuration options are not available at
2677 the command line, simply because they are not practical here.
2687 the command line, simply because they are not practical here.
2678 Look into your ipythonrc configuration file for details on those.
2688 Look into your ipythonrc configuration file for details on those.
2679 This file typically installed in the
2689 This file typically installed in the
2680 \family typewriter
2690 \family typewriter
2681 $HOME/.ipython
2691 $HOME/.ipython
2682 \family default
2692 \family default
2683 directory.
2693 directory.
2684 For Windows users,
2694 For Windows users,
2685 \family typewriter
2695 \family typewriter
2686 $HOME
2696 $HOME
2687 \family default
2697 \family default
2688 resolves to
2698 resolves to
2689 \family typewriter
2699 \family typewriter
2690 C:
2700 C:
2691 \backslash
2701 \backslash
2692
2702
2693 \backslash
2703 \backslash
2694 Documents and Settings
2704 Documents and Settings
2695 \backslash
2705 \backslash
2696
2706
2697 \backslash
2707 \backslash
2698 YourUserName
2708 YourUserName
2699 \family default
2709 \family default
2700 in most instances.
2710 in most instances.
2701 In the rest of this text, we will refer to this directory as
2711 In the rest of this text, we will refer to this directory as
2702 \family typewriter
2712 \family typewriter
2703 IPYTHONDIR
2713 IPYTHONDIR
2704 \family default
2714 \family default
2705 .
2715 .
2706 \layout Subsection
2716 \layout Subsection
2707
2717
2708
2718
2709 \begin_inset LatexCommand \label{sec:threading-opts}
2719 \begin_inset LatexCommand \label{sec:threading-opts}
2710
2720
2711 \end_inset
2721 \end_inset
2712
2722
2713 Special Threading Options
2723 Special Threading Options
2714 \layout Standard
2724 \layout Standard
2715
2725
2716 The following special options are ONLY valid at the beginning of the command
2726 The following special options are ONLY valid at the beginning of the command
2717 line, and not later.
2727 line, and not later.
2718 This is because they control the initial- ization of ipython itself, before
2728 This is because they control the initial- ization of ipython itself, before
2719 the normal option-handling mechanism is active.
2729 the normal option-handling mechanism is active.
2720 \layout List
2730 \layout List
2721 \labelwidthstring 00.00.0000
2731 \labelwidthstring 00.00.0000
2722
2732
2723
2733
2724 \family typewriter
2734 \family typewriter
2725 \series bold
2735 \series bold
2726 -gthread,\SpecialChar ~
2736 -gthread,\SpecialChar ~
2727 -qthread,\SpecialChar ~
2737 -qthread,\SpecialChar ~
2728 -wthread,\SpecialChar ~
2738 -wthread,\SpecialChar ~
2729 -pylab:
2739 -pylab:
2730 \family default
2740 \family default
2731 \series default
2741 \series default
2732 Only
2742 Only
2733 \emph on
2743 \emph on
2734 one
2744 one
2735 \emph default
2745 \emph default
2736 of these can be given, and it can only be given as the first option passed
2746 of these can be given, and it can only be given as the first option passed
2737 to IPython (it will have no effect in any other position).
2747 to IPython (it will have no effect in any other position).
2738 They provide threading support for the GTK Qt and WXPython toolkits, and
2748 They provide threading support for the GTK Qt and WXPython toolkits, and
2739 for the matplotlib library.
2749 for the matplotlib library.
2740 \layout List
2750 \layout List
2741 \labelwidthstring 00.00.0000
2751 \labelwidthstring 00.00.0000
2742
2752
2743 \SpecialChar ~
2753 \SpecialChar ~
2744 With any of the first three options, IPython starts running a separate
2754 With any of the first three options, IPython starts running a separate
2745 thread for the graphical toolkit's operation, so that you can open and
2755 thread for the graphical toolkit's operation, so that you can open and
2746 control graphical elements from within an IPython command line, without
2756 control graphical elements from within an IPython command line, without
2747 blocking.
2757 blocking.
2748 All three provide essentially the same functionality, respectively for
2758 All three provide essentially the same functionality, respectively for
2749 GTK, QT and WXWidgets (via their Python interfaces).
2759 GTK, QT and WXWidgets (via their Python interfaces).
2750 \layout List
2760 \layout List
2751 \labelwidthstring 00.00.0000
2761 \labelwidthstring 00.00.0000
2752
2762
2753 \SpecialChar ~
2763 \SpecialChar ~
2754 Note that with
2764 Note that with
2755 \family typewriter
2765 \family typewriter
2756 -wthread
2766 -wthread
2757 \family default
2767 \family default
2758 , you can additionally use the -wxversion option to request a specific version
2768 , you can additionally use the -wxversion option to request a specific version
2759 of wx to be used.
2769 of wx to be used.
2760 This requires that you have the
2770 This requires that you have the
2761 \family typewriter
2771 \family typewriter
2762 wxversion
2772 wxversion
2763 \family default
2773 \family default
2764 Python module installed, which is part of recent wxPython distributions.
2774 Python module installed, which is part of recent wxPython distributions.
2765 \layout List
2775 \layout List
2766 \labelwidthstring 00.00.0000
2776 \labelwidthstring 00.00.0000
2767
2777
2768 \SpecialChar ~
2778 \SpecialChar ~
2769 If
2779 If
2770 \family typewriter
2780 \family typewriter
2771 -pylab
2781 -pylab
2772 \family default
2782 \family default
2773 is given, IPython loads special support for the mat plotlib library (
2783 is given, IPython loads special support for the mat plotlib library (
2774 \begin_inset LatexCommand \htmlurl{http://matplotlib.sourceforge.net}
2784 \begin_inset LatexCommand \htmlurl{http://matplotlib.sourceforge.net}
2775
2785
2776 \end_inset
2786 \end_inset
2777
2787
2778 ), allowing interactive usage of any of its backends as defined in the user's
2788 ), allowing interactive usage of any of its backends as defined in the user's
2779
2789
2780 \family typewriter
2790 \family typewriter
2781 ~/.matplotlib/matplotlibrc
2791 ~/.matplotlib/matplotlibrc
2782 \family default
2792 \family default
2783 file.
2793 file.
2784 It automatically activates GTK, Qt or WX threading for IPyhton if the choice
2794 It automatically activates GTK, Qt or WX threading for IPyhton if the choice
2785 of matplotlib backend requires it.
2795 of matplotlib backend requires it.
2786 It also modifies the
2796 It also modifies the
2787 \family typewriter
2797 \family typewriter
2788 %run
2798 %run
2789 \family default
2799 \family default
2790 command to correctly execute (without blocking) any matplotlib-based script
2800 command to correctly execute (without blocking) any matplotlib-based script
2791 which calls
2801 which calls
2792 \family typewriter
2802 \family typewriter
2793 show()
2803 show()
2794 \family default
2804 \family default
2795 at the end.
2805 at the end.
2796
2806
2797 \layout List
2807 \layout List
2798 \labelwidthstring 00.00.0000
2808 \labelwidthstring 00.00.0000
2799
2809
2800
2810
2801 \family typewriter
2811 \family typewriter
2802 \series bold
2812 \series bold
2803 -tk
2813 -tk
2804 \family default
2814 \family default
2805 \series default
2815 \series default
2806 The
2816 The
2807 \family typewriter
2817 \family typewriter
2808 -g/q/wthread
2818 -g/q/wthread
2809 \family default
2819 \family default
2810 options, and
2820 options, and
2811 \family typewriter
2821 \family typewriter
2812 -pylab
2822 -pylab
2813 \family default
2823 \family default
2814 (if matplotlib is configured to use GTK, Qt or WX), will normally block
2824 (if matplotlib is configured to use GTK, Qt or WX), will normally block
2815 Tk graphical interfaces.
2825 Tk graphical interfaces.
2816 This means that when either GTK, Qt or WX threading is active, any attempt
2826 This means that when either GTK, Qt or WX threading is active, any attempt
2817 to open a Tk GUI will result in a dead window, and possibly cause the Python
2827 to open a Tk GUI will result in a dead window, and possibly cause the Python
2818 interpreter to crash.
2828 interpreter to crash.
2819 An extra option,
2829 An extra option,
2820 \family typewriter
2830 \family typewriter
2821 -tk
2831 -tk
2822 \family default
2832 \family default
2823 , is available to address this issue.
2833 , is available to address this issue.
2824 It can
2834 It can
2825 \emph on
2835 \emph on
2826 only
2836 only
2827 \emph default
2837 \emph default
2828 be given as a
2838 be given as a
2829 \emph on
2839 \emph on
2830 second
2840 second
2831 \emph default
2841 \emph default
2832 option after any of the above (
2842 option after any of the above (
2833 \family typewriter
2843 \family typewriter
2834 -gthread
2844 -gthread
2835 \family default
2845 \family default
2836 ,
2846 ,
2837 \family typewriter
2847 \family typewriter
2838 -wthread
2848 -wthread
2839 \family default
2849 \family default
2840 or
2850 or
2841 \family typewriter
2851 \family typewriter
2842 -pylab
2852 -pylab
2843 \family default
2853 \family default
2844 ).
2854 ).
2845 \layout List
2855 \layout List
2846 \labelwidthstring 00.00.0000
2856 \labelwidthstring 00.00.0000
2847
2857
2848 \SpecialChar ~
2858 \SpecialChar ~
2849 If
2859 If
2850 \family typewriter
2860 \family typewriter
2851 -tk
2861 -tk
2852 \family default
2862 \family default
2853 is given, IPython will try to coordinate Tk threading with GTK, Qt or WX.
2863 is given, IPython will try to coordinate Tk threading with GTK, Qt or WX.
2854 This is however potentially unreliable, and you will have to test on your
2864 This is however potentially unreliable, and you will have to test on your
2855 platform and Python configuration to determine whether it works for you.
2865 platform and Python configuration to determine whether it works for you.
2856 Debian users have reported success, apparently due to the fact that Debian
2866 Debian users have reported success, apparently due to the fact that Debian
2857 builds all of Tcl, Tk, Tkinter and Python with pthreads support.
2867 builds all of Tcl, Tk, Tkinter and Python with pthreads support.
2858 Under other Linux environments (such as Fedora Core 2/3), this option has
2868 Under other Linux environments (such as Fedora Core 2/3), this option has
2859 caused random crashes and lockups of the Python interpreter.
2869 caused random crashes and lockups of the Python interpreter.
2860 Under other operating systems (Mac OSX and Windows), you'll need to try
2870 Under other operating systems (Mac OSX and Windows), you'll need to try
2861 it to find out, since currently no user reports are available.
2871 it to find out, since currently no user reports are available.
2862 \layout List
2872 \layout List
2863 \labelwidthstring 00.00.0000
2873 \labelwidthstring 00.00.0000
2864
2874
2865 \SpecialChar ~
2875 \SpecialChar ~
2866 There is unfortunately no way for IPython to determine at run time whether
2876 There is unfortunately no way for IPython to determine at run time whether
2867
2877
2868 \family typewriter
2878 \family typewriter
2869 -tk
2879 -tk
2870 \family default
2880 \family default
2871 will work reliably or not, so you will need to do some experiments before
2881 will work reliably or not, so you will need to do some experiments before
2872 relying on it for regular work.
2882 relying on it for regular work.
2873
2883
2874 \layout Subsection
2884 \layout Subsection
2875
2885
2876
2886
2877 \begin_inset LatexCommand \label{sec:cmd-line-opts}
2887 \begin_inset LatexCommand \label{sec:cmd-line-opts}
2878
2888
2879 \end_inset
2889 \end_inset
2880
2890
2881 Regular Options
2891 Regular Options
2882 \layout Standard
2892 \layout Standard
2883
2893
2884 After the above threading options have been given, regular options can follow
2894 After the above threading options have been given, regular options can follow
2885 in any order.
2895 in any order.
2886 All options can be abbreviated to their shortest non-ambiguous form and
2896 All options can be abbreviated to their shortest non-ambiguous form and
2887 are case-sensitive.
2897 are case-sensitive.
2888 One or two dashes can be used.
2898 One or two dashes can be used.
2889 Some options have an alternate short form, indicated after a
2899 Some options have an alternate short form, indicated after a
2890 \family typewriter
2900 \family typewriter
2891 |
2901 |
2892 \family default
2902 \family default
2893 .
2903 .
2894 \layout Standard
2904 \layout Standard
2895
2905
2896 Most options can also be set from your ipythonrc configuration file.
2906 Most options can also be set from your ipythonrc configuration file.
2897 See the provided example for more details on what the options do.
2907 See the provided example for more details on what the options do.
2898 Options given at the command line override the values set in the ipythonrc
2908 Options given at the command line override the values set in the ipythonrc
2899 file.
2909 file.
2900 \layout Standard
2910 \layout Standard
2901
2911
2902 All options with a
2912 All options with a
2903 \family typewriter
2913 \family typewriter
2904 [no]
2914 [no]
2905 \family default
2915 \family default
2906 prepended can be specified in negated form (
2916 prepended can be specified in negated form (
2907 \family typewriter
2917 \family typewriter
2908 -nooption
2918 -nooption
2909 \family default
2919 \family default
2910 instead of
2920 instead of
2911 \family typewriter
2921 \family typewriter
2912 -option
2922 -option
2913 \family default
2923 \family default
2914 ) to turn the feature off.
2924 ) to turn the feature off.
2915 \layout List
2925 \layout List
2916 \labelwidthstring 00.00.0000
2926 \labelwidthstring 00.00.0000
2917
2927
2918
2928
2919 \family typewriter
2929 \family typewriter
2920 \series bold
2930 \series bold
2921 -help
2931 -help
2922 \family default
2932 \family default
2923 \series default
2933 \series default
2924 : print a help message and exit.
2934 : print a help message and exit.
2925 \layout List
2935 \layout List
2926 \labelwidthstring 00.00.0000
2936 \labelwidthstring 00.00.0000
2927
2937
2928
2938
2929 \family typewriter
2939 \family typewriter
2930 \series bold
2940 \series bold
2931 -pylab:
2941 -pylab:
2932 \family default
2942 \family default
2933 \series default
2943 \series default
2934 this can
2944 this can
2935 \emph on
2945 \emph on
2936 only
2946 only
2937 \emph default
2947 \emph default
2938 be given as the
2948 be given as the
2939 \emph on
2949 \emph on
2940 first
2950 first
2941 \emph default
2951 \emph default
2942 option passed to IPython (it will have no effect in any other position).
2952 option passed to IPython (it will have no effect in any other position).
2943 It adds special support for the matplotlib library (
2953 It adds special support for the matplotlib library (
2944 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
2954 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
2945
2955
2946 \end_inset
2956 \end_inset
2947
2957
2948 ), allowing interactive usage of any of its backends as defined in the user's
2958 ), allowing interactive usage of any of its backends as defined in the user's
2949
2959
2950 \family typewriter
2960 \family typewriter
2951 .matplotlibrc
2961 .matplotlibrc
2952 \family default
2962 \family default
2953 file.
2963 file.
2954 It automatically activates GTK or WX threading for IPyhton if the choice
2964 It automatically activates GTK or WX threading for IPyhton if the choice
2955 of matplotlib backend requires it.
2965 of matplotlib backend requires it.
2956 It also modifies the
2966 It also modifies the
2957 \family typewriter
2967 \family typewriter
2958 %run
2968 %run
2959 \family default
2969 \family default
2960 command to correctly execute (without blocking) any matplotlib-based script
2970 command to correctly execute (without blocking) any matplotlib-based script
2961 which calls
2971 which calls
2962 \family typewriter
2972 \family typewriter
2963 show()
2973 show()
2964 \family default
2974 \family default
2965 at the end.
2975 at the end.
2966 See Sec.\SpecialChar ~
2976 See Sec.\SpecialChar ~
2967
2977
2968 \begin_inset LatexCommand \ref{sec:matplotlib-support}
2978 \begin_inset LatexCommand \ref{sec:matplotlib-support}
2969
2979
2970 \end_inset
2980 \end_inset
2971
2981
2972 for more details.
2982 for more details.
2973 \layout List
2983 \layout List
2974 \labelwidthstring 00.00.0000
2984 \labelwidthstring 00.00.0000
2975
2985
2976
2986
2977 \family typewriter
2987 \family typewriter
2978 \series bold
2988 \series bold
2979 -autocall <val>:
2989 -autocall <val>:
2980 \family default
2990 \family default
2981 \series default
2991 \series default
2982 Make IPython automatically call any callable object even if you didn't
2992 Make IPython automatically call any callable object even if you didn't
2983 type explicit parentheses.
2993 type explicit parentheses.
2984 For example, `str 43' becomes `str(43)' automatically.
2994 For example, `str 43' becomes `str(43)' automatically.
2985 The value can be `0' to disable the feature, `1' for
2995 The value can be `0' to disable the feature, `1' for
2986 \emph on
2996 \emph on
2987 smart
2997 smart
2988 \emph default
2998 \emph default
2989 autocall, where it is not applied if there are no more arguments on the
2999 autocall, where it is not applied if there are no more arguments on the
2990 line, and `2' for
3000 line, and `2' for
2991 \emph on
3001 \emph on
2992 full
3002 full
2993 \emph default
3003 \emph default
2994 autocall, where all callable objects are automatically called (even if
3004 autocall, where all callable objects are automatically called (even if
2995 no arguments are present).
3005 no arguments are present).
2996 The default is `1'.
3006 The default is `1'.
2997 \layout List
3007 \layout List
2998 \labelwidthstring 00.00.0000
3008 \labelwidthstring 00.00.0000
2999
3009
3000
3010
3001 \family typewriter
3011 \family typewriter
3002 \series bold
3012 \series bold
3003 -[no]autoindent:
3013 -[no]autoindent:
3004 \family default
3014 \family default
3005 \series default
3015 \series default
3006 Turn automatic indentation on/off.
3016 Turn automatic indentation on/off.
3007 \layout List
3017 \layout List
3008 \labelwidthstring 00.00.0000
3018 \labelwidthstring 00.00.0000
3009
3019
3010
3020
3011 \family typewriter
3021 \family typewriter
3012 \series bold
3022 \series bold
3013 -[no]automagic
3023 -[no]automagic
3014 \series default
3024 \series default
3015 :
3025 :
3016 \family default
3026 \family default
3017 make magic commands automatic (without needing their first character to
3027 make magic commands automatic (without needing their first character to
3018 be
3028 be
3019 \family typewriter
3029 \family typewriter
3020 %
3030 %
3021 \family default
3031 \family default
3022 ).
3032 ).
3023 Type
3033 Type
3024 \family typewriter
3034 \family typewriter
3025 %magic
3035 %magic
3026 \family default
3036 \family default
3027 at the IPython prompt for more information.
3037 at the IPython prompt for more information.
3028 \layout List
3038 \layout List
3029 \labelwidthstring 00.00.0000
3039 \labelwidthstring 00.00.0000
3030
3040
3031
3041
3032 \family typewriter
3042 \family typewriter
3033 \series bold
3043 \series bold
3034 -[no]autoedit_syntax:
3044 -[no]autoedit_syntax:
3035 \family default
3045 \family default
3036 \series default
3046 \series default
3037 When a syntax error occurs after editing a file, automatically open the
3047 When a syntax error occurs after editing a file, automatically open the
3038 file to the trouble causing line for convenient fixing.
3048 file to the trouble causing line for convenient fixing.
3039
3049
3040 \layout List
3050 \layout List
3041 \labelwidthstring 00.00.0000
3051 \labelwidthstring 00.00.0000
3042
3052
3043
3053
3044 \family typewriter
3054 \family typewriter
3045 \series bold
3055 \series bold
3046 -[no]banner
3056 -[no]banner
3047 \series default
3057 \series default
3048 :
3058 :
3049 \family default
3059 \family default
3050 Print the initial information banner (default on).
3060 Print the initial information banner (default on).
3051 \layout List
3061 \layout List
3052 \labelwidthstring 00.00.0000
3062 \labelwidthstring 00.00.0000
3053
3063
3054
3064
3055 \family typewriter
3065 \family typewriter
3056 \series bold
3066 \series bold
3057 -c\SpecialChar ~
3067 -c\SpecialChar ~
3058 <command>:
3068 <command>:
3059 \family default
3069 \family default
3060 \series default
3070 \series default
3061 execute the given command string, and set sys.argv to
3071 execute the given command string, and set sys.argv to
3062 \family typewriter
3072 \family typewriter
3063 ['c']
3073 ['c']
3064 \family default
3074 \family default
3065 .
3075 .
3066 This is similar to the
3076 This is similar to the
3067 \family typewriter
3077 \family typewriter
3068 -c
3078 -c
3069 \family default
3079 \family default
3070 option in the normal Python interpreter.
3080 option in the normal Python interpreter.
3071
3081
3072 \layout List
3082 \layout List
3073 \labelwidthstring 00.00.0000
3083 \labelwidthstring 00.00.0000
3074
3084
3075
3085
3076 \family typewriter
3086 \family typewriter
3077 \series bold
3087 \series bold
3078 -cache_size|cs\SpecialChar ~
3088 -cache_size|cs\SpecialChar ~
3079 <n>
3089 <n>
3080 \series default
3090 \series default
3081 :
3091 :
3082 \family default
3092 \family default
3083 size of the output cache (maximum number of entries to hold in memory).
3093 size of the output cache (maximum number of entries to hold in memory).
3084 The default is 1000, you can change it permanently in your config file.
3094 The default is 1000, you can change it permanently in your config file.
3085 Setting it to 0 completely disables the caching system, and the minimum
3095 Setting it to 0 completely disables the caching system, and the minimum
3086 value accepted is 20 (if you provide a value less than 20, it is reset
3096 value accepted is 20 (if you provide a value less than 20, it is reset
3087 to 0 and a warning is issued) This limit is defined because otherwise you'll
3097 to 0 and a warning is issued) This limit is defined because otherwise you'll
3088 spend more time re-flushing a too small cache than working.
3098 spend more time re-flushing a too small cache than working.
3089 \layout List
3099 \layout List
3090 \labelwidthstring 00.00.0000
3100 \labelwidthstring 00.00.0000
3091
3101
3092
3102
3093 \family typewriter
3103 \family typewriter
3094 \series bold
3104 \series bold
3095 -classic|cl
3105 -classic|cl
3096 \series default
3106 \series default
3097 :
3107 :
3098 \family default
3108 \family default
3099 Gives IPython a similar feel to the classic Python prompt.
3109 Gives IPython a similar feel to the classic Python prompt.
3100 \layout List
3110 \layout List
3101 \labelwidthstring 00.00.0000
3111 \labelwidthstring 00.00.0000
3102
3112
3103
3113
3104 \family typewriter
3114 \family typewriter
3105 \series bold
3115 \series bold
3106 -colors\SpecialChar ~
3116 -colors\SpecialChar ~
3107 <scheme>:
3117 <scheme>:
3108 \family default
3118 \family default
3109 \series default
3119 \series default
3110 Color scheme for prompts and exception reporting.
3120 Color scheme for prompts and exception reporting.
3111 Currently implemented: NoColor, Linux and LightBG.
3121 Currently implemented: NoColor, Linux and LightBG.
3112 \layout List
3122 \layout List
3113 \labelwidthstring 00.00.0000
3123 \labelwidthstring 00.00.0000
3114
3124
3115
3125
3116 \family typewriter
3126 \family typewriter
3117 \series bold
3127 \series bold
3118 -[no]color_info:
3128 -[no]color_info:
3119 \family default
3129 \family default
3120 \series default
3130 \series default
3121 IPython can display information about objects via a set of functions, and
3131 IPython can display information about objects via a set of functions, and
3122 optionally can use colors for this, syntax highlighting source code and
3132 optionally can use colors for this, syntax highlighting source code and
3123 various other elements.
3133 various other elements.
3124 However, because this information is passed through a pager (like 'less')
3134 However, because this information is passed through a pager (like 'less')
3125 and many pagers get confused with color codes, this option is off by default.
3135 and many pagers get confused with color codes, this option is off by default.
3126 You can test it and turn it on permanently in your ipythonrc file if it
3136 You can test it and turn it on permanently in your ipythonrc file if it
3127 works for you.
3137 works for you.
3128 As a reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
3138 As a reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
3129 that in RedHat 7.2 doesn't.
3139 that in RedHat 7.2 doesn't.
3130 \layout List
3140 \layout List
3131 \labelwidthstring 00.00.0000
3141 \labelwidthstring 00.00.0000
3132
3142
3133 \SpecialChar ~
3143 \SpecialChar ~
3134 Test it and turn it on permanently if it works with your system.
3144 Test it and turn it on permanently if it works with your system.
3135 The magic function
3145 The magic function
3136 \family typewriter
3146 \family typewriter
3137 %color_info
3147 %color_info
3138 \family default
3148 \family default
3139 allows you to toggle this interactively for testing.
3149 allows you to toggle this interactively for testing.
3140 \layout List
3150 \layout List
3141 \labelwidthstring 00.00.0000
3151 \labelwidthstring 00.00.0000
3142
3152
3143
3153
3144 \family typewriter
3154 \family typewriter
3145 \series bold
3155 \series bold
3146 -[no]debug
3156 -[no]debug
3147 \family default
3157 \family default
3148 \series default
3158 \series default
3149 : Show information about the loading process.
3159 : Show information about the loading process.
3150 Very useful to pin down problems with your configuration files or to get
3160 Very useful to pin down problems with your configuration files or to get
3151 details about session restores.
3161 details about session restores.
3152 \layout List
3162 \layout List
3153 \labelwidthstring 00.00.0000
3163 \labelwidthstring 00.00.0000
3154
3164
3155
3165
3156 \family typewriter
3166 \family typewriter
3157 \series bold
3167 \series bold
3158 -[no]deep_reload
3168 -[no]deep_reload
3159 \series default
3169 \series default
3160 :
3170 :
3161 \family default
3171 \family default
3162 IPython can use the
3172 IPython can use the
3163 \family typewriter
3173 \family typewriter
3164 deep_reload
3174 deep_reload
3165 \family default
3175 \family default
3166 module which reloads changes in modules recursively (it replaces the
3176 module which reloads changes in modules recursively (it replaces the
3167 \family typewriter
3177 \family typewriter
3168 reload()
3178 reload()
3169 \family default
3179 \family default
3170 function, so you don't need to change anything to use it).
3180 function, so you don't need to change anything to use it).
3171
3181
3172 \family typewriter
3182 \family typewriter
3173 deep_reload()
3183 deep_reload()
3174 \family default
3184 \family default
3175 forces a full reload of modules whose code may have changed, which the
3185 forces a full reload of modules whose code may have changed, which the
3176 default
3186 default
3177 \family typewriter
3187 \family typewriter
3178 reload()
3188 reload()
3179 \family default
3189 \family default
3180 function does not.
3190 function does not.
3181 \layout List
3191 \layout List
3182 \labelwidthstring 00.00.0000
3192 \labelwidthstring 00.00.0000
3183
3193
3184 \SpecialChar ~
3194 \SpecialChar ~
3185 When deep_reload is off, IPython will use the normal
3195 When deep_reload is off, IPython will use the normal
3186 \family typewriter
3196 \family typewriter
3187 reload()
3197 reload()
3188 \family default
3198 \family default
3189 , but deep_reload will still be available as
3199 , but deep_reload will still be available as
3190 \family typewriter
3200 \family typewriter
3191 dreload()
3201 dreload()
3192 \family default
3202 \family default
3193 .
3203 .
3194 This feature is off by default [which means that you have both normal
3204 This feature is off by default [which means that you have both normal
3195 \family typewriter
3205 \family typewriter
3196 reload()
3206 reload()
3197 \family default
3207 \family default
3198 and
3208 and
3199 \family typewriter
3209 \family typewriter
3200 dreload()
3210 dreload()
3201 \family default
3211 \family default
3202 ].
3212 ].
3203 \layout List
3213 \layout List
3204 \labelwidthstring 00.00.0000
3214 \labelwidthstring 00.00.0000
3205
3215
3206
3216
3207 \family typewriter
3217 \family typewriter
3208 \series bold
3218 \series bold
3209 -editor\SpecialChar ~
3219 -editor\SpecialChar ~
3210 <name>
3220 <name>
3211 \family default
3221 \family default
3212 \series default
3222 \series default
3213 : Which editor to use with the
3223 : Which editor to use with the
3214 \family typewriter
3224 \family typewriter
3215 %edit
3225 %edit
3216 \family default
3226 \family default
3217 command.
3227 command.
3218 By default, IPython will honor your
3228 By default, IPython will honor your
3219 \family typewriter
3229 \family typewriter
3220 EDITOR
3230 EDITOR
3221 \family default
3231 \family default
3222 environment variable (if not set, vi is the Unix default and notepad the
3232 environment variable (if not set, vi is the Unix default and notepad the
3223 Windows one).
3233 Windows one).
3224 Since this editor is invoked on the fly by IPython and is meant for editing
3234 Since this editor is invoked on the fly by IPython and is meant for editing
3225 small code snippets, you may want to use a small, lightweight editor here
3235 small code snippets, you may want to use a small, lightweight editor here
3226 (in case your default
3236 (in case your default
3227 \family typewriter
3237 \family typewriter
3228 EDITOR
3238 EDITOR
3229 \family default
3239 \family default
3230 is something like Emacs).
3240 is something like Emacs).
3231 \layout List
3241 \layout List
3232 \labelwidthstring 00.00.0000
3242 \labelwidthstring 00.00.0000
3233
3243
3234
3244
3235 \family typewriter
3245 \family typewriter
3236 \series bold
3246 \series bold
3237 -ipythondir\SpecialChar ~
3247 -ipythondir\SpecialChar ~
3238 <name>
3248 <name>
3239 \series default
3249 \series default
3240 :
3250 :
3241 \family default
3251 \family default
3242 name of your IPython configuration directory
3252 name of your IPython configuration directory
3243 \family typewriter
3253 \family typewriter
3244 IPYTHONDIR
3254 IPYTHONDIR
3245 \family default
3255 \family default
3246 .
3256 .
3247 This can also be specified through the environment variable
3257 This can also be specified through the environment variable
3248 \family typewriter
3258 \family typewriter
3249 IPYTHONDIR
3259 IPYTHONDIR
3250 \family default
3260 \family default
3251 .
3261 .
3252 \layout List
3262 \layout List
3253 \labelwidthstring 00.00.0000
3263 \labelwidthstring 00.00.0000
3254
3264
3255
3265
3256 \family typewriter
3266 \family typewriter
3257 \series bold
3267 \series bold
3258 -log|l
3268 -log|l
3259 \family default
3269 \family default
3260 \series default
3270 \series default
3261 : generate a log file of all input.
3271 : generate a log file of all input.
3262 The file is named
3272 The file is named
3263 \family typewriter
3273 \family typewriter
3264 ipython_log.py
3274 ipython_log.py
3265 \family default
3275 \family default
3266 in your current directory (which prevents logs from multiple IPython sessions
3276 in your current directory (which prevents logs from multiple IPython sessions
3267 from trampling each other).
3277 from trampling each other).
3268 You can use this to later restore a session by loading your logfile as
3278 You can use this to later restore a session by loading your logfile as
3269 a file to be executed with option
3279 a file to be executed with option
3270 \family typewriter
3280 \family typewriter
3271 -logplay
3281 -logplay
3272 \family default
3282 \family default
3273 (see below).
3283 (see below).
3274 \layout List
3284 \layout List
3275 \labelwidthstring 00.00.0000
3285 \labelwidthstring 00.00.0000
3276
3286
3277
3287
3278 \family typewriter
3288 \family typewriter
3279 \series bold
3289 \series bold
3280 -logfile|lf\SpecialChar ~
3290 -logfile|lf\SpecialChar ~
3281 <name>
3291 <name>
3282 \series default
3292 \series default
3283 :
3293 :
3284 \family default
3294 \family default
3285 specify the name of your logfile.
3295 specify the name of your logfile.
3286 \layout List
3296 \layout List
3287 \labelwidthstring 00.00.0000
3297 \labelwidthstring 00.00.0000
3288
3298
3289
3299
3290 \family typewriter
3300 \family typewriter
3291 \series bold
3301 \series bold
3292 -logplay|lp\SpecialChar ~
3302 -logplay|lp\SpecialChar ~
3293 <name>
3303 <name>
3294 \series default
3304 \series default
3295 :
3305 :
3296 \family default
3306 \family default
3297 you can replay a previous log.
3307 you can replay a previous log.
3298 For restoring a session as close as possible to the state you left it in,
3308 For restoring a session as close as possible to the state you left it in,
3299 use this option (don't just run the logfile).
3309 use this option (don't just run the logfile).
3300 With
3310 With
3301 \family typewriter
3311 \family typewriter
3302 -logplay
3312 -logplay
3303 \family default
3313 \family default
3304 , IPython will try to reconstruct the previous working environment in full,
3314 , IPython will try to reconstruct the previous working environment in full,
3305 not just execute the commands in the logfile.
3315 not just execute the commands in the logfile.
3306 \layout List
3316 \layout List
3307 \labelwidthstring 00.00.0000
3317 \labelwidthstring 00.00.0000
3308
3318
3309 \SpecialChar ~
3319 \SpecialChar ~
3310 When a session is restored, logging is automatically turned on again with
3320 When a session is restored, logging is automatically turned on again with
3311 the name of the logfile it was invoked with (it is read from the log header).
3321 the name of the logfile it was invoked with (it is read from the log header).
3312 So once you've turned logging on for a session, you can quit IPython and
3322 So once you've turned logging on for a session, you can quit IPython and
3313 reload it as many times as you want and it will continue to log its history
3323 reload it as many times as you want and it will continue to log its history
3314 and restore from the beginning every time.
3324 and restore from the beginning every time.
3315 \layout List
3325 \layout List
3316 \labelwidthstring 00.00.0000
3326 \labelwidthstring 00.00.0000
3317
3327
3318 \SpecialChar ~
3328 \SpecialChar ~
3319 Caveats: there are limitations in this option.
3329 Caveats: there are limitations in this option.
3320 The history variables
3330 The history variables
3321 \family typewriter
3331 \family typewriter
3322 _i*
3332 _i*
3323 \family default
3333 \family default
3324 ,
3334 ,
3325 \family typewriter
3335 \family typewriter
3326 _*
3336 _*
3327 \family default
3337 \family default
3328 and
3338 and
3329 \family typewriter
3339 \family typewriter
3330 _dh
3340 _dh
3331 \family default
3341 \family default
3332 don't get restored properly.
3342 don't get restored properly.
3333 In the future we will try to implement full session saving by writing and
3343 In the future we will try to implement full session saving by writing and
3334 retrieving a 'snapshot' of the memory state of IPython.
3344 retrieving a 'snapshot' of the memory state of IPython.
3335 But our first attempts failed because of inherent limitations of Python's
3345 But our first attempts failed because of inherent limitations of Python's
3336 Pickle module, so this may have to wait.
3346 Pickle module, so this may have to wait.
3337 \layout List
3347 \layout List
3338 \labelwidthstring 00.00.0000
3348 \labelwidthstring 00.00.0000
3339
3349
3340
3350
3341 \family typewriter
3351 \family typewriter
3342 \series bold
3352 \series bold
3343 -[no]messages
3353 -[no]messages
3344 \series default
3354 \series default
3345 :
3355 :
3346 \family default
3356 \family default
3347 Print messages which IPython collects about its startup process (default
3357 Print messages which IPython collects about its startup process (default
3348 on).
3358 on).
3349 \layout List
3359 \layout List
3350 \labelwidthstring 00.00.0000
3360 \labelwidthstring 00.00.0000
3351
3361
3352
3362
3353 \family typewriter
3363 \family typewriter
3354 \series bold
3364 \series bold
3355 -[no]pdb
3365 -[no]pdb
3356 \family default
3366 \family default
3357 \series default
3367 \series default
3358 : Automatically call the pdb debugger after every uncaught exception.
3368 : Automatically call the pdb debugger after every uncaught exception.
3359 If you are used to debugging using pdb, this puts you automatically inside
3369 If you are used to debugging using pdb, this puts you automatically inside
3360 of it after any call (either in IPython or in code called by it) which
3370 of it after any call (either in IPython or in code called by it) which
3361 triggers an exception which goes uncaught.
3371 triggers an exception which goes uncaught.
3362 \layout List
3372 \layout List
3363 \labelwidthstring 00.00.0000
3373 \labelwidthstring 00.00.0000
3364
3374
3365
3375
3366 \family typewriter
3376 \family typewriter
3367 \series bold
3377 \series bold
3368 -[no]pprint
3378 -[no]pprint
3369 \series default
3379 \series default
3370 :
3380 :
3371 \family default
3381 \family default
3372 ipython can optionally use the pprint (pretty printer) module for displaying
3382 ipython can optionally use the pprint (pretty printer) module for displaying
3373 results.
3383 results.
3374 pprint tends to give a nicer display of nested data structures.
3384 pprint tends to give a nicer display of nested data structures.
3375 If you like it, you can turn it on permanently in your config file (default
3385 If you like it, you can turn it on permanently in your config file (default
3376 off).
3386 off).
3377 \layout List
3387 \layout List
3378 \labelwidthstring 00.00.0000
3388 \labelwidthstring 00.00.0000
3379
3389
3380
3390
3381 \family typewriter
3391 \family typewriter
3382 \series bold
3392 \series bold
3383 -profile|p <name>
3393 -profile|p <name>
3384 \series default
3394 \series default
3385 :
3395 :
3386 \family default
3396 \family default
3387 assume that your config file is
3397 assume that your config file is
3388 \family typewriter
3398 \family typewriter
3389 ipythonrc-<name>
3399 ipythonrc-<name>
3390 \family default
3400 \family default
3391 (looks in current dir first, then in
3401 (looks in current dir first, then in
3392 \family typewriter
3402 \family typewriter
3393 IPYTHONDIR
3403 IPYTHONDIR
3394 \family default
3404 \family default
3395 ).
3405 ).
3396 This is a quick way to keep and load multiple config files for different
3406 This is a quick way to keep and load multiple config files for different
3397 tasks, especially if you use the include option of config files.
3407 tasks, especially if you use the include option of config files.
3398 You can keep a basic
3408 You can keep a basic
3399 \family typewriter
3409 \family typewriter
3400 IPYTHONDIR/ipythonrc
3410 IPYTHONDIR/ipythonrc
3401 \family default
3411 \family default
3402 file and then have other 'profiles' which include this one and load extra
3412 file and then have other 'profiles' which include this one and load extra
3403 things for particular tasks.
3413 things for particular tasks.
3404 For example:
3414 For example:
3405 \layout List
3415 \layout List
3406 \labelwidthstring 00.00.0000
3416 \labelwidthstring 00.00.0000
3407
3417
3408
3418
3409 \family typewriter
3419 \family typewriter
3410 \SpecialChar ~
3420 \SpecialChar ~
3411
3421
3412 \family default
3422 \family default
3413 1.
3423 1.
3414
3424
3415 \family typewriter
3425 \family typewriter
3416 $HOME/.ipython/ipythonrc
3426 $HOME/.ipython/ipythonrc
3417 \family default
3427 \family default
3418 : load basic things you always want.
3428 : load basic things you always want.
3419 \layout List
3429 \layout List
3420 \labelwidthstring 00.00.0000
3430 \labelwidthstring 00.00.0000
3421
3431
3422
3432
3423 \family typewriter
3433 \family typewriter
3424 \SpecialChar ~
3434 \SpecialChar ~
3425
3435
3426 \family default
3436 \family default
3427 2.
3437 2.
3428
3438
3429 \family typewriter
3439 \family typewriter
3430 $HOME/.ipython/ipythonrc-math
3440 $HOME/.ipython/ipythonrc-math
3431 \family default
3441 \family default
3432 : load (1) and basic math-related modules.
3442 : load (1) and basic math-related modules.
3433
3443
3434 \layout List
3444 \layout List
3435 \labelwidthstring 00.00.0000
3445 \labelwidthstring 00.00.0000
3436
3446
3437
3447
3438 \family typewriter
3448 \family typewriter
3439 \SpecialChar ~
3449 \SpecialChar ~
3440
3450
3441 \family default
3451 \family default
3442 3.
3452 3.
3443
3453
3444 \family typewriter
3454 \family typewriter
3445 $HOME/.ipython/ipythonrc-numeric
3455 $HOME/.ipython/ipythonrc-numeric
3446 \family default
3456 \family default
3447 : load (1) and Numeric and plotting modules.
3457 : load (1) and Numeric and plotting modules.
3448 \layout List
3458 \layout List
3449 \labelwidthstring 00.00.0000
3459 \labelwidthstring 00.00.0000
3450
3460
3451 \SpecialChar ~
3461 \SpecialChar ~
3452 Since it is possible to create an endless loop by having circular file
3462 Since it is possible to create an endless loop by having circular file
3453 inclusions, IPython will stop if it reaches 15 recursive inclusions.
3463 inclusions, IPython will stop if it reaches 15 recursive inclusions.
3454 \layout List
3464 \layout List
3455 \labelwidthstring 00.00.0000
3465 \labelwidthstring 00.00.0000
3456
3466
3457
3467
3458 \family typewriter
3468 \family typewriter
3459 \series bold
3469 \series bold
3460 -prompt_in1|pi1\SpecialChar ~
3470 -prompt_in1|pi1\SpecialChar ~
3461 <string>:
3471 <string>:
3462 \family default
3472 \family default
3463 \series default
3473 \series default
3464 Specify the string used for input prompts.
3474 Specify the string used for input prompts.
3465 Note that if you are using numbered prompts, the number is represented
3475 Note that if you are using numbered prompts, the number is represented
3466 with a '
3476 with a '
3467 \backslash
3477 \backslash
3468 #' in the string.
3478 #' in the string.
3469 Don't forget to quote strings with spaces embedded in them.
3479 Don't forget to quote strings with spaces embedded in them.
3470 Default: '
3480 Default: '
3471 \family typewriter
3481 \family typewriter
3472 In\SpecialChar ~
3482 In\SpecialChar ~
3473 [
3483 [
3474 \backslash
3484 \backslash
3475 #]:
3485 #]:
3476 \family default
3486 \family default
3477 '.
3487 '.
3478 Sec.\SpecialChar ~
3488 Sec.\SpecialChar ~
3479
3489
3480 \begin_inset LatexCommand \ref{sec:prompts}
3490 \begin_inset LatexCommand \ref{sec:prompts}
3481
3491
3482 \end_inset
3492 \end_inset
3483
3493
3484 discusses in detail all the available escapes to customize your prompts.
3494 discusses in detail all the available escapes to customize your prompts.
3485 \layout List
3495 \layout List
3486 \labelwidthstring 00.00.0000
3496 \labelwidthstring 00.00.0000
3487
3497
3488
3498
3489 \family typewriter
3499 \family typewriter
3490 \series bold
3500 \series bold
3491 -prompt_in2|pi2\SpecialChar ~
3501 -prompt_in2|pi2\SpecialChar ~
3492 <string>:
3502 <string>:
3493 \family default
3503 \family default
3494 \series default
3504 \series default
3495 Similar to the previous option, but used for the continuation prompts.
3505 Similar to the previous option, but used for the continuation prompts.
3496 The special sequence '
3506 The special sequence '
3497 \family typewriter
3507 \family typewriter
3498
3508
3499 \backslash
3509 \backslash
3500 D
3510 D
3501 \family default
3511 \family default
3502 ' is similar to '
3512 ' is similar to '
3503 \family typewriter
3513 \family typewriter
3504
3514
3505 \backslash
3515 \backslash
3506 #
3516 #
3507 \family default
3517 \family default
3508 ', but with all digits replaced dots (so you can have your continuation
3518 ', but with all digits replaced dots (so you can have your continuation
3509 prompt aligned with your input prompt).
3519 prompt aligned with your input prompt).
3510 Default: '
3520 Default: '
3511 \family typewriter
3521 \family typewriter
3512 \SpecialChar ~
3522 \SpecialChar ~
3513 \SpecialChar ~
3523 \SpecialChar ~
3514 \SpecialChar ~
3524 \SpecialChar ~
3515 .
3525 .
3516 \backslash
3526 \backslash
3517 D.:
3527 D.:
3518 \family default
3528 \family default
3519 ' (note three spaces at the start for alignment with '
3529 ' (note three spaces at the start for alignment with '
3520 \family typewriter
3530 \family typewriter
3521 In\SpecialChar ~
3531 In\SpecialChar ~
3522 [
3532 [
3523 \backslash
3533 \backslash
3524 #]
3534 #]
3525 \family default
3535 \family default
3526 ').
3536 ').
3527 \layout List
3537 \layout List
3528 \labelwidthstring 00.00.0000
3538 \labelwidthstring 00.00.0000
3529
3539
3530
3540
3531 \family typewriter
3541 \family typewriter
3532 \series bold
3542 \series bold
3533 -prompt_out|po\SpecialChar ~
3543 -prompt_out|po\SpecialChar ~
3534 <string>:
3544 <string>:
3535 \family default
3545 \family default
3536 \series default
3546 \series default
3537 String used for output prompts, also uses numbers like
3547 String used for output prompts, also uses numbers like
3538 \family typewriter
3548 \family typewriter
3539 prompt_in1
3549 prompt_in1
3540 \family default
3550 \family default
3541 .
3551 .
3542 Default: '
3552 Default: '
3543 \family typewriter
3553 \family typewriter
3544 Out[
3554 Out[
3545 \backslash
3555 \backslash
3546 #]:
3556 #]:
3547 \family default
3557 \family default
3548 '
3558 '
3549 \layout List
3559 \layout List
3550 \labelwidthstring 00.00.0000
3560 \labelwidthstring 00.00.0000
3551
3561
3552
3562
3553 \family typewriter
3563 \family typewriter
3554 \series bold
3564 \series bold
3555 -quick
3565 -quick
3556 \family default
3566 \family default
3557 \series default
3567 \series default
3558 : start in bare bones mode (no config file loaded).
3568 : start in bare bones mode (no config file loaded).
3559 \layout List
3569 \layout List
3560 \labelwidthstring 00.00.0000
3570 \labelwidthstring 00.00.0000
3561
3571
3562
3572
3563 \family typewriter
3573 \family typewriter
3564 \series bold
3574 \series bold
3565 -rcfile\SpecialChar ~
3575 -rcfile\SpecialChar ~
3566 <name>
3576 <name>
3567 \series default
3577 \series default
3568 :
3578 :
3569 \family default
3579 \family default
3570 name of your IPython resource configuration file.
3580 name of your IPython resource configuration file.
3571 Normally IPython loads ipythonrc (from current directory) or
3581 Normally IPython loads ipythonrc (from current directory) or
3572 \family typewriter
3582 \family typewriter
3573 IPYTHONDIR/ipythonrc
3583 IPYTHONDIR/ipythonrc
3574 \family default
3584 \family default
3575 .
3585 .
3576 \layout List
3586 \layout List
3577 \labelwidthstring 00.00.0000
3587 \labelwidthstring 00.00.0000
3578
3588
3579 \SpecialChar ~
3589 \SpecialChar ~
3580 If the loading of your config file fails, IPython starts with a bare bones
3590 If the loading of your config file fails, IPython starts with a bare bones
3581 configuration (no modules loaded at all).
3591 configuration (no modules loaded at all).
3582 \layout List
3592 \layout List
3583 \labelwidthstring 00.00.0000
3593 \labelwidthstring 00.00.0000
3584
3594
3585
3595
3586 \family typewriter
3596 \family typewriter
3587 \series bold
3597 \series bold
3588 -[no]readline
3598 -[no]readline
3589 \family default
3599 \family default
3590 \series default
3600 \series default
3591 : use the readline library, which is needed to support name completion and
3601 : use the readline library, which is needed to support name completion and
3592 command history, among other things.
3602 command history, among other things.
3593 It is enabled by default, but may cause problems for users of X/Emacs in
3603 It is enabled by default, but may cause problems for users of X/Emacs in
3594 Python comint or shell buffers.
3604 Python comint or shell buffers.
3595 \layout List
3605 \layout List
3596 \labelwidthstring 00.00.0000
3606 \labelwidthstring 00.00.0000
3597
3607
3598 \SpecialChar ~
3608 \SpecialChar ~
3599 Note that X/Emacs 'eterm' buffers (opened with
3609 Note that X/Emacs 'eterm' buffers (opened with
3600 \family typewriter
3610 \family typewriter
3601 M-x\SpecialChar ~
3611 M-x\SpecialChar ~
3602 term
3612 term
3603 \family default
3613 \family default
3604 ) support IPython's readline and syntax coloring fine, only 'emacs' (
3614 ) support IPython's readline and syntax coloring fine, only 'emacs' (
3605 \family typewriter
3615 \family typewriter
3606 M-x\SpecialChar ~
3616 M-x\SpecialChar ~
3607 shell
3617 shell
3608 \family default
3618 \family default
3609 and
3619 and
3610 \family typewriter
3620 \family typewriter
3611 C-c\SpecialChar ~
3621 C-c\SpecialChar ~
3612 !
3622 !
3613 \family default
3623 \family default
3614 ) buffers do not.
3624 ) buffers do not.
3615 \layout List
3625 \layout List
3616 \labelwidthstring 00.00.0000
3626 \labelwidthstring 00.00.0000
3617
3627
3618
3628
3619 \family typewriter
3629 \family typewriter
3620 \series bold
3630 \series bold
3621 -screen_length|sl\SpecialChar ~
3631 -screen_length|sl\SpecialChar ~
3622 <n>
3632 <n>
3623 \series default
3633 \series default
3624 :
3634 :
3625 \family default
3635 \family default
3626 number of lines of your screen.
3636 number of lines of your screen.
3627 This is used to control printing of very long strings.
3637 This is used to control printing of very long strings.
3628 Strings longer than this number of lines will be sent through a pager instead
3638 Strings longer than this number of lines will be sent through a pager instead
3629 of directly printed.
3639 of directly printed.
3630 \layout List
3640 \layout List
3631 \labelwidthstring 00.00.0000
3641 \labelwidthstring 00.00.0000
3632
3642
3633 \SpecialChar ~
3643 \SpecialChar ~
3634 The default value for this is 0, which means IPython will auto-detect your
3644 The default value for this is 0, which means IPython will auto-detect your
3635 screen size every time it needs to print certain potentially long strings
3645 screen size every time it needs to print certain potentially long strings
3636 (this doesn't change the behavior of the 'print' keyword, it's only triggered
3646 (this doesn't change the behavior of the 'print' keyword, it's only triggered
3637 internally).
3647 internally).
3638 If for some reason this isn't working well (it needs curses support), specify
3648 If for some reason this isn't working well (it needs curses support), specify
3639 it yourself.
3649 it yourself.
3640 Otherwise don't change the default.
3650 Otherwise don't change the default.
3641 \layout List
3651 \layout List
3642 \labelwidthstring 00.00.0000
3652 \labelwidthstring 00.00.0000
3643
3653
3644
3654
3645 \family typewriter
3655 \family typewriter
3646 \series bold
3656 \series bold
3647 -separate_in|si\SpecialChar ~
3657 -separate_in|si\SpecialChar ~
3648 <string>
3658 <string>
3649 \series default
3659 \series default
3650 :
3660 :
3651 \family default
3661 \family default
3652 separator before input prompts.
3662 separator before input prompts.
3653 Default: '
3663 Default: '
3654 \family typewriter
3664 \family typewriter
3655
3665
3656 \backslash
3666 \backslash
3657 n
3667 n
3658 \family default
3668 \family default
3659 '
3669 '
3660 \layout List
3670 \layout List
3661 \labelwidthstring 00.00.0000
3671 \labelwidthstring 00.00.0000
3662
3672
3663
3673
3664 \family typewriter
3674 \family typewriter
3665 \series bold
3675 \series bold
3666 -separate_out|so\SpecialChar ~
3676 -separate_out|so\SpecialChar ~
3667 <string>
3677 <string>
3668 \family default
3678 \family default
3669 \series default
3679 \series default
3670 : separator before output prompts.
3680 : separator before output prompts.
3671 Default: nothing.
3681 Default: nothing.
3672 \layout List
3682 \layout List
3673 \labelwidthstring 00.00.0000
3683 \labelwidthstring 00.00.0000
3674
3684
3675
3685
3676 \family typewriter
3686 \family typewriter
3677 \series bold
3687 \series bold
3678 -separate_out2|so2\SpecialChar ~
3688 -separate_out2|so2\SpecialChar ~
3679 <string>
3689 <string>
3680 \series default
3690 \series default
3681 :
3691 :
3682 \family default
3692 \family default
3683 separator after output prompts.
3693 separator after output prompts.
3684 Default: nothing.
3694 Default: nothing.
3685 \layout List
3695 \layout List
3686 \labelwidthstring 00.00.0000
3696 \labelwidthstring 00.00.0000
3687
3697
3688 \SpecialChar ~
3698 \SpecialChar ~
3689 For these three options, use the value 0 to specify no separator.
3699 For these three options, use the value 0 to specify no separator.
3690 \layout List
3700 \layout List
3691 \labelwidthstring 00.00.0000
3701 \labelwidthstring 00.00.0000
3692
3702
3693
3703
3694 \family typewriter
3704 \family typewriter
3695 \series bold
3705 \series bold
3696 -nosep
3706 -nosep
3697 \series default
3707 \series default
3698 :
3708 :
3699 \family default
3709 \family default
3700 shorthand for
3710 shorthand for
3701 \family typewriter
3711 \family typewriter
3702 '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'
3712 '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'
3703 \family default
3713 \family default
3704 .
3714 .
3705 Simply removes all input/output separators.
3715 Simply removes all input/output separators.
3706 \layout List
3716 \layout List
3707 \labelwidthstring 00.00.0000
3717 \labelwidthstring 00.00.0000
3708
3718
3709
3719
3710 \family typewriter
3720 \family typewriter
3711 \series bold
3721 \series bold
3712 -upgrade
3722 -upgrade
3713 \family default
3723 \family default
3714 \series default
3724 \series default
3715 : allows you to upgrade your
3725 : allows you to upgrade your
3716 \family typewriter
3726 \family typewriter
3717 IPYTHONDIR
3727 IPYTHONDIR
3718 \family default
3728 \family default
3719 configuration when you install a new version of IPython.
3729 configuration when you install a new version of IPython.
3720 Since new versions may include new command line options or example files,
3730 Since new versions may include new command line options or example files,
3721 this copies updated ipythonrc-type files.
3731 this copies updated ipythonrc-type files.
3722 However, it backs up (with a
3732 However, it backs up (with a
3723 \family typewriter
3733 \family typewriter
3724 .old
3734 .old
3725 \family default
3735 \family default
3726 extension) all files which it overwrites so that you can merge back any
3736 extension) all files which it overwrites so that you can merge back any
3727 customizations you might have in your personal files.
3737 customizations you might have in your personal files.
3728 \layout List
3738 \layout List
3729 \labelwidthstring 00.00.0000
3739 \labelwidthstring 00.00.0000
3730
3740
3731
3741
3732 \family typewriter
3742 \family typewriter
3733 \series bold
3743 \series bold
3734 -Version
3744 -Version
3735 \series default
3745 \series default
3736 :
3746 :
3737 \family default
3747 \family default
3738 print version information and exit.
3748 print version information and exit.
3739 \layout List
3749 \layout List
3740 \labelwidthstring 00.00.0000
3750 \labelwidthstring 00.00.0000
3741
3751
3742
3752
3743 \family typewriter
3753 \family typewriter
3744 \series bold
3754 \series bold
3745 -wxversion\SpecialChar ~
3755 -wxversion\SpecialChar ~
3746 <string>:
3756 <string>:
3747 \family default
3757 \family default
3748 \series default
3758 \series default
3749 Select a specific version of wxPython (used in conjunction with
3759 Select a specific version of wxPython (used in conjunction with
3750 \family typewriter
3760 \family typewriter
3751 -wthread
3761 -wthread
3752 \family default
3762 \family default
3753 ).
3763 ).
3754 Requires the wxversion module, part of recent wxPython distributions
3764 Requires the wxversion module, part of recent wxPython distributions
3755 \layout List
3765 \layout List
3756 \labelwidthstring 00.00.0000
3766 \labelwidthstring 00.00.0000
3757
3767
3758
3768
3759 \family typewriter
3769 \family typewriter
3760 \series bold
3770 \series bold
3761 -xmode\SpecialChar ~
3771 -xmode\SpecialChar ~
3762 <modename>
3772 <modename>
3763 \series default
3773 \series default
3764 :
3774 :
3765 \family default
3775 \family default
3766 Mode for exception reporting.
3776 Mode for exception reporting.
3767 \layout List
3777 \layout List
3768 \labelwidthstring 00.00.0000
3778 \labelwidthstring 00.00.0000
3769
3779
3770 \SpecialChar ~
3780 \SpecialChar ~
3771 Valid modes: Plain, Context and Verbose.
3781 Valid modes: Plain, Context and Verbose.
3772 \layout List
3782 \layout List
3773 \labelwidthstring 00.00.0000
3783 \labelwidthstring 00.00.0000
3774
3784
3775 \SpecialChar ~
3785 \SpecialChar ~
3776 Plain: similar to python's normal traceback printing.
3786 Plain: similar to python's normal traceback printing.
3777 \layout List
3787 \layout List
3778 \labelwidthstring 00.00.0000
3788 \labelwidthstring 00.00.0000
3779
3789
3780 \SpecialChar ~
3790 \SpecialChar ~
3781 Context: prints 5 lines of context source code around each line in the
3791 Context: prints 5 lines of context source code around each line in the
3782 traceback.
3792 traceback.
3783 \layout List
3793 \layout List
3784 \labelwidthstring 00.00.0000
3794 \labelwidthstring 00.00.0000
3785
3795
3786 \SpecialChar ~
3796 \SpecialChar ~
3787 Verbose: similar to Context, but additionally prints the variables currently
3797 Verbose: similar to Context, but additionally prints the variables currently
3788 visible where the exception happened (shortening their strings if too long).
3798 visible where the exception happened (shortening their strings if too long).
3789 This can potentially be very slow, if you happen to have a huge data structure
3799 This can potentially be very slow, if you happen to have a huge data structure
3790 whose string representation is complex to compute.
3800 whose string representation is complex to compute.
3791 Your computer may appear to freeze for a while with cpu usage at 100%.
3801 Your computer may appear to freeze for a while with cpu usage at 100%.
3792 If this occurs, you can cancel the traceback with Ctrl-C (maybe hitting
3802 If this occurs, you can cancel the traceback with Ctrl-C (maybe hitting
3793 it more than once).
3803 it more than once).
3794 \layout Section
3804 \layout Section
3795
3805
3796 Interactive use
3806 Interactive use
3797 \layout Standard
3807 \layout Standard
3798
3808
3799
3809
3800 \series bold
3810 \series bold
3801 Warning
3811 Warning
3802 \series default
3812 \series default
3803 : IPython relies on the existence of a global variable called
3813 : IPython relies on the existence of a global variable called
3804 \family typewriter
3814 \family typewriter
3805 __IP
3815 __IP
3806 \family default
3816 \family default
3807 which controls the shell itself.
3817 which controls the shell itself.
3808 If you redefine
3818 If you redefine
3809 \family typewriter
3819 \family typewriter
3810 __IP
3820 __IP
3811 \family default
3821 \family default
3812 to anything, bizarre behavior will quickly occur.
3822 to anything, bizarre behavior will quickly occur.
3813 \layout Standard
3823 \layout Standard
3814
3824
3815 Other than the above warning, IPython is meant to work as a drop-in replacement
3825 Other than the above warning, IPython is meant to work as a drop-in replacement
3816 for the standard interactive interpreter.
3826 for the standard interactive interpreter.
3817 As such, any code which is valid python should execute normally under IPython
3827 As such, any code which is valid python should execute normally under IPython
3818 (cases where this is not true should be reported as bugs).
3828 (cases where this is not true should be reported as bugs).
3819 It does, however, offer many features which are not available at a standard
3829 It does, however, offer many features which are not available at a standard
3820 python prompt.
3830 python prompt.
3821 What follows is a list of these.
3831 What follows is a list of these.
3822 \layout Subsection
3832 \layout Subsection
3823
3833
3824 Caution for Windows users
3834 Caution for Windows users
3825 \layout Standard
3835 \layout Standard
3826
3836
3827 Windows, unfortunately, uses the `
3837 Windows, unfortunately, uses the `
3828 \family typewriter
3838 \family typewriter
3829
3839
3830 \backslash
3840 \backslash
3831
3841
3832 \family default
3842 \family default
3833 ' character as a path separator.
3843 ' character as a path separator.
3834 This is a terrible choice, because `
3844 This is a terrible choice, because `
3835 \family typewriter
3845 \family typewriter
3836
3846
3837 \backslash
3847 \backslash
3838
3848
3839 \family default
3849 \family default
3840 ' also represents the escape character in most modern programming languages,
3850 ' also represents the escape character in most modern programming languages,
3841 including Python.
3851 including Python.
3842 For this reason, issuing many of the commands discussed below (especially
3852 For this reason, issuing many of the commands discussed below (especially
3843 magics which affect the filesystem) with `
3853 magics which affect the filesystem) with `
3844 \family typewriter
3854 \family typewriter
3845
3855
3846 \backslash
3856 \backslash
3847
3857
3848 \family default
3858 \family default
3849 ' in them will cause strange errors.
3859 ' in them will cause strange errors.
3850 \layout Standard
3860 \layout Standard
3851
3861
3852 A partial solution is to use instead the `
3862 A partial solution is to use instead the `
3853 \family typewriter
3863 \family typewriter
3854 /
3864 /
3855 \family default
3865 \family default
3856 ' character as a path separator, which Windows recognizes in
3866 ' character as a path separator, which Windows recognizes in
3857 \emph on
3867 \emph on
3858 most
3868 most
3859 \emph default
3869 \emph default
3860 situations.
3870 situations.
3861 However, in Windows commands `
3871 However, in Windows commands `
3862 \family typewriter
3872 \family typewriter
3863 /
3873 /
3864 \family default
3874 \family default
3865 ' flags options, so you can not use it for the root directory.
3875 ' flags options, so you can not use it for the root directory.
3866 This means that paths beginning at the root must be typed in a contrived
3876 This means that paths beginning at the root must be typed in a contrived
3867 manner like:
3877 manner like:
3868 \newline
3878 \newline
3869
3879
3870 \family typewriter
3880 \family typewriter
3871 %copy
3881 %copy
3872 \backslash
3882 \backslash
3873 opt/foo/bar.txt
3883 opt/foo/bar.txt
3874 \backslash
3884 \backslash
3875 tmp
3885 tmp
3876 \layout Standard
3886 \layout Standard
3877
3887
3878 There is no sensible thing IPython can do to truly work around this flaw
3888 There is no sensible thing IPython can do to truly work around this flaw
3879 in Windows
3889 in Windows
3880 \begin_inset Foot
3890 \begin_inset Foot
3881 collapsed true
3891 collapsed true
3882
3892
3883 \layout Standard
3893 \layout Standard
3884
3894
3885 If anyone comes up with a
3895 If anyone comes up with a
3886 \emph on
3896 \emph on
3887 clean
3897 clean
3888 \emph default
3898 \emph default
3889 solution which works consistently and does not negatively impact other
3899 solution which works consistently and does not negatively impact other
3890 platforms at all, I'll gladly accept a patch.
3900 platforms at all, I'll gladly accept a patch.
3891 \end_inset
3901 \end_inset
3892
3902
3893 .
3903 .
3894 \layout Subsection
3904 \layout Subsection
3895
3905
3896
3906
3897 \begin_inset LatexCommand \label{sec:magic}
3907 \begin_inset LatexCommand \label{sec:magic}
3898
3908
3899 \end_inset
3909 \end_inset
3900
3910
3901 Magic command system
3911 Magic command system
3902 \layout Standard
3912 \layout Standard
3903
3913
3904 IPython will treat any line whose first character is a
3914 IPython will treat any line whose first character is a
3905 \family typewriter
3915 \family typewriter
3906 %
3916 %
3907 \family default
3917 \family default
3908 as a special call to a 'magic' function.
3918 as a special call to a 'magic' function.
3909 These allow you to control the behavior of IPython itself, plus a lot of
3919 These allow you to control the behavior of IPython itself, plus a lot of
3910 system-type features.
3920 system-type features.
3911 They are all prefixed with a
3921 They are all prefixed with a
3912 \family typewriter
3922 \family typewriter
3913 %
3923 %
3914 \family default
3924 \family default
3915 character, but parameters are given without parentheses or quotes.
3925 character, but parameters are given without parentheses or quotes.
3916 \layout Standard
3926 \layout Standard
3917
3927
3918 Example: typing
3928 Example: typing
3919 \family typewriter
3929 \family typewriter
3920 '%cd mydir'
3930 '%cd mydir'
3921 \family default
3931 \family default
3922 (without the quotes) changes you working directory to
3932 (without the quotes) changes you working directory to
3923 \family typewriter
3933 \family typewriter
3924 'mydir'
3934 'mydir'
3925 \family default
3935 \family default
3926 , if it exists.
3936 , if it exists.
3927 \layout Standard
3937 \layout Standard
3928
3938
3929 If you have 'automagic' enabled (in your
3939 If you have 'automagic' enabled (in your
3930 \family typewriter
3940 \family typewriter
3931 ipythonrc
3941 ipythonrc
3932 \family default
3942 \family default
3933 file, via the command line option
3943 file, via the command line option
3934 \family typewriter
3944 \family typewriter
3935 -automagic
3945 -automagic
3936 \family default
3946 \family default
3937 or with the
3947 or with the
3938 \family typewriter
3948 \family typewriter
3939 %automagic
3949 %automagic
3940 \family default
3950 \family default
3941 function), you don't need to type in the
3951 function), you don't need to type in the
3942 \family typewriter
3952 \family typewriter
3943 %
3953 %
3944 \family default
3954 \family default
3945 explicitly.
3955 explicitly.
3946 IPython will scan its internal list of magic functions and call one if
3956 IPython will scan its internal list of magic functions and call one if
3947 it exists.
3957 it exists.
3948 With automagic on you can then just type '
3958 With automagic on you can then just type '
3949 \family typewriter
3959 \family typewriter
3950 cd mydir
3960 cd mydir
3951 \family default
3961 \family default
3952 ' to go to directory '
3962 ' to go to directory '
3953 \family typewriter
3963 \family typewriter
3954 mydir
3964 mydir
3955 \family default
3965 \family default
3956 '.
3966 '.
3957 The automagic system has the lowest possible precedence in name searches,
3967 The automagic system has the lowest possible precedence in name searches,
3958 so defining an identifier with the same name as an existing magic function
3968 so defining an identifier with the same name as an existing magic function
3959 will shadow it for automagic use.
3969 will shadow it for automagic use.
3960 You can still access the shadowed magic function by explicitly using the
3970 You can still access the shadowed magic function by explicitly using the
3961
3971
3962 \family typewriter
3972 \family typewriter
3963 %
3973 %
3964 \family default
3974 \family default
3965 character at the beginning of the line.
3975 character at the beginning of the line.
3966 \layout Standard
3976 \layout Standard
3967
3977
3968 An example (with automagic on) should clarify all this:
3978 An example (with automagic on) should clarify all this:
3969 \layout LyX-Code
3979 \layout LyX-Code
3970
3980
3971 In [1]: cd ipython # %cd is called by automagic
3981 In [1]: cd ipython # %cd is called by automagic
3972 \layout LyX-Code
3982 \layout LyX-Code
3973
3983
3974 /home/fperez/ipython
3984 /home/fperez/ipython
3975 \layout LyX-Code
3985 \layout LyX-Code
3976
3986
3977 In [2]: cd=1 # now cd is just a variable
3987 In [2]: cd=1 # now cd is just a variable
3978 \layout LyX-Code
3988 \layout LyX-Code
3979
3989
3980 In [3]: cd ..
3990 In [3]: cd ..
3981 # and doesn't work as a function anymore
3991 # and doesn't work as a function anymore
3982 \layout LyX-Code
3992 \layout LyX-Code
3983
3993
3984 ------------------------------------------------------------
3994 ------------------------------------------------------------
3985 \layout LyX-Code
3995 \layout LyX-Code
3986
3996
3987 File "<console>", line 1
3997 File "<console>", line 1
3988 \layout LyX-Code
3998 \layout LyX-Code
3989
3999
3990 cd ..
4000 cd ..
3991 \layout LyX-Code
4001 \layout LyX-Code
3992
4002
3993 ^
4003 ^
3994 \layout LyX-Code
4004 \layout LyX-Code
3995
4005
3996 SyntaxError: invalid syntax
4006 SyntaxError: invalid syntax
3997 \layout LyX-Code
4007 \layout LyX-Code
3998
4008
3999 \layout LyX-Code
4009 \layout LyX-Code
4000
4010
4001 In [4]: %cd ..
4011 In [4]: %cd ..
4002 # but %cd always works
4012 # but %cd always works
4003 \layout LyX-Code
4013 \layout LyX-Code
4004
4014
4005 /home/fperez
4015 /home/fperez
4006 \layout LyX-Code
4016 \layout LyX-Code
4007
4017
4008 In [5]: del cd # if you remove the cd variable
4018 In [5]: del cd # if you remove the cd variable
4009 \layout LyX-Code
4019 \layout LyX-Code
4010
4020
4011 In [6]: cd ipython # automagic can work again
4021 In [6]: cd ipython # automagic can work again
4012 \layout LyX-Code
4022 \layout LyX-Code
4013
4023
4014 /home/fperez/ipython
4024 /home/fperez/ipython
4015 \layout Standard
4025 \layout Standard
4016
4026
4017 You can define your own magic functions to extend the system.
4027 You can define your own magic functions to extend the system.
4018 The following is a snippet of code which shows how to do it.
4028 The following is a snippet of code which shows how to do it.
4019 It is provided as file
4029 It is provided as file
4020 \family typewriter
4030 \family typewriter
4021 example-magic.py
4031 example-magic.py
4022 \family default
4032 \family default
4023 in the examples directory:
4033 in the examples directory:
4024 \layout Standard
4034 \layout Standard
4025
4035
4026
4036
4027 \begin_inset ERT
4037 \begin_inset ERT
4028 status Open
4038 status Open
4029
4039
4030 \layout Standard
4040 \layout Standard
4031
4041
4032 \backslash
4042 \backslash
4033 codelist{examples/example-magic.py}
4043 codelist{examples/example-magic.py}
4034 \end_inset
4044 \end_inset
4035
4045
4036
4046
4037 \layout Standard
4047 \layout Standard
4038
4048
4039 You can also define your own aliased names for magic functions.
4049 You can also define your own aliased names for magic functions.
4040 In your
4050 In your
4041 \family typewriter
4051 \family typewriter
4042 ipythonrc
4052 ipythonrc
4043 \family default
4053 \family default
4044 file, placing a line like:
4054 file, placing a line like:
4045 \layout Standard
4055 \layout Standard
4046
4056
4047
4057
4048 \family typewriter
4058 \family typewriter
4049 execute __IP.magic_cl = __IP.magic_clear
4059 execute __IP.magic_cl = __IP.magic_clear
4050 \layout Standard
4060 \layout Standard
4051
4061
4052 will define
4062 will define
4053 \family typewriter
4063 \family typewriter
4054 %cl
4064 %cl
4055 \family default
4065 \family default
4056 as a new name for
4066 as a new name for
4057 \family typewriter
4067 \family typewriter
4058 %clear
4068 %clear
4059 \family default
4069 \family default
4060 .
4070 .
4061 \layout Standard
4071 \layout Standard
4062
4072
4063 Type
4073 Type
4064 \family typewriter
4074 \family typewriter
4065 %magic
4075 %magic
4066 \family default
4076 \family default
4067 for more information, including a list of all available magic functions
4077 for more information, including a list of all available magic functions
4068 at any time and their docstrings.
4078 at any time and their docstrings.
4069 You can also type
4079 You can also type
4070 \family typewriter
4080 \family typewriter
4071 %magic_function_name?
4081 %magic_function_name?
4072 \family default
4082 \family default
4073 (see sec.
4083 (see sec.
4074
4084
4075 \begin_inset LatexCommand \ref{sec:dyn-object-info}
4085 \begin_inset LatexCommand \ref{sec:dyn-object-info}
4076
4086
4077 \end_inset
4087 \end_inset
4078
4088
4079 for information on the
4089 for information on the
4080 \family typewriter
4090 \family typewriter
4081 '?'
4091 '?'
4082 \family default
4092 \family default
4083 system) to get information about any particular magic function you are
4093 system) to get information about any particular magic function you are
4084 interested in.
4094 interested in.
4085 \layout Subsubsection
4095 \layout Subsubsection
4086
4096
4087 Magic commands
4097 Magic commands
4088 \layout Standard
4098 \layout Standard
4089
4099
4090 The rest of this section is automatically generated for each release from
4100 The rest of this section is automatically generated for each release from
4091 the docstrings in the IPython code.
4101 the docstrings in the IPython code.
4092 Therefore the formatting is somewhat minimal, but this method has the advantage
4102 Therefore the formatting is somewhat minimal, but this method has the advantage
4093 of having information always in sync with the code.
4103 of having information always in sync with the code.
4094 \layout Standard
4104 \layout Standard
4095
4105
4096 A list of all the magic commands available in IPython's
4106 A list of all the magic commands available in IPython's
4097 \emph on
4107 \emph on
4098 default
4108 default
4099 \emph default
4109 \emph default
4100 installation follows.
4110 installation follows.
4101 This is similar to what you'll see by simply typing
4111 This is similar to what you'll see by simply typing
4102 \family typewriter
4112 \family typewriter
4103 %magic
4113 %magic
4104 \family default
4114 \family default
4105 at the prompt, but that will also give you information about magic commands
4115 at the prompt, but that will also give you information about magic commands
4106 you may have added as part of your personal customizations.
4116 you may have added as part of your personal customizations.
4107 \layout Standard
4117 \layout Standard
4108
4118
4109
4119
4110 \begin_inset Include \input{magic.tex}
4120 \begin_inset Include \input{magic.tex}
4111 preview false
4121 preview false
4112
4122
4113 \end_inset
4123 \end_inset
4114
4124
4115
4125
4116 \layout Subsection
4126 \layout Subsection
4117
4127
4118 Access to the standard Python help
4128 Access to the standard Python help
4119 \layout Standard
4129 \layout Standard
4120
4130
4121 As of Python 2.1, a help system is available with access to object docstrings
4131 As of Python 2.1, a help system is available with access to object docstrings
4122 and the Python manuals.
4132 and the Python manuals.
4123 Simply type
4133 Simply type
4124 \family typewriter
4134 \family typewriter
4125 'help'
4135 'help'
4126 \family default
4136 \family default
4127 (no quotes) to access it.
4137 (no quotes) to access it.
4128 You can also type
4138 You can also type
4129 \family typewriter
4139 \family typewriter
4130 help(object)
4140 help(object)
4131 \family default
4141 \family default
4132 to obtain information about a given object, and
4142 to obtain information about a given object, and
4133 \family typewriter
4143 \family typewriter
4134 help('keyword')
4144 help('keyword')
4135 \family default
4145 \family default
4136 for information on a keyword.
4146 for information on a keyword.
4137 As noted in sec.
4147 As noted in sec.
4138
4148
4139 \begin_inset LatexCommand \ref{sec:help-access}
4149 \begin_inset LatexCommand \ref{sec:help-access}
4140
4150
4141 \end_inset
4151 \end_inset
4142
4152
4143 , you need to properly configure your environment variable
4153 , you need to properly configure your environment variable
4144 \family typewriter
4154 \family typewriter
4145 PYTHONDOCS
4155 PYTHONDOCS
4146 \family default
4156 \family default
4147 for this feature to work correctly.
4157 for this feature to work correctly.
4148 \layout Subsection
4158 \layout Subsection
4149
4159
4150
4160
4151 \begin_inset LatexCommand \label{sec:dyn-object-info}
4161 \begin_inset LatexCommand \label{sec:dyn-object-info}
4152
4162
4153 \end_inset
4163 \end_inset
4154
4164
4155 Dynamic object information
4165 Dynamic object information
4156 \layout Standard
4166 \layout Standard
4157
4167
4158 Typing
4168 Typing
4159 \family typewriter
4169 \family typewriter
4160 ?word
4170 ?word
4161 \family default
4171 \family default
4162 or
4172 or
4163 \family typewriter
4173 \family typewriter
4164 word?
4174 word?
4165 \family default
4175 \family default
4166 prints detailed information about an object.
4176 prints detailed information about an object.
4167 If certain strings in the object are too long (docstrings, code, etc.) they
4177 If certain strings in the object are too long (docstrings, code, etc.) they
4168 get snipped in the center for brevity.
4178 get snipped in the center for brevity.
4169 This system gives access variable types and values, full source code for
4179 This system gives access variable types and values, full source code for
4170 any object (if available), function prototypes and other useful information.
4180 any object (if available), function prototypes and other useful information.
4171 \layout Standard
4181 \layout Standard
4172
4182
4173 Typing
4183 Typing
4174 \family typewriter
4184 \family typewriter
4175 ??word
4185 ??word
4176 \family default
4186 \family default
4177 or
4187 or
4178 \family typewriter
4188 \family typewriter
4179 word??
4189 word??
4180 \family default
4190 \family default
4181 gives access to the full information without snipping long strings.
4191 gives access to the full information without snipping long strings.
4182 Long strings are sent to the screen through the
4192 Long strings are sent to the screen through the
4183 \family typewriter
4193 \family typewriter
4184 less
4194 less
4185 \family default
4195 \family default
4186 pager if longer than the screen and printed otherwise.
4196 pager if longer than the screen and printed otherwise.
4187 On systems lacking the
4197 On systems lacking the
4188 \family typewriter
4198 \family typewriter
4189 less
4199 less
4190 \family default
4200 \family default
4191 command, IPython uses a very basic internal pager.
4201 command, IPython uses a very basic internal pager.
4192 \layout Standard
4202 \layout Standard
4193
4203
4194 The following magic functions are particularly useful for gathering information
4204 The following magic functions are particularly useful for gathering information
4195 about your working environment.
4205 about your working environment.
4196 You can get more details by typing
4206 You can get more details by typing
4197 \family typewriter
4207 \family typewriter
4198 %magic
4208 %magic
4199 \family default
4209 \family default
4200 or querying them individually (use
4210 or querying them individually (use
4201 \family typewriter
4211 \family typewriter
4202 %function_name?
4212 %function_name?
4203 \family default
4213 \family default
4204 with or without the
4214 with or without the
4205 \family typewriter
4215 \family typewriter
4206 %
4216 %
4207 \family default
4217 \family default
4208 ), this is just a summary:
4218 ), this is just a summary:
4209 \layout List
4219 \layout List
4210 \labelwidthstring 00.00.0000
4220 \labelwidthstring 00.00.0000
4211
4221
4212
4222
4213 \family typewriter
4223 \family typewriter
4214 \series bold
4224 \series bold
4215 %pdoc\SpecialChar ~
4225 %pdoc\SpecialChar ~
4216 <object>
4226 <object>
4217 \family default
4227 \family default
4218 \series default
4228 \series default
4219 : Print (or run through a pager if too long) the docstring for an object.
4229 : Print (or run through a pager if too long) the docstring for an object.
4220 If the given object is a class, it will print both the class and the constructo
4230 If the given object is a class, it will print both the class and the constructo
4221 r docstrings.
4231 r docstrings.
4222 \layout List
4232 \layout List
4223 \labelwidthstring 00.00.0000
4233 \labelwidthstring 00.00.0000
4224
4234
4225
4235
4226 \family typewriter
4236 \family typewriter
4227 \series bold
4237 \series bold
4228 %pdef\SpecialChar ~
4238 %pdef\SpecialChar ~
4229 <object>
4239 <object>
4230 \family default
4240 \family default
4231 \series default
4241 \series default
4232 : Print the definition header for any callable object.
4242 : Print the definition header for any callable object.
4233 If the object is a class, print the constructor information.
4243 If the object is a class, print the constructor information.
4234 \layout List
4244 \layout List
4235 \labelwidthstring 00.00.0000
4245 \labelwidthstring 00.00.0000
4236
4246
4237
4247
4238 \family typewriter
4248 \family typewriter
4239 \series bold
4249 \series bold
4240 %psource\SpecialChar ~
4250 %psource\SpecialChar ~
4241 <object>
4251 <object>
4242 \family default
4252 \family default
4243 \series default
4253 \series default
4244 : Print (or run through a pager if too long) the source code for an object.
4254 : Print (or run through a pager if too long) the source code for an object.
4245 \layout List
4255 \layout List
4246 \labelwidthstring 00.00.0000
4256 \labelwidthstring 00.00.0000
4247
4257
4248
4258
4249 \family typewriter
4259 \family typewriter
4250 \series bold
4260 \series bold
4251 %pfile\SpecialChar ~
4261 %pfile\SpecialChar ~
4252 <object>
4262 <object>
4253 \family default
4263 \family default
4254 \series default
4264 \series default
4255 : Show the entire source file where an object was defined via a pager, opening
4265 : Show the entire source file where an object was defined via a pager, opening
4256 it at the line where the object definition begins.
4266 it at the line where the object definition begins.
4257 \layout List
4267 \layout List
4258 \labelwidthstring 00.00.0000
4268 \labelwidthstring 00.00.0000
4259
4269
4260
4270
4261 \family typewriter
4271 \family typewriter
4262 \series bold
4272 \series bold
4263 %who/%whos
4273 %who/%whos
4264 \family default
4274 \family default
4265 \series default
4275 \series default
4266 : These functions give information about identifiers you have defined interactiv
4276 : These functions give information about identifiers you have defined interactiv
4267 ely (not things you loaded or defined in your configuration files).
4277 ely (not things you loaded or defined in your configuration files).
4268
4278
4269 \family typewriter
4279 \family typewriter
4270 %who
4280 %who
4271 \family default
4281 \family default
4272 just prints a list of identifiers and
4282 just prints a list of identifiers and
4273 \family typewriter
4283 \family typewriter
4274 %whos
4284 %whos
4275 \family default
4285 \family default
4276 prints a table with some basic details about each identifier.
4286 prints a table with some basic details about each identifier.
4277 \layout Standard
4287 \layout Standard
4278
4288
4279 Note that the dynamic object information functions (
4289 Note that the dynamic object information functions (
4280 \family typewriter
4290 \family typewriter
4281 ?/??, %pdoc, %pfile, %pdef, %psource
4291 ?/??, %pdoc, %pfile, %pdef, %psource
4282 \family default
4292 \family default
4283 ) give you access to documentation even on things which are not really defined
4293 ) give you access to documentation even on things which are not really defined
4284 as separate identifiers.
4294 as separate identifiers.
4285 Try for example typing
4295 Try for example typing
4286 \family typewriter
4296 \family typewriter
4287 {}.get?
4297 {}.get?
4288 \family default
4298 \family default
4289 or after doing
4299 or after doing
4290 \family typewriter
4300 \family typewriter
4291 import os
4301 import os
4292 \family default
4302 \family default
4293 , type
4303 , type
4294 \family typewriter
4304 \family typewriter
4295 os.path.abspath??
4305 os.path.abspath??
4296 \family default
4306 \family default
4297 .
4307 .
4298 \layout Subsection
4308 \layout Subsection
4299
4309
4300
4310
4301 \begin_inset LatexCommand \label{sec:readline}
4311 \begin_inset LatexCommand \label{sec:readline}
4302
4312
4303 \end_inset
4313 \end_inset
4304
4314
4305 Readline-based features
4315 Readline-based features
4306 \layout Standard
4316 \layout Standard
4307
4317
4308 These features require the GNU readline library, so they won't work if your
4318 These features require the GNU readline library, so they won't work if your
4309 Python installation lacks readline support.
4319 Python installation lacks readline support.
4310 We will first describe the default behavior IPython uses, and then how
4320 We will first describe the default behavior IPython uses, and then how
4311 to change it to suit your preferences.
4321 to change it to suit your preferences.
4312 \layout Subsubsection
4322 \layout Subsubsection
4313
4323
4314 Command line completion
4324 Command line completion
4315 \layout Standard
4325 \layout Standard
4316
4326
4317 At any time, hitting TAB will complete any available python commands or
4327 At any time, hitting TAB will complete any available python commands or
4318 variable names, and show you a list of the possible completions if there's
4328 variable names, and show you a list of the possible completions if there's
4319 no unambiguous one.
4329 no unambiguous one.
4320 It will also complete filenames in the current directory if no python names
4330 It will also complete filenames in the current directory if no python names
4321 match what you've typed so far.
4331 match what you've typed so far.
4322 \layout Subsubsection
4332 \layout Subsubsection
4323
4333
4324 Search command history
4334 Search command history
4325 \layout Standard
4335 \layout Standard
4326
4336
4327 IPython provides two ways for searching through previous input and thus
4337 IPython provides two ways for searching through previous input and thus
4328 reduce the need for repetitive typing:
4338 reduce the need for repetitive typing:
4329 \layout Enumerate
4339 \layout Enumerate
4330
4340
4331 Start typing, and then use
4341 Start typing, and then use
4332 \family typewriter
4342 \family typewriter
4333 Ctrl-p
4343 Ctrl-p
4334 \family default
4344 \family default
4335 (previous,up) and
4345 (previous,up) and
4336 \family typewriter
4346 \family typewriter
4337 Ctrl-n
4347 Ctrl-n
4338 \family default
4348 \family default
4339 (next,down) to search through only the history items that match what you've
4349 (next,down) to search through only the history items that match what you've
4340 typed so far.
4350 typed so far.
4341 If you use
4351 If you use
4342 \family typewriter
4352 \family typewriter
4343 Ctrl-p/Ctrl-n
4353 Ctrl-p/Ctrl-n
4344 \family default
4354 \family default
4345 at a blank prompt, they just behave like normal arrow keys.
4355 at a blank prompt, they just behave like normal arrow keys.
4346 \layout Enumerate
4356 \layout Enumerate
4347
4357
4348 Hit
4358 Hit
4349 \family typewriter
4359 \family typewriter
4350 Ctrl-r
4360 Ctrl-r
4351 \family default
4361 \family default
4352 : opens a search prompt.
4362 : opens a search prompt.
4353 Begin typing and the system searches your history for lines that contain
4363 Begin typing and the system searches your history for lines that contain
4354 what you've typed so far, completing as much as it can.
4364 what you've typed so far, completing as much as it can.
4355 \layout Subsubsection
4365 \layout Subsubsection
4356
4366
4357 Persistent command history across sessions
4367 Persistent command history across sessions
4358 \layout Standard
4368 \layout Standard
4359
4369
4360 IPython will save your input history when it leaves and reload it next time
4370 IPython will save your input history when it leaves and reload it next time
4361 you restart it.
4371 you restart it.
4362 By default, the history file is named
4372 By default, the history file is named
4363 \family typewriter
4373 \family typewriter
4364 $IPYTHONDIR/history
4374 $IPYTHONDIR/history
4365 \family default
4375 \family default
4366 , but if you've loaded a named profile, '
4376 , but if you've loaded a named profile, '
4367 \family typewriter
4377 \family typewriter
4368 -PROFILE_NAME
4378 -PROFILE_NAME
4369 \family default
4379 \family default
4370 ' is appended to the name.
4380 ' is appended to the name.
4371 This allows you to keep separate histories related to various tasks: commands
4381 This allows you to keep separate histories related to various tasks: commands
4372 related to numerical work will not be clobbered by a system shell history,
4382 related to numerical work will not be clobbered by a system shell history,
4373 for example.
4383 for example.
4374 \layout Subsubsection
4384 \layout Subsubsection
4375
4385
4376 Autoindent
4386 Autoindent
4377 \layout Standard
4387 \layout Standard
4378
4388
4379 IPython can recognize lines ending in ':' and indent the next line, while
4389 IPython can recognize lines ending in ':' and indent the next line, while
4380 also un-indenting automatically after 'raise' or 'return'.
4390 also un-indenting automatically after 'raise' or 'return'.
4381
4391
4382 \layout Standard
4392 \layout Standard
4383
4393
4384 This feature uses the readline library, so it will honor your
4394 This feature uses the readline library, so it will honor your
4385 \family typewriter
4395 \family typewriter
4386 ~/.inputrc
4396 ~/.inputrc
4387 \family default
4397 \family default
4388 configuration (or whatever file your
4398 configuration (or whatever file your
4389 \family typewriter
4399 \family typewriter
4390 INPUTRC
4400 INPUTRC
4391 \family default
4401 \family default
4392 variable points to).
4402 variable points to).
4393 Adding the following lines to your
4403 Adding the following lines to your
4394 \family typewriter
4404 \family typewriter
4395 .inputrc
4405 .inputrc
4396 \family default
4406 \family default
4397 file can make indenting/unindenting more convenient (
4407 file can make indenting/unindenting more convenient (
4398 \family typewriter
4408 \family typewriter
4399 M-i
4409 M-i
4400 \family default
4410 \family default
4401 indents,
4411 indents,
4402 \family typewriter
4412 \family typewriter
4403 M-u
4413 M-u
4404 \family default
4414 \family default
4405 unindents):
4415 unindents):
4406 \layout Standard
4416 \layout Standard
4407
4417
4408
4418
4409 \family typewriter
4419 \family typewriter
4410 $if Python
4420 $if Python
4411 \newline
4421 \newline
4412 "
4422 "
4413 \backslash
4423 \backslash
4414 M-i": "\SpecialChar ~
4424 M-i": "\SpecialChar ~
4415 \SpecialChar ~
4425 \SpecialChar ~
4416 \SpecialChar ~
4426 \SpecialChar ~
4417 \SpecialChar ~
4427 \SpecialChar ~
4418 "
4428 "
4419 \newline
4429 \newline
4420 "
4430 "
4421 \backslash
4431 \backslash
4422 M-u": "
4432 M-u": "
4423 \backslash
4433 \backslash
4424 d
4434 d
4425 \backslash
4435 \backslash
4426 d
4436 d
4427 \backslash
4437 \backslash
4428 d
4438 d
4429 \backslash
4439 \backslash
4430 d"
4440 d"
4431 \newline
4441 \newline
4432 $endif
4442 $endif
4433 \layout Standard
4443 \layout Standard
4434
4444
4435 Note that there are 4 spaces between the quote marks after
4445 Note that there are 4 spaces between the quote marks after
4436 \family typewriter
4446 \family typewriter
4437 "M-i"
4447 "M-i"
4438 \family default
4448 \family default
4439 above.
4449 above.
4440 \layout Standard
4450 \layout Standard
4441
4451
4442
4452
4443 \series bold
4453 \series bold
4444 Warning:
4454 Warning:
4445 \series default
4455 \series default
4446 this feature is ON by default, but it can cause problems with the pasting
4456 this feature is ON by default, but it can cause problems with the pasting
4447 of multi-line indented code (the pasted code gets re-indented on each line).
4457 of multi-line indented code (the pasted code gets re-indented on each line).
4448 A magic function
4458 A magic function
4449 \family typewriter
4459 \family typewriter
4450 %autoindent
4460 %autoindent
4451 \family default
4461 \family default
4452 allows you to toggle it on/off at runtime.
4462 allows you to toggle it on/off at runtime.
4453 You can also disable it permanently on in your
4463 You can also disable it permanently on in your
4454 \family typewriter
4464 \family typewriter
4455 ipythonrc
4465 ipythonrc
4456 \family default
4466 \family default
4457 file (set
4467 file (set
4458 \family typewriter
4468 \family typewriter
4459 autoindent 0
4469 autoindent 0
4460 \family default
4470 \family default
4461 ).
4471 ).
4462 \layout Subsubsection
4472 \layout Subsubsection
4463
4473
4464 Customizing readline behavior
4474 Customizing readline behavior
4465 \layout Standard
4475 \layout Standard
4466
4476
4467 All these features are based on the GNU readline library, which has an extremely
4477 All these features are based on the GNU readline library, which has an extremely
4468 customizable interface.
4478 customizable interface.
4469 Normally, readline is configured via a file which defines the behavior
4479 Normally, readline is configured via a file which defines the behavior
4470 of the library; the details of the syntax for this can be found in the
4480 of the library; the details of the syntax for this can be found in the
4471 readline documentation available with your system or on the Internet.
4481 readline documentation available with your system or on the Internet.
4472 IPython doesn't read this file (if it exists) directly, but it does support
4482 IPython doesn't read this file (if it exists) directly, but it does support
4473 passing to readline valid options via a simple interface.
4483 passing to readline valid options via a simple interface.
4474 In brief, you can customize readline by setting the following options in
4484 In brief, you can customize readline by setting the following options in
4475 your
4485 your
4476 \family typewriter
4486 \family typewriter
4477 ipythonrc
4487 ipythonrc
4478 \family default
4488 \family default
4479 configuration file (note that these options can
4489 configuration file (note that these options can
4480 \emph on
4490 \emph on
4481 not
4491 not
4482 \emph default
4492 \emph default
4483 be specified at the command line):
4493 be specified at the command line):
4484 \layout List
4494 \layout List
4485 \labelwidthstring 00.00.0000
4495 \labelwidthstring 00.00.0000
4486
4496
4487
4497
4488 \family typewriter
4498 \family typewriter
4489 \series bold
4499 \series bold
4490 readline_parse_and_bind:
4500 readline_parse_and_bind:
4491 \family default
4501 \family default
4492 \series default
4502 \series default
4493 this option can appear as many times as you want, each time defining a
4503 this option can appear as many times as you want, each time defining a
4494 string to be executed via a
4504 string to be executed via a
4495 \family typewriter
4505 \family typewriter
4496 readline.parse_and_bind()
4506 readline.parse_and_bind()
4497 \family default
4507 \family default
4498 command.
4508 command.
4499 The syntax for valid commands of this kind can be found by reading the
4509 The syntax for valid commands of this kind can be found by reading the
4500 documentation for the GNU readline library, as these commands are of the
4510 documentation for the GNU readline library, as these commands are of the
4501 kind which readline accepts in its configuration file.
4511 kind which readline accepts in its configuration file.
4502 \layout List
4512 \layout List
4503 \labelwidthstring 00.00.0000
4513 \labelwidthstring 00.00.0000
4504
4514
4505
4515
4506 \family typewriter
4516 \family typewriter
4507 \series bold
4517 \series bold
4508 readline_remove_delims:
4518 readline_remove_delims:
4509 \family default
4519 \family default
4510 \series default
4520 \series default
4511 a string of characters to be removed from the default word-delimiters list
4521 a string of characters to be removed from the default word-delimiters list
4512 used by readline, so that completions may be performed on strings which
4522 used by readline, so that completions may be performed on strings which
4513 contain them.
4523 contain them.
4514 Do not change the default value unless you know what you're doing.
4524 Do not change the default value unless you know what you're doing.
4515 \layout List
4525 \layout List
4516 \labelwidthstring 00.00.0000
4526 \labelwidthstring 00.00.0000
4517
4527
4518
4528
4519 \family typewriter
4529 \family typewriter
4520 \series bold
4530 \series bold
4521 readline_omit__names
4531 readline_omit__names
4522 \family default
4532 \family default
4523 \series default
4533 \series default
4524 : when tab-completion is enabled, hitting
4534 : when tab-completion is enabled, hitting
4525 \family typewriter
4535 \family typewriter
4526 <tab>
4536 <tab>
4527 \family default
4537 \family default
4528 after a '
4538 after a '
4529 \family typewriter
4539 \family typewriter
4530 .
4540 .
4531 \family default
4541 \family default
4532 ' in a name will complete all attributes of an object, including all the
4542 ' in a name will complete all attributes of an object, including all the
4533 special methods whose names include double underscores (like
4543 special methods whose names include double underscores (like
4534 \family typewriter
4544 \family typewriter
4535 __getitem__
4545 __getitem__
4536 \family default
4546 \family default
4537 or
4547 or
4538 \family typewriter
4548 \family typewriter
4539 __class__
4549 __class__
4540 \family default
4550 \family default
4541 ).
4551 ).
4542 If you'd rather not see these names by default, you can set this option
4552 If you'd rather not see these names by default, you can set this option
4543 to 1.
4553 to 1.
4544 Note that even when this option is set, you can still see those names by
4554 Note that even when this option is set, you can still see those names by
4545 explicitly typing a
4555 explicitly typing a
4546 \family typewriter
4556 \family typewriter
4547 _
4557 _
4548 \family default
4558 \family default
4549 after the period and hitting
4559 after the period and hitting
4550 \family typewriter
4560 \family typewriter
4551 <tab>
4561 <tab>
4552 \family default
4562 \family default
4553 : '
4563 : '
4554 \family typewriter
4564 \family typewriter
4555 name._<tab>
4565 name._<tab>
4556 \family default
4566 \family default
4557 ' will always complete attribute names starting with '
4567 ' will always complete attribute names starting with '
4558 \family typewriter
4568 \family typewriter
4559 _
4569 _
4560 \family default
4570 \family default
4561 '.
4571 '.
4562 \layout List
4572 \layout List
4563 \labelwidthstring 00.00.0000
4573 \labelwidthstring 00.00.0000
4564
4574
4565 \SpecialChar ~
4575 \SpecialChar ~
4566 This option is off by default so that new users see all attributes of any
4576 This option is off by default so that new users see all attributes of any
4567 objects they are dealing with.
4577 objects they are dealing with.
4568 \layout Standard
4578 \layout Standard
4569
4579
4570 You will find the default values along with a corresponding detailed explanation
4580 You will find the default values along with a corresponding detailed explanation
4571 in your
4581 in your
4572 \family typewriter
4582 \family typewriter
4573 ipythonrc
4583 ipythonrc
4574 \family default
4584 \family default
4575 file.
4585 file.
4576 \layout Subsection
4586 \layout Subsection
4577
4587
4578 Session logging and restoring
4588 Session logging and restoring
4579 \layout Standard
4589 \layout Standard
4580
4590
4581 You can log all input from a session either by starting IPython with the
4591 You can log all input from a session either by starting IPython with the
4582 command line switches
4592 command line switches
4583 \family typewriter
4593 \family typewriter
4584 -log
4594 -log
4585 \family default
4595 \family default
4586 or
4596 or
4587 \family typewriter
4597 \family typewriter
4588 -logfile
4598 -logfile
4589 \family default
4599 \family default
4590 (see sec.
4600 (see sec.
4591
4601
4592 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
4602 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
4593
4603
4594 \end_inset
4604 \end_inset
4595
4605
4596 )or by activating the logging at any moment with the magic function
4606 )or by activating the logging at any moment with the magic function
4597 \family typewriter
4607 \family typewriter
4598 %logstart
4608 %logstart
4599 \family default
4609 \family default
4600 .
4610 .
4601
4611
4602 \layout Standard
4612 \layout Standard
4603
4613
4604 Log files can later be reloaded with the
4614 Log files can later be reloaded with the
4605 \family typewriter
4615 \family typewriter
4606 -logplay
4616 -logplay
4607 \family default
4617 \family default
4608 option and IPython will attempt to 'replay' the log by executing all the
4618 option and IPython will attempt to 'replay' the log by executing all the
4609 lines in it, thus restoring the state of a previous session.
4619 lines in it, thus restoring the state of a previous session.
4610 This feature is not quite perfect, but can still be useful in many cases.
4620 This feature is not quite perfect, but can still be useful in many cases.
4611 \layout Standard
4621 \layout Standard
4612
4622
4613 The log files can also be used as a way to have a permanent record of any
4623 The log files can also be used as a way to have a permanent record of any
4614 code you wrote while experimenting.
4624 code you wrote while experimenting.
4615 Log files are regular text files which you can later open in your favorite
4625 Log files are regular text files which you can later open in your favorite
4616 text editor to extract code or to 'clean them up' before using them to
4626 text editor to extract code or to 'clean them up' before using them to
4617 replay a session.
4627 replay a session.
4618 \layout Standard
4628 \layout Standard
4619
4629
4620 The
4630 The
4621 \family typewriter
4631 \family typewriter
4622 %logstart
4632 %logstart
4623 \family default
4633 \family default
4624 function for activating logging in mid-session is used as follows:
4634 function for activating logging in mid-session is used as follows:
4625 \layout Standard
4635 \layout Standard
4626
4636
4627
4637
4628 \family typewriter
4638 \family typewriter
4629 %logstart [log_name [log_mode]]
4639 %logstart [log_name [log_mode]]
4630 \layout Standard
4640 \layout Standard
4631
4641
4632 If no name is given, it defaults to a file named
4642 If no name is given, it defaults to a file named
4633 \family typewriter
4643 \family typewriter
4634 'log'
4644 'log'
4635 \family default
4645 \family default
4636 in your IPYTHONDIR directory, in
4646 in your IPYTHONDIR directory, in
4637 \family typewriter
4647 \family typewriter
4638 'rotate'
4648 'rotate'
4639 \family default
4649 \family default
4640 mode (see below).
4650 mode (see below).
4641 \layout Standard
4651 \layout Standard
4642
4652
4643 '
4653 '
4644 \family typewriter
4654 \family typewriter
4645 %logstart name
4655 %logstart name
4646 \family default
4656 \family default
4647 ' saves to file
4657 ' saves to file
4648 \family typewriter
4658 \family typewriter
4649 'name'
4659 'name'
4650 \family default
4660 \family default
4651 in
4661 in
4652 \family typewriter
4662 \family typewriter
4653 'backup'
4663 'backup'
4654 \family default
4664 \family default
4655 mode.
4665 mode.
4656 It saves your history up to that point and then continues logging.
4666 It saves your history up to that point and then continues logging.
4657 \layout Standard
4667 \layout Standard
4658
4668
4659
4669
4660 \family typewriter
4670 \family typewriter
4661 %logstart
4671 %logstart
4662 \family default
4672 \family default
4663 takes a second optional parameter: logging mode.
4673 takes a second optional parameter: logging mode.
4664 This can be one of (note that the modes are given unquoted):
4674 This can be one of (note that the modes are given unquoted):
4665 \layout List
4675 \layout List
4666 \labelwidthstring 00.00.0000
4676 \labelwidthstring 00.00.0000
4667
4677
4668
4678
4669 \family typewriter
4679 \family typewriter
4670 over
4680 over
4671 \family default
4681 \family default
4672 : overwrite existing
4682 : overwrite existing
4673 \family typewriter
4683 \family typewriter
4674 log_name
4684 log_name
4675 \family default
4685 \family default
4676 .
4686 .
4677 \layout List
4687 \layout List
4678 \labelwidthstring 00.00.0000
4688 \labelwidthstring 00.00.0000
4679
4689
4680
4690
4681 \family typewriter
4691 \family typewriter
4682 backup
4692 backup
4683 \family default
4693 \family default
4684 : rename (if exists) to
4694 : rename (if exists) to
4685 \family typewriter
4695 \family typewriter
4686 log_name~
4696 log_name~
4687 \family default
4697 \family default
4688 and start
4698 and start
4689 \family typewriter
4699 \family typewriter
4690 log_name
4700 log_name
4691 \family default
4701 \family default
4692 .
4702 .
4693 \layout List
4703 \layout List
4694 \labelwidthstring 00.00.0000
4704 \labelwidthstring 00.00.0000
4695
4705
4696
4706
4697 \family typewriter
4707 \family typewriter
4698 append
4708 append
4699 \family default
4709 \family default
4700 : well, that says it.
4710 : well, that says it.
4701 \layout List
4711 \layout List
4702 \labelwidthstring 00.00.0000
4712 \labelwidthstring 00.00.0000
4703
4713
4704
4714
4705 \family typewriter
4715 \family typewriter
4706 rotate
4716 rotate
4707 \family default
4717 \family default
4708 : create rotating logs
4718 : create rotating logs
4709 \family typewriter
4719 \family typewriter
4710 log_name
4720 log_name
4711 \family default
4721 \family default
4712 .
4722 .
4713 \family typewriter
4723 \family typewriter
4714 1~
4724 1~
4715 \family default
4725 \family default
4716 ,
4726 ,
4717 \family typewriter
4727 \family typewriter
4718 log_name.2~
4728 log_name.2~
4719 \family default
4729 \family default
4720 , etc.
4730 , etc.
4721 \layout Standard
4731 \layout Standard
4722
4732
4723 The
4733 The
4724 \family typewriter
4734 \family typewriter
4725 %logoff
4735 %logoff
4726 \family default
4736 \family default
4727 and
4737 and
4728 \family typewriter
4738 \family typewriter
4729 %logon
4739 %logon
4730 \family default
4740 \family default
4731 functions allow you to temporarily stop and resume logging to a file which
4741 functions allow you to temporarily stop and resume logging to a file which
4732 had previously been started with
4742 had previously been started with
4733 \family typewriter
4743 \family typewriter
4734 %logstart
4744 %logstart
4735 \family default
4745 \family default
4736 .
4746 .
4737 They will fail (with an explanation) if you try to use them before logging
4747 They will fail (with an explanation) if you try to use them before logging
4738 has been started.
4748 has been started.
4739 \layout Subsection
4749 \layout Subsection
4740
4750
4741
4751
4742 \begin_inset LatexCommand \label{sub:System-shell-access}
4752 \begin_inset LatexCommand \label{sub:System-shell-access}
4743
4753
4744 \end_inset
4754 \end_inset
4745
4755
4746 System shell access
4756 System shell access
4747 \layout Standard
4757 \layout Standard
4748
4758
4749 Any input line beginning with a
4759 Any input line beginning with a
4750 \family typewriter
4760 \family typewriter
4751 !
4761 !
4752 \family default
4762 \family default
4753 character is passed verbatim (minus the
4763 character is passed verbatim (minus the
4754 \family typewriter
4764 \family typewriter
4755 !
4765 !
4756 \family default
4766 \family default
4757 , of course) to the underlying operating system.
4767 , of course) to the underlying operating system.
4758 For example, typing
4768 For example, typing
4759 \family typewriter
4769 \family typewriter
4760 !ls
4770 !ls
4761 \family default
4771 \family default
4762 will run
4772 will run
4763 \family typewriter
4773 \family typewriter
4764 'ls'
4774 'ls'
4765 \family default
4775 \family default
4766 in the current directory.
4776 in the current directory.
4767 \layout Subsubsection
4777 \layout Subsubsection
4768
4778
4769 Manual capture of command output
4779 Manual capture of command output
4770 \layout Standard
4780 \layout Standard
4771
4781
4772 If the input line begins with
4782 If the input line begins with
4773 \emph on
4783 \emph on
4774 two
4784 two
4775 \emph default
4785 \emph default
4776 exclamation marks,
4786 exclamation marks,
4777 \family typewriter
4787 \family typewriter
4778 !!
4788 !!
4779 \family default
4789 \family default
4780 , the command is executed but its output is captured and returned as a python
4790 , the command is executed but its output is captured and returned as a python
4781 list, split on newlines.
4791 list, split on newlines.
4782 Any output sent by the subprocess to standard error is printed separately,
4792 Any output sent by the subprocess to standard error is printed separately,
4783 so that the resulting list only captures standard output.
4793 so that the resulting list only captures standard output.
4784 The
4794 The
4785 \family typewriter
4795 \family typewriter
4786 !!
4796 !!
4787 \family default
4797 \family default
4788 syntax is a shorthand for the
4798 syntax is a shorthand for the
4789 \family typewriter
4799 \family typewriter
4790 %sx
4800 %sx
4791 \family default
4801 \family default
4792 magic command.
4802 magic command.
4793 \layout Standard
4803 \layout Standard
4794
4804
4795 Finally, the
4805 Finally, the
4796 \family typewriter
4806 \family typewriter
4797 %sc
4807 %sc
4798 \family default
4808 \family default
4799 magic (short for `shell capture') is similar to
4809 magic (short for `shell capture') is similar to
4800 \family typewriter
4810 \family typewriter
4801 %sx
4811 %sx
4802 \family default
4812 \family default
4803 , but allowing more fine-grained control of the capture details, and storing
4813 , but allowing more fine-grained control of the capture details, and storing
4804 the result directly into a named variable.
4814 the result directly into a named variable.
4805 \layout Standard
4815 \layout Standard
4806
4816
4807 See Sec.\SpecialChar ~
4817 See Sec.\SpecialChar ~
4808
4818
4809 \begin_inset LatexCommand \ref{sec:magic}
4819 \begin_inset LatexCommand \ref{sec:magic}
4810
4820
4811 \end_inset
4821 \end_inset
4812
4822
4813 for details on the magics
4823 for details on the magics
4814 \family typewriter
4824 \family typewriter
4815 %sc
4825 %sc
4816 \family default
4826 \family default
4817 and
4827 and
4818 \family typewriter
4828 \family typewriter
4819 %sx
4829 %sx
4820 \family default
4830 \family default
4821 , or use IPython's own help (
4831 , or use IPython's own help (
4822 \family typewriter
4832 \family typewriter
4823 sc?
4833 sc?
4824 \family default
4834 \family default
4825 and
4835 and
4826 \family typewriter
4836 \family typewriter
4827 sx?
4837 sx?
4828 \family default
4838 \family default
4829 ) for further details.
4839 ) for further details.
4830 \layout Standard
4840 \layout Standard
4831
4841
4832 IPython also allows you to expand the value of python variables when making
4842 IPython also allows you to expand the value of python variables when making
4833 system calls.
4843 system calls.
4834 Any python variable or expression which you prepend with
4844 Any python variable or expression which you prepend with
4835 \family typewriter
4845 \family typewriter
4836 $
4846 $
4837 \family default
4847 \family default
4838 will get expanded before the system call is made.
4848 will get expanded before the system call is made.
4839
4849
4840 \layout Standard
4850 \layout Standard
4841
4851
4842
4852
4843 \family typewriter
4853 \family typewriter
4844 In [1]: pyvar='Hello world'
4854 In [1]: pyvar='Hello world'
4845 \newline
4855 \newline
4846 In [2]: !echo "A python variable: $pyvar"
4856 In [2]: !echo "A python variable: $pyvar"
4847 \newline
4857 \newline
4848 A python variable: Hello world
4858 A python variable: Hello world
4849 \layout Standard
4859 \layout Standard
4850
4860
4851 If you want the shell to actually see a literal
4861 If you want the shell to actually see a literal
4852 \family typewriter
4862 \family typewriter
4853 $
4863 $
4854 \family default
4864 \family default
4855 , you need to type it twice:
4865 , you need to type it twice:
4856 \layout Standard
4866 \layout Standard
4857
4867
4858
4868
4859 \family typewriter
4869 \family typewriter
4860 In [3]: !echo "A system variable: $$HOME"
4870 In [3]: !echo "A system variable: $$HOME"
4861 \newline
4871 \newline
4862 A system variable: /home/fperez
4872 A system variable: /home/fperez
4863 \layout Standard
4873 \layout Standard
4864
4874
4865 You can pass arbitrary expressions, though you'll need to delimit them with
4875 You can pass arbitrary expressions, though you'll need to delimit them with
4866
4876
4867 \family typewriter
4877 \family typewriter
4868 {}
4878 {}
4869 \family default
4879 \family default
4870 if there is ambiguity as to the extent of the expression:
4880 if there is ambiguity as to the extent of the expression:
4871 \layout Standard
4881 \layout Standard
4872
4882
4873
4883
4874 \family typewriter
4884 \family typewriter
4875 In [5]: x=10
4885 In [5]: x=10
4876 \newline
4886 \newline
4877 In [6]: y=20
4887 In [6]: y=20
4878 \newline
4888 \newline
4879 In [13]: !echo $x+y
4889 In [13]: !echo $x+y
4880 \newline
4890 \newline
4881 10+y
4891 10+y
4882 \newline
4892 \newline
4883 In [7]: !echo ${x+y}
4893 In [7]: !echo ${x+y}
4884 \newline
4894 \newline
4885 30
4895 30
4886 \layout Standard
4896 \layout Standard
4887
4897
4888 Even object attributes can be expanded:
4898 Even object attributes can be expanded:
4889 \layout Standard
4899 \layout Standard
4890
4900
4891
4901
4892 \family typewriter
4902 \family typewriter
4893 In [12]: !echo $sys.argv
4903 In [12]: !echo $sys.argv
4894 \newline
4904 \newline
4895 [/home/fperez/usr/bin/ipython]
4905 [/home/fperez/usr/bin/ipython]
4896 \layout Subsection
4906 \layout Subsection
4897
4907
4898 System command aliases
4908 System command aliases
4899 \layout Standard
4909 \layout Standard
4900
4910
4901 The
4911 The
4902 \family typewriter
4912 \family typewriter
4903 %alias
4913 %alias
4904 \family default
4914 \family default
4905 magic function and the
4915 magic function and the
4906 \family typewriter
4916 \family typewriter
4907 alias
4917 alias
4908 \family default
4918 \family default
4909 option in the
4919 option in the
4910 \family typewriter
4920 \family typewriter
4911 ipythonrc
4921 ipythonrc
4912 \family default
4922 \family default
4913 configuration file allow you to define magic functions which are in fact
4923 configuration file allow you to define magic functions which are in fact
4914 system shell commands.
4924 system shell commands.
4915 These aliases can have parameters.
4925 These aliases can have parameters.
4916
4926
4917 \layout Standard
4927 \layout Standard
4918
4928
4919 '
4929 '
4920 \family typewriter
4930 \family typewriter
4921 %alias alias_name cmd
4931 %alias alias_name cmd
4922 \family default
4932 \family default
4923 ' defines '
4933 ' defines '
4924 \family typewriter
4934 \family typewriter
4925 alias_name
4935 alias_name
4926 \family default
4936 \family default
4927 ' as an alias for '
4937 ' as an alias for '
4928 \family typewriter
4938 \family typewriter
4929 cmd
4939 cmd
4930 \family default
4940 \family default
4931 '
4941 '
4932 \layout Standard
4942 \layout Standard
4933
4943
4934 Then, typing '
4944 Then, typing '
4935 \family typewriter
4945 \family typewriter
4936 %alias_name params
4946 %alias_name params
4937 \family default
4947 \family default
4938 ' will execute the system command '
4948 ' will execute the system command '
4939 \family typewriter
4949 \family typewriter
4940 cmd params
4950 cmd params
4941 \family default
4951 \family default
4942 ' (from your underlying operating system).
4952 ' (from your underlying operating system).
4943
4953
4944 \layout Standard
4954 \layout Standard
4945
4955
4946 You can also define aliases with parameters using
4956 You can also define aliases with parameters using
4947 \family typewriter
4957 \family typewriter
4948 %s
4958 %s
4949 \family default
4959 \family default
4950 specifiers (one per parameter).
4960 specifiers (one per parameter).
4951 The following example defines the
4961 The following example defines the
4952 \family typewriter
4962 \family typewriter
4953 %parts
4963 %parts
4954 \family default
4964 \family default
4955 function as an alias to the command '
4965 function as an alias to the command '
4956 \family typewriter
4966 \family typewriter
4957 echo first %s second %s
4967 echo first %s second %s
4958 \family default
4968 \family default
4959 ' where each
4969 ' where each
4960 \family typewriter
4970 \family typewriter
4961 %s
4971 %s
4962 \family default
4972 \family default
4963 will be replaced by a positional parameter to the call to
4973 will be replaced by a positional parameter to the call to
4964 \family typewriter
4974 \family typewriter
4965 %parts:
4975 %parts:
4966 \layout Standard
4976 \layout Standard
4967
4977
4968
4978
4969 \family typewriter
4979 \family typewriter
4970 In [1]: alias parts echo first %s second %s
4980 In [1]: alias parts echo first %s second %s
4971 \newline
4981 \newline
4972 In [2]: %parts A B
4982 In [2]: %parts A B
4973 \newline
4983 \newline
4974 first A second B
4984 first A second B
4975 \newline
4985 \newline
4976 In [3]: %parts A
4986 In [3]: %parts A
4977 \newline
4987 \newline
4978 Incorrect number of arguments: 2 expected.
4988 Incorrect number of arguments: 2 expected.
4979
4989
4980 \newline
4990 \newline
4981 parts is an alias to: 'echo first %s second %s'
4991 parts is an alias to: 'echo first %s second %s'
4982 \layout Standard
4992 \layout Standard
4983
4993
4984 If called with no parameters,
4994 If called with no parameters,
4985 \family typewriter
4995 \family typewriter
4986 %alias
4996 %alias
4987 \family default
4997 \family default
4988 prints the table of currently defined aliases.
4998 prints the table of currently defined aliases.
4989 \layout Standard
4999 \layout Standard
4990
5000
4991 The
5001 The
4992 \family typewriter
5002 \family typewriter
4993 %rehash/rehashx
5003 %rehash/rehashx
4994 \family default
5004 \family default
4995 magics allow you to load your entire
5005 magics allow you to load your entire
4996 \family typewriter
5006 \family typewriter
4997 $PATH
5007 $PATH
4998 \family default
5008 \family default
4999 as ipython aliases.
5009 as ipython aliases.
5000 See their respective docstrings (or sec.\SpecialChar ~
5010 See their respective docstrings (or sec.\SpecialChar ~
5001
5011
5002 \begin_inset LatexCommand \ref{sec:magic}
5012 \begin_inset LatexCommand \ref{sec:magic}
5003
5013
5004 \end_inset
5014 \end_inset
5005
5015
5006 for further details).
5016 for further details).
5007 \layout Subsection
5017 \layout Subsection
5008
5018
5009
5019
5010 \begin_inset LatexCommand \label{sec:dreload}
5020 \begin_inset LatexCommand \label{sec:dreload}
5011
5021
5012 \end_inset
5022 \end_inset
5013
5023
5014 Recursive reload
5024 Recursive reload
5015 \layout Standard
5025 \layout Standard
5016
5026
5017 The
5027 The
5018 \family typewriter
5028 \family typewriter
5019 %dreload
5029 %dreload
5020 \family default
5030 \family default
5021 command does a recursive reload of a module: changes made to the module
5031 command does a recursive reload of a module: changes made to the module
5022 since you imported will actually be available without having to exit.
5032 since you imported will actually be available without having to exit.
5023 \layout Subsection
5033 \layout Subsection
5024
5034
5025 Verbose and colored exception traceback printouts
5035 Verbose and colored exception traceback printouts
5026 \layout Standard
5036 \layout Standard
5027
5037
5028 IPython provides the option to see very detailed exception tracebacks, which
5038 IPython provides the option to see very detailed exception tracebacks, which
5029 can be especially useful when debugging large programs.
5039 can be especially useful when debugging large programs.
5030 You can run any Python file with the
5040 You can run any Python file with the
5031 \family typewriter
5041 \family typewriter
5032 %run
5042 %run
5033 \family default
5043 \family default
5034 function to benefit from these detailed tracebacks.
5044 function to benefit from these detailed tracebacks.
5035 Furthermore, both normal and verbose tracebacks can be colored (if your
5045 Furthermore, both normal and verbose tracebacks can be colored (if your
5036 terminal supports it) which makes them much easier to parse visually.
5046 terminal supports it) which makes them much easier to parse visually.
5037 \layout Standard
5047 \layout Standard
5038
5048
5039 See the magic
5049 See the magic
5040 \family typewriter
5050 \family typewriter
5041 xmode
5051 xmode
5042 \family default
5052 \family default
5043 and
5053 and
5044 \family typewriter
5054 \family typewriter
5045 colors
5055 colors
5046 \family default
5056 \family default
5047 functions for details (just type
5057 functions for details (just type
5048 \family typewriter
5058 \family typewriter
5049 %magic
5059 %magic
5050 \family default
5060 \family default
5051 ).
5061 ).
5052 \layout Standard
5062 \layout Standard
5053
5063
5054 These features are basically a terminal version of Ka-Ping Yee's
5064 These features are basically a terminal version of Ka-Ping Yee's
5055 \family typewriter
5065 \family typewriter
5056 cgitb
5066 cgitb
5057 \family default
5067 \family default
5058 module, now part of the standard Python library.
5068 module, now part of the standard Python library.
5059 \layout Subsection
5069 \layout Subsection
5060
5070
5061
5071
5062 \begin_inset LatexCommand \label{sec:cache_input}
5072 \begin_inset LatexCommand \label{sec:cache_input}
5063
5073
5064 \end_inset
5074 \end_inset
5065
5075
5066 Input caching system
5076 Input caching system
5067 \layout Standard
5077 \layout Standard
5068
5078
5069 IPython offers numbered prompts (In/Out) with input and output caching.
5079 IPython offers numbered prompts (In/Out) with input and output caching.
5070 All input is saved and can be retrieved as variables (besides the usual
5080 All input is saved and can be retrieved as variables (besides the usual
5071 arrow key recall).
5081 arrow key recall).
5072 \layout Standard
5082 \layout Standard
5073
5083
5074 The following GLOBAL variables always exist (so don't overwrite them!):
5084 The following GLOBAL variables always exist (so don't overwrite them!):
5075
5085
5076 \family typewriter
5086 \family typewriter
5077 _i
5087 _i
5078 \family default
5088 \family default
5079 : stores previous input.
5089 : stores previous input.
5080
5090
5081 \family typewriter
5091 \family typewriter
5082 _ii
5092 _ii
5083 \family default
5093 \family default
5084 : next previous.
5094 : next previous.
5085
5095
5086 \family typewriter
5096 \family typewriter
5087 _iii
5097 _iii
5088 \family default
5098 \family default
5089 : next-next previous.
5099 : next-next previous.
5090
5100
5091 \family typewriter
5101 \family typewriter
5092 _ih
5102 _ih
5093 \family default
5103 \family default
5094 : a list of all input
5104 : a list of all input
5095 \family typewriter
5105 \family typewriter
5096 _ih[n]
5106 _ih[n]
5097 \family default
5107 \family default
5098 is the input from line
5108 is the input from line
5099 \family typewriter
5109 \family typewriter
5100 n
5110 n
5101 \family default
5111 \family default
5102 and this list is aliased to the global variable
5112 and this list is aliased to the global variable
5103 \family typewriter
5113 \family typewriter
5104 In
5114 In
5105 \family default
5115 \family default
5106 .
5116 .
5107 If you overwrite
5117 If you overwrite
5108 \family typewriter
5118 \family typewriter
5109 In
5119 In
5110 \family default
5120 \family default
5111 with a variable of your own, you can remake the assignment to the internal
5121 with a variable of your own, you can remake the assignment to the internal
5112 list with a simple
5122 list with a simple
5113 \family typewriter
5123 \family typewriter
5114 'In=_ih'
5124 'In=_ih'
5115 \family default
5125 \family default
5116 .
5126 .
5117 \layout Standard
5127 \layout Standard
5118
5128
5119 Additionally, global variables named
5129 Additionally, global variables named
5120 \family typewriter
5130 \family typewriter
5121 _i<n>
5131 _i<n>
5122 \family default
5132 \family default
5123 are dynamically created (
5133 are dynamically created (
5124 \family typewriter
5134 \family typewriter
5125 <n>
5135 <n>
5126 \family default
5136 \family default
5127 being the prompt counter), such that
5137 being the prompt counter), such that
5128 \newline
5138 \newline
5129
5139
5130 \family typewriter
5140 \family typewriter
5131 _i<n> == _ih[<n>] == In[<n>].
5141 _i<n> == _ih[<n>] == In[<n>].
5132 \layout Standard
5142 \layout Standard
5133
5143
5134 For example, what you typed at prompt 14 is available as
5144 For example, what you typed at prompt 14 is available as
5135 \family typewriter
5145 \family typewriter
5136 _i14,
5146 _i14,
5137 \family default
5147 \family default
5138
5148
5139 \family typewriter
5149 \family typewriter
5140 _ih[14]
5150 _ih[14]
5141 \family default
5151 \family default
5142 and
5152 and
5143 \family typewriter
5153 \family typewriter
5144 In[14]
5154 In[14]
5145 \family default
5155 \family default
5146 .
5156 .
5147 \layout Standard
5157 \layout Standard
5148
5158
5149 This allows you to easily cut and paste multi line interactive prompts by
5159 This allows you to easily cut and paste multi line interactive prompts by
5150 printing them out: they print like a clean string, without prompt characters.
5160 printing them out: they print like a clean string, without prompt characters.
5151 You can also manipulate them like regular variables (they are strings),
5161 You can also manipulate them like regular variables (they are strings),
5152 modify or exec them (typing
5162 modify or exec them (typing
5153 \family typewriter
5163 \family typewriter
5154 'exec _i9'
5164 'exec _i9'
5155 \family default
5165 \family default
5156 will re-execute the contents of input prompt 9, '
5166 will re-execute the contents of input prompt 9, '
5157 \family typewriter
5167 \family typewriter
5158 exec In[9:14]+In[18]
5168 exec In[9:14]+In[18]
5159 \family default
5169 \family default
5160 ' will re-execute lines 9 through 13 and line 18).
5170 ' will re-execute lines 9 through 13 and line 18).
5161 \layout Standard
5171 \layout Standard
5162
5172
5163 You can also re-execute multiple lines of input easily by using the magic
5173 You can also re-execute multiple lines of input easily by using the magic
5164
5174
5165 \family typewriter
5175 \family typewriter
5166 %macro
5176 %macro
5167 \family default
5177 \family default
5168 function (which automates the process and allows re-execution without having
5178 function (which automates the process and allows re-execution without having
5169 to type '
5179 to type '
5170 \family typewriter
5180 \family typewriter
5171 exec
5181 exec
5172 \family default
5182 \family default
5173 ' every time).
5183 ' every time).
5174 The macro system also allows you to re-execute previous lines which include
5184 The macro system also allows you to re-execute previous lines which include
5175 magic function calls (which require special processing).
5185 magic function calls (which require special processing).
5176 Type
5186 Type
5177 \family typewriter
5187 \family typewriter
5178 %macro?
5188 %macro?
5179 \family default
5189 \family default
5180 or see sec.
5190 or see sec.
5181
5191
5182 \begin_inset LatexCommand \ref{sec:magic}
5192 \begin_inset LatexCommand \ref{sec:magic}
5183
5193
5184 \end_inset
5194 \end_inset
5185
5195
5186 for more details on the macro system.
5196 for more details on the macro system.
5187 \layout Standard
5197 \layout Standard
5188
5198
5189 A history function
5199 A history function
5190 \family typewriter
5200 \family typewriter
5191 %hist
5201 %hist
5192 \family default
5202 \family default
5193 allows you to see any part of your input history by printing a range of
5203 allows you to see any part of your input history by printing a range of
5194 the
5204 the
5195 \family typewriter
5205 \family typewriter
5196 _i
5206 _i
5197 \family default
5207 \family default
5198 variables.
5208 variables.
5199 \layout Subsection
5209 \layout Subsection
5200
5210
5201
5211
5202 \begin_inset LatexCommand \label{sec:cache_output}
5212 \begin_inset LatexCommand \label{sec:cache_output}
5203
5213
5204 \end_inset
5214 \end_inset
5205
5215
5206 Output caching system
5216 Output caching system
5207 \layout Standard
5217 \layout Standard
5208
5218
5209 For output that is returned from actions, a system similar to the input
5219 For output that is returned from actions, a system similar to the input
5210 cache exists but using
5220 cache exists but using
5211 \family typewriter
5221 \family typewriter
5212 _
5222 _
5213 \family default
5223 \family default
5214 instead of
5224 instead of
5215 \family typewriter
5225 \family typewriter
5216 _i
5226 _i
5217 \family default
5227 \family default
5218 .
5228 .
5219 Only actions that produce a result (NOT assignments, for example) are cached.
5229 Only actions that produce a result (NOT assignments, for example) are cached.
5220 If you are familiar with Mathematica, IPython's
5230 If you are familiar with Mathematica, IPython's
5221 \family typewriter
5231 \family typewriter
5222 _
5232 _
5223 \family default
5233 \family default
5224 variables behave exactly like Mathematica's
5234 variables behave exactly like Mathematica's
5225 \family typewriter
5235 \family typewriter
5226 %
5236 %
5227 \family default
5237 \family default
5228 variables.
5238 variables.
5229 \layout Standard
5239 \layout Standard
5230
5240
5231 The following GLOBAL variables always exist (so don't overwrite them!):
5241 The following GLOBAL variables always exist (so don't overwrite them!):
5232
5242
5233 \layout List
5243 \layout List
5234 \labelwidthstring 00.00.0000
5244 \labelwidthstring 00.00.0000
5235
5245
5236
5246
5237 \family typewriter
5247 \family typewriter
5238 \series bold
5248 \series bold
5239 _
5249 _
5240 \family default
5250 \family default
5241 \series default
5251 \series default
5242 (a
5252 (a
5243 \emph on
5253 \emph on
5244 single
5254 single
5245 \emph default
5255 \emph default
5246 underscore) : stores previous output, like Python's default interpreter.
5256 underscore) : stores previous output, like Python's default interpreter.
5247 \layout List
5257 \layout List
5248 \labelwidthstring 00.00.0000
5258 \labelwidthstring 00.00.0000
5249
5259
5250
5260
5251 \family typewriter
5261 \family typewriter
5252 \series bold
5262 \series bold
5253 __
5263 __
5254 \family default
5264 \family default
5255 \series default
5265 \series default
5256 (two underscores): next previous.
5266 (two underscores): next previous.
5257 \layout List
5267 \layout List
5258 \labelwidthstring 00.00.0000
5268 \labelwidthstring 00.00.0000
5259
5269
5260
5270
5261 \family typewriter
5271 \family typewriter
5262 \series bold
5272 \series bold
5263 ___
5273 ___
5264 \family default
5274 \family default
5265 \series default
5275 \series default
5266 (three underscores): next-next previous.
5276 (three underscores): next-next previous.
5267 \layout Standard
5277 \layout Standard
5268
5278
5269 Additionally, global variables named
5279 Additionally, global variables named
5270 \family typewriter
5280 \family typewriter
5271 _<n>
5281 _<n>
5272 \family default
5282 \family default
5273 are dynamically created (
5283 are dynamically created (
5274 \family typewriter
5284 \family typewriter
5275 <n>
5285 <n>
5276 \family default
5286 \family default
5277 being the prompt counter), such that the result of output
5287 being the prompt counter), such that the result of output
5278 \family typewriter
5288 \family typewriter
5279 <n>
5289 <n>
5280 \family default
5290 \family default
5281 is always available as
5291 is always available as
5282 \family typewriter
5292 \family typewriter
5283 _<n>
5293 _<n>
5284 \family default
5294 \family default
5285 (don't use the angle brackets, just the number, e.g.
5295 (don't use the angle brackets, just the number, e.g.
5286
5296
5287 \family typewriter
5297 \family typewriter
5288 _21
5298 _21
5289 \family default
5299 \family default
5290 ).
5300 ).
5291 \layout Standard
5301 \layout Standard
5292
5302
5293 These global variables are all stored in a global dictionary (not a list,
5303 These global variables are all stored in a global dictionary (not a list,
5294 since it only has entries for lines which returned a result) available
5304 since it only has entries for lines which returned a result) available
5295 under the names
5305 under the names
5296 \family typewriter
5306 \family typewriter
5297 _oh
5307 _oh
5298 \family default
5308 \family default
5299 and
5309 and
5300 \family typewriter
5310 \family typewriter
5301 Out
5311 Out
5302 \family default
5312 \family default
5303 (similar to
5313 (similar to
5304 \family typewriter
5314 \family typewriter
5305 _ih
5315 _ih
5306 \family default
5316 \family default
5307 and
5317 and
5308 \family typewriter
5318 \family typewriter
5309 In
5319 In
5310 \family default
5320 \family default
5311 ).
5321 ).
5312 So the output from line 12 can be obtained as
5322 So the output from line 12 can be obtained as
5313 \family typewriter
5323 \family typewriter
5314 _12
5324 _12
5315 \family default
5325 \family default
5316 ,
5326 ,
5317 \family typewriter
5327 \family typewriter
5318 Out[12]
5328 Out[12]
5319 \family default
5329 \family default
5320 or
5330 or
5321 \family typewriter
5331 \family typewriter
5322 _oh[12]
5332 _oh[12]
5323 \family default
5333 \family default
5324 .
5334 .
5325 If you accidentally overwrite the
5335 If you accidentally overwrite the
5326 \family typewriter
5336 \family typewriter
5327 Out
5337 Out
5328 \family default
5338 \family default
5329 variable you can recover it by typing
5339 variable you can recover it by typing
5330 \family typewriter
5340 \family typewriter
5331 'Out=_oh
5341 'Out=_oh
5332 \family default
5342 \family default
5333 ' at the prompt.
5343 ' at the prompt.
5334 \layout Standard
5344 \layout Standard
5335
5345
5336 This system obviously can potentially put heavy memory demands on your system,
5346 This system obviously can potentially put heavy memory demands on your system,
5337 since it prevents Python's garbage collector from removing any previously
5347 since it prevents Python's garbage collector from removing any previously
5338 computed results.
5348 computed results.
5339 You can control how many results are kept in memory with the option (at
5349 You can control how many results are kept in memory with the option (at
5340 the command line or in your
5350 the command line or in your
5341 \family typewriter
5351 \family typewriter
5342 ipythonrc
5352 ipythonrc
5343 \family default
5353 \family default
5344 file)
5354 file)
5345 \family typewriter
5355 \family typewriter
5346 cache_size
5356 cache_size
5347 \family default
5357 \family default
5348 .
5358 .
5349 If you set it to 0, the whole system is completely disabled and the prompts
5359 If you set it to 0, the whole system is completely disabled and the prompts
5350 revert to the classic
5360 revert to the classic
5351 \family typewriter
5361 \family typewriter
5352 '>>>'
5362 '>>>'
5353 \family default
5363 \family default
5354 of normal Python.
5364 of normal Python.
5355 \layout Subsection
5365 \layout Subsection
5356
5366
5357 Directory history
5367 Directory history
5358 \layout Standard
5368 \layout Standard
5359
5369
5360 Your history of visited directories is kept in the global list
5370 Your history of visited directories is kept in the global list
5361 \family typewriter
5371 \family typewriter
5362 _dh
5372 _dh
5363 \family default
5373 \family default
5364 , and the magic
5374 , and the magic
5365 \family typewriter
5375 \family typewriter
5366 %cd
5376 %cd
5367 \family default
5377 \family default
5368 command can be used to go to any entry in that list.
5378 command can be used to go to any entry in that list.
5369 The
5379 The
5370 \family typewriter
5380 \family typewriter
5371 %dhist
5381 %dhist
5372 \family default
5382 \family default
5373 command allows you to view this history.
5383 command allows you to view this history.
5374 \layout Subsection
5384 \layout Subsection
5375
5385
5376 Automatic parentheses and quotes
5386 Automatic parentheses and quotes
5377 \layout Standard
5387 \layout Standard
5378
5388
5379 These features were adapted from Nathan Gray's LazyPython.
5389 These features were adapted from Nathan Gray's LazyPython.
5380 They are meant to allow less typing for common situations.
5390 They are meant to allow less typing for common situations.
5381 \layout Subsubsection
5391 \layout Subsubsection
5382
5392
5383 Automatic parentheses
5393 Automatic parentheses
5384 \layout Standard
5394 \layout Standard
5385
5395
5386 Callable objects (i.e.
5396 Callable objects (i.e.
5387 functions, methods, etc) can be invoked like this (notice the commas between
5397 functions, methods, etc) can be invoked like this (notice the commas between
5388 the arguments):
5398 the arguments):
5389 \layout Standard
5399 \layout Standard
5390
5400
5391
5401
5392 \family typewriter
5402 \family typewriter
5393 >>> callable_ob arg1, arg2, arg3
5403 >>> callable_ob arg1, arg2, arg3
5394 \layout Standard
5404 \layout Standard
5395
5405
5396 and the input will be translated to this:
5406 and the input will be translated to this:
5397 \layout Standard
5407 \layout Standard
5398
5408
5399
5409
5400 \family typewriter
5410 \family typewriter
5401 --> callable_ob(arg1, arg2, arg3)
5411 --> callable_ob(arg1, arg2, arg3)
5402 \layout Standard
5412 \layout Standard
5403
5413
5404 You can force automatic parentheses by using '/' as the first character
5414 You can force automatic parentheses by using '/' as the first character
5405 of a line.
5415 of a line.
5406 For example:
5416 For example:
5407 \layout Standard
5417 \layout Standard
5408
5418
5409
5419
5410 \family typewriter
5420 \family typewriter
5411 >>> /globals # becomes 'globals()'
5421 >>> /globals # becomes 'globals()'
5412 \layout Standard
5422 \layout Standard
5413
5423
5414 Note that the '/' MUST be the first character on the line! This won't work:
5424 Note that the '/' MUST be the first character on the line! This won't work:
5415
5425
5416 \layout Standard
5426 \layout Standard
5417
5427
5418
5428
5419 \family typewriter
5429 \family typewriter
5420 >>> print /globals # syntax error
5430 >>> print /globals # syntax error
5421 \layout Standard
5431 \layout Standard
5422
5432
5423 In most cases the automatic algorithm should work, so you should rarely
5433 In most cases the automatic algorithm should work, so you should rarely
5424 need to explicitly invoke /.
5434 need to explicitly invoke /.
5425 One notable exception is if you are trying to call a function with a list
5435 One notable exception is if you are trying to call a function with a list
5426 of tuples as arguments (the parenthesis will confuse IPython):
5436 of tuples as arguments (the parenthesis will confuse IPython):
5427 \layout Standard
5437 \layout Standard
5428
5438
5429
5439
5430 \family typewriter
5440 \family typewriter
5431 In [1]: zip (1,2,3),(4,5,6) # won't work
5441 In [1]: zip (1,2,3),(4,5,6) # won't work
5432 \layout Standard
5442 \layout Standard
5433
5443
5434 but this will work:
5444 but this will work:
5435 \layout Standard
5445 \layout Standard
5436
5446
5437
5447
5438 \family typewriter
5448 \family typewriter
5439 In [2]: /zip (1,2,3),(4,5,6)
5449 In [2]: /zip (1,2,3),(4,5,6)
5440 \newline
5450 \newline
5441 ------> zip ((1,2,3),(4,5,6))
5451 ------> zip ((1,2,3),(4,5,6))
5442 \newline
5452 \newline
5443 Out[2]= [(1, 4), (2, 5), (3, 6)]
5453 Out[2]= [(1, 4), (2, 5), (3, 6)]
5444 \layout Standard
5454 \layout Standard
5445
5455
5446 IPython tells you that it has altered your command line by displaying the
5456 IPython tells you that it has altered your command line by displaying the
5447 new command line preceded by
5457 new command line preceded by
5448 \family typewriter
5458 \family typewriter
5449 -->
5459 -->
5450 \family default
5460 \family default
5451 .
5461 .
5452 e.g.:
5462 e.g.:
5453 \layout Standard
5463 \layout Standard
5454
5464
5455
5465
5456 \family typewriter
5466 \family typewriter
5457 In [18]: callable list
5467 In [18]: callable list
5458 \newline
5468 \newline
5459 -------> callable (list)
5469 -------> callable (list)
5460 \layout Subsubsection
5470 \layout Subsubsection
5461
5471
5462 Automatic quoting
5472 Automatic quoting
5463 \layout Standard
5473 \layout Standard
5464
5474
5465 You can force automatic quoting of a function's arguments by using
5475 You can force automatic quoting of a function's arguments by using
5466 \family typewriter
5476 \family typewriter
5467 `,'
5477 `,'
5468 \family default
5478 \family default
5469 or
5479 or
5470 \family typewriter
5480 \family typewriter
5471 `;'
5481 `;'
5472 \family default
5482 \family default
5473 as the first character of a line.
5483 as the first character of a line.
5474 For example:
5484 For example:
5475 \layout Standard
5485 \layout Standard
5476
5486
5477
5487
5478 \family typewriter
5488 \family typewriter
5479 >>> ,my_function /home/me # becomes my_function("/home/me")
5489 >>> ,my_function /home/me # becomes my_function("/home/me")
5480 \layout Standard
5490 \layout Standard
5481
5491
5482 If you use
5492 If you use
5483 \family typewriter
5493 \family typewriter
5484 `;'
5494 `;'
5485 \family default
5495 \family default
5486 instead, the whole argument is quoted as a single string (while
5496 instead, the whole argument is quoted as a single string (while
5487 \family typewriter
5497 \family typewriter
5488 `,'
5498 `,'
5489 \family default
5499 \family default
5490 splits on whitespace):
5500 splits on whitespace):
5491 \layout Standard
5501 \layout Standard
5492
5502
5493
5503
5494 \family typewriter
5504 \family typewriter
5495 >>> ,my_function a b c # becomes my_function("a","b","c")
5505 >>> ,my_function a b c # becomes my_function("a","b","c")
5496 \layout Standard
5506 \layout Standard
5497
5507
5498
5508
5499 \family typewriter
5509 \family typewriter
5500 >>> ;my_function a b c # becomes my_function("a b c")
5510 >>> ;my_function a b c # becomes my_function("a b c")
5501 \layout Standard
5511 \layout Standard
5502
5512
5503 Note that the `
5513 Note that the `
5504 \family typewriter
5514 \family typewriter
5505 ,
5515 ,
5506 \family default
5516 \family default
5507 ' or `
5517 ' or `
5508 \family typewriter
5518 \family typewriter
5509 ;
5519 ;
5510 \family default
5520 \family default
5511 ' MUST be the first character on the line! This won't work:
5521 ' MUST be the first character on the line! This won't work:
5512 \layout Standard
5522 \layout Standard
5513
5523
5514
5524
5515 \family typewriter
5525 \family typewriter
5516 >>> x = ,my_function /home/me # syntax error
5526 >>> x = ,my_function /home/me # syntax error
5517 \layout Section
5527 \layout Section
5518
5528
5519
5529
5520 \begin_inset LatexCommand \label{sec:customization}
5530 \begin_inset LatexCommand \label{sec:customization}
5521
5531
5522 \end_inset
5532 \end_inset
5523
5533
5524 Customization
5534 Customization
5525 \layout Standard
5535 \layout Standard
5526
5536
5527 As we've already mentioned, IPython reads a configuration file which can
5537 As we've already mentioned, IPython reads a configuration file which can
5528 be specified at the command line (
5538 be specified at the command line (
5529 \family typewriter
5539 \family typewriter
5530 -rcfile
5540 -rcfile
5531 \family default
5541 \family default
5532 ) or which by default is assumed to be called
5542 ) or which by default is assumed to be called
5533 \family typewriter
5543 \family typewriter
5534 ipythonrc
5544 ipythonrc
5535 \family default
5545 \family default
5536 .
5546 .
5537 Such a file is looked for in the current directory where IPython is started
5547 Such a file is looked for in the current directory where IPython is started
5538 and then in your
5548 and then in your
5539 \family typewriter
5549 \family typewriter
5540 IPYTHONDIR
5550 IPYTHONDIR
5541 \family default
5551 \family default
5542 , which allows you to have local configuration files for specific projects.
5552 , which allows you to have local configuration files for specific projects.
5543 In this section we will call these types of configuration files simply
5553 In this section we will call these types of configuration files simply
5544 rcfiles (short for resource configuration file).
5554 rcfiles (short for resource configuration file).
5545 \layout Standard
5555 \layout Standard
5546
5556
5547 The syntax of an rcfile is one of key-value pairs separated by whitespace,
5557 The syntax of an rcfile is one of key-value pairs separated by whitespace,
5548 one per line.
5558 one per line.
5549 Lines beginning with a
5559 Lines beginning with a
5550 \family typewriter
5560 \family typewriter
5551 #
5561 #
5552 \family default
5562 \family default
5553 are ignored as comments, but comments can
5563 are ignored as comments, but comments can
5554 \series bold
5564 \series bold
5555 not
5565 not
5556 \series default
5566 \series default
5557 be put on lines with data (the parser is fairly primitive).
5567 be put on lines with data (the parser is fairly primitive).
5558 Note that these are not python files, and this is deliberate, because it
5568 Note that these are not python files, and this is deliberate, because it
5559 allows us to do some things which would be quite tricky to implement if
5569 allows us to do some things which would be quite tricky to implement if
5560 they were normal python files.
5570 they were normal python files.
5561 \layout Standard
5571 \layout Standard
5562
5572
5563 First, an rcfile can contain permanent default values for almost all command
5573 First, an rcfile can contain permanent default values for almost all command
5564 line options (except things like
5574 line options (except things like
5565 \family typewriter
5575 \family typewriter
5566 -help
5576 -help
5567 \family default
5577 \family default
5568 or
5578 or
5569 \family typewriter
5579 \family typewriter
5570 -Version
5580 -Version
5571 \family default
5581 \family default
5572 ).
5582 ).
5573 Sec\SpecialChar ~
5583 Sec\SpecialChar ~
5574
5584
5575 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5585 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5576
5586
5577 \end_inset
5587 \end_inset
5578
5588
5579 contains a description of all command-line options.
5589 contains a description of all command-line options.
5580 However, values you explicitly specify at the command line override the
5590 However, values you explicitly specify at the command line override the
5581 values defined in the rcfile.
5591 values defined in the rcfile.
5582 \layout Standard
5592 \layout Standard
5583
5593
5584 Besides command line option values, the rcfile can specify values for certain
5594 Besides command line option values, the rcfile can specify values for certain
5585 extra special options which are not available at the command line.
5595 extra special options which are not available at the command line.
5586 These options are briefly described below.
5596 These options are briefly described below.
5587
5597
5588 \layout Standard
5598 \layout Standard
5589
5599
5590 Each of these options may appear as many times as you need it in the file.
5600 Each of these options may appear as many times as you need it in the file.
5591 \layout List
5601 \layout List
5592 \labelwidthstring 00.00.0000
5602 \labelwidthstring 00.00.0000
5593
5603
5594
5604
5595 \family typewriter
5605 \family typewriter
5596 \series bold
5606 \series bold
5597 include\SpecialChar ~
5607 include\SpecialChar ~
5598 <file1>\SpecialChar ~
5608 <file1>\SpecialChar ~
5599 <file2>\SpecialChar ~
5609 <file2>\SpecialChar ~
5600 ...
5610 ...
5601 \family default
5611 \family default
5602 \series default
5612 \series default
5603 : you can name
5613 : you can name
5604 \emph on
5614 \emph on
5605 other
5615 other
5606 \emph default
5616 \emph default
5607 rcfiles you want to recursively load up to 15 levels (don't use the
5617 rcfiles you want to recursively load up to 15 levels (don't use the
5608 \family typewriter
5618 \family typewriter
5609 <>
5619 <>
5610 \family default
5620 \family default
5611 brackets in your names!).
5621 brackets in your names!).
5612 This feature allows you to define a 'base' rcfile with general options
5622 This feature allows you to define a 'base' rcfile with general options
5613 and special-purpose files which can be loaded only when needed with particular
5623 and special-purpose files which can be loaded only when needed with particular
5614 configuration options.
5624 configuration options.
5615 To make this more convenient, IPython accepts the
5625 To make this more convenient, IPython accepts the
5616 \family typewriter
5626 \family typewriter
5617 -profile <name>
5627 -profile <name>
5618 \family default
5628 \family default
5619 option (abbreviates to
5629 option (abbreviates to
5620 \family typewriter
5630 \family typewriter
5621 -p <name
5631 -p <name
5622 \family default
5632 \family default
5623 >)
5633 >)
5624 \family typewriter
5634 \family typewriter
5625 which
5635 which
5626 \family default
5636 \family default
5627 tells it to look for an rcfile named
5637 tells it to look for an rcfile named
5628 \family typewriter
5638 \family typewriter
5629 ipythonrc-<name>
5639 ipythonrc-<name>
5630 \family default
5640 \family default
5631 .
5641 .
5632
5642
5633 \layout List
5643 \layout List
5634 \labelwidthstring 00.00.0000
5644 \labelwidthstring 00.00.0000
5635
5645
5636
5646
5637 \family typewriter
5647 \family typewriter
5638 \series bold
5648 \series bold
5639 import_mod\SpecialChar ~
5649 import_mod\SpecialChar ~
5640 <mod1>\SpecialChar ~
5650 <mod1>\SpecialChar ~
5641 <mod2>\SpecialChar ~
5651 <mod2>\SpecialChar ~
5642 ...
5652 ...
5643 \family default
5653 \family default
5644 \series default
5654 \series default
5645 : import modules with '
5655 : import modules with '
5646 \family typewriter
5656 \family typewriter
5647 import
5657 import
5648 \family default
5658 \family default
5649
5659
5650 \family typewriter
5660 \family typewriter
5651 <mod1>,<mod2>,...
5661 <mod1>,<mod2>,...
5652 \family default
5662 \family default
5653 '
5663 '
5654 \layout List
5664 \layout List
5655 \labelwidthstring 00.00.0000
5665 \labelwidthstring 00.00.0000
5656
5666
5657
5667
5658 \family typewriter
5668 \family typewriter
5659 \series bold
5669 \series bold
5660 import_some\SpecialChar ~
5670 import_some\SpecialChar ~
5661 <mod>\SpecialChar ~
5671 <mod>\SpecialChar ~
5662 <f1>\SpecialChar ~
5672 <f1>\SpecialChar ~
5663 <f2>\SpecialChar ~
5673 <f2>\SpecialChar ~
5664 ...
5674 ...
5665 \family default
5675 \family default
5666 \series default
5676 \series default
5667 : import functions with '
5677 : import functions with '
5668 \family typewriter
5678 \family typewriter
5669 from <mod> import
5679 from <mod> import
5670 \family default
5680 \family default
5671
5681
5672 \family typewriter
5682 \family typewriter
5673 <f1>,<f2>,...
5683 <f1>,<f2>,...
5674 \family default
5684 \family default
5675 '
5685 '
5676 \layout List
5686 \layout List
5677 \labelwidthstring 00.00.0000
5687 \labelwidthstring 00.00.0000
5678
5688
5679
5689
5680 \family typewriter
5690 \family typewriter
5681 \series bold
5691 \series bold
5682 import_all\SpecialChar ~
5692 import_all\SpecialChar ~
5683 <mod1>\SpecialChar ~
5693 <mod1>\SpecialChar ~
5684 <mod2>\SpecialChar ~
5694 <mod2>\SpecialChar ~
5685 ...
5695 ...
5686 \family default
5696 \family default
5687 \series default
5697 \series default
5688 : for each module listed import functions with '
5698 : for each module listed import functions with '
5689 \family typewriter
5699 \family typewriter
5690 from <mod> import *
5700 from <mod> import *
5691 \family default
5701 \family default
5692 '
5702 '
5693 \layout List
5703 \layout List
5694 \labelwidthstring 00.00.0000
5704 \labelwidthstring 00.00.0000
5695
5705
5696
5706
5697 \family typewriter
5707 \family typewriter
5698 \series bold
5708 \series bold
5699 execute\SpecialChar ~
5709 execute\SpecialChar ~
5700 <python\SpecialChar ~
5710 <python\SpecialChar ~
5701 code>
5711 code>
5702 \family default
5712 \family default
5703 \series default
5713 \series default
5704 : give any single-line python code to be executed.
5714 : give any single-line python code to be executed.
5705 \layout List
5715 \layout List
5706 \labelwidthstring 00.00.0000
5716 \labelwidthstring 00.00.0000
5707
5717
5708
5718
5709 \family typewriter
5719 \family typewriter
5710 \series bold
5720 \series bold
5711 execfile\SpecialChar ~
5721 execfile\SpecialChar ~
5712 <filename>
5722 <filename>
5713 \family default
5723 \family default
5714 \series default
5724 \series default
5715 : execute the python file given with an '
5725 : execute the python file given with an '
5716 \family typewriter
5726 \family typewriter
5717 execfile(filename)
5727 execfile(filename)
5718 \family default
5728 \family default
5719 ' command.
5729 ' command.
5720 Username expansion is performed on the given names.
5730 Username expansion is performed on the given names.
5721 So if you need any amount of extra fancy customization that won't fit in
5731 So if you need any amount of extra fancy customization that won't fit in
5722 any of the above 'canned' options, you can just put it in a separate python
5732 any of the above 'canned' options, you can just put it in a separate python
5723 file and execute it.
5733 file and execute it.
5724 \layout List
5734 \layout List
5725 \labelwidthstring 00.00.0000
5735 \labelwidthstring 00.00.0000
5726
5736
5727
5737
5728 \family typewriter
5738 \family typewriter
5729 \series bold
5739 \series bold
5730 alias\SpecialChar ~
5740 alias\SpecialChar ~
5731 <alias_def>
5741 <alias_def>
5732 \family default
5742 \family default
5733 \series default
5743 \series default
5734 : this is equivalent to calling '
5744 : this is equivalent to calling '
5735 \family typewriter
5745 \family typewriter
5736 %alias\SpecialChar ~
5746 %alias\SpecialChar ~
5737 <alias_def>
5747 <alias_def>
5738 \family default
5748 \family default
5739 ' at the IPython command line.
5749 ' at the IPython command line.
5740 This way, from within IPython you can do common system tasks without having
5750 This way, from within IPython you can do common system tasks without having
5741 to exit it or use the
5751 to exit it or use the
5742 \family typewriter
5752 \family typewriter
5743 !
5753 !
5744 \family default
5754 \family default
5745 escape.
5755 escape.
5746 IPython isn't meant to be a shell replacement, but it is often very useful
5756 IPython isn't meant to be a shell replacement, but it is often very useful
5747 to be able to do things with files while testing code.
5757 to be able to do things with files while testing code.
5748 This gives you the flexibility to have within IPython any aliases you may
5758 This gives you the flexibility to have within IPython any aliases you may
5749 be used to under your normal system shell.
5759 be used to under your normal system shell.
5750 \layout Subsection
5760 \layout Subsection
5751
5761
5752
5762
5753 \begin_inset LatexCommand \label{sec:ipytonrc-sample}
5763 \begin_inset LatexCommand \label{sec:ipytonrc-sample}
5754
5764
5755 \end_inset
5765 \end_inset
5756
5766
5757 Sample
5767 Sample
5758 \family typewriter
5768 \family typewriter
5759 ipythonrc
5769 ipythonrc
5760 \family default
5770 \family default
5761 file
5771 file
5762 \layout Standard
5772 \layout Standard
5763
5773
5764 The default rcfile, called
5774 The default rcfile, called
5765 \family typewriter
5775 \family typewriter
5766 ipythonrc
5776 ipythonrc
5767 \family default
5777 \family default
5768 and supplied in your
5778 and supplied in your
5769 \family typewriter
5779 \family typewriter
5770 IPYTHONDIR
5780 IPYTHONDIR
5771 \family default
5781 \family default
5772 directory contains lots of comments on all of these options.
5782 directory contains lots of comments on all of these options.
5773 We reproduce it here for reference:
5783 We reproduce it here for reference:
5774 \layout Standard
5784 \layout Standard
5775
5785
5776
5786
5777 \begin_inset ERT
5787 \begin_inset ERT
5778 status Open
5788 status Open
5779
5789
5780 \layout Standard
5790 \layout Standard
5781
5791
5782 \backslash
5792 \backslash
5783 codelist{../IPython/UserConfig/ipythonrc}
5793 codelist{../IPython/UserConfig/ipythonrc}
5784 \end_inset
5794 \end_inset
5785
5795
5786
5796
5787 \layout Subsection
5797 \layout Subsection
5788
5798
5789
5799
5790 \begin_inset LatexCommand \label{sec:prompts}
5800 \begin_inset LatexCommand \label{sec:prompts}
5791
5801
5792 \end_inset
5802 \end_inset
5793
5803
5794 Fine-tuning your prompt
5804 Fine-tuning your prompt
5795 \layout Standard
5805 \layout Standard
5796
5806
5797 IPython's prompts can be customized using a syntax similar to that of the
5807 IPython's prompts can be customized using a syntax similar to that of the
5798
5808
5799 \family typewriter
5809 \family typewriter
5800 bash
5810 bash
5801 \family default
5811 \family default
5802 shell.
5812 shell.
5803 Many of
5813 Many of
5804 \family typewriter
5814 \family typewriter
5805 bash
5815 bash
5806 \family default
5816 \family default
5807 's escapes are supported, as well as a few additional ones.
5817 's escapes are supported, as well as a few additional ones.
5808 We list them below:
5818 We list them below:
5809 \layout Description
5819 \layout Description
5810
5820
5811
5821
5812 \backslash
5822 \backslash
5813 # the prompt/history count number
5823 # the prompt/history count number
5814 \layout Description
5824 \layout Description
5815
5825
5816
5826
5817 \backslash
5827 \backslash
5818 D the prompt/history count, with the actual digits replaced by dots.
5828 D the prompt/history count, with the actual digits replaced by dots.
5819 Used mainly in continuation prompts (prompt_in2)
5829 Used mainly in continuation prompts (prompt_in2)
5820 \layout Description
5830 \layout Description
5821
5831
5822
5832
5823 \backslash
5833 \backslash
5824 w the current working directory
5834 w the current working directory
5825 \layout Description
5835 \layout Description
5826
5836
5827
5837
5828 \backslash
5838 \backslash
5829 W the basename of current working directory
5839 W the basename of current working directory
5830 \layout Description
5840 \layout Description
5831
5841
5832
5842
5833 \backslash
5843 \backslash
5834 X
5844 X
5835 \emph on
5845 \emph on
5836 n
5846 n
5837 \emph default
5847 \emph default
5838 where
5848 where
5839 \begin_inset Formula $n=0\ldots5.$
5849 \begin_inset Formula $n=0\ldots5.$
5840 \end_inset
5850 \end_inset
5841
5851
5842 The current working directory, with
5852 The current working directory, with
5843 \family typewriter
5853 \family typewriter
5844 $HOME
5854 $HOME
5845 \family default
5855 \family default
5846 replaced by
5856 replaced by
5847 \family typewriter
5857 \family typewriter
5848 ~
5858 ~
5849 \family default
5859 \family default
5850 , and filtered out to contain only
5860 , and filtered out to contain only
5851 \begin_inset Formula $n$
5861 \begin_inset Formula $n$
5852 \end_inset
5862 \end_inset
5853
5863
5854 path elements
5864 path elements
5855 \layout Description
5865 \layout Description
5856
5866
5857
5867
5858 \backslash
5868 \backslash
5859 Y
5869 Y
5860 \emph on
5870 \emph on
5861 n
5871 n
5862 \emph default
5872 \emph default
5863 Similar to
5873 Similar to
5864 \backslash
5874 \backslash
5865 X
5875 X
5866 \emph on
5876 \emph on
5867 n
5877 n
5868 \emph default
5878 \emph default
5869 , but with the
5879 , but with the
5870 \begin_inset Formula $n+1$
5880 \begin_inset Formula $n+1$
5871 \end_inset
5881 \end_inset
5872
5882
5873 element included if it is
5883 element included if it is
5874 \family typewriter
5884 \family typewriter
5875 ~
5885 ~
5876 \family default
5886 \family default
5877 (this is similar to the behavior of the %c
5887 (this is similar to the behavior of the %c
5878 \emph on
5888 \emph on
5879 n
5889 n
5880 \emph default
5890 \emph default
5881 escapes in
5891 escapes in
5882 \family typewriter
5892 \family typewriter
5883 tcsh
5893 tcsh
5884 \family default
5894 \family default
5885 )
5895 )
5886 \layout Description
5896 \layout Description
5887
5897
5888
5898
5889 \backslash
5899 \backslash
5890 u the username of the current user
5900 u the username of the current user
5891 \layout Description
5901 \layout Description
5892
5902
5893
5903
5894 \backslash
5904 \backslash
5895 $ if the effective UID is 0, a #, otherwise a $
5905 $ if the effective UID is 0, a #, otherwise a $
5896 \layout Description
5906 \layout Description
5897
5907
5898
5908
5899 \backslash
5909 \backslash
5900 h the hostname up to the first `.'
5910 h the hostname up to the first `.'
5901 \layout Description
5911 \layout Description
5902
5912
5903
5913
5904 \backslash
5914 \backslash
5905 H the hostname
5915 H the hostname
5906 \layout Description
5916 \layout Description
5907
5917
5908
5918
5909 \backslash
5919 \backslash
5910 n a newline
5920 n a newline
5911 \layout Description
5921 \layout Description
5912
5922
5913
5923
5914 \backslash
5924 \backslash
5915 r a carriage return
5925 r a carriage return
5916 \layout Description
5926 \layout Description
5917
5927
5918
5928
5919 \backslash
5929 \backslash
5920 v IPython version string
5930 v IPython version string
5921 \layout Standard
5931 \layout Standard
5922
5932
5923 In addition to these, ANSI color escapes can be insterted into the prompts,
5933 In addition to these, ANSI color escapes can be insterted into the prompts,
5924 as
5934 as
5925 \family typewriter
5935 \family typewriter
5926
5936
5927 \backslash
5937 \backslash
5928 C_
5938 C_
5929 \emph on
5939 \emph on
5930 ColorName
5940 ColorName
5931 \family default
5941 \family default
5932 \emph default
5942 \emph default
5933 .
5943 .
5934 The list of valid color names is: Black, Blue, Brown, Cyan, DarkGray, Green,
5944 The list of valid color names is: Black, Blue, Brown, Cyan, DarkGray, Green,
5935 LightBlue, LightCyan, LightGray, LightGreen, LightPurple, LightRed, NoColor,
5945 LightBlue, LightCyan, LightGray, LightGreen, LightPurple, LightRed, NoColor,
5936 Normal, Purple, Red, White, Yellow.
5946 Normal, Purple, Red, White, Yellow.
5937 \layout Standard
5947 \layout Standard
5938
5948
5939 Finally, IPython supports the evaluation of arbitrary expressions in your
5949 Finally, IPython supports the evaluation of arbitrary expressions in your
5940 prompt string.
5950 prompt string.
5941 The prompt strings are evaluated through the syntax of PEP 215, but basically
5951 The prompt strings are evaluated through the syntax of PEP 215, but basically
5942 you can use
5952 you can use
5943 \family typewriter
5953 \family typewriter
5944 $x.y
5954 $x.y
5945 \family default
5955 \family default
5946 to expand the value of
5956 to expand the value of
5947 \family typewriter
5957 \family typewriter
5948 x.y
5958 x.y
5949 \family default
5959 \family default
5950 , and for more complicated expressions you can use braces:
5960 , and for more complicated expressions you can use braces:
5951 \family typewriter
5961 \family typewriter
5952 ${foo()+x}
5962 ${foo()+x}
5953 \family default
5963 \family default
5954 will call function
5964 will call function
5955 \family typewriter
5965 \family typewriter
5956 foo
5966 foo
5957 \family default
5967 \family default
5958 and add to it the value of
5968 and add to it the value of
5959 \family typewriter
5969 \family typewriter
5960 x
5970 x
5961 \family default
5971 \family default
5962 , before putting the result into your prompt.
5972 , before putting the result into your prompt.
5963 For example, using
5973 For example, using
5964 \newline
5974 \newline
5965
5975
5966 \family typewriter
5976 \family typewriter
5967 prompt_in1 '${commands.getoutput("uptime")}
5977 prompt_in1 '${commands.getoutput("uptime")}
5968 \backslash
5978 \backslash
5969 nIn [
5979 nIn [
5970 \backslash
5980 \backslash
5971 #]: '
5981 #]: '
5972 \newline
5982 \newline
5973
5983
5974 \family default
5984 \family default
5975 will print the result of the uptime command on each prompt (assuming the
5985 will print the result of the uptime command on each prompt (assuming the
5976
5986
5977 \family typewriter
5987 \family typewriter
5978 commands
5988 commands
5979 \family default
5989 \family default
5980 module has been imported in your
5990 module has been imported in your
5981 \family typewriter
5991 \family typewriter
5982 ipythonrc
5992 ipythonrc
5983 \family default
5993 \family default
5984 file).
5994 file).
5985 \layout Subsubsection
5995 \layout Subsubsection
5986
5996
5987 Prompt examples
5997 Prompt examples
5988 \layout Standard
5998 \layout Standard
5989
5999
5990 The following options in an ipythonrc file will give you IPython's default
6000 The following options in an ipythonrc file will give you IPython's default
5991 prompts:
6001 prompts:
5992 \layout Standard
6002 \layout Standard
5993
6003
5994
6004
5995 \family typewriter
6005 \family typewriter
5996 prompt_in1 'In [
6006 prompt_in1 'In [
5997 \backslash
6007 \backslash
5998 #]:'
6008 #]:'
5999 \newline
6009 \newline
6000 prompt_in2 '\SpecialChar ~
6010 prompt_in2 '\SpecialChar ~
6001 \SpecialChar ~
6011 \SpecialChar ~
6002 \SpecialChar ~
6012 \SpecialChar ~
6003 .
6013 .
6004 \backslash
6014 \backslash
6005 D.:'
6015 D.:'
6006 \newline
6016 \newline
6007 prompt_out 'Out[
6017 prompt_out 'Out[
6008 \backslash
6018 \backslash
6009 #]:'
6019 #]:'
6010 \layout Standard
6020 \layout Standard
6011
6021
6012 which look like this:
6022 which look like this:
6013 \layout Standard
6023 \layout Standard
6014
6024
6015
6025
6016 \family typewriter
6026 \family typewriter
6017 In [1]: 1+2
6027 In [1]: 1+2
6018 \newline
6028 \newline
6019 Out[1]: 3
6029 Out[1]: 3
6020 \layout Standard
6030 \layout Standard
6021
6031
6022
6032
6023 \family typewriter
6033 \family typewriter
6024 In [2]: for i in (1,2,3):
6034 In [2]: for i in (1,2,3):
6025 \newline
6035 \newline
6026
6036
6027 \begin_inset ERT
6037 \begin_inset ERT
6028 status Collapsed
6038 status Collapsed
6029
6039
6030 \layout Standard
6040 \layout Standard
6031
6041
6032 \backslash
6042 \backslash
6033 hspace*{0mm}
6043 hspace*{0mm}
6034 \end_inset
6044 \end_inset
6035
6045
6036 \SpecialChar ~
6046 \SpecialChar ~
6037 \SpecialChar ~
6047 \SpecialChar ~
6038 \SpecialChar ~
6048 \SpecialChar ~
6039 ...: \SpecialChar ~
6049 ...: \SpecialChar ~
6040 \SpecialChar ~
6050 \SpecialChar ~
6041 \SpecialChar ~
6051 \SpecialChar ~
6042 \SpecialChar ~
6052 \SpecialChar ~
6043 print i,
6053 print i,
6044 \newline
6054 \newline
6045
6055
6046 \begin_inset ERT
6056 \begin_inset ERT
6047 status Collapsed
6057 status Collapsed
6048
6058
6049 \layout Standard
6059 \layout Standard
6050
6060
6051 \backslash
6061 \backslash
6052 hspace*{0mm}
6062 hspace*{0mm}
6053 \end_inset
6063 \end_inset
6054
6064
6055 \SpecialChar ~
6065 \SpecialChar ~
6056 \SpecialChar ~
6066 \SpecialChar ~
6057 \SpecialChar ~
6067 \SpecialChar ~
6058 ...:
6068 ...:
6059 \newline
6069 \newline
6060 1 2 3
6070 1 2 3
6061 \layout Standard
6071 \layout Standard
6062
6072
6063 These will give you a very colorful prompt with path information:
6073 These will give you a very colorful prompt with path information:
6064 \layout Standard
6074 \layout Standard
6065
6075
6066
6076
6067 \family typewriter
6077 \family typewriter
6068 #prompt_in1 '
6078 #prompt_in1 '
6069 \backslash
6079 \backslash
6070 C_Red
6080 C_Red
6071 \backslash
6081 \backslash
6072 u
6082 u
6073 \backslash
6083 \backslash
6074 C_Blue[
6084 C_Blue[
6075 \backslash
6085 \backslash
6076 C_Cyan
6086 C_Cyan
6077 \backslash
6087 \backslash
6078 Y1
6088 Y1
6079 \backslash
6089 \backslash
6080 C_Blue]
6090 C_Blue]
6081 \backslash
6091 \backslash
6082 C_LightGreen
6092 C_LightGreen
6083 \backslash
6093 \backslash
6084 #>'
6094 #>'
6085 \newline
6095 \newline
6086 prompt_in2 ' ..
6096 prompt_in2 ' ..
6087 \backslash
6097 \backslash
6088 D>'
6098 D>'
6089 \newline
6099 \newline
6090 prompt_out '<
6100 prompt_out '<
6091 \backslash
6101 \backslash
6092 #>'
6102 #>'
6093 \layout Standard
6103 \layout Standard
6094
6104
6095 which look like this:
6105 which look like this:
6096 \layout Standard
6106 \layout Standard
6097
6107
6098
6108
6099 \family typewriter
6109 \family typewriter
6100 \color red
6110 \color red
6101 fperez
6111 fperez
6102 \color blue
6112 \color blue
6103 [
6113 [
6104 \color cyan
6114 \color cyan
6105 ~/ipython
6115 ~/ipython
6106 \color blue
6116 \color blue
6107 ]
6117 ]
6108 \color green
6118 \color green
6109 1>
6119 1>
6110 \color default
6120 \color default
6111 1+2
6121 1+2
6112 \newline
6122 \newline
6113
6123
6114 \begin_inset ERT
6124 \begin_inset ERT
6115 status Collapsed
6125 status Collapsed
6116
6126
6117 \layout Standard
6127 \layout Standard
6118
6128
6119 \backslash
6129 \backslash
6120 hspace*{0mm}
6130 hspace*{0mm}
6121 \end_inset
6131 \end_inset
6122
6132
6123 \SpecialChar ~
6133 \SpecialChar ~
6124 \SpecialChar ~
6134 \SpecialChar ~
6125 \SpecialChar ~
6135 \SpecialChar ~
6126 \SpecialChar ~
6136 \SpecialChar ~
6127 \SpecialChar ~
6137 \SpecialChar ~
6128 \SpecialChar ~
6138 \SpecialChar ~
6129 \SpecialChar ~
6139 \SpecialChar ~
6130 \SpecialChar ~
6140 \SpecialChar ~
6131 \SpecialChar ~
6141 \SpecialChar ~
6132 \SpecialChar ~
6142 \SpecialChar ~
6133 \SpecialChar ~
6143 \SpecialChar ~
6134 \SpecialChar ~
6144 \SpecialChar ~
6135 \SpecialChar ~
6145 \SpecialChar ~
6136 \SpecialChar ~
6146 \SpecialChar ~
6137 \SpecialChar ~
6147 \SpecialChar ~
6138 \SpecialChar ~
6148 \SpecialChar ~
6139
6149
6140 \color red
6150 \color red
6141 <1>
6151 <1>
6142 \color default
6152 \color default
6143 3
6153 3
6144 \newline
6154 \newline
6145
6155
6146 \color red
6156 \color red
6147 fperez
6157 fperez
6148 \color blue
6158 \color blue
6149 [
6159 [
6150 \color cyan
6160 \color cyan
6151 ~/ipython
6161 ~/ipython
6152 \color blue
6162 \color blue
6153 ]
6163 ]
6154 \color green
6164 \color green
6155 2>
6165 2>
6156 \color default
6166 \color default
6157 for i in (1,2,3):
6167 for i in (1,2,3):
6158 \newline
6168 \newline
6159
6169
6160 \begin_inset ERT
6170 \begin_inset ERT
6161 status Collapsed
6171 status Collapsed
6162
6172
6163 \layout Standard
6173 \layout Standard
6164
6174
6165 \backslash
6175 \backslash
6166 hspace*{0mm}
6176 hspace*{0mm}
6167 \end_inset
6177 \end_inset
6168
6178
6169 \SpecialChar ~
6179 \SpecialChar ~
6170 \SpecialChar ~
6180 \SpecialChar ~
6171 \SpecialChar ~
6181 \SpecialChar ~
6172 \SpecialChar ~
6182 \SpecialChar ~
6173 \SpecialChar ~
6183 \SpecialChar ~
6174 \SpecialChar ~
6184 \SpecialChar ~
6175 \SpecialChar ~
6185 \SpecialChar ~
6176 \SpecialChar ~
6186 \SpecialChar ~
6177 \SpecialChar ~
6187 \SpecialChar ~
6178 \SpecialChar ~
6188 \SpecialChar ~
6179 \SpecialChar ~
6189 \SpecialChar ~
6180 \SpecialChar ~
6190 \SpecialChar ~
6181 \SpecialChar ~
6191 \SpecialChar ~
6182 \SpecialChar ~
6192 \SpecialChar ~
6183 \SpecialChar ~
6193 \SpecialChar ~
6184
6194
6185 \color green
6195 \color green
6186 ...>
6196 ...>
6187 \color default
6197 \color default
6188 \SpecialChar ~
6198 \SpecialChar ~
6189 \SpecialChar ~
6199 \SpecialChar ~
6190 \SpecialChar ~
6200 \SpecialChar ~
6191 \SpecialChar ~
6201 \SpecialChar ~
6192 print i,
6202 print i,
6193 \newline
6203 \newline
6194
6204
6195 \begin_inset ERT
6205 \begin_inset ERT
6196 status Collapsed
6206 status Collapsed
6197
6207
6198 \layout Standard
6208 \layout Standard
6199
6209
6200 \backslash
6210 \backslash
6201 hspace*{0mm}
6211 hspace*{0mm}
6202 \end_inset
6212 \end_inset
6203
6213
6204 \SpecialChar ~
6214 \SpecialChar ~
6205 \SpecialChar ~
6215 \SpecialChar ~
6206 \SpecialChar ~
6216 \SpecialChar ~
6207 \SpecialChar ~
6217 \SpecialChar ~
6208 \SpecialChar ~
6218 \SpecialChar ~
6209 \SpecialChar ~
6219 \SpecialChar ~
6210 \SpecialChar ~
6220 \SpecialChar ~
6211 \SpecialChar ~
6221 \SpecialChar ~
6212 \SpecialChar ~
6222 \SpecialChar ~
6213 \SpecialChar ~
6223 \SpecialChar ~
6214 \SpecialChar ~
6224 \SpecialChar ~
6215 \SpecialChar ~
6225 \SpecialChar ~
6216 \SpecialChar ~
6226 \SpecialChar ~
6217 \SpecialChar ~
6227 \SpecialChar ~
6218 \SpecialChar ~
6228 \SpecialChar ~
6219
6229
6220 \color green
6230 \color green
6221 ...>
6231 ...>
6222 \color default
6232 \color default
6223
6233
6224 \newline
6234 \newline
6225 1 2 3
6235 1 2 3
6226 \layout Standard
6236 \layout Standard
6227
6237
6228 The following shows the usage of dynamic expression evaluation:
6238 The following shows the usage of dynamic expression evaluation:
6229 \layout Subsection
6239 \layout Subsection
6230
6240
6231
6241
6232 \begin_inset LatexCommand \label{sec:profiles}
6242 \begin_inset LatexCommand \label{sec:profiles}
6233
6243
6234 \end_inset
6244 \end_inset
6235
6245
6236 IPython profiles
6246 IPython profiles
6237 \layout Standard
6247 \layout Standard
6238
6248
6239 As we already mentioned, IPython supports the
6249 As we already mentioned, IPython supports the
6240 \family typewriter
6250 \family typewriter
6241 -profile
6251 -profile
6242 \family default
6252 \family default
6243 command-line option (see sec.
6253 command-line option (see sec.
6244
6254
6245 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
6255 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
6246
6256
6247 \end_inset
6257 \end_inset
6248
6258
6249 ).
6259 ).
6250 A profile is nothing more than a particular configuration file like your
6260 A profile is nothing more than a particular configuration file like your
6251 basic
6261 basic
6252 \family typewriter
6262 \family typewriter
6253 ipythonrc
6263 ipythonrc
6254 \family default
6264 \family default
6255 one, but with particular customizations for a specific purpose.
6265 one, but with particular customizations for a specific purpose.
6256 When you start IPython with '
6266 When you start IPython with '
6257 \family typewriter
6267 \family typewriter
6258 ipython -profile <name>
6268 ipython -profile <name>
6259 \family default
6269 \family default
6260 ', it assumes that in your
6270 ', it assumes that in your
6261 \family typewriter
6271 \family typewriter
6262 IPYTHONDIR
6272 IPYTHONDIR
6263 \family default
6273 \family default
6264 there is a file called
6274 there is a file called
6265 \family typewriter
6275 \family typewriter
6266 ipythonrc-<name>
6276 ipythonrc-<name>
6267 \family default
6277 \family default
6268 , and loads it instead of the normal
6278 , and loads it instead of the normal
6269 \family typewriter
6279 \family typewriter
6270 ipythonrc
6280 ipythonrc
6271 \family default
6281 \family default
6272 .
6282 .
6273 \layout Standard
6283 \layout Standard
6274
6284
6275 This system allows you to maintain multiple configurations which load modules,
6285 This system allows you to maintain multiple configurations which load modules,
6276 set options, define functions, etc.
6286 set options, define functions, etc.
6277 suitable for different tasks and activate them in a very simple manner.
6287 suitable for different tasks and activate them in a very simple manner.
6278 In order to avoid having to repeat all of your basic options (common things
6288 In order to avoid having to repeat all of your basic options (common things
6279 that don't change such as your color preferences, for example), any profile
6289 that don't change such as your color preferences, for example), any profile
6280 can include another configuration file.
6290 can include another configuration file.
6281 The most common way to use profiles is then to have each one include your
6291 The most common way to use profiles is then to have each one include your
6282 basic
6292 basic
6283 \family typewriter
6293 \family typewriter
6284 ipythonrc
6294 ipythonrc
6285 \family default
6295 \family default
6286 file as a starting point, and then add further customizations.
6296 file as a starting point, and then add further customizations.
6287 \layout Standard
6297 \layout Standard
6288
6298
6289 In sections
6299 In sections
6290 \begin_inset LatexCommand \ref{sec:syntax-extensions}
6300 \begin_inset LatexCommand \ref{sec:syntax-extensions}
6291
6301
6292 \end_inset
6302 \end_inset
6293
6303
6294 and
6304 and
6295 \begin_inset LatexCommand \ref{sec:Gnuplot}
6305 \begin_inset LatexCommand \ref{sec:Gnuplot}
6296
6306
6297 \end_inset
6307 \end_inset
6298
6308
6299 we discuss some particular profiles which come as part of the standard
6309 we discuss some particular profiles which come as part of the standard
6300 IPython distribution.
6310 IPython distribution.
6301 You may also look in your
6311 You may also look in your
6302 \family typewriter
6312 \family typewriter
6303 IPYTHONDIR
6313 IPYTHONDIR
6304 \family default
6314 \family default
6305 directory, any file whose name begins with
6315 directory, any file whose name begins with
6306 \family typewriter
6316 \family typewriter
6307 ipythonrc-
6317 ipythonrc-
6308 \family default
6318 \family default
6309 is a profile.
6319 is a profile.
6310 You can use those as examples for further customizations to suit your own
6320 You can use those as examples for further customizations to suit your own
6311 needs.
6321 needs.
6312 \layout Section
6322 \layout Section
6313
6323
6314
6324
6315 \begin_inset OptArg
6325 \begin_inset OptArg
6316 collapsed false
6326 collapsed false
6317
6327
6318 \layout Standard
6328 \layout Standard
6319
6329
6320 IPython as default...
6330 IPython as default...
6321 \end_inset
6331 \end_inset
6322
6332
6323 IPython as your default Python environment
6333 IPython as your default Python environment
6324 \layout Standard
6334 \layout Standard
6325
6335
6326 Python honors the environment variable
6336 Python honors the environment variable
6327 \family typewriter
6337 \family typewriter
6328 PYTHONSTARTUP
6338 PYTHONSTARTUP
6329 \family default
6339 \family default
6330 and will execute at startup the file referenced by this variable.
6340 and will execute at startup the file referenced by this variable.
6331 If you put at the end of this file the following two lines of code:
6341 If you put at the end of this file the following two lines of code:
6332 \layout Standard
6342 \layout Standard
6333
6343
6334
6344
6335 \family typewriter
6345 \family typewriter
6336 import IPython
6346 import IPython
6337 \newline
6347 \newline
6338 IPython.Shell.IPShell().mainloop(sys_exit=1)
6348 IPython.Shell.IPShell().mainloop(sys_exit=1)
6339 \layout Standard
6349 \layout Standard
6340
6350
6341 then IPython will be your working environment anytime you start Python.
6351 then IPython will be your working environment anytime you start Python.
6342 The
6352 The
6343 \family typewriter
6353 \family typewriter
6344 sys_exit=1
6354 sys_exit=1
6345 \family default
6355 \family default
6346 is needed to have IPython issue a call to
6356 is needed to have IPython issue a call to
6347 \family typewriter
6357 \family typewriter
6348 sys.exit()
6358 sys.exit()
6349 \family default
6359 \family default
6350 when it finishes, otherwise you'll be back at the normal Python '
6360 when it finishes, otherwise you'll be back at the normal Python '
6351 \family typewriter
6361 \family typewriter
6352 >>>
6362 >>>
6353 \family default
6363 \family default
6354 ' prompt
6364 ' prompt
6355 \begin_inset Foot
6365 \begin_inset Foot
6356 collapsed true
6366 collapsed true
6357
6367
6358 \layout Standard
6368 \layout Standard
6359
6369
6360 Based on an idea by Holger Krekel.
6370 Based on an idea by Holger Krekel.
6361 \end_inset
6371 \end_inset
6362
6372
6363 .
6373 .
6364 \layout Standard
6374 \layout Standard
6365
6375
6366 This is probably useful to developers who manage multiple Python versions
6376 This is probably useful to developers who manage multiple Python versions
6367 and don't want to have correspondingly multiple IPython versions.
6377 and don't want to have correspondingly multiple IPython versions.
6368 Note that in this mode, there is no way to pass IPython any command-line
6378 Note that in this mode, there is no way to pass IPython any command-line
6369 options, as those are trapped first by Python itself.
6379 options, as those are trapped first by Python itself.
6370 \layout Section
6380 \layout Section
6371
6381
6372
6382
6373 \begin_inset LatexCommand \label{sec:embed}
6383 \begin_inset LatexCommand \label{sec:embed}
6374
6384
6375 \end_inset
6385 \end_inset
6376
6386
6377 Embedding IPython
6387 Embedding IPython
6378 \layout Standard
6388 \layout Standard
6379
6389
6380 It is possible to start an IPython instance
6390 It is possible to start an IPython instance
6381 \emph on
6391 \emph on
6382 inside
6392 inside
6383 \emph default
6393 \emph default
6384 your own Python programs.
6394 your own Python programs.
6385 This allows you to evaluate dynamically the state of your code, operate
6395 This allows you to evaluate dynamically the state of your code, operate
6386 with your variables, analyze them, etc.
6396 with your variables, analyze them, etc.
6387 Note however that any changes you make to values while in the shell do
6397 Note however that any changes you make to values while in the shell do
6388
6398
6389 \emph on
6399 \emph on
6390 not
6400 not
6391 \emph default
6401 \emph default
6392 propagate back to the running code, so it is safe to modify your values
6402 propagate back to the running code, so it is safe to modify your values
6393 because you won't break your code in bizarre ways by doing so.
6403 because you won't break your code in bizarre ways by doing so.
6394 \layout Standard
6404 \layout Standard
6395
6405
6396 This feature allows you to easily have a fully functional python environment
6406 This feature allows you to easily have a fully functional python environment
6397 for doing object introspection anywhere in your code with a simple function
6407 for doing object introspection anywhere in your code with a simple function
6398 call.
6408 call.
6399 In some cases a simple print statement is enough, but if you need to do
6409 In some cases a simple print statement is enough, but if you need to do
6400 more detailed analysis of a code fragment this feature can be very valuable.
6410 more detailed analysis of a code fragment this feature can be very valuable.
6401 \layout Standard
6411 \layout Standard
6402
6412
6403 It can also be useful in scientific computing situations where it is common
6413 It can also be useful in scientific computing situations where it is common
6404 to need to do some automatic, computationally intensive part and then stop
6414 to need to do some automatic, computationally intensive part and then stop
6405 to look at data, plots, etc
6415 to look at data, plots, etc
6406 \begin_inset Foot
6416 \begin_inset Foot
6407 collapsed true
6417 collapsed true
6408
6418
6409 \layout Standard
6419 \layout Standard
6410
6420
6411 This functionality was inspired by IDL's combination of the
6421 This functionality was inspired by IDL's combination of the
6412 \family typewriter
6422 \family typewriter
6413 stop
6423 stop
6414 \family default
6424 \family default
6415 keyword and the
6425 keyword and the
6416 \family typewriter
6426 \family typewriter
6417 .continue
6427 .continue
6418 \family default
6428 \family default
6419 executive command, which I have found very useful in the past, and by a
6429 executive command, which I have found very useful in the past, and by a
6420 posting on comp.lang.python by cmkl <cmkleffner-AT-gmx.de> on Dec.
6430 posting on comp.lang.python by cmkl <cmkleffner-AT-gmx.de> on Dec.
6421 06/01 concerning similar uses of pyrepl.
6431 06/01 concerning similar uses of pyrepl.
6422 \end_inset
6432 \end_inset
6423
6433
6424 .
6434 .
6425 Opening an IPython instance will give you full access to your data and
6435 Opening an IPython instance will give you full access to your data and
6426 functions, and you can resume program execution once you are done with
6436 functions, and you can resume program execution once you are done with
6427 the interactive part (perhaps to stop again later, as many times as needed).
6437 the interactive part (perhaps to stop again later, as many times as needed).
6428 \layout Standard
6438 \layout Standard
6429
6439
6430 The following code snippet is the bare minimum you need to include in your
6440 The following code snippet is the bare minimum you need to include in your
6431 Python programs for this to work (detailed examples follow later):
6441 Python programs for this to work (detailed examples follow later):
6432 \layout LyX-Code
6442 \layout LyX-Code
6433
6443
6434 from IPython.Shell import IPShellEmbed
6444 from IPython.Shell import IPShellEmbed
6435 \layout LyX-Code
6445 \layout LyX-Code
6436
6446
6437 ipshell = IPShellEmbed()
6447 ipshell = IPShellEmbed()
6438 \layout LyX-Code
6448 \layout LyX-Code
6439
6449
6440 ipshell() # this call anywhere in your program will start IPython
6450 ipshell() # this call anywhere in your program will start IPython
6441 \layout Standard
6451 \layout Standard
6442
6452
6443 You can run embedded instances even in code which is itself being run at
6453 You can run embedded instances even in code which is itself being run at
6444 the IPython interactive prompt with '
6454 the IPython interactive prompt with '
6445 \family typewriter
6455 \family typewriter
6446 %run\SpecialChar ~
6456 %run\SpecialChar ~
6447 <filename>
6457 <filename>
6448 \family default
6458 \family default
6449 '.
6459 '.
6450 Since it's easy to get lost as to where you are (in your top-level IPython
6460 Since it's easy to get lost as to where you are (in your top-level IPython
6451 or in your embedded one), it's a good idea in such cases to set the in/out
6461 or in your embedded one), it's a good idea in such cases to set the in/out
6452 prompts to something different for the embedded instances.
6462 prompts to something different for the embedded instances.
6453 The code examples below illustrate this.
6463 The code examples below illustrate this.
6454 \layout Standard
6464 \layout Standard
6455
6465
6456 You can also have multiple IPython instances in your program and open them
6466 You can also have multiple IPython instances in your program and open them
6457 separately, for example with different options for data presentation.
6467 separately, for example with different options for data presentation.
6458 If you close and open the same instance multiple times, its prompt counters
6468 If you close and open the same instance multiple times, its prompt counters
6459 simply continue from each execution to the next.
6469 simply continue from each execution to the next.
6460 \layout Standard
6470 \layout Standard
6461
6471
6462 Please look at the docstrings in the
6472 Please look at the docstrings in the
6463 \family typewriter
6473 \family typewriter
6464 Shell.py
6474 Shell.py
6465 \family default
6475 \family default
6466 module for more details on the use of this system.
6476 module for more details on the use of this system.
6467 \layout Standard
6477 \layout Standard
6468
6478
6469 The following sample file illustrating how to use the embedding functionality
6479 The following sample file illustrating how to use the embedding functionality
6470 is provided in the examples directory as
6480 is provided in the examples directory as
6471 \family typewriter
6481 \family typewriter
6472 example-embed.py
6482 example-embed.py
6473 \family default
6483 \family default
6474 .
6484 .
6475 It should be fairly self-explanatory:
6485 It should be fairly self-explanatory:
6476 \layout Standard
6486 \layout Standard
6477
6487
6478
6488
6479 \begin_inset ERT
6489 \begin_inset ERT
6480 status Open
6490 status Open
6481
6491
6482 \layout Standard
6492 \layout Standard
6483
6493
6484 \backslash
6494 \backslash
6485 codelist{examples/example-embed.py}
6495 codelist{examples/example-embed.py}
6486 \end_inset
6496 \end_inset
6487
6497
6488
6498
6489 \layout Standard
6499 \layout Standard
6490
6500
6491 Once you understand how the system functions, you can use the following
6501 Once you understand how the system functions, you can use the following
6492 code fragments in your programs which are ready for cut and paste:
6502 code fragments in your programs which are ready for cut and paste:
6493 \layout Standard
6503 \layout Standard
6494
6504
6495
6505
6496 \begin_inset ERT
6506 \begin_inset ERT
6497 status Open
6507 status Open
6498
6508
6499 \layout Standard
6509 \layout Standard
6500
6510
6501 \backslash
6511 \backslash
6502 codelist{examples/example-embed-short.py}
6512 codelist{examples/example-embed-short.py}
6503 \end_inset
6513 \end_inset
6504
6514
6505
6515
6506 \layout Section
6516 \layout Section
6507
6517
6508
6518
6509 \begin_inset LatexCommand \label{sec:using-pdb}
6519 \begin_inset LatexCommand \label{sec:using-pdb}
6510
6520
6511 \end_inset
6521 \end_inset
6512
6522
6513 Using the Python debugger (
6523 Using the Python debugger (
6514 \family typewriter
6524 \family typewriter
6515 pdb
6525 pdb
6516 \family default
6526 \family default
6517 )
6527 )
6518 \layout Subsection
6528 \layout Subsection
6519
6529
6520 Running entire programs via
6530 Running entire programs via
6521 \family typewriter
6531 \family typewriter
6522 pdb
6532 pdb
6523 \layout Standard
6533 \layout Standard
6524
6534
6525
6535
6526 \family typewriter
6536 \family typewriter
6527 pdb
6537 pdb
6528 \family default
6538 \family default
6529 , the Python debugger, is a powerful interactive debugger which allows you
6539 , the Python debugger, is a powerful interactive debugger which allows you
6530 to step through code, set breakpoints, watch variables, etc.
6540 to step through code, set breakpoints, watch variables, etc.
6531 IPython makes it very easy to start any script under the control of
6541 IPython makes it very easy to start any script under the control of
6532 \family typewriter
6542 \family typewriter
6533 pdb
6543 pdb
6534 \family default
6544 \family default
6535 , regardless of whether you have wrapped it into a
6545 , regardless of whether you have wrapped it into a
6536 \family typewriter
6546 \family typewriter
6537 `main()'
6547 `main()'
6538 \family default
6548 \family default
6539 function or not.
6549 function or not.
6540 For this, simply type
6550 For this, simply type
6541 \family typewriter
6551 \family typewriter
6542 `%run -d myscript'
6552 `%run -d myscript'
6543 \family default
6553 \family default
6544 at an IPython prompt.
6554 at an IPython prompt.
6545 See the
6555 See the
6546 \family typewriter
6556 \family typewriter
6547 %run
6557 %run
6548 \family default
6558 \family default
6549 command's documentation (via
6559 command's documentation (via
6550 \family typewriter
6560 \family typewriter
6551 `%run?'
6561 `%run?'
6552 \family default
6562 \family default
6553 or in Sec.\SpecialChar ~
6563 or in Sec.\SpecialChar ~
6554
6564
6555 \begin_inset LatexCommand \ref{sec:magic}
6565 \begin_inset LatexCommand \ref{sec:magic}
6556
6566
6557 \end_inset
6567 \end_inset
6558
6568
6559 ) for more details, including how to control where
6569 ) for more details, including how to control where
6560 \family typewriter
6570 \family typewriter
6561 pdb
6571 pdb
6562 \family default
6572 \family default
6563 will stop execution first.
6573 will stop execution first.
6564 \layout Standard
6574 \layout Standard
6565
6575
6566 For more information on the use of the
6576 For more information on the use of the
6567 \family typewriter
6577 \family typewriter
6568 pdb
6578 pdb
6569 \family default
6579 \family default
6570 debugger, read the included
6580 debugger, read the included
6571 \family typewriter
6581 \family typewriter
6572 pdb.doc
6582 pdb.doc
6573 \family default
6583 \family default
6574 file (part of the standard Python distribution).
6584 file (part of the standard Python distribution).
6575 On a stock Linux system it is located at
6585 On a stock Linux system it is located at
6576 \family typewriter
6586 \family typewriter
6577 /usr/lib/python2.3/pdb.doc
6587 /usr/lib/python2.3/pdb.doc
6578 \family default
6588 \family default
6579 , but the easiest way to read it is by using the
6589 , but the easiest way to read it is by using the
6580 \family typewriter
6590 \family typewriter
6581 help()
6591 help()
6582 \family default
6592 \family default
6583 function of the
6593 function of the
6584 \family typewriter
6594 \family typewriter
6585 pdb
6595 pdb
6586 \family default
6596 \family default
6587 module as follows (in an IPython prompt):
6597 module as follows (in an IPython prompt):
6588 \layout Standard
6598 \layout Standard
6589
6599
6590
6600
6591 \family typewriter
6601 \family typewriter
6592 In [1]: import pdb
6602 In [1]: import pdb
6593 \newline
6603 \newline
6594 In [2]: pdb.help()
6604 In [2]: pdb.help()
6595 \layout Standard
6605 \layout Standard
6596
6606
6597 This will load the
6607 This will load the
6598 \family typewriter
6608 \family typewriter
6599 pdb.doc
6609 pdb.doc
6600 \family default
6610 \family default
6601 document in a file viewer for you automatically.
6611 document in a file viewer for you automatically.
6602 \layout Subsection
6612 \layout Subsection
6603
6613
6604 Automatic invocation of
6614 Automatic invocation of
6605 \family typewriter
6615 \family typewriter
6606 pdb
6616 pdb
6607 \family default
6617 \family default
6608 on exceptions
6618 on exceptions
6609 \layout Standard
6619 \layout Standard
6610
6620
6611 IPython, if started with the
6621 IPython, if started with the
6612 \family typewriter
6622 \family typewriter
6613 -pdb
6623 -pdb
6614 \family default
6624 \family default
6615 option (or if the option is set in your rc file) can call the Python
6625 option (or if the option is set in your rc file) can call the Python
6616 \family typewriter
6626 \family typewriter
6617 pdb
6627 pdb
6618 \family default
6628 \family default
6619 debugger every time your code triggers an uncaught exception
6629 debugger every time your code triggers an uncaught exception
6620 \begin_inset Foot
6630 \begin_inset Foot
6621 collapsed true
6631 collapsed true
6622
6632
6623 \layout Standard
6633 \layout Standard
6624
6634
6625 Many thanks to Christopher Hart for the request which prompted adding this
6635 Many thanks to Christopher Hart for the request which prompted adding this
6626 feature to IPython.
6636 feature to IPython.
6627 \end_inset
6637 \end_inset
6628
6638
6629 .
6639 .
6630 This feature can also be toggled at any time with the
6640 This feature can also be toggled at any time with the
6631 \family typewriter
6641 \family typewriter
6632 %pdb
6642 %pdb
6633 \family default
6643 \family default
6634 magic command.
6644 magic command.
6635 This can be extremely useful in order to find the origin of subtle bugs,
6645 This can be extremely useful in order to find the origin of subtle bugs,
6636 because
6646 because
6637 \family typewriter
6647 \family typewriter
6638 pdb
6648 pdb
6639 \family default
6649 \family default
6640 opens up at the point in your code which triggered the exception, and while
6650 opens up at the point in your code which triggered the exception, and while
6641 your program is at this point `dead', all the data is still available and
6651 your program is at this point `dead', all the data is still available and
6642 you can walk up and down the stack frame and understand the origin of the
6652 you can walk up and down the stack frame and understand the origin of the
6643 problem.
6653 problem.
6644 \layout Standard
6654 \layout Standard
6645
6655
6646 Furthermore, you can use these debugging facilities both with the embedded
6656 Furthermore, you can use these debugging facilities both with the embedded
6647 IPython mode and without IPython at all.
6657 IPython mode and without IPython at all.
6648 For an embedded shell (see sec.
6658 For an embedded shell (see sec.
6649
6659
6650 \begin_inset LatexCommand \ref{sec:embed}
6660 \begin_inset LatexCommand \ref{sec:embed}
6651
6661
6652 \end_inset
6662 \end_inset
6653
6663
6654 ), simply call the constructor with
6664 ), simply call the constructor with
6655 \family typewriter
6665 \family typewriter
6656 `-pdb'
6666 `-pdb'
6657 \family default
6667 \family default
6658 in the argument string and automatically
6668 in the argument string and automatically
6659 \family typewriter
6669 \family typewriter
6660 pdb
6670 pdb
6661 \family default
6671 \family default
6662 will be called if an uncaught exception is triggered by your code.
6672 will be called if an uncaught exception is triggered by your code.
6663
6673
6664 \layout Standard
6674 \layout Standard
6665
6675
6666 For stand-alone use of the feature in your programs which do not use IPython
6676 For stand-alone use of the feature in your programs which do not use IPython
6667 at all, put the following lines toward the top of your `main' routine:
6677 at all, put the following lines toward the top of your `main' routine:
6668 \layout Standard
6678 \layout Standard
6669 \align left
6679 \align left
6670
6680
6671 \family typewriter
6681 \family typewriter
6672 import sys,IPython.ultraTB
6682 import sys,IPython.ultraTB
6673 \newline
6683 \newline
6674 sys.excepthook = IPython.ultraTB.FormattedTB(mode=`Verbose', color_scheme=`Linux',
6684 sys.excepthook = IPython.ultraTB.FormattedTB(mode=`Verbose', color_scheme=`Linux',
6675 call_pdb=1)
6685 call_pdb=1)
6676 \layout Standard
6686 \layout Standard
6677
6687
6678 The
6688 The
6679 \family typewriter
6689 \family typewriter
6680 mode
6690 mode
6681 \family default
6691 \family default
6682 keyword can be either
6692 keyword can be either
6683 \family typewriter
6693 \family typewriter
6684 `Verbose'
6694 `Verbose'
6685 \family default
6695 \family default
6686 or
6696 or
6687 \family typewriter
6697 \family typewriter
6688 `Plain'
6698 `Plain'
6689 \family default
6699 \family default
6690 , giving either very detailed or normal tracebacks respectively.
6700 , giving either very detailed or normal tracebacks respectively.
6691 The
6701 The
6692 \family typewriter
6702 \family typewriter
6693 color_scheme
6703 color_scheme
6694 \family default
6704 \family default
6695 keyword can be one of
6705 keyword can be one of
6696 \family typewriter
6706 \family typewriter
6697 `NoColor'
6707 `NoColor'
6698 \family default
6708 \family default
6699 ,
6709 ,
6700 \family typewriter
6710 \family typewriter
6701 `Linux'
6711 `Linux'
6702 \family default
6712 \family default
6703 (default) or
6713 (default) or
6704 \family typewriter
6714 \family typewriter
6705 `LightBG'
6715 `LightBG'
6706 \family default
6716 \family default
6707 .
6717 .
6708 These are the same options which can be set in IPython with
6718 These are the same options which can be set in IPython with
6709 \family typewriter
6719 \family typewriter
6710 -colors
6720 -colors
6711 \family default
6721 \family default
6712 and
6722 and
6713 \family typewriter
6723 \family typewriter
6714 -xmode
6724 -xmode
6715 \family default
6725 \family default
6716 .
6726 .
6717 \layout Standard
6727 \layout Standard
6718
6728
6719 This will give any of your programs detailed, colored tracebacks with automatic
6729 This will give any of your programs detailed, colored tracebacks with automatic
6720 invocation of
6730 invocation of
6721 \family typewriter
6731 \family typewriter
6722 pdb
6732 pdb
6723 \family default
6733 \family default
6724 .
6734 .
6725 \layout Section
6735 \layout Section
6726
6736
6727
6737
6728 \begin_inset LatexCommand \label{sec:syntax-extensions}
6738 \begin_inset LatexCommand \label{sec:syntax-extensions}
6729
6739
6730 \end_inset
6740 \end_inset
6731
6741
6732 Extensions for syntax processing
6742 Extensions for syntax processing
6733 \layout Standard
6743 \layout Standard
6734
6744
6735 This isn't for the faint of heart, because the potential for breaking things
6745 This isn't for the faint of heart, because the potential for breaking things
6736 is quite high.
6746 is quite high.
6737 But it can be a very powerful and useful feature.
6747 But it can be a very powerful and useful feature.
6738 In a nutshell, you can redefine the way IPython processes the user input
6748 In a nutshell, you can redefine the way IPython processes the user input
6739 line to accept new, special extensions to the syntax without needing to
6749 line to accept new, special extensions to the syntax without needing to
6740 change any of IPython's own code.
6750 change any of IPython's own code.
6741 \layout Standard
6751 \layout Standard
6742
6752
6743 In the
6753 In the
6744 \family typewriter
6754 \family typewriter
6745 IPython/Extensions
6755 IPython/Extensions
6746 \family default
6756 \family default
6747 directory you will find some examples supplied, which we will briefly describe
6757 directory you will find some examples supplied, which we will briefly describe
6748 now.
6758 now.
6749 These can be used `as is' (and both provide very useful functionality),
6759 These can be used `as is' (and both provide very useful functionality),
6750 or you can use them as a starting point for writing your own extensions.
6760 or you can use them as a starting point for writing your own extensions.
6751 \layout Subsection
6761 \layout Subsection
6752
6762
6753 Pasting of code starting with
6763 Pasting of code starting with
6754 \family typewriter
6764 \family typewriter
6755 `>>>
6765 `>>>
6756 \family default
6766 \family default
6757 ' or
6767 ' or
6758 \family typewriter
6768 \family typewriter
6759 `...
6769 `...
6760
6770
6761 \family default
6771 \family default
6762 '
6772 '
6763 \layout Standard
6773 \layout Standard
6764
6774
6765 In the python tutorial it is common to find code examples which have been
6775 In the python tutorial it is common to find code examples which have been
6766 taken from real python sessions.
6776 taken from real python sessions.
6767 The problem with those is that all the lines begin with either
6777 The problem with those is that all the lines begin with either
6768 \family typewriter
6778 \family typewriter
6769 `>>>
6779 `>>>
6770 \family default
6780 \family default
6771 ' or
6781 ' or
6772 \family typewriter
6782 \family typewriter
6773 `...
6783 `...
6774
6784
6775 \family default
6785 \family default
6776 ', which makes it impossible to paste them all at once.
6786 ', which makes it impossible to paste them all at once.
6777 One must instead do a line by line manual copying, carefully removing the
6787 One must instead do a line by line manual copying, carefully removing the
6778 leading extraneous characters.
6788 leading extraneous characters.
6779 \layout Standard
6789 \layout Standard
6780
6790
6781 This extension identifies those starting characters and removes them from
6791 This extension identifies those starting characters and removes them from
6782 the input automatically, so that one can paste multi-line examples directly
6792 the input automatically, so that one can paste multi-line examples directly
6783 into IPython, saving a lot of time.
6793 into IPython, saving a lot of time.
6784 Please look at the file
6794 Please look at the file
6785 \family typewriter
6795 \family typewriter
6786 InterpreterPasteInput.py
6796 InterpreterPasteInput.py
6787 \family default
6797 \family default
6788 in the
6798 in the
6789 \family typewriter
6799 \family typewriter
6790 IPython/Extensions
6800 IPython/Extensions
6791 \family default
6801 \family default
6792 directory for details on how this is done.
6802 directory for details on how this is done.
6793 \layout Standard
6803 \layout Standard
6794
6804
6795 IPython comes with a special profile enabling this feature, called
6805 IPython comes with a special profile enabling this feature, called
6796 \family typewriter
6806 \family typewriter
6797 tutorial
6807 tutorial
6798 \family default
6808 \family default
6799 \emph on
6809 \emph on
6800 .
6810 .
6801
6811
6802 \emph default
6812 \emph default
6803 Simply start IPython via
6813 Simply start IPython via
6804 \family typewriter
6814 \family typewriter
6805 `ipython\SpecialChar ~
6815 `ipython\SpecialChar ~
6806 -p\SpecialChar ~
6816 -p\SpecialChar ~
6807 tutorial'
6817 tutorial'
6808 \family default
6818 \family default
6809 and the feature will be available.
6819 and the feature will be available.
6810 In a normal IPython session you can activate the feature by importing the
6820 In a normal IPython session you can activate the feature by importing the
6811 corresponding module with:
6821 corresponding module with:
6812 \newline
6822 \newline
6813
6823
6814 \family typewriter
6824 \family typewriter
6815 In [1]: import IPython.Extensions.InterpreterPasteInput
6825 In [1]: import IPython.Extensions.InterpreterPasteInput
6816 \layout Standard
6826 \layout Standard
6817
6827
6818 The following is a 'screenshot' of how things work when this extension is
6828 The following is a 'screenshot' of how things work when this extension is
6819 on, copying an example from the standard tutorial:
6829 on, copying an example from the standard tutorial:
6820 \layout Standard
6830 \layout Standard
6821
6831
6822
6832
6823 \family typewriter
6833 \family typewriter
6824 IPython profile: tutorial
6834 IPython profile: tutorial
6825 \newline
6835 \newline
6826 \SpecialChar ~
6836 \SpecialChar ~
6827
6837
6828 \newline
6838 \newline
6829 *** Pasting of code with ">>>" or "..." has been enabled.
6839 *** Pasting of code with ">>>" or "..." has been enabled.
6830 \newline
6840 \newline
6831 \SpecialChar ~
6841 \SpecialChar ~
6832
6842
6833 \newline
6843 \newline
6834 In [1]: >>> def fib2(n): # return Fibonacci series up to n
6844 In [1]: >>> def fib2(n): # return Fibonacci series up to n
6835 \newline
6845 \newline
6836
6846
6837 \begin_inset ERT
6847 \begin_inset ERT
6838 status Collapsed
6848 status Collapsed
6839
6849
6840 \layout Standard
6850 \layout Standard
6841
6851
6842 \backslash
6852 \backslash
6843 hspace*{0mm}
6853 hspace*{0mm}
6844 \end_inset
6854 \end_inset
6845
6855
6846 \SpecialChar ~
6856 \SpecialChar ~
6847 \SpecialChar ~
6857 \SpecialChar ~
6848 ...: ...\SpecialChar ~
6858 ...: ...\SpecialChar ~
6849 \SpecialChar ~
6859 \SpecialChar ~
6850 \SpecialChar ~
6860 \SpecialChar ~
6851 \SpecialChar ~
6861 \SpecialChar ~
6852 """Return a list containing the Fibonacci series up to n."""
6862 """Return a list containing the Fibonacci series up to n."""
6853 \newline
6863 \newline
6854
6864
6855 \begin_inset ERT
6865 \begin_inset ERT
6856 status Collapsed
6866 status Collapsed
6857
6867
6858 \layout Standard
6868 \layout Standard
6859
6869
6860 \backslash
6870 \backslash
6861 hspace*{0mm}
6871 hspace*{0mm}
6862 \end_inset
6872 \end_inset
6863
6873
6864 \SpecialChar ~
6874 \SpecialChar ~
6865 \SpecialChar ~
6875 \SpecialChar ~
6866 ...: ...\SpecialChar ~
6876 ...: ...\SpecialChar ~
6867 \SpecialChar ~
6877 \SpecialChar ~
6868 \SpecialChar ~
6878 \SpecialChar ~
6869 \SpecialChar ~
6879 \SpecialChar ~
6870 result = []
6880 result = []
6871 \newline
6881 \newline
6872
6882
6873 \begin_inset ERT
6883 \begin_inset ERT
6874 status Collapsed
6884 status Collapsed
6875
6885
6876 \layout Standard
6886 \layout Standard
6877
6887
6878 \backslash
6888 \backslash
6879 hspace*{0mm}
6889 hspace*{0mm}
6880 \end_inset
6890 \end_inset
6881
6891
6882 \SpecialChar ~
6892 \SpecialChar ~
6883 \SpecialChar ~
6893 \SpecialChar ~
6884 ...: ...\SpecialChar ~
6894 ...: ...\SpecialChar ~
6885 \SpecialChar ~
6895 \SpecialChar ~
6886 \SpecialChar ~
6896 \SpecialChar ~
6887 \SpecialChar ~
6897 \SpecialChar ~
6888 a, b = 0, 1
6898 a, b = 0, 1
6889 \newline
6899 \newline
6890
6900
6891 \begin_inset ERT
6901 \begin_inset ERT
6892 status Collapsed
6902 status Collapsed
6893
6903
6894 \layout Standard
6904 \layout Standard
6895
6905
6896 \backslash
6906 \backslash
6897 hspace*{0mm}
6907 hspace*{0mm}
6898 \end_inset
6908 \end_inset
6899
6909
6900 \SpecialChar ~
6910 \SpecialChar ~
6901 \SpecialChar ~
6911 \SpecialChar ~
6902 ...: ...\SpecialChar ~
6912 ...: ...\SpecialChar ~
6903 \SpecialChar ~
6913 \SpecialChar ~
6904 \SpecialChar ~
6914 \SpecialChar ~
6905 \SpecialChar ~
6915 \SpecialChar ~
6906 while b < n:
6916 while b < n:
6907 \newline
6917 \newline
6908
6918
6909 \begin_inset ERT
6919 \begin_inset ERT
6910 status Collapsed
6920 status Collapsed
6911
6921
6912 \layout Standard
6922 \layout Standard
6913
6923
6914 \backslash
6924 \backslash
6915 hspace*{0mm}
6925 hspace*{0mm}
6916 \end_inset
6926 \end_inset
6917
6927
6918 \SpecialChar ~
6928 \SpecialChar ~
6919 \SpecialChar ~
6929 \SpecialChar ~
6920 ...: ...\SpecialChar ~
6930 ...: ...\SpecialChar ~
6921 \SpecialChar ~
6931 \SpecialChar ~
6922 \SpecialChar ~
6932 \SpecialChar ~
6923 \SpecialChar ~
6933 \SpecialChar ~
6924 \SpecialChar ~
6934 \SpecialChar ~
6925 \SpecialChar ~
6935 \SpecialChar ~
6926 \SpecialChar ~
6936 \SpecialChar ~
6927 \SpecialChar ~
6937 \SpecialChar ~
6928 result.append(b)\SpecialChar ~
6938 result.append(b)\SpecialChar ~
6929 \SpecialChar ~
6939 \SpecialChar ~
6930 \SpecialChar ~
6940 \SpecialChar ~
6931 # see below
6941 # see below
6932 \newline
6942 \newline
6933
6943
6934 \begin_inset ERT
6944 \begin_inset ERT
6935 status Collapsed
6945 status Collapsed
6936
6946
6937 \layout Standard
6947 \layout Standard
6938
6948
6939 \backslash
6949 \backslash
6940 hspace*{0mm}
6950 hspace*{0mm}
6941 \end_inset
6951 \end_inset
6942
6952
6943 \SpecialChar ~
6953 \SpecialChar ~
6944 \SpecialChar ~
6954 \SpecialChar ~
6945 ...: ...\SpecialChar ~
6955 ...: ...\SpecialChar ~
6946 \SpecialChar ~
6956 \SpecialChar ~
6947 \SpecialChar ~
6957 \SpecialChar ~
6948 \SpecialChar ~
6958 \SpecialChar ~
6949 \SpecialChar ~
6959 \SpecialChar ~
6950 \SpecialChar ~
6960 \SpecialChar ~
6951 \SpecialChar ~
6961 \SpecialChar ~
6952 \SpecialChar ~
6962 \SpecialChar ~
6953 a, b = b, a+b
6963 a, b = b, a+b
6954 \newline
6964 \newline
6955
6965
6956 \begin_inset ERT
6966 \begin_inset ERT
6957 status Collapsed
6967 status Collapsed
6958
6968
6959 \layout Standard
6969 \layout Standard
6960
6970
6961 \backslash
6971 \backslash
6962 hspace*{0mm}
6972 hspace*{0mm}
6963 \end_inset
6973 \end_inset
6964
6974
6965 \SpecialChar ~
6975 \SpecialChar ~
6966 \SpecialChar ~
6976 \SpecialChar ~
6967 ...: ...\SpecialChar ~
6977 ...: ...\SpecialChar ~
6968 \SpecialChar ~
6978 \SpecialChar ~
6969 \SpecialChar ~
6979 \SpecialChar ~
6970 \SpecialChar ~
6980 \SpecialChar ~
6971 return result
6981 return result
6972 \newline
6982 \newline
6973
6983
6974 \begin_inset ERT
6984 \begin_inset ERT
6975 status Collapsed
6985 status Collapsed
6976
6986
6977 \layout Standard
6987 \layout Standard
6978
6988
6979 \backslash
6989 \backslash
6980 hspace*{0mm}
6990 hspace*{0mm}
6981 \end_inset
6991 \end_inset
6982
6992
6983 \SpecialChar ~
6993 \SpecialChar ~
6984 \SpecialChar ~
6994 \SpecialChar ~
6985 ...:
6995 ...:
6986 \newline
6996 \newline
6987 \SpecialChar ~
6997 \SpecialChar ~
6988
6998
6989 \newline
6999 \newline
6990 In [2]: fib2(10)
7000 In [2]: fib2(10)
6991 \newline
7001 \newline
6992 Out[2]: [1, 1, 2, 3, 5, 8]
7002 Out[2]: [1, 1, 2, 3, 5, 8]
6993 \layout Standard
7003 \layout Standard
6994
7004
6995 Note that as currently written, this extension does
7005 Note that as currently written, this extension does
6996 \emph on
7006 \emph on
6997 not
7007 not
6998 \emph default
7008 \emph default
6999 recognize IPython's prompts for pasting.
7009 recognize IPython's prompts for pasting.
7000 Those are more complicated, since the user can change them very easily,
7010 Those are more complicated, since the user can change them very easily,
7001 they involve numbers and can vary in length.
7011 they involve numbers and can vary in length.
7002 One could however extract all the relevant information from the IPython
7012 One could however extract all the relevant information from the IPython
7003 instance and build an appropriate regular expression.
7013 instance and build an appropriate regular expression.
7004 This is left as an exercise for the reader.
7014 This is left as an exercise for the reader.
7005 \layout Subsection
7015 \layout Subsection
7006
7016
7007 Input of physical quantities with units
7017 Input of physical quantities with units
7008 \layout Standard
7018 \layout Standard
7009
7019
7010 The module
7020 The module
7011 \family typewriter
7021 \family typewriter
7012 PhysicalQInput
7022 PhysicalQInput
7013 \family default
7023 \family default
7014 allows a simplified form of input for physical quantities with units.
7024 allows a simplified form of input for physical quantities with units.
7015 This file is meant to be used in conjunction with the
7025 This file is meant to be used in conjunction with the
7016 \family typewriter
7026 \family typewriter
7017 PhysicalQInteractive
7027 PhysicalQInteractive
7018 \family default
7028 \family default
7019 module (in the same directory) and
7029 module (in the same directory) and
7020 \family typewriter
7030 \family typewriter
7021 Physics.PhysicalQuantities
7031 Physics.PhysicalQuantities
7022 \family default
7032 \family default
7023 from Konrad Hinsen's ScientificPython (
7033 from Konrad Hinsen's ScientificPython (
7024 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/hinsen/scientific.html}
7034 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/hinsen/scientific.html}
7025
7035
7026 \end_inset
7036 \end_inset
7027
7037
7028 ).
7038 ).
7029 \layout Standard
7039 \layout Standard
7030
7040
7031 The
7041 The
7032 \family typewriter
7042 \family typewriter
7033 Physics.PhysicalQuantities
7043 Physics.PhysicalQuantities
7034 \family default
7044 \family default
7035 module defines
7045 module defines
7036 \family typewriter
7046 \family typewriter
7037 PhysicalQuantity
7047 PhysicalQuantity
7038 \family default
7048 \family default
7039 objects, but these must be declared as instances of a class.
7049 objects, but these must be declared as instances of a class.
7040 For example, to define
7050 For example, to define
7041 \family typewriter
7051 \family typewriter
7042 v
7052 v
7043 \family default
7053 \family default
7044 as a velocity of 3\SpecialChar ~
7054 as a velocity of 3\SpecialChar ~
7045 m/s, normally you would write:
7055 m/s, normally you would write:
7046 \family typewriter
7056 \family typewriter
7047
7057
7048 \newline
7058 \newline
7049 In [1]: v = PhysicalQuantity(3,'m/s')
7059 In [1]: v = PhysicalQuantity(3,'m/s')
7050 \layout Standard
7060 \layout Standard
7051
7061
7052 Using the
7062 Using the
7053 \family typewriter
7063 \family typewriter
7054 PhysicalQ_Input
7064 PhysicalQ_Input
7055 \family default
7065 \family default
7056 extension this can be input instead as:
7066 extension this can be input instead as:
7057 \family typewriter
7067 \family typewriter
7058
7068
7059 \newline
7069 \newline
7060 In [1]: v = 3 m/s
7070 In [1]: v = 3 m/s
7061 \family default
7071 \family default
7062
7072
7063 \newline
7073 \newline
7064 which is much more convenient for interactive use (even though it is blatantly
7074 which is much more convenient for interactive use (even though it is blatantly
7065 invalid Python syntax).
7075 invalid Python syntax).
7066 \layout Standard
7076 \layout Standard
7067
7077
7068 The
7078 The
7069 \family typewriter
7079 \family typewriter
7070 physics
7080 physics
7071 \family default
7081 \family default
7072 profile supplied with IPython (enabled via
7082 profile supplied with IPython (enabled via
7073 \family typewriter
7083 \family typewriter
7074 'ipython -p physics'
7084 'ipython -p physics'
7075 \family default
7085 \family default
7076 ) uses these extensions, which you can also activate with:
7086 ) uses these extensions, which you can also activate with:
7077 \layout Standard
7087 \layout Standard
7078
7088
7079
7089
7080 \family typewriter
7090 \family typewriter
7081 from math import * # math MUST be imported BEFORE PhysicalQInteractive
7091 from math import * # math MUST be imported BEFORE PhysicalQInteractive
7082 \newline
7092 \newline
7083 from IPython.Extensions.PhysicalQInteractive import *
7093 from IPython.Extensions.PhysicalQInteractive import *
7084 \newline
7094 \newline
7085 import IPython.Extensions.PhysicalQInput
7095 import IPython.Extensions.PhysicalQInput
7086 \layout Section
7096 \layout Section
7087
7097
7088
7098
7089 \begin_inset LatexCommand \label{sec:IPython-as-shell}
7099 \begin_inset LatexCommand \label{sec:IPython-as-shell}
7090
7100
7091 \end_inset
7101 \end_inset
7092
7102
7093 IPython as a system shell
7103 IPython as a system shell
7094 \layout Standard
7104 \layout Standard
7095
7105
7096 IPython ships with a special profile called
7106 IPython ships with a special profile called
7097 \family typewriter
7107 \family typewriter
7098 pysh
7108 pysh
7099 \family default
7109 \family default
7100 , which you can activate at the command line as
7110 , which you can activate at the command line as
7101 \family typewriter
7111 \family typewriter
7102 `ipython -p pysh'
7112 `ipython -p pysh'
7103 \family default
7113 \family default
7104 .
7114 .
7105 This loads
7115 This loads
7106 \family typewriter
7116 \family typewriter
7107 InterpreterExec
7117 InterpreterExec
7108 \family default
7118 \family default
7109 , along with some additional facilities and a prompt customized for filesystem
7119 , along with some additional facilities and a prompt customized for filesystem
7110 navigation.
7120 navigation.
7111 \layout Standard
7121 \layout Standard
7112
7122
7113 Note that this does
7123 Note that this does
7114 \emph on
7124 \emph on
7115 not
7125 not
7116 \emph default
7126 \emph default
7117 make IPython a full-fledged system shell.
7127 make IPython a full-fledged system shell.
7118 In particular, it has no job control, so if you type Ctrl-Z (under Unix),
7128 In particular, it has no job control, so if you type Ctrl-Z (under Unix),
7119 you'll suspend pysh itself, not the process you just started.
7129 you'll suspend pysh itself, not the process you just started.
7120
7130
7121 \layout Standard
7131 \layout Standard
7122
7132
7123 What the shell profile allows you to do is to use the convenient and powerful
7133 What the shell profile allows you to do is to use the convenient and powerful
7124 syntax of Python to do quick scripting at the command line.
7134 syntax of Python to do quick scripting at the command line.
7125 Below we describe some of its features.
7135 Below we describe some of its features.
7126 \layout Subsection
7136 \layout Subsection
7127
7137
7128 Aliases
7138 Aliases
7129 \layout Standard
7139 \layout Standard
7130
7140
7131 All of your
7141 All of your
7132 \family typewriter
7142 \family typewriter
7133 $PATH
7143 $PATH
7134 \family default
7144 \family default
7135 has been loaded as IPython aliases, so you should be able to type any normal
7145 has been loaded as IPython aliases, so you should be able to type any normal
7136 system command and have it executed.
7146 system command and have it executed.
7137 See
7147 See
7138 \family typewriter
7148 \family typewriter
7139 %alias?
7149 %alias?
7140 \family default
7150 \family default
7141 and
7151 and
7142 \family typewriter
7152 \family typewriter
7143 %unalias?
7153 %unalias?
7144 \family default
7154 \family default
7145 for details on the alias facilities.
7155 for details on the alias facilities.
7146 See also
7156 See also
7147 \family typewriter
7157 \family typewriter
7148 %rehash?
7158 %rehash?
7149 \family default
7159 \family default
7150 and
7160 and
7151 \family typewriter
7161 \family typewriter
7152 %rehashx?
7162 %rehashx?
7153 \family default
7163 \family default
7154 for details on the mechanism used to load
7164 for details on the mechanism used to load
7155 \family typewriter
7165 \family typewriter
7156 $PATH
7166 $PATH
7157 \family default
7167 \family default
7158 .
7168 .
7159 \layout Subsection
7169 \layout Subsection
7160
7170
7161 Special syntax
7171 Special syntax
7162 \layout Standard
7172 \layout Standard
7163
7173
7164 Any lines which begin with
7174 Any lines which begin with
7165 \family typewriter
7175 \family typewriter
7166 `~'
7176 `~'
7167 \family default
7177 \family default
7168 ,
7178 ,
7169 \family typewriter
7179 \family typewriter
7170 `/'
7180 `/'
7171 \family default
7181 \family default
7172 and
7182 and
7173 \family typewriter
7183 \family typewriter
7174 `.'
7184 `.'
7175 \family default
7185 \family default
7176 will be executed as shell commands instead of as Python code.
7186 will be executed as shell commands instead of as Python code.
7177 The special escapes below are also recognized.
7187 The special escapes below are also recognized.
7178
7188
7179 \family typewriter
7189 \family typewriter
7180 !cmd
7190 !cmd
7181 \family default
7191 \family default
7182 is valid in single or multi-line input, all others are only valid in single-lin
7192 is valid in single or multi-line input, all others are only valid in single-lin
7183 e input:
7193 e input:
7184 \layout Description
7194 \layout Description
7185
7195
7186
7196
7187 \family typewriter
7197 \family typewriter
7188 !cmd
7198 !cmd
7189 \family default
7199 \family default
7190 pass `cmd' directly to the shell
7200 pass `cmd' directly to the shell
7191 \layout Description
7201 \layout Description
7192
7202
7193
7203
7194 \family typewriter
7204 \family typewriter
7195 !!cmd
7205 !!cmd
7196 \family default
7206 \family default
7197 execute `cmd' and return output as a list (split on `
7207 execute `cmd' and return output as a list (split on `
7198 \backslash
7208 \backslash
7199 n')
7209 n')
7200 \layout Description
7210 \layout Description
7201
7211
7202
7212
7203 \family typewriter
7213 \family typewriter
7204 $var=cmd
7214 $var=cmd
7205 \family default
7215 \family default
7206 capture output of cmd into var, as a string
7216 capture output of cmd into var, as a string
7207 \layout Description
7217 \layout Description
7208
7218
7209
7219
7210 \family typewriter
7220 \family typewriter
7211 $$var=cmd
7221 $$var=cmd
7212 \family default
7222 \family default
7213 capture output of cmd into var, as a list (split on `
7223 capture output of cmd into var, as a list (split on `
7214 \backslash
7224 \backslash
7215 n')
7225 n')
7216 \layout Standard
7226 \layout Standard
7217
7227
7218 The
7228 The
7219 \family typewriter
7229 \family typewriter
7220 $
7230 $
7221 \family default
7231 \family default
7222 /
7232 /
7223 \family typewriter
7233 \family typewriter
7224 $$
7234 $$
7225 \family default
7235 \family default
7226 syntaxes make Python variables from system output, which you can later
7236 syntaxes make Python variables from system output, which you can later
7227 use for further scripting.
7237 use for further scripting.
7228 The converse is also possible: when executing an alias or calling to the
7238 The converse is also possible: when executing an alias or calling to the
7229 system via
7239 system via
7230 \family typewriter
7240 \family typewriter
7231 !
7241 !
7232 \family default
7242 \family default
7233 /
7243 /
7234 \family typewriter
7244 \family typewriter
7235 !!
7245 !!
7236 \family default
7246 \family default
7237 , you can expand any python variable or expression by prepending it with
7247 , you can expand any python variable or expression by prepending it with
7238
7248
7239 \family typewriter
7249 \family typewriter
7240 $
7250 $
7241 \family default
7251 \family default
7242 .
7252 .
7243 Full details of the allowed syntax can be found in Python's PEP 215.
7253 Full details of the allowed syntax can be found in Python's PEP 215.
7244 \layout Standard
7254 \layout Standard
7245
7255
7246 A few brief examples will illustrate these (note that the indentation below
7256 A few brief examples will illustrate these (note that the indentation below
7247 may be incorrectly displayed):
7257 may be incorrectly displayed):
7248 \layout Standard
7258 \layout Standard
7249
7259
7250
7260
7251 \family typewriter
7261 \family typewriter
7252 fperez[~/test]|3> !ls *s.py
7262 fperez[~/test]|3> !ls *s.py
7253 \newline
7263 \newline
7254 scopes.py strings.py
7264 scopes.py strings.py
7255 \layout Standard
7265 \layout Standard
7256
7266
7257 ls is an internal alias, so there's no need to use
7267 ls is an internal alias, so there's no need to use
7258 \family typewriter
7268 \family typewriter
7259 !
7269 !
7260 \family default
7270 \family default
7261 :
7271 :
7262 \layout Standard
7272 \layout Standard
7263
7273
7264
7274
7265 \family typewriter
7275 \family typewriter
7266 fperez[~/test]|4> ls *s.py
7276 fperez[~/test]|4> ls *s.py
7267 \newline
7277 \newline
7268 scopes.py* strings.py
7278 scopes.py* strings.py
7269 \layout Standard
7279 \layout Standard
7270
7280
7271 !!ls will return the output into a Python variable:
7281 !!ls will return the output into a Python variable:
7272 \layout Standard
7282 \layout Standard
7273
7283
7274
7284
7275 \family typewriter
7285 \family typewriter
7276 fperez[~/test]|5> !!ls *s.py
7286 fperez[~/test]|5> !!ls *s.py
7277 \newline
7287 \newline
7278
7288
7279 \begin_inset ERT
7289 \begin_inset ERT
7280 status Collapsed
7290 status Collapsed
7281
7291
7282 \layout Standard
7292 \layout Standard
7283
7293
7284 \backslash
7294 \backslash
7285 hspace*{0mm}
7295 hspace*{0mm}
7286 \end_inset
7296 \end_inset
7287
7297
7288 \SpecialChar ~
7298 \SpecialChar ~
7289 \SpecialChar ~
7299 \SpecialChar ~
7290 \SpecialChar ~
7300 \SpecialChar ~
7291 \SpecialChar ~
7301 \SpecialChar ~
7292 \SpecialChar ~
7302 \SpecialChar ~
7293 \SpecialChar ~
7303 \SpecialChar ~
7294 \SpecialChar ~
7304 \SpecialChar ~
7295 \SpecialChar ~
7305 \SpecialChar ~
7296 \SpecialChar ~
7306 \SpecialChar ~
7297 \SpecialChar ~
7307 \SpecialChar ~
7298 \SpecialChar ~
7308 \SpecialChar ~
7299 \SpecialChar ~
7309 \SpecialChar ~
7300 \SpecialChar ~
7310 \SpecialChar ~
7301 \SpecialChar ~
7311 \SpecialChar ~
7302 <5> ['scopes.py', 'strings.py']
7312 <5> ['scopes.py', 'strings.py']
7303 \newline
7313 \newline
7304 fperez[~/test]|6> print _5
7314 fperez[~/test]|6> print _5
7305 \newline
7315 \newline
7306 ['scopes.py', 'strings.py']
7316 ['scopes.py', 'strings.py']
7307 \layout Standard
7317 \layout Standard
7308
7318
7309
7319
7310 \family typewriter
7320 \family typewriter
7311 $
7321 $
7312 \family default
7322 \family default
7313 and
7323 and
7314 \family typewriter
7324 \family typewriter
7315 $$
7325 $$
7316 \family default
7326 \family default
7317 allow direct capture to named variables:
7327 allow direct capture to named variables:
7318 \layout Standard
7328 \layout Standard
7319
7329
7320
7330
7321 \family typewriter
7331 \family typewriter
7322 fperez[~/test]|7> $astr = ls *s.py
7332 fperez[~/test]|7> $astr = ls *s.py
7323 \newline
7333 \newline
7324 fperez[~/test]|8> astr
7334 fperez[~/test]|8> astr
7325 \newline
7335 \newline
7326
7336
7327 \begin_inset ERT
7337 \begin_inset ERT
7328 status Collapsed
7338 status Collapsed
7329
7339
7330 \layout Standard
7340 \layout Standard
7331
7341
7332 \backslash
7342 \backslash
7333 hspace*{0mm}
7343 hspace*{0mm}
7334 \end_inset
7344 \end_inset
7335
7345
7336 \SpecialChar ~
7346 \SpecialChar ~
7337 \SpecialChar ~
7347 \SpecialChar ~
7338 \SpecialChar ~
7348 \SpecialChar ~
7339 \SpecialChar ~
7349 \SpecialChar ~
7340 \SpecialChar ~
7350 \SpecialChar ~
7341 \SpecialChar ~
7351 \SpecialChar ~
7342 \SpecialChar ~
7352 \SpecialChar ~
7343 \SpecialChar ~
7353 \SpecialChar ~
7344 \SpecialChar ~
7354 \SpecialChar ~
7345 \SpecialChar ~
7355 \SpecialChar ~
7346 \SpecialChar ~
7356 \SpecialChar ~
7347 \SpecialChar ~
7357 \SpecialChar ~
7348 \SpecialChar ~
7358 \SpecialChar ~
7349 \SpecialChar ~
7359 \SpecialChar ~
7350 <8> 'scopes.py
7360 <8> 'scopes.py
7351 \backslash
7361 \backslash
7352 nstrings.py'
7362 nstrings.py'
7353 \layout Standard
7363 \layout Standard
7354
7364
7355
7365
7356 \family typewriter
7366 \family typewriter
7357 fperez[~/test]|9> $$alist = ls *s.py
7367 fperez[~/test]|9> $$alist = ls *s.py
7358 \newline
7368 \newline
7359 fperez[~/test]|10> alist
7369 fperez[~/test]|10> alist
7360 \newline
7370 \newline
7361
7371
7362 \begin_inset ERT
7372 \begin_inset ERT
7363 status Collapsed
7373 status Collapsed
7364
7374
7365 \layout Standard
7375 \layout Standard
7366
7376
7367 \backslash
7377 \backslash
7368 hspace*{0mm}
7378 hspace*{0mm}
7369 \end_inset
7379 \end_inset
7370
7380
7371 \SpecialChar ~
7381 \SpecialChar ~
7372 \SpecialChar ~
7382 \SpecialChar ~
7373 \SpecialChar ~
7383 \SpecialChar ~
7374 \SpecialChar ~
7384 \SpecialChar ~
7375 \SpecialChar ~
7385 \SpecialChar ~
7376 \SpecialChar ~
7386 \SpecialChar ~
7377 \SpecialChar ~
7387 \SpecialChar ~
7378 \SpecialChar ~
7388 \SpecialChar ~
7379 \SpecialChar ~
7389 \SpecialChar ~
7380 \SpecialChar ~
7390 \SpecialChar ~
7381 \SpecialChar ~
7391 \SpecialChar ~
7382 \SpecialChar ~
7392 \SpecialChar ~
7383 \SpecialChar ~
7393 \SpecialChar ~
7384 \SpecialChar ~
7394 \SpecialChar ~
7385 <10> ['scopes.py', 'strings.py']
7395 <10> ['scopes.py', 'strings.py']
7386 \layout Standard
7396 \layout Standard
7387
7397
7388 alist is now a normal python list you can loop over.
7398 alist is now a normal python list you can loop over.
7389 Using
7399 Using
7390 \family typewriter
7400 \family typewriter
7391 $
7401 $
7392 \family default
7402 \family default
7393 will expand back the python values when alias calls are made:
7403 will expand back the python values when alias calls are made:
7394 \layout Standard
7404 \layout Standard
7395
7405
7396
7406
7397 \family typewriter
7407 \family typewriter
7398 fperez[~/test]|11> for f in alist:
7408 fperez[~/test]|11> for f in alist:
7399 \newline
7409 \newline
7400
7410
7401 \begin_inset ERT
7411 \begin_inset ERT
7402 status Collapsed
7412 status Collapsed
7403
7413
7404 \layout Standard
7414 \layout Standard
7405
7415
7406 \backslash
7416 \backslash
7407 hspace*{0mm}
7417 hspace*{0mm}
7408 \end_inset
7418 \end_inset
7409
7419
7410 \SpecialChar ~
7420 \SpecialChar ~
7411 \SpecialChar ~
7421 \SpecialChar ~
7412 \SpecialChar ~
7422 \SpecialChar ~
7413 \SpecialChar ~
7423 \SpecialChar ~
7414 \SpecialChar ~
7424 \SpecialChar ~
7415 \SpecialChar ~
7425 \SpecialChar ~
7416 \SpecialChar ~
7426 \SpecialChar ~
7417 \SpecialChar ~
7427 \SpecialChar ~
7418 \SpecialChar ~
7428 \SpecialChar ~
7419 \SpecialChar ~
7429 \SpecialChar ~
7420 \SpecialChar ~
7430 \SpecialChar ~
7421 \SpecialChar ~
7431 \SpecialChar ~
7422 \SpecialChar ~
7432 \SpecialChar ~
7423 \SpecialChar ~
7433 \SpecialChar ~
7424 |..> \SpecialChar ~
7434 |..> \SpecialChar ~
7425 \SpecialChar ~
7435 \SpecialChar ~
7426 \SpecialChar ~
7436 \SpecialChar ~
7427 \SpecialChar ~
7437 \SpecialChar ~
7428 print 'file',f,
7438 print 'file',f,
7429 \newline
7439 \newline
7430
7440
7431 \begin_inset ERT
7441 \begin_inset ERT
7432 status Collapsed
7442 status Collapsed
7433
7443
7434 \layout Standard
7444 \layout Standard
7435
7445
7436 \backslash
7446 \backslash
7437 hspace*{0mm}
7447 hspace*{0mm}
7438 \end_inset
7448 \end_inset
7439
7449
7440 \SpecialChar ~
7450 \SpecialChar ~
7441 \SpecialChar ~
7451 \SpecialChar ~
7442 \SpecialChar ~
7452 \SpecialChar ~
7443 \SpecialChar ~
7453 \SpecialChar ~
7444 \SpecialChar ~
7454 \SpecialChar ~
7445 \SpecialChar ~
7455 \SpecialChar ~
7446 \SpecialChar ~
7456 \SpecialChar ~
7447 \SpecialChar ~
7457 \SpecialChar ~
7448 \SpecialChar ~
7458 \SpecialChar ~
7449 \SpecialChar ~
7459 \SpecialChar ~
7450 \SpecialChar ~
7460 \SpecialChar ~
7451 \SpecialChar ~
7461 \SpecialChar ~
7452 \SpecialChar ~
7462 \SpecialChar ~
7453 \SpecialChar ~
7463 \SpecialChar ~
7454 |..> \SpecialChar ~
7464 |..> \SpecialChar ~
7455 \SpecialChar ~
7465 \SpecialChar ~
7456 \SpecialChar ~
7466 \SpecialChar ~
7457 \SpecialChar ~
7467 \SpecialChar ~
7458 wc -l $f
7468 wc -l $f
7459 \newline
7469 \newline
7460
7470
7461 \begin_inset ERT
7471 \begin_inset ERT
7462 status Collapsed
7472 status Collapsed
7463
7473
7464 \layout Standard
7474 \layout Standard
7465
7475
7466 \backslash
7476 \backslash
7467 hspace*{0mm}
7477 hspace*{0mm}
7468 \end_inset
7478 \end_inset
7469
7479
7470 \SpecialChar ~
7480 \SpecialChar ~
7471 \SpecialChar ~
7481 \SpecialChar ~
7472 \SpecialChar ~
7482 \SpecialChar ~
7473 \SpecialChar ~
7483 \SpecialChar ~
7474 \SpecialChar ~
7484 \SpecialChar ~
7475 \SpecialChar ~
7485 \SpecialChar ~
7476 \SpecialChar ~
7486 \SpecialChar ~
7477 \SpecialChar ~
7487 \SpecialChar ~
7478 \SpecialChar ~
7488 \SpecialChar ~
7479 \SpecialChar ~
7489 \SpecialChar ~
7480 \SpecialChar ~
7490 \SpecialChar ~
7481 \SpecialChar ~
7491 \SpecialChar ~
7482 \SpecialChar ~
7492 \SpecialChar ~
7483 \SpecialChar ~
7493 \SpecialChar ~
7484 |..>
7494 |..>
7485 \newline
7495 \newline
7486 file scopes.py 13 scopes.py
7496 file scopes.py 13 scopes.py
7487 \newline
7497 \newline
7488 file strings.py 4 strings.py
7498 file strings.py 4 strings.py
7489 \layout Standard
7499 \layout Standard
7490
7500
7491 Note that you may need to protect your variables with braces if you want
7501 Note that you may need to protect your variables with braces if you want
7492 to append strings to their names.
7502 to append strings to their names.
7493 To copy all files in alist to
7503 To copy all files in alist to
7494 \family typewriter
7504 \family typewriter
7495 .bak
7505 .bak
7496 \family default
7506 \family default
7497 extensions, you must use:
7507 extensions, you must use:
7498 \layout Standard
7508 \layout Standard
7499
7509
7500
7510
7501 \family typewriter
7511 \family typewriter
7502 fperez[~/test]|12> for f in alist:
7512 fperez[~/test]|12> for f in alist:
7503 \newline
7513 \newline
7504
7514
7505 \begin_inset ERT
7515 \begin_inset ERT
7506 status Collapsed
7516 status Collapsed
7507
7517
7508 \layout Standard
7518 \layout Standard
7509
7519
7510 \backslash
7520 \backslash
7511 hspace*{0mm}
7521 hspace*{0mm}
7512 \end_inset
7522 \end_inset
7513
7523
7514 \SpecialChar ~
7524 \SpecialChar ~
7515 \SpecialChar ~
7525 \SpecialChar ~
7516 \SpecialChar ~
7526 \SpecialChar ~
7517 \SpecialChar ~
7527 \SpecialChar ~
7518 \SpecialChar ~
7528 \SpecialChar ~
7519 \SpecialChar ~
7529 \SpecialChar ~
7520 \SpecialChar ~
7530 \SpecialChar ~
7521 \SpecialChar ~
7531 \SpecialChar ~
7522 \SpecialChar ~
7532 \SpecialChar ~
7523 \SpecialChar ~
7533 \SpecialChar ~
7524 \SpecialChar ~
7534 \SpecialChar ~
7525 \SpecialChar ~
7535 \SpecialChar ~
7526 \SpecialChar ~
7536 \SpecialChar ~
7527 \SpecialChar ~
7537 \SpecialChar ~
7528 |..> \SpecialChar ~
7538 |..> \SpecialChar ~
7529 \SpecialChar ~
7539 \SpecialChar ~
7530 \SpecialChar ~
7540 \SpecialChar ~
7531 \SpecialChar ~
7541 \SpecialChar ~
7532 cp $f ${f}.bak
7542 cp $f ${f}.bak
7533 \layout Standard
7543 \layout Standard
7534
7544
7535 If you try using
7545 If you try using
7536 \family typewriter
7546 \family typewriter
7537 $f.bak
7547 $f.bak
7538 \family default
7548 \family default
7539 , you'll get an AttributeError exception saying that your string object
7549 , you'll get an AttributeError exception saying that your string object
7540 doesn't have a
7550 doesn't have a
7541 \family typewriter
7551 \family typewriter
7542 .bak
7552 .bak
7543 \family default
7553 \family default
7544 attribute.
7554 attribute.
7545 This is because the
7555 This is because the
7546 \family typewriter
7556 \family typewriter
7547 $
7557 $
7548 \family default
7558 \family default
7549 expansion mechanism allows you to expand full Python expressions:
7559 expansion mechanism allows you to expand full Python expressions:
7550 \layout Standard
7560 \layout Standard
7551
7561
7552
7562
7553 \family typewriter
7563 \family typewriter
7554 fperez[~/test]|13> echo "sys.platform is: $sys.platform"
7564 fperez[~/test]|13> echo "sys.platform is: $sys.platform"
7555 \newline
7565 \newline
7556 sys.platform is: linux2
7566 sys.platform is: linux2
7557 \layout Standard
7567 \layout Standard
7558
7568
7559 IPython's input history handling is still active, which allows you to rerun
7569 IPython's input history handling is still active, which allows you to rerun
7560 a single block of multi-line input by simply using exec:
7570 a single block of multi-line input by simply using exec:
7561 \newline
7571 \newline
7562
7572
7563 \family typewriter
7573 \family typewriter
7564 fperez[~/test]|14> $$alist = ls *.eps
7574 fperez[~/test]|14> $$alist = ls *.eps
7565 \newline
7575 \newline
7566 fperez[~/test]|15> exec _i11
7576 fperez[~/test]|15> exec _i11
7567 \newline
7577 \newline
7568 file image2.eps 921 image2.eps
7578 file image2.eps 921 image2.eps
7569 \newline
7579 \newline
7570 file image.eps 921 image.eps
7580 file image.eps 921 image.eps
7571 \layout Standard
7581 \layout Standard
7572
7582
7573 While these are new special-case syntaxes, they are designed to allow very
7583 While these are new special-case syntaxes, they are designed to allow very
7574 efficient use of the shell with minimal typing.
7584 efficient use of the shell with minimal typing.
7575 At an interactive shell prompt, conciseness of expression wins over readability.
7585 At an interactive shell prompt, conciseness of expression wins over readability.
7576 \layout Subsection
7586 \layout Subsection
7577
7587
7578 Useful functions and modules
7588 Useful functions and modules
7579 \layout Standard
7589 \layout Standard
7580
7590
7581 The os, sys and shutil modules from the Python standard library are automaticall
7591 The os, sys and shutil modules from the Python standard library are automaticall
7582 y loaded.
7592 y loaded.
7583 Some additional functions, useful for shell usage, are listed below.
7593 Some additional functions, useful for shell usage, are listed below.
7584 You can request more help about them with `
7594 You can request more help about them with `
7585 \family typewriter
7595 \family typewriter
7586 ?
7596 ?
7587 \family default
7597 \family default
7588 '.
7598 '.
7589 \layout Description
7599 \layout Description
7590
7600
7591
7601
7592 \family typewriter
7602 \family typewriter
7593 shell
7603 shell
7594 \family default
7604 \family default
7595 - execute a command in the underlying system shell
7605 - execute a command in the underlying system shell
7596 \layout Description
7606 \layout Description
7597
7607
7598
7608
7599 \family typewriter
7609 \family typewriter
7600 system
7610 system
7601 \family default
7611 \family default
7602 - like
7612 - like
7603 \family typewriter
7613 \family typewriter
7604 shell()
7614 shell()
7605 \family default
7615 \family default
7606 , but return the exit status of the command
7616 , but return the exit status of the command
7607 \layout Description
7617 \layout Description
7608
7618
7609
7619
7610 \family typewriter
7620 \family typewriter
7611 sout
7621 sout
7612 \family default
7622 \family default
7613 - capture the output of a command as a string
7623 - capture the output of a command as a string
7614 \layout Description
7624 \layout Description
7615
7625
7616
7626
7617 \family typewriter
7627 \family typewriter
7618 lout
7628 lout
7619 \family default
7629 \family default
7620 - capture the output of a command as a list (split on `
7630 - capture the output of a command as a list (split on `
7621 \backslash
7631 \backslash
7622 n')
7632 n')
7623 \layout Description
7633 \layout Description
7624
7634
7625
7635
7626 \family typewriter
7636 \family typewriter
7627 getoutputerror
7637 getoutputerror
7628 \family default
7638 \family default
7629 - capture (output,error) of a shell commandss
7639 - capture (output,error) of a shell commandss
7630 \layout Standard
7640 \layout Standard
7631
7641
7632
7642
7633 \family typewriter
7643 \family typewriter
7634 sout
7644 sout
7635 \family default
7645 \family default
7636 /
7646 /
7637 \family typewriter
7647 \family typewriter
7638 lout
7648 lout
7639 \family default
7649 \family default
7640 are the functional equivalents of
7650 are the functional equivalents of
7641 \family typewriter
7651 \family typewriter
7642 $
7652 $
7643 \family default
7653 \family default
7644 /
7654 /
7645 \family typewriter
7655 \family typewriter
7646 $$
7656 $$
7647 \family default
7657 \family default
7648 .
7658 .
7649 They are provided to allow you to capture system output in the middle of
7659 They are provided to allow you to capture system output in the middle of
7650 true python code, function definitions, etc (where
7660 true python code, function definitions, etc (where
7651 \family typewriter
7661 \family typewriter
7652 $
7662 $
7653 \family default
7663 \family default
7654 and
7664 and
7655 \family typewriter
7665 \family typewriter
7656 $$
7666 $$
7657 \family default
7667 \family default
7658 are invalid).
7668 are invalid).
7659 \layout Subsection
7669 \layout Subsection
7660
7670
7661 Directory management
7671 Directory management
7662 \layout Standard
7672 \layout Standard
7663
7673
7664 Since each command passed by pysh to the underlying system is executed in
7674 Since each command passed by pysh to the underlying system is executed in
7665 a subshell which exits immediately, you can NOT use !cd to navigate the
7675 a subshell which exits immediately, you can NOT use !cd to navigate the
7666 filesystem.
7676 filesystem.
7667 \layout Standard
7677 \layout Standard
7668
7678
7669 Pysh provides its own builtin
7679 Pysh provides its own builtin
7670 \family typewriter
7680 \family typewriter
7671 `%cd
7681 `%cd
7672 \family default
7682 \family default
7673 ' magic command to move in the filesystem (the
7683 ' magic command to move in the filesystem (the
7674 \family typewriter
7684 \family typewriter
7675 %
7685 %
7676 \family default
7686 \family default
7677 is not required with automagic on).
7687 is not required with automagic on).
7678 It also maintains a list of visited directories (use
7688 It also maintains a list of visited directories (use
7679 \family typewriter
7689 \family typewriter
7680 %dhist
7690 %dhist
7681 \family default
7691 \family default
7682 to see it) and allows direct switching to any of them.
7692 to see it) and allows direct switching to any of them.
7683 Type
7693 Type
7684 \family typewriter
7694 \family typewriter
7685 `cd?
7695 `cd?
7686 \family default
7696 \family default
7687 ' for more details.
7697 ' for more details.
7688 \layout Standard
7698 \layout Standard
7689
7699
7690
7700
7691 \family typewriter
7701 \family typewriter
7692 %pushd
7702 %pushd
7693 \family default
7703 \family default
7694 ,
7704 ,
7695 \family typewriter
7705 \family typewriter
7696 %popd
7706 %popd
7697 \family default
7707 \family default
7698 and
7708 and
7699 \family typewriter
7709 \family typewriter
7700 %dirs
7710 %dirs
7701 \family default
7711 \family default
7702 are provided for directory stack handling.
7712 are provided for directory stack handling.
7703 \layout Subsection
7713 \layout Subsection
7704
7714
7705 Prompt customization
7715 Prompt customization
7706 \layout Standard
7716 \layout Standard
7707
7717
7708 The supplied
7718 The supplied
7709 \family typewriter
7719 \family typewriter
7710 ipythonrc-pysh
7720 ipythonrc-pysh
7711 \family default
7721 \family default
7712 profile comes with an example of a very colored and detailed prompt, mainly
7722 profile comes with an example of a very colored and detailed prompt, mainly
7713 to serve as an illustration.
7723 to serve as an illustration.
7714 The valid escape sequences, besides color names, are:
7724 The valid escape sequences, besides color names, are:
7715 \layout Description
7725 \layout Description
7716
7726
7717
7727
7718 \backslash
7728 \backslash
7719 # - Prompt number.
7729 # - Prompt number.
7720 \layout Description
7730 \layout Description
7721
7731
7722
7732
7723 \backslash
7733 \backslash
7724 D - Dots, as many as there are digits in
7734 D - Dots, as many as there are digits in
7725 \backslash
7735 \backslash
7726 # (so they align).
7736 # (so they align).
7727 \layout Description
7737 \layout Description
7728
7738
7729
7739
7730 \backslash
7740 \backslash
7731 w - Current working directory (cwd).
7741 w - Current working directory (cwd).
7732 \layout Description
7742 \layout Description
7733
7743
7734
7744
7735 \backslash
7745 \backslash
7736 W - Basename of current working directory.
7746 W - Basename of current working directory.
7737 \layout Description
7747 \layout Description
7738
7748
7739
7749
7740 \backslash
7750 \backslash
7741 X
7751 X
7742 \emph on
7752 \emph on
7743 N
7753 N
7744 \emph default
7754 \emph default
7745 - Where
7755 - Where
7746 \emph on
7756 \emph on
7747 N
7757 N
7748 \emph default
7758 \emph default
7749 =0..5.
7759 =0..5.
7750 N terms of the cwd, with $HOME written as ~.
7760 N terms of the cwd, with $HOME written as ~.
7751 \layout Description
7761 \layout Description
7752
7762
7753
7763
7754 \backslash
7764 \backslash
7755 Y
7765 Y
7756 \emph on
7766 \emph on
7757 N
7767 N
7758 \emph default
7768 \emph default
7759 - Where
7769 - Where
7760 \emph on
7770 \emph on
7761 N
7771 N
7762 \emph default
7772 \emph default
7763 =0..5.
7773 =0..5.
7764 Like X
7774 Like X
7765 \emph on
7775 \emph on
7766 N
7776 N
7767 \emph default
7777 \emph default
7768 , but if ~ is term
7778 , but if ~ is term
7769 \emph on
7779 \emph on
7770 N
7780 N
7771 \emph default
7781 \emph default
7772 +1 it's also shown.
7782 +1 it's also shown.
7773 \layout Description
7783 \layout Description
7774
7784
7775
7785
7776 \backslash
7786 \backslash
7777 u - Username.
7787 u - Username.
7778 \layout Description
7788 \layout Description
7779
7789
7780
7790
7781 \backslash
7791 \backslash
7782 H - Full hostname.
7792 H - Full hostname.
7783 \layout Description
7793 \layout Description
7784
7794
7785
7795
7786 \backslash
7796 \backslash
7787 h - Hostname up to first '.'
7797 h - Hostname up to first '.'
7788 \layout Description
7798 \layout Description
7789
7799
7790
7800
7791 \backslash
7801 \backslash
7792 $ - Root symbol ($ or #).
7802 $ - Root symbol ($ or #).
7793
7803
7794 \layout Description
7804 \layout Description
7795
7805
7796
7806
7797 \backslash
7807 \backslash
7798 t - Current time, in H:M:S format.
7808 t - Current time, in H:M:S format.
7799 \layout Description
7809 \layout Description
7800
7810
7801
7811
7802 \backslash
7812 \backslash
7803 v - IPython release version.
7813 v - IPython release version.
7804
7814
7805 \layout Description
7815 \layout Description
7806
7816
7807
7817
7808 \backslash
7818 \backslash
7809 n - Newline.
7819 n - Newline.
7810
7820
7811 \layout Description
7821 \layout Description
7812
7822
7813
7823
7814 \backslash
7824 \backslash
7815 r - Carriage return.
7825 r - Carriage return.
7816
7826
7817 \layout Description
7827 \layout Description
7818
7828
7819
7829
7820 \backslash
7830 \backslash
7821
7831
7822 \backslash
7832 \backslash
7823 - An explicitly escaped '
7833 - An explicitly escaped '
7824 \backslash
7834 \backslash
7825 '.
7835 '.
7826 \layout Standard
7836 \layout Standard
7827
7837
7828 You can configure your prompt colors using any ANSI color escape.
7838 You can configure your prompt colors using any ANSI color escape.
7829 Each color escape sets the color for any subsequent text, until another
7839 Each color escape sets the color for any subsequent text, until another
7830 escape comes in and changes things.
7840 escape comes in and changes things.
7831 The valid color escapes are:
7841 The valid color escapes are:
7832 \layout Description
7842 \layout Description
7833
7843
7834
7844
7835 \backslash
7845 \backslash
7836 C_Black
7846 C_Black
7837 \layout Description
7847 \layout Description
7838
7848
7839
7849
7840 \backslash
7850 \backslash
7841 C_Blue
7851 C_Blue
7842 \layout Description
7852 \layout Description
7843
7853
7844
7854
7845 \backslash
7855 \backslash
7846 C_Brown
7856 C_Brown
7847 \layout Description
7857 \layout Description
7848
7858
7849
7859
7850 \backslash
7860 \backslash
7851 C_Cyan
7861 C_Cyan
7852 \layout Description
7862 \layout Description
7853
7863
7854
7864
7855 \backslash
7865 \backslash
7856 C_DarkGray
7866 C_DarkGray
7857 \layout Description
7867 \layout Description
7858
7868
7859
7869
7860 \backslash
7870 \backslash
7861 C_Green
7871 C_Green
7862 \layout Description
7872 \layout Description
7863
7873
7864
7874
7865 \backslash
7875 \backslash
7866 C_LightBlue
7876 C_LightBlue
7867 \layout Description
7877 \layout Description
7868
7878
7869
7879
7870 \backslash
7880 \backslash
7871 C_LightCyan
7881 C_LightCyan
7872 \layout Description
7882 \layout Description
7873
7883
7874
7884
7875 \backslash
7885 \backslash
7876 C_LightGray
7886 C_LightGray
7877 \layout Description
7887 \layout Description
7878
7888
7879
7889
7880 \backslash
7890 \backslash
7881 C_LightGreen
7891 C_LightGreen
7882 \layout Description
7892 \layout Description
7883
7893
7884
7894
7885 \backslash
7895 \backslash
7886 C_LightPurple
7896 C_LightPurple
7887 \layout Description
7897 \layout Description
7888
7898
7889
7899
7890 \backslash
7900 \backslash
7891 C_LightRed
7901 C_LightRed
7892 \layout Description
7902 \layout Description
7893
7903
7894
7904
7895 \backslash
7905 \backslash
7896 C_Purple
7906 C_Purple
7897 \layout Description
7907 \layout Description
7898
7908
7899
7909
7900 \backslash
7910 \backslash
7901 C_Red
7911 C_Red
7902 \layout Description
7912 \layout Description
7903
7913
7904
7914
7905 \backslash
7915 \backslash
7906 C_White
7916 C_White
7907 \layout Description
7917 \layout Description
7908
7918
7909
7919
7910 \backslash
7920 \backslash
7911 C_Yellow
7921 C_Yellow
7912 \layout Description
7922 \layout Description
7913
7923
7914
7924
7915 \backslash
7925 \backslash
7916 C_Normal Stop coloring, defaults to your terminal settings.
7926 C_Normal Stop coloring, defaults to your terminal settings.
7917 \layout Section
7927 \layout Section
7918
7928
7919
7929
7920 \begin_inset LatexCommand \label{sec:Threading-support}
7930 \begin_inset LatexCommand \label{sec:Threading-support}
7921
7931
7922 \end_inset
7932 \end_inset
7923
7933
7924 Threading support
7934 Threading support
7925 \layout Standard
7935 \layout Standard
7926
7936
7927
7937
7928 \series bold
7938 \series bold
7929 WARNING:
7939 WARNING:
7930 \series default
7940 \series default
7931 The threading support is still somewhat experimental, and it has only seen
7941 The threading support is still somewhat experimental, and it has only seen
7932 reasonable testing under Linux.
7942 reasonable testing under Linux.
7933 Threaded code is particularly tricky to debug, and it tends to show extremely
7943 Threaded code is particularly tricky to debug, and it tends to show extremely
7934 platform-dependent behavior.
7944 platform-dependent behavior.
7935 Since I only have access to Linux machines, I will have to rely on user's
7945 Since I only have access to Linux machines, I will have to rely on user's
7936 experiences and assistance for this area of IPython to improve under other
7946 experiences and assistance for this area of IPython to improve under other
7937 platforms.
7947 platforms.
7938 \layout Standard
7948 \layout Standard
7939
7949
7940 IPython, via the
7950 IPython, via the
7941 \family typewriter
7951 \family typewriter
7942 -gthread
7952 -gthread
7943 \family default
7953 \family default
7944 ,
7954 ,
7945 \family typewriter
7955 \family typewriter
7946 -qthread
7956 -qthread
7947 \family default
7957 \family default
7948 and
7958 and
7949 \family typewriter
7959 \family typewriter
7950 -wthread
7960 -wthread
7951 \family default
7961 \family default
7952 options (described in Sec.\SpecialChar ~
7962 options (described in Sec.\SpecialChar ~
7953
7963
7954 \begin_inset LatexCommand \ref{sec:threading-opts}
7964 \begin_inset LatexCommand \ref{sec:threading-opts}
7955
7965
7956 \end_inset
7966 \end_inset
7957
7967
7958 ), can run in multithreaded mode to support pyGTK, Qt and WXPython applications
7968 ), can run in multithreaded mode to support pyGTK, Qt and WXPython applications
7959 respectively.
7969 respectively.
7960 These GUI toolkits need to control the python main loop of execution, so
7970 These GUI toolkits need to control the python main loop of execution, so
7961 under a normal Python interpreter, starting a pyGTK, Qt or WXPython application
7971 under a normal Python interpreter, starting a pyGTK, Qt or WXPython application
7962 will immediately freeze the shell.
7972 will immediately freeze the shell.
7963
7973
7964 \layout Standard
7974 \layout Standard
7965
7975
7966 IPython, with one of these options (you can only use one at a time), separates
7976 IPython, with one of these options (you can only use one at a time), separates
7967 the graphical loop and IPython's code execution run into different threads.
7977 the graphical loop and IPython's code execution run into different threads.
7968 This allows you to test interactively (with
7978 This allows you to test interactively (with
7969 \family typewriter
7979 \family typewriter
7970 %run
7980 %run
7971 \family default
7981 \family default
7972 , for example) your GUI code without blocking.
7982 , for example) your GUI code without blocking.
7973 \layout Standard
7983 \layout Standard
7974
7984
7975 A nice mini-tutorial on using IPython along with the Qt Designer application
7985 A nice mini-tutorial on using IPython along with the Qt Designer application
7976 is available at the SciPy wiki:
7986 is available at the SciPy wiki:
7977 \begin_inset LatexCommand \htmlurl{http://www.scipy.org/wikis/topical_software/QtWithIPythonAndDesigner}
7987 \begin_inset LatexCommand \htmlurl{http://www.scipy.org/wikis/topical_software/QtWithIPythonAndDesigner}
7978
7988
7979 \end_inset
7989 \end_inset
7980
7990
7981 .
7991 .
7982 \layout Subsection
7992 \layout Subsection
7983
7993
7984 Tk issues
7994 Tk issues
7985 \layout Standard
7995 \layout Standard
7986
7996
7987 As indicated in Sec.\SpecialChar ~
7997 As indicated in Sec.\SpecialChar ~
7988
7998
7989 \begin_inset LatexCommand \ref{sec:threading-opts}
7999 \begin_inset LatexCommand \ref{sec:threading-opts}
7990
8000
7991 \end_inset
8001 \end_inset
7992
8002
7993 , a special
8003 , a special
7994 \family typewriter
8004 \family typewriter
7995 -tk
8005 -tk
7996 \family default
8006 \family default
7997 option is provided to try and allow Tk graphical applications to coexist
8007 option is provided to try and allow Tk graphical applications to coexist
7998 interactively with WX, Qt or GTK ones.
8008 interactively with WX, Qt or GTK ones.
7999 Whether this works at all, however, is very platform and configuration
8009 Whether this works at all, however, is very platform and configuration
8000 dependent.
8010 dependent.
8001 Please experiment with simple test cases before committing to using this
8011 Please experiment with simple test cases before committing to using this
8002 combination of Tk and GTK/Qt/WX threading in a production environment.
8012 combination of Tk and GTK/Qt/WX threading in a production environment.
8003 \layout Subsection
8013 \layout Subsection
8004
8014
8005 Signals and Threads
8015 Signals and Threads
8006 \layout Standard
8016 \layout Standard
8007
8017
8008 When any of the thread systems (GTK, Qt or WX) are active, either directly
8018 When any of the thread systems (GTK, Qt or WX) are active, either directly
8009 or via
8019 or via
8010 \family typewriter
8020 \family typewriter
8011 -pylab
8021 -pylab
8012 \family default
8022 \family default
8013 with a threaded backend, it is impossible to interrupt long-running Python
8023 with a threaded backend, it is impossible to interrupt long-running Python
8014 code via
8024 code via
8015 \family typewriter
8025 \family typewriter
8016 Ctrl-C
8026 Ctrl-C
8017 \family default
8027 \family default
8018 .
8028 .
8019 IPython can not pass the KeyboardInterrupt exception (or the underlying
8029 IPython can not pass the KeyboardInterrupt exception (or the underlying
8020
8030
8021 \family typewriter
8031 \family typewriter
8022 SIGINT
8032 SIGINT
8023 \family default
8033 \family default
8024 ) across threads, so any long-running process started from IPython will
8034 ) across threads, so any long-running process started from IPython will
8025 run to completion, or will have to be killed via an external (OS-based)
8035 run to completion, or will have to be killed via an external (OS-based)
8026 mechanism.
8036 mechanism.
8027 \layout Standard
8037 \layout Standard
8028
8038
8029 To the best of my knowledge, this limitation is imposed by the Python interprete
8039 To the best of my knowledge, this limitation is imposed by the Python interprete
8030 r itself, and it comes from the difficulty of writing portable signal/threaded
8040 r itself, and it comes from the difficulty of writing portable signal/threaded
8031 code.
8041 code.
8032 If any user is an expert on this topic and can suggest a better solution,
8042 If any user is an expert on this topic and can suggest a better solution,
8033 I would love to hear about it.
8043 I would love to hear about it.
8034 In the IPython sources, look at the
8044 In the IPython sources, look at the
8035 \family typewriter
8045 \family typewriter
8036 Shell.py
8046 Shell.py
8037 \family default
8047 \family default
8038 module, and in particular at the
8048 module, and in particular at the
8039 \family typewriter
8049 \family typewriter
8040 runcode()
8050 runcode()
8041 \family default
8051 \family default
8042 method.
8052 method.
8043
8053
8044 \layout Subsection
8054 \layout Subsection
8045
8055
8046 I/O pitfalls
8056 I/O pitfalls
8047 \layout Standard
8057 \layout Standard
8048
8058
8049 Be mindful that the Python interpreter switches between threads every
8059 Be mindful that the Python interpreter switches between threads every
8050 \begin_inset Formula $N$
8060 \begin_inset Formula $N$
8051 \end_inset
8061 \end_inset
8052
8062
8053 bytecodes, where the default value as of Python\SpecialChar ~
8063 bytecodes, where the default value as of Python\SpecialChar ~
8054 2.3 is
8064 2.3 is
8055 \begin_inset Formula $N=100.$
8065 \begin_inset Formula $N=100.$
8056 \end_inset
8066 \end_inset
8057
8067
8058 This value can be read by using the
8068 This value can be read by using the
8059 \family typewriter
8069 \family typewriter
8060 sys.getcheckinterval()
8070 sys.getcheckinterval()
8061 \family default
8071 \family default
8062 function, and it can be reset via
8072 function, and it can be reset via
8063 \family typewriter
8073 \family typewriter
8064 sys.setcheckinterval(
8074 sys.setcheckinterval(
8065 \emph on
8075 \emph on
8066 N
8076 N
8067 \emph default
8077 \emph default
8068 )
8078 )
8069 \family default
8079 \family default
8070 .
8080 .
8071 This switching of threads can cause subtly confusing effects if one of
8081 This switching of threads can cause subtly confusing effects if one of
8072 your threads is doing file I/O.
8082 your threads is doing file I/O.
8073 In text mode, most systems only flush file buffers when they encounter
8083 In text mode, most systems only flush file buffers when they encounter
8074 a
8084 a
8075 \family typewriter
8085 \family typewriter
8076 `
8086 `
8077 \backslash
8087 \backslash
8078 n'
8088 n'
8079 \family default
8089 \family default
8080 .
8090 .
8081 An instruction as simple as
8091 An instruction as simple as
8082 \family typewriter
8092 \family typewriter
8083
8093
8084 \newline
8094 \newline
8085 \SpecialChar ~
8095 \SpecialChar ~
8086 \SpecialChar ~
8096 \SpecialChar ~
8087 print >> filehandle,
8097 print >> filehandle,
8088 \begin_inset Quotes eld
8098 \begin_inset Quotes eld
8089 \end_inset
8099 \end_inset
8090
8100
8091 hello world
8101 hello world
8092 \begin_inset Quotes erd
8102 \begin_inset Quotes erd
8093 \end_inset
8103 \end_inset
8094
8104
8095
8105
8096 \family default
8106 \family default
8097
8107
8098 \newline
8108 \newline
8099 actually consists of several bytecodes, so it is possible that the newline
8109 actually consists of several bytecodes, so it is possible that the newline
8100 does not reach your file before the next thread switch.
8110 does not reach your file before the next thread switch.
8101 Similarly, if you are writing to a file in binary mode, the file won't
8111 Similarly, if you are writing to a file in binary mode, the file won't
8102 be flushed until the buffer fills, and your other thread may see apparently
8112 be flushed until the buffer fills, and your other thread may see apparently
8103 truncated files.
8113 truncated files.
8104
8114
8105 \layout Standard
8115 \layout Standard
8106
8116
8107 For this reason, if you are using IPython's thread support and have (for
8117 For this reason, if you are using IPython's thread support and have (for
8108 example) a GUI application which will read data generated by files written
8118 example) a GUI application which will read data generated by files written
8109 to from the IPython thread, the safest approach is to open all of your
8119 to from the IPython thread, the safest approach is to open all of your
8110 files in unbuffered mode (the third argument to the
8120 files in unbuffered mode (the third argument to the
8111 \family typewriter
8121 \family typewriter
8112 file/open
8122 file/open
8113 \family default
8123 \family default
8114 function is the buffering value):
8124 function is the buffering value):
8115 \newline
8125 \newline
8116
8126
8117 \family typewriter
8127 \family typewriter
8118 \SpecialChar ~
8128 \SpecialChar ~
8119 \SpecialChar ~
8129 \SpecialChar ~
8120 filehandle = open(filename,mode,0)
8130 filehandle = open(filename,mode,0)
8121 \layout Standard
8131 \layout Standard
8122
8132
8123 This is obviously a brute force way of avoiding race conditions with the
8133 This is obviously a brute force way of avoiding race conditions with the
8124 file buffering.
8134 file buffering.
8125 If you want to do it cleanly, and you have a resource which is being shared
8135 If you want to do it cleanly, and you have a resource which is being shared
8126 by the interactive IPython loop and your GUI thread, you should really
8136 by the interactive IPython loop and your GUI thread, you should really
8127 handle it with thread locking and syncrhonization properties.
8137 handle it with thread locking and syncrhonization properties.
8128 The Python documentation discusses these.
8138 The Python documentation discusses these.
8129 \layout Section
8139 \layout Section
8130
8140
8131
8141
8132 \begin_inset LatexCommand \label{sec:interactive-demos}
8142 \begin_inset LatexCommand \label{sec:interactive-demos}
8133
8143
8134 \end_inset
8144 \end_inset
8135
8145
8136 Interactive demos with IPython
8146 Interactive demos with IPython
8137 \layout Standard
8147 \layout Standard
8138
8148
8139 IPython ships with a basic system for running scripts interactively in sections,
8149 IPython ships with a basic system for running scripts interactively in sections,
8140 useful when presenting code to audiences.
8150 useful when presenting code to audiences.
8141 A few tags embedded in comments (so that the script remains valid Python
8151 A few tags embedded in comments (so that the script remains valid Python
8142 code) divide a file into separate blocks, and the demo can be run one block
8152 code) divide a file into separate blocks, and the demo can be run one block
8143 at a time, with IPython printing (with syntax highlighting) the block before
8153 at a time, with IPython printing (with syntax highlighting) the block before
8144 executing it, and returning to the interactive prompt after each block.
8154 executing it, and returning to the interactive prompt after each block.
8145 The interactive namespace is updated after each block is run with the contents
8155 The interactive namespace is updated after each block is run with the contents
8146 of the demo's namespace.
8156 of the demo's namespace.
8147 \layout Standard
8157 \layout Standard
8148
8158
8149 This allows you to show a piece of code, run it and then execute interactively
8159 This allows you to show a piece of code, run it and then execute interactively
8150 commands based on the variables just created.
8160 commands based on the variables just created.
8151 Once you want to continue, you simply execute the next block of the demo.
8161 Once you want to continue, you simply execute the next block of the demo.
8152 The following listing shows the markup necessary for dividing a script
8162 The following listing shows the markup necessary for dividing a script
8153 into sections for execution as a demo.
8163 into sections for execution as a demo.
8154 \layout Standard
8164 \layout Standard
8155
8165
8156
8166
8157 \begin_inset ERT
8167 \begin_inset ERT
8158 status Open
8168 status Open
8159
8169
8160 \layout Standard
8170 \layout Standard
8161
8171
8162 \backslash
8172 \backslash
8163 codelist{examples/example-demo.py}
8173 codelist{examples/example-demo.py}
8164 \end_inset
8174 \end_inset
8165
8175
8166
8176
8167 \layout Standard
8177 \layout Standard
8168
8178
8169 In order to run a file as a demo, you must first make a
8179 In order to run a file as a demo, you must first make a
8170 \family typewriter
8180 \family typewriter
8171 Demo
8181 Demo
8172 \family default
8182 \family default
8173 object out of it.
8183 object out of it.
8174 If the file is named
8184 If the file is named
8175 \family typewriter
8185 \family typewriter
8176 myscript.py
8186 myscript.py
8177 \family default
8187 \family default
8178 , the following code will make a demo:
8188 , the following code will make a demo:
8179 \layout LyX-Code
8189 \layout LyX-Code
8180
8190
8181 from IPython.demo import Demo
8191 from IPython.demo import Demo
8182 \layout LyX-Code
8192 \layout LyX-Code
8183
8193
8184 mydemo = Demo('myscript.py')
8194 mydemo = Demo('myscript.py')
8185 \layout Standard
8195 \layout Standard
8186
8196
8187 This creates the
8197 This creates the
8188 \family typewriter
8198 \family typewriter
8189 mydemo
8199 mydemo
8190 \family default
8200 \family default
8191 object, whose blocks you run one at a time by simply calling the object
8201 object, whose blocks you run one at a time by simply calling the object
8192 with no arguments.
8202 with no arguments.
8193 If you have autocall active in IPython (the default), all you need to do
8203 If you have autocall active in IPython (the default), all you need to do
8194 is type
8204 is type
8195 \layout LyX-Code
8205 \layout LyX-Code
8196
8206
8197 mydemo
8207 mydemo
8198 \layout Standard
8208 \layout Standard
8199
8209
8200 and IPython will call it, executing each block.
8210 and IPython will call it, executing each block.
8201 Demo objects can be restarted, you can move forward or back skipping blocks,
8211 Demo objects can be restarted, you can move forward or back skipping blocks,
8202 re-execute the last block, etc.
8212 re-execute the last block, etc.
8203 Simply use the Tab key on a demo object to see its methods, and call
8213 Simply use the Tab key on a demo object to see its methods, and call
8204 \family typewriter
8214 \family typewriter
8205 `?'
8215 `?'
8206 \family default
8216 \family default
8207 on them to see their docstrings for more usage details.
8217 on them to see their docstrings for more usage details.
8208 In addition, the
8218 In addition, the
8209 \family typewriter
8219 \family typewriter
8210 demo
8220 demo
8211 \family default
8221 \family default
8212 module itself contains a comprehensive docstring, which you can access
8222 module itself contains a comprehensive docstring, which you can access
8213 via
8223 via
8214 \layout LyX-Code
8224 \layout LyX-Code
8215
8225
8216 from IPython import demo
8226 from IPython import demo
8217 \layout LyX-Code
8227 \layout LyX-Code
8218
8228
8219 demo?
8229 demo?
8220 \layout Standard
8230 \layout Standard
8221
8231
8222
8232
8223 \series bold
8233 \series bold
8224 Limitations:
8234 Limitations:
8225 \series default
8235 \series default
8226 It is important to note that these demos are limited to fairly simple uses.
8236 It is important to note that these demos are limited to fairly simple uses.
8227 In particular, you can
8237 In particular, you can
8228 \emph on
8238 \emph on
8229 not
8239 not
8230 \emph default
8240 \emph default
8231 put division marks in indented code (loops, if statements, function definitions
8241 put division marks in indented code (loops, if statements, function definitions
8232 , etc.) Supporting something like this would basically require tracking the
8242 , etc.) Supporting something like this would basically require tracking the
8233 internal execution state of the Python interpreter, so only top-level divisions
8243 internal execution state of the Python interpreter, so only top-level divisions
8234 are allowed.
8244 are allowed.
8235 If you want to be able to open an IPython instance at an arbitrary point
8245 If you want to be able to open an IPython instance at an arbitrary point
8236 in a program, you can use IPython's embedding facilities, described in
8246 in a program, you can use IPython's embedding facilities, described in
8237 detail in Sec\SpecialChar \@.
8247 detail in Sec\SpecialChar \@.
8238 \SpecialChar ~
8248 \SpecialChar ~
8239
8249
8240 \begin_inset LatexCommand \ref{sec:embed}
8250 \begin_inset LatexCommand \ref{sec:embed}
8241
8251
8242 \end_inset
8252 \end_inset
8243
8253
8244 .
8254 .
8245 \layout Section
8255 \layout Section
8246
8256
8247
8257
8248 \begin_inset LatexCommand \label{sec:matplotlib-support}
8258 \begin_inset LatexCommand \label{sec:matplotlib-support}
8249
8259
8250 \end_inset
8260 \end_inset
8251
8261
8252 Plotting with
8262 Plotting with
8253 \family typewriter
8263 \family typewriter
8254 matplotlib
8264 matplotlib
8255 \family default
8265 \family default
8256
8266
8257 \layout Standard
8267 \layout Standard
8258
8268
8259 The matplotlib library (
8269 The matplotlib library (
8260 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
8270 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
8261
8271
8262 \end_inset
8272 \end_inset
8263
8273
8264 ) provides high quality 2D plotting for Python.
8274 ) provides high quality 2D plotting for Python.
8265 Matplotlib can produce plots on screen using a variety of GUI toolkits,
8275 Matplotlib can produce plots on screen using a variety of GUI toolkits,
8266 including Tk, GTK and WXPython.
8276 including Tk, GTK and WXPython.
8267 It also provides a number of commands useful for scientific computing,
8277 It also provides a number of commands useful for scientific computing,
8268 all with a syntax compatible with that of the popular Matlab program.
8278 all with a syntax compatible with that of the popular Matlab program.
8269 \layout Standard
8279 \layout Standard
8270
8280
8271 IPython accepts the special option
8281 IPython accepts the special option
8272 \family typewriter
8282 \family typewriter
8273 -pylab
8283 -pylab
8274 \family default
8284 \family default
8275 (Sec.\SpecialChar ~
8285 (Sec.\SpecialChar ~
8276
8286
8277 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
8287 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
8278
8288
8279 \end_inset
8289 \end_inset
8280
8290
8281 ).
8291 ).
8282 This configures it to support matplotlib, honoring the settings in the
8292 This configures it to support matplotlib, honoring the settings in the
8283
8293
8284 \family typewriter
8294 \family typewriter
8285 .matplotlibrc
8295 .matplotlibrc
8286 \family default
8296 \family default
8287 file.
8297 file.
8288 IPython will detect the user's choice of matplotlib GUI backend, and automatica
8298 IPython will detect the user's choice of matplotlib GUI backend, and automatica
8289 lly select the proper threading model to prevent blocking.
8299 lly select the proper threading model to prevent blocking.
8290 It also sets matplotlib in interactive mode and modifies
8300 It also sets matplotlib in interactive mode and modifies
8291 \family typewriter
8301 \family typewriter
8292 %run
8302 %run
8293 \family default
8303 \family default
8294 slightly, so that any matplotlib-based script can be executed using
8304 slightly, so that any matplotlib-based script can be executed using
8295 \family typewriter
8305 \family typewriter
8296 %run
8306 %run
8297 \family default
8307 \family default
8298 and the final
8308 and the final
8299 \family typewriter
8309 \family typewriter
8300 show()
8310 show()
8301 \family default
8311 \family default
8302 command does not block the interactive shell.
8312 command does not block the interactive shell.
8303 \layout Standard
8313 \layout Standard
8304
8314
8305 The
8315 The
8306 \family typewriter
8316 \family typewriter
8307 -pylab
8317 -pylab
8308 \family default
8318 \family default
8309 option must be given first in order for IPython to configure its threading
8319 option must be given first in order for IPython to configure its threading
8310 mode.
8320 mode.
8311 However, you can still issue other options afterwards.
8321 However, you can still issue other options afterwards.
8312 This allows you to have a matplotlib-based environment customized with
8322 This allows you to have a matplotlib-based environment customized with
8313 additional modules using the standard IPython profile mechanism (Sec.\SpecialChar ~
8323 additional modules using the standard IPython profile mechanism (Sec.\SpecialChar ~
8314
8324
8315 \begin_inset LatexCommand \ref{sec:profiles}
8325 \begin_inset LatexCommand \ref{sec:profiles}
8316
8326
8317 \end_inset
8327 \end_inset
8318
8328
8319 ): ``
8329 ): ``
8320 \family typewriter
8330 \family typewriter
8321 ipython -pylab -p myprofile
8331 ipython -pylab -p myprofile
8322 \family default
8332 \family default
8323 '' will load the profile defined in
8333 '' will load the profile defined in
8324 \family typewriter
8334 \family typewriter
8325 ipythonrc-myprofile
8335 ipythonrc-myprofile
8326 \family default
8336 \family default
8327 after configuring matplotlib.
8337 after configuring matplotlib.
8328 \layout Section
8338 \layout Section
8329
8339
8330
8340
8331 \begin_inset LatexCommand \label{sec:Gnuplot}
8341 \begin_inset LatexCommand \label{sec:Gnuplot}
8332
8342
8333 \end_inset
8343 \end_inset
8334
8344
8335 Plotting with
8345 Plotting with
8336 \family typewriter
8346 \family typewriter
8337 Gnuplot
8347 Gnuplot
8338 \layout Standard
8348 \layout Standard
8339
8349
8340 Through the magic extension system described in sec.
8350 Through the magic extension system described in sec.
8341
8351
8342 \begin_inset LatexCommand \ref{sec:magic}
8352 \begin_inset LatexCommand \ref{sec:magic}
8343
8353
8344 \end_inset
8354 \end_inset
8345
8355
8346 , IPython incorporates a mechanism for conveniently interfacing with the
8356 , IPython incorporates a mechanism for conveniently interfacing with the
8347 Gnuplot system (
8357 Gnuplot system (
8348 \begin_inset LatexCommand \htmlurl{http://www.gnuplot.info}
8358 \begin_inset LatexCommand \htmlurl{http://www.gnuplot.info}
8349
8359
8350 \end_inset
8360 \end_inset
8351
8361
8352 ).
8362 ).
8353 Gnuplot is a very complete 2D and 3D plotting package available for many
8363 Gnuplot is a very complete 2D and 3D plotting package available for many
8354 operating systems and commonly included in modern Linux distributions.
8364 operating systems and commonly included in modern Linux distributions.
8355
8365
8356 \layout Standard
8366 \layout Standard
8357
8367
8358 Besides having Gnuplot installed, this functionality requires the
8368 Besides having Gnuplot installed, this functionality requires the
8359 \family typewriter
8369 \family typewriter
8360 Gnuplot.py
8370 Gnuplot.py
8361 \family default
8371 \family default
8362 module for interfacing python with Gnuplot.
8372 module for interfacing python with Gnuplot.
8363 It can be downloaded from:
8373 It can be downloaded from:
8364 \begin_inset LatexCommand \htmlurl{http://gnuplot-py.sourceforge.net}
8374 \begin_inset LatexCommand \htmlurl{http://gnuplot-py.sourceforge.net}
8365
8375
8366 \end_inset
8376 \end_inset
8367
8377
8368 .
8378 .
8369 \layout Subsection
8379 \layout Subsection
8370
8380
8371 Proper Gnuplot configuration
8381 Proper Gnuplot configuration
8372 \layout Standard
8382 \layout Standard
8373
8383
8374 As of version 4.0, Gnuplot has excellent mouse and interactive keyboard support.
8384 As of version 4.0, Gnuplot has excellent mouse and interactive keyboard support.
8375 However, as of
8385 However, as of
8376 \family typewriter
8386 \family typewriter
8377 Gnuplot.py
8387 Gnuplot.py
8378 \family default
8388 \family default
8379 version 1.7, a new option was added to communicate between Python and Gnuplot
8389 version 1.7, a new option was added to communicate between Python and Gnuplot
8380 via FIFOs (pipes).
8390 via FIFOs (pipes).
8381 This mechanism, while fast, also breaks the mouse system.
8391 This mechanism, while fast, also breaks the mouse system.
8382 You must therefore set the variable
8392 You must therefore set the variable
8383 \family typewriter
8393 \family typewriter
8384 prefer_fifo_data
8394 prefer_fifo_data
8385 \family default
8395 \family default
8386 to
8396 to
8387 \family typewriter
8397 \family typewriter
8388 0
8398 0
8389 \family default
8399 \family default
8390 in file
8400 in file
8391 \family typewriter
8401 \family typewriter
8392 gp_unix.py
8402 gp_unix.py
8393 \family default
8403 \family default
8394 if you wish to keep the interactive mouse and keyboard features working
8404 if you wish to keep the interactive mouse and keyboard features working
8395 properly (
8405 properly (
8396 \family typewriter
8406 \family typewriter
8397 prefer_inline_data
8407 prefer_inline_data
8398 \family default
8408 \family default
8399 also must be
8409 also must be
8400 \family typewriter
8410 \family typewriter
8401 0
8411 0
8402 \family default
8412 \family default
8403 , but this is the default so unless you've changed it manually you should
8413 , but this is the default so unless you've changed it manually you should
8404 be fine).
8414 be fine).
8405 \layout Standard
8415 \layout Standard
8406
8416
8407 'Out of the box', Gnuplot is configured with a rather poor set of size,
8417 'Out of the box', Gnuplot is configured with a rather poor set of size,
8408 color and linewidth choices which make the graphs fairly hard to read on
8418 color and linewidth choices which make the graphs fairly hard to read on
8409 modern high-resolution displays (although they work fine on old 640x480
8419 modern high-resolution displays (although they work fine on old 640x480
8410 ones).
8420 ones).
8411 Below is a section of my
8421 Below is a section of my
8412 \family typewriter
8422 \family typewriter
8413 .Xdefaults
8423 .Xdefaults
8414 \family default
8424 \family default
8415 file which I use for having a more convenient Gnuplot setup.
8425 file which I use for having a more convenient Gnuplot setup.
8416 Remember to load it by running
8426 Remember to load it by running
8417 \family typewriter
8427 \family typewriter
8418 `xrdb .Xdefaults`
8428 `xrdb .Xdefaults`
8419 \family default
8429 \family default
8420 :
8430 :
8421 \layout Standard
8431 \layout Standard
8422
8432
8423
8433
8424 \family typewriter
8434 \family typewriter
8425 !******************************************************************
8435 !******************************************************************
8426 \newline
8436 \newline
8427 ! gnuplot options
8437 ! gnuplot options
8428 \newline
8438 \newline
8429 ! modify this for a convenient window size
8439 ! modify this for a convenient window size
8430 \newline
8440 \newline
8431 gnuplot*geometry: 780x580
8441 gnuplot*geometry: 780x580
8432 \layout Standard
8442 \layout Standard
8433
8443
8434
8444
8435 \family typewriter
8445 \family typewriter
8436 ! on-screen font (not for PostScript)
8446 ! on-screen font (not for PostScript)
8437 \newline
8447 \newline
8438 gnuplot*font: -misc-fixed-bold-r-normal--15-120-100-100-c-90-iso8859-1
8448 gnuplot*font: -misc-fixed-bold-r-normal--15-120-100-100-c-90-iso8859-1
8439 \layout Standard
8449 \layout Standard
8440
8450
8441
8451
8442 \family typewriter
8452 \family typewriter
8443 ! color options
8453 ! color options
8444 \newline
8454 \newline
8445 gnuplot*background: black
8455 gnuplot*background: black
8446 \newline
8456 \newline
8447 gnuplot*textColor: white
8457 gnuplot*textColor: white
8448 \newline
8458 \newline
8449 gnuplot*borderColor: white
8459 gnuplot*borderColor: white
8450 \newline
8460 \newline
8451 gnuplot*axisColor: white
8461 gnuplot*axisColor: white
8452 \newline
8462 \newline
8453 gnuplot*line1Color: red
8463 gnuplot*line1Color: red
8454 \newline
8464 \newline
8455 gnuplot*line2Color: green
8465 gnuplot*line2Color: green
8456 \newline
8466 \newline
8457 gnuplot*line3Color: blue
8467 gnuplot*line3Color: blue
8458 \newline
8468 \newline
8459 gnuplot*line4Color: magenta
8469 gnuplot*line4Color: magenta
8460 \newline
8470 \newline
8461 gnuplot*line5Color: cyan
8471 gnuplot*line5Color: cyan
8462 \newline
8472 \newline
8463 gnuplot*line6Color: sienna
8473 gnuplot*line6Color: sienna
8464 \newline
8474 \newline
8465 gnuplot*line7Color: orange
8475 gnuplot*line7Color: orange
8466 \newline
8476 \newline
8467 gnuplot*line8Color: coral
8477 gnuplot*line8Color: coral
8468 \layout Standard
8478 \layout Standard
8469
8479
8470
8480
8471 \family typewriter
8481 \family typewriter
8472 ! multiplicative factor for point styles
8482 ! multiplicative factor for point styles
8473 \newline
8483 \newline
8474 gnuplot*pointsize: 2
8484 gnuplot*pointsize: 2
8475 \layout Standard
8485 \layout Standard
8476
8486
8477
8487
8478 \family typewriter
8488 \family typewriter
8479 ! line width options (in pixels)
8489 ! line width options (in pixels)
8480 \newline
8490 \newline
8481 gnuplot*borderWidth: 2
8491 gnuplot*borderWidth: 2
8482 \newline
8492 \newline
8483 gnuplot*axisWidth: 2
8493 gnuplot*axisWidth: 2
8484 \newline
8494 \newline
8485 gnuplot*line1Width: 2
8495 gnuplot*line1Width: 2
8486 \newline
8496 \newline
8487 gnuplot*line2Width: 2
8497 gnuplot*line2Width: 2
8488 \newline
8498 \newline
8489 gnuplot*line3Width: 2
8499 gnuplot*line3Width: 2
8490 \newline
8500 \newline
8491 gnuplot*line4Width: 2
8501 gnuplot*line4Width: 2
8492 \newline
8502 \newline
8493 gnuplot*line5Width: 2
8503 gnuplot*line5Width: 2
8494 \newline
8504 \newline
8495 gnuplot*line6Width: 2
8505 gnuplot*line6Width: 2
8496 \newline
8506 \newline
8497 gnuplot*line7Width: 2
8507 gnuplot*line7Width: 2
8498 \newline
8508 \newline
8499 gnuplot*line8Width: 2
8509 gnuplot*line8Width: 2
8500 \layout Subsection
8510 \layout Subsection
8501
8511
8502 The
8512 The
8503 \family typewriter
8513 \family typewriter
8504 IPython.GnuplotRuntime
8514 IPython.GnuplotRuntime
8505 \family default
8515 \family default
8506 module
8516 module
8507 \layout Standard
8517 \layout Standard
8508
8518
8509 IPython includes a module called
8519 IPython includes a module called
8510 \family typewriter
8520 \family typewriter
8511 Gnuplot2.py
8521 Gnuplot2.py
8512 \family default
8522 \family default
8513 which extends and improves the default
8523 which extends and improves the default
8514 \family typewriter
8524 \family typewriter
8515 Gnuplot
8525 Gnuplot
8516 \family default
8526 \family default
8517 .
8527 .
8518 \family typewriter
8528 \family typewriter
8519 py
8529 py
8520 \family default
8530 \family default
8521 (which it still relies upon).
8531 (which it still relies upon).
8522 For example, the new
8532 For example, the new
8523 \family typewriter
8533 \family typewriter
8524 plot
8534 plot
8525 \family default
8535 \family default
8526 function adds several improvements to the original making it more convenient
8536 function adds several improvements to the original making it more convenient
8527 for interactive use, and
8537 for interactive use, and
8528 \family typewriter
8538 \family typewriter
8529 hardcopy
8539 hardcopy
8530 \family default
8540 \family default
8531 fixes a bug in the original which under some circumstances blocks the creation
8541 fixes a bug in the original which under some circumstances blocks the creation
8532 of PostScript output.
8542 of PostScript output.
8533 \layout Standard
8543 \layout Standard
8534
8544
8535 For scripting use,
8545 For scripting use,
8536 \family typewriter
8546 \family typewriter
8537 GnuplotRuntime.py
8547 GnuplotRuntime.py
8538 \family default
8548 \family default
8539 is provided, which wraps
8549 is provided, which wraps
8540 \family typewriter
8550 \family typewriter
8541 Gnuplot2.py
8551 Gnuplot2.py
8542 \family default
8552 \family default
8543 and creates a series of global aliases.
8553 and creates a series of global aliases.
8544 These make it easy to control Gnuplot plotting jobs through the Python
8554 These make it easy to control Gnuplot plotting jobs through the Python
8545 language.
8555 language.
8546 \layout Standard
8556 \layout Standard
8547
8557
8548 Below is some example code which illustrates how to configure Gnuplot inside
8558 Below is some example code which illustrates how to configure Gnuplot inside
8549 your own programs but have it available for further interactive use through
8559 your own programs but have it available for further interactive use through
8550 an embedded IPython instance.
8560 an embedded IPython instance.
8551 Simply run this file at a system prompt.
8561 Simply run this file at a system prompt.
8552 This file is provided as
8562 This file is provided as
8553 \family typewriter
8563 \family typewriter
8554 example-gnuplot.py
8564 example-gnuplot.py
8555 \family default
8565 \family default
8556 in the examples directory:
8566 in the examples directory:
8557 \layout Standard
8567 \layout Standard
8558
8568
8559
8569
8560 \begin_inset ERT
8570 \begin_inset ERT
8561 status Open
8571 status Open
8562
8572
8563 \layout Standard
8573 \layout Standard
8564
8574
8565 \backslash
8575 \backslash
8566 codelist{examples/example-gnuplot.py}
8576 codelist{examples/example-gnuplot.py}
8567 \end_inset
8577 \end_inset
8568
8578
8569
8579
8570 \layout Subsection
8580 \layout Subsection
8571
8581
8572 The
8582 The
8573 \family typewriter
8583 \family typewriter
8574 numeric
8584 numeric
8575 \family default
8585 \family default
8576 profile: a scientific computing environment
8586 profile: a scientific computing environment
8577 \layout Standard
8587 \layout Standard
8578
8588
8579 The
8589 The
8580 \family typewriter
8590 \family typewriter
8581 numeric
8591 numeric
8582 \family default
8592 \family default
8583 IPython profile, which you can activate with
8593 IPython profile, which you can activate with
8584 \family typewriter
8594 \family typewriter
8585 `ipython -p numeric
8595 `ipython -p numeric
8586 \family default
8596 \family default
8587 ' will automatically load the IPython Gnuplot extensions (plus Numeric and
8597 ' will automatically load the IPython Gnuplot extensions (plus Numeric and
8588 other useful things for numerical computing), contained in the
8598 other useful things for numerical computing), contained in the
8589 \family typewriter
8599 \family typewriter
8590 IPython.GnuplotInteractive
8600 IPython.GnuplotInteractive
8591 \family default
8601 \family default
8592 module.
8602 module.
8593 This will create the globals
8603 This will create the globals
8594 \family typewriter
8604 \family typewriter
8595 Gnuplot
8605 Gnuplot
8596 \family default
8606 \family default
8597 (an alias to the improved Gnuplot2 module),
8607 (an alias to the improved Gnuplot2 module),
8598 \family typewriter
8608 \family typewriter
8599 gp
8609 gp
8600 \family default
8610 \family default
8601 (a Gnuplot active instance), the new magic commands
8611 (a Gnuplot active instance), the new magic commands
8602 \family typewriter
8612 \family typewriter
8603 %gpc
8613 %gpc
8604 \family default
8614 \family default
8605 and
8615 and
8606 \family typewriter
8616 \family typewriter
8607 %gp_set_instance
8617 %gp_set_instance
8608 \family default
8618 \family default
8609 and several other convenient globals.
8619 and several other convenient globals.
8610 Type
8620 Type
8611 \family typewriter
8621 \family typewriter
8612 gphelp()
8622 gphelp()
8613 \family default
8623 \family default
8614 for further details.
8624 for further details.
8615 \layout Standard
8625 \layout Standard
8616
8626
8617 This should turn IPython into a convenient environment for numerical computing,
8627 This should turn IPython into a convenient environment for numerical computing,
8618 with all the functions in the NumPy library and the Gnuplot facilities
8628 with all the functions in the NumPy library and the Gnuplot facilities
8619 for plotting.
8629 for plotting.
8620 Further improvements can be obtained by loading the SciPy libraries for
8630 Further improvements can be obtained by loading the SciPy libraries for
8621 scientific computing, available at
8631 scientific computing, available at
8622 \begin_inset LatexCommand \htmlurl{http://scipy.org}
8632 \begin_inset LatexCommand \htmlurl{http://scipy.org}
8623
8633
8624 \end_inset
8634 \end_inset
8625
8635
8626 .
8636 .
8627 \layout Standard
8637 \layout Standard
8628
8638
8629 If you are in the middle of a working session with numerical objects and
8639 If you are in the middle of a working session with numerical objects and
8630 need to plot them but you didn't start the
8640 need to plot them but you didn't start the
8631 \family typewriter
8641 \family typewriter
8632 numeric
8642 numeric
8633 \family default
8643 \family default
8634 profile, you can load these extensions at any time by typing
8644 profile, you can load these extensions at any time by typing
8635 \newline
8645 \newline
8636
8646
8637 \family typewriter
8647 \family typewriter
8638 from IPython.GnuplotInteractive import *
8648 from IPython.GnuplotInteractive import *
8639 \newline
8649 \newline
8640
8650
8641 \family default
8651 \family default
8642 at the IPython prompt.
8652 at the IPython prompt.
8643 This will allow you to keep your objects intact and start using Gnuplot
8653 This will allow you to keep your objects intact and start using Gnuplot
8644 to view them.
8654 to view them.
8645 \layout Section
8655 \layout Section
8646
8656
8647 Reporting bugs
8657 Reporting bugs
8648 \layout Subsection*
8658 \layout Subsection*
8649
8659
8650 Automatic crash reports
8660 Automatic crash reports
8651 \layout Standard
8661 \layout Standard
8652
8662
8653 Ideally, IPython itself shouldn't crash.
8663 Ideally, IPython itself shouldn't crash.
8654 It will catch exceptions produced by you, but bugs in its internals will
8664 It will catch exceptions produced by you, but bugs in its internals will
8655 still crash it.
8665 still crash it.
8656 \layout Standard
8666 \layout Standard
8657
8667
8658 In such a situation, IPython will leave a file named
8668 In such a situation, IPython will leave a file named
8659 \family typewriter
8669 \family typewriter
8660 IPython_crash_report.txt
8670 IPython_crash_report.txt
8661 \family default
8671 \family default
8662 in your IPYTHONDIR directory (that way if crashes happen several times
8672 in your IPYTHONDIR directory (that way if crashes happen several times
8663 it won't litter many directories, the post-mortem file is always located
8673 it won't litter many directories, the post-mortem file is always located
8664 in the same place and new occurrences just overwrite the previous one).
8674 in the same place and new occurrences just overwrite the previous one).
8665 If you can mail this file to the developers (see sec.
8675 If you can mail this file to the developers (see sec.
8666
8676
8667 \begin_inset LatexCommand \ref{sec:credits}
8677 \begin_inset LatexCommand \ref{sec:credits}
8668
8678
8669 \end_inset
8679 \end_inset
8670
8680
8671 for names and addresses), it will help us
8681 for names and addresses), it will help us
8672 \emph on
8682 \emph on
8673 a lot
8683 a lot
8674 \emph default
8684 \emph default
8675 in understanding the cause of the problem and fixing it sooner.
8685 in understanding the cause of the problem and fixing it sooner.
8676 \layout Subsection*
8686 \layout Subsection*
8677
8687
8678 The bug tracker
8688 The bug tracker
8679 \layout Standard
8689 \layout Standard
8680
8690
8681 IPython also has an online bug-tracker, located at
8691 IPython also has an online bug-tracker, located at
8682 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython}
8692 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython}
8683
8693
8684 \end_inset
8694 \end_inset
8685
8695
8686 .
8696 .
8687 In addition to mailing the developers, it would be a good idea to file
8697 In addition to mailing the developers, it would be a good idea to file
8688 a bug report here.
8698 a bug report here.
8689 This will ensure that the issue is properly followed to conclusion.
8699 This will ensure that the issue is properly followed to conclusion.
8690 \layout Standard
8700 \layout Standard
8691
8701
8692 You can also use this bug tracker to file feature requests.
8702 You can also use this bug tracker to file feature requests.
8693 \layout Section
8703 \layout Section
8694
8704
8695 Brief history
8705 Brief history
8696 \layout Subsection
8706 \layout Subsection
8697
8707
8698 Origins
8708 Origins
8699 \layout Standard
8709 \layout Standard
8700
8710
8701 The current IPython system grew out of the following three projects:
8711 The current IPython system grew out of the following three projects:
8702 \layout List
8712 \layout List
8703 \labelwidthstring 00.00.0000
8713 \labelwidthstring 00.00.0000
8704
8714
8705 ipython by Fernando P
8715 ipython by Fernando P
8706 \begin_inset ERT
8716 \begin_inset ERT
8707 status Collapsed
8717 status Collapsed
8708
8718
8709 \layout Standard
8719 \layout Standard
8710
8720
8711 \backslash
8721 \backslash
8712 '{e}
8722 '{e}
8713 \end_inset
8723 \end_inset
8714
8724
8715 rez.
8725 rez.
8716 I was working on adding Mathematica-type prompts and a flexible configuration
8726 I was working on adding Mathematica-type prompts and a flexible configuration
8717 system (something better than
8727 system (something better than
8718 \family typewriter
8728 \family typewriter
8719 $PYTHONSTARTUP
8729 $PYTHONSTARTUP
8720 \family default
8730 \family default
8721 ) to the standard Python interactive interpreter.
8731 ) to the standard Python interactive interpreter.
8722 \layout List
8732 \layout List
8723 \labelwidthstring 00.00.0000
8733 \labelwidthstring 00.00.0000
8724
8734
8725 IPP by Janko Hauser.
8735 IPP by Janko Hauser.
8726 Very well organized, great usability.
8736 Very well organized, great usability.
8727 Had an old help system.
8737 Had an old help system.
8728 IPP was used as the `container' code into which I added the functionality
8738 IPP was used as the `container' code into which I added the functionality
8729 from ipython and LazyPython.
8739 from ipython and LazyPython.
8730 \layout List
8740 \layout List
8731 \labelwidthstring 00.00.0000
8741 \labelwidthstring 00.00.0000
8732
8742
8733 LazyPython by Nathan Gray.
8743 LazyPython by Nathan Gray.
8734 Simple but
8744 Simple but
8735 \emph on
8745 \emph on
8736 very
8746 very
8737 \emph default
8747 \emph default
8738 powerful.
8748 powerful.
8739 The quick syntax (auto parens, auto quotes) and verbose/colored tracebacks
8749 The quick syntax (auto parens, auto quotes) and verbose/colored tracebacks
8740 were all taken from here.
8750 were all taken from here.
8741 \layout Standard
8751 \layout Standard
8742
8752
8743 When I found out (see sec.
8753 When I found out (see sec.
8744
8754
8745 \begin_inset LatexCommand \ref{figgins}
8755 \begin_inset LatexCommand \ref{figgins}
8746
8756
8747 \end_inset
8757 \end_inset
8748
8758
8749 ) about IPP and LazyPython I tried to join all three into a unified system.
8759 ) about IPP and LazyPython I tried to join all three into a unified system.
8750 I thought this could provide a very nice working environment, both for
8760 I thought this could provide a very nice working environment, both for
8751 regular programming and scientific computing: shell-like features, IDL/Matlab
8761 regular programming and scientific computing: shell-like features, IDL/Matlab
8752 numerics, Mathematica-type prompt history and great object introspection
8762 numerics, Mathematica-type prompt history and great object introspection
8753 and help facilities.
8763 and help facilities.
8754 I think it worked reasonably well, though it was a lot more work than I
8764 I think it worked reasonably well, though it was a lot more work than I
8755 had initially planned.
8765 had initially planned.
8756 \layout Subsection
8766 \layout Subsection
8757
8767
8758 Current status
8768 Current status
8759 \layout Standard
8769 \layout Standard
8760
8770
8761 The above listed features work, and quite well for the most part.
8771 The above listed features work, and quite well for the most part.
8762 But until a major internal restructuring is done (see below), only bug
8772 But until a major internal restructuring is done (see below), only bug
8763 fixing will be done, no other features will be added (unless very minor
8773 fixing will be done, no other features will be added (unless very minor
8764 and well localized in the cleaner parts of the code).
8774 and well localized in the cleaner parts of the code).
8765 \layout Standard
8775 \layout Standard
8766
8776
8767 IPython consists of some 18000 lines of pure python code, of which roughly
8777 IPython consists of some 18000 lines of pure python code, of which roughly
8768 two thirds is reasonably clean.
8778 two thirds is reasonably clean.
8769 The rest is, messy code which needs a massive restructuring before any
8779 The rest is, messy code which needs a massive restructuring before any
8770 further major work is done.
8780 further major work is done.
8771 Even the messy code is fairly well documented though, and most of the problems
8781 Even the messy code is fairly well documented though, and most of the problems
8772 in the (non-existent) class design are well pointed to by a PyChecker run.
8782 in the (non-existent) class design are well pointed to by a PyChecker run.
8773 So the rewriting work isn't that bad, it will just be time-consuming.
8783 So the rewriting work isn't that bad, it will just be time-consuming.
8774 \layout Subsection
8784 \layout Subsection
8775
8785
8776 Future
8786 Future
8777 \layout Standard
8787 \layout Standard
8778
8788
8779 See the separate
8789 See the separate
8780 \family typewriter
8790 \family typewriter
8781 new_design
8791 new_design
8782 \family default
8792 \family default
8783 document for details.
8793 document for details.
8784 Ultimately, I would like to see IPython become part of the standard Python
8794 Ultimately, I would like to see IPython become part of the standard Python
8785 distribution as a `big brother with batteries' to the standard Python interacti
8795 distribution as a `big brother with batteries' to the standard Python interacti
8786 ve interpreter.
8796 ve interpreter.
8787 But that will never happen with the current state of the code, so all contribut
8797 But that will never happen with the current state of the code, so all contribut
8788 ions are welcome.
8798 ions are welcome.
8789 \layout Section
8799 \layout Section
8790
8800
8791 License
8801 License
8792 \layout Standard
8802 \layout Standard
8793
8803
8794 IPython is released under the terms of the BSD license, whose general form
8804 IPython is released under the terms of the BSD license, whose general form
8795 can be found at:
8805 can be found at:
8796 \begin_inset LatexCommand \htmlurl{http://www.opensource.org/licenses/bsd-license.php}
8806 \begin_inset LatexCommand \htmlurl{http://www.opensource.org/licenses/bsd-license.php}
8797
8807
8798 \end_inset
8808 \end_inset
8799
8809
8800 .
8810 .
8801 The full text of the IPython license is reproduced below:
8811 The full text of the IPython license is reproduced below:
8802 \layout Quote
8812 \layout Quote
8803
8813
8804
8814
8805 \family typewriter
8815 \family typewriter
8806 \size small
8816 \size small
8807 IPython is released under a BSD-type license.
8817 IPython is released under a BSD-type license.
8808 \layout Quote
8818 \layout Quote
8809
8819
8810
8820
8811 \family typewriter
8821 \family typewriter
8812 \size small
8822 \size small
8813 Copyright (c) 2001, 2002, 2003, 2004 Fernando Perez <fperez@colorado.edu>.
8823 Copyright (c) 2001, 2002, 2003, 2004 Fernando Perez <fperez@colorado.edu>.
8814 \layout Quote
8824 \layout Quote
8815
8825
8816
8826
8817 \family typewriter
8827 \family typewriter
8818 \size small
8828 \size small
8819 Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and
8829 Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and
8820 \newline
8830 \newline
8821 Nathaniel Gray <n8gray@caltech.edu>.
8831 Nathaniel Gray <n8gray@caltech.edu>.
8822 \layout Quote
8832 \layout Quote
8823
8833
8824
8834
8825 \family typewriter
8835 \family typewriter
8826 \size small
8836 \size small
8827 All rights reserved.
8837 All rights reserved.
8828 \layout Quote
8838 \layout Quote
8829
8839
8830
8840
8831 \family typewriter
8841 \family typewriter
8832 \size small
8842 \size small
8833 Redistribution and use in source and binary forms, with or without modification,
8843 Redistribution and use in source and binary forms, with or without modification,
8834 are permitted provided that the following conditions are met:
8844 are permitted provided that the following conditions are met:
8835 \layout Quote
8845 \layout Quote
8836
8846
8837
8847
8838 \family typewriter
8848 \family typewriter
8839 \size small
8849 \size small
8840 a.
8850 a.
8841 Redistributions of source code must retain the above copyright notice,
8851 Redistributions of source code must retain the above copyright notice,
8842 this list of conditions and the following disclaimer.
8852 this list of conditions and the following disclaimer.
8843 \layout Quote
8853 \layout Quote
8844
8854
8845
8855
8846 \family typewriter
8856 \family typewriter
8847 \size small
8857 \size small
8848 b.
8858 b.
8849 Redistributions in binary form must reproduce the above copyright notice,
8859 Redistributions in binary form must reproduce the above copyright notice,
8850 this list of conditions and the following disclaimer in the documentation
8860 this list of conditions and the following disclaimer in the documentation
8851 and/or other materials provided with the distribution.
8861 and/or other materials provided with the distribution.
8852 \layout Quote
8862 \layout Quote
8853
8863
8854
8864
8855 \family typewriter
8865 \family typewriter
8856 \size small
8866 \size small
8857 c.
8867 c.
8858 Neither the name of the copyright holders nor the names of any contributors
8868 Neither the name of the copyright holders nor the names of any contributors
8859 to this software may be used to endorse or promote products derived from
8869 to this software may be used to endorse or promote products derived from
8860 this software without specific prior written permission.
8870 this software without specific prior written permission.
8861 \layout Quote
8871 \layout Quote
8862
8872
8863
8873
8864 \family typewriter
8874 \family typewriter
8865 \size small
8875 \size small
8866 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
8876 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
8867 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
8877 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
8868 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
8878 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
8869 PURPOSE ARE DISCLAIMED.
8879 PURPOSE ARE DISCLAIMED.
8870 IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
8880 IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
8871 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
8881 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
8872 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8882 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8873 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8883 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8874 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8884 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8875 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8885 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8876 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8886 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8877
8887
8878 \layout Standard
8888 \layout Standard
8879
8889
8880 Individual authors are the holders of the copyright for their code and are
8890 Individual authors are the holders of the copyright for their code and are
8881 listed in each file.
8891 listed in each file.
8882 \layout Standard
8892 \layout Standard
8883
8893
8884 Some files (
8894 Some files (
8885 \family typewriter
8895 \family typewriter
8886 DPyGetOpt.py
8896 DPyGetOpt.py
8887 \family default
8897 \family default
8888 , for example) may be licensed under different conditions.
8898 , for example) may be licensed under different conditions.
8889 Ultimately each file indicates clearly the conditions under which its author/au
8899 Ultimately each file indicates clearly the conditions under which its author/au
8890 thors have decided to publish the code.
8900 thors have decided to publish the code.
8891 \layout Standard
8901 \layout Standard
8892
8902
8893 Versions of IPython up to and including 0.6.3 were released under the GNU
8903 Versions of IPython up to and including 0.6.3 were released under the GNU
8894 Lesser General Public License (LGPL), available at
8904 Lesser General Public License (LGPL), available at
8895 \begin_inset LatexCommand \htmlurl{http://www.gnu.org/copyleft/lesser.html}
8905 \begin_inset LatexCommand \htmlurl{http://www.gnu.org/copyleft/lesser.html}
8896
8906
8897 \end_inset
8907 \end_inset
8898
8908
8899 .
8909 .
8900 \layout Section
8910 \layout Section
8901
8911
8902
8912
8903 \begin_inset LatexCommand \label{sec:credits}
8913 \begin_inset LatexCommand \label{sec:credits}
8904
8914
8905 \end_inset
8915 \end_inset
8906
8916
8907 Credits
8917 Credits
8908 \layout Standard
8918 \layout Standard
8909
8919
8910 IPython is mainly developed by Fernando P
8920 IPython is mainly developed by Fernando P
8911 \begin_inset ERT
8921 \begin_inset ERT
8912 status Collapsed
8922 status Collapsed
8913
8923
8914 \layout Standard
8924 \layout Standard
8915
8925
8916 \backslash
8926 \backslash
8917 '{e}
8927 '{e}
8918 \end_inset
8928 \end_inset
8919
8929
8920 rez
8930 rez
8921 \family typewriter
8931 \family typewriter
8922 <Fernando.Perez@colorado.edu>
8932 <Fernando.Perez@colorado.edu>
8923 \family default
8933 \family default
8924 , but the project was born from mixing in Fernando's code with the IPP project
8934 , but the project was born from mixing in Fernando's code with the IPP project
8925 by Janko Hauser
8935 by Janko Hauser
8926 \family typewriter
8936 \family typewriter
8927 <jhauser-AT-zscout.de>
8937 <jhauser-AT-zscout.de>
8928 \family default
8938 \family default
8929 and LazyPython by Nathan Gray
8939 and LazyPython by Nathan Gray
8930 \family typewriter
8940 \family typewriter
8931 <n8gray-AT-caltech.edu>
8941 <n8gray-AT-caltech.edu>
8932 \family default
8942 \family default
8933 .
8943 .
8934 For all IPython-related requests, please contact Fernando.
8944 For all IPython-related requests, please contact Fernando.
8935
8945
8936 \layout Standard
8946 \layout Standard
8937
8947
8938 As of early 2006, the following developers have joined the core team:
8948 As of early 2006, the following developers have joined the core team:
8939 \layout List
8949 \layout List
8940 \labelwidthstring 00.00.0000
8950 \labelwidthstring 00.00.0000
8941
8951
8942 Robert\SpecialChar ~
8952 Robert\SpecialChar ~
8943 Kern
8953 Kern
8944 \family typewriter
8954 \family typewriter
8945 <rkern-AT-enthought.com>
8955 <rkern-AT-enthought.com>
8946 \family default
8956 \family default
8947 : co-mentored the 2005 Google Summer of Code project to develop python interacti
8957 : co-mentored the 2005 Google Summer of Code project to develop python interacti
8948 ve notebooks (XML documents) and graphical interface.
8958 ve notebooks (XML documents) and graphical interface.
8949 This project was awarded to the students Tzanko Matev
8959 This project was awarded to the students Tzanko Matev
8950 \family typewriter
8960 \family typewriter
8951 <tsanko-AT-gmail.com>
8961 <tsanko-AT-gmail.com>
8952 \family default
8962 \family default
8953 and Toni Alatalo
8963 and Toni Alatalo
8954 \family typewriter
8964 \family typewriter
8955 <antont-AT-an.org>
8965 <antont-AT-an.org>
8956 \layout List
8966 \layout List
8957 \labelwidthstring 00.00.0000
8967 \labelwidthstring 00.00.0000
8958
8968
8959 Brian\SpecialChar ~
8969 Brian\SpecialChar ~
8960 Granger
8970 Granger
8961 \family typewriter
8971 \family typewriter
8962 <bgranger-AT-scu.edu>
8972 <bgranger-AT-scu.edu>
8963 \family default
8973 \family default
8964 : extending IPython to allow support for interactive parallel computing.
8974 : extending IPython to allow support for interactive parallel computing.
8965 \layout List
8975 \layout List
8966 \labelwidthstring 00.00.0000
8976 \labelwidthstring 00.00.0000
8967
8977
8968 Ville\SpecialChar ~
8978 Ville\SpecialChar ~
8969 Vainio
8979 Vainio
8970 \family typewriter
8980 \family typewriter
8971 <vivainio-AT-gmail.com>
8981 <vivainio-AT-gmail.com>
8972 \family default
8982 \family default
8973 : Ville is the new maintainer for the main trunk of IPython after version
8983 : Ville is the new maintainer for the main trunk of IPython after version
8974 0.7.1.
8984 0.7.1.
8975 \layout Standard
8985 \layout Standard
8976
8986
8977 User or development help should be requested via the IPython mailing lists:
8987 User or development help should be requested via the IPython mailing lists:
8978 \layout Description
8988 \layout Description
8979
8989
8980 User\SpecialChar ~
8990 User\SpecialChar ~
8981 list:
8991 list:
8982 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-user}
8992 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-user}
8983
8993
8984 \end_inset
8994 \end_inset
8985
8995
8986
8996
8987 \layout Description
8997 \layout Description
8988
8998
8989 Developer's\SpecialChar ~
8999 Developer's\SpecialChar ~
8990 list:
9000 list:
8991 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-dev}
9001 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-dev}
8992
9002
8993 \end_inset
9003 \end_inset
8994
9004
8995
9005
8996 \layout Standard
9006 \layout Standard
8997
9007
8998 The IPython project is also very grateful to
9008 The IPython project is also very grateful to
8999 \begin_inset Foot
9009 \begin_inset Foot
9000 collapsed true
9010 collapsed true
9001
9011
9002 \layout Standard
9012 \layout Standard
9003
9013
9004 I've mangled email addresses to reduce spam, since the IPython manuals can
9014 I've mangled email addresses to reduce spam, since the IPython manuals can
9005 be accessed online.
9015 be accessed online.
9006 \end_inset
9016 \end_inset
9007
9017
9008 :
9018 :
9009 \layout Standard
9019 \layout Standard
9010
9020
9011 Bill Bumgarner
9021 Bill Bumgarner
9012 \family typewriter
9022 \family typewriter
9013 <bbum-AT-friday.com>
9023 <bbum-AT-friday.com>
9014 \family default
9024 \family default
9015 : for providing the DPyGetOpt module which gives very powerful and convenient
9025 : for providing the DPyGetOpt module which gives very powerful and convenient
9016 handling of command-line options (light years ahead of what Python 2.1.1's
9026 handling of command-line options (light years ahead of what Python 2.1.1's
9017 getopt module does).
9027 getopt module does).
9018 \layout Standard
9028 \layout Standard
9019
9029
9020 Ka-Ping Yee
9030 Ka-Ping Yee
9021 \family typewriter
9031 \family typewriter
9022 <ping-AT-lfw.org>
9032 <ping-AT-lfw.org>
9023 \family default
9033 \family default
9024 : for providing the Itpl module for convenient and powerful string interpolation
9034 : for providing the Itpl module for convenient and powerful string interpolation
9025 with a much nicer syntax than formatting through the '%' operator.
9035 with a much nicer syntax than formatting through the '%' operator.
9026 \layout Standard
9036 \layout Standard
9027
9037
9028 Arnd Baecker
9038 Arnd Baecker
9029 \family typewriter
9039 \family typewriter
9030 <baecker-AT-physik.tu-dresden.de>
9040 <baecker-AT-physik.tu-dresden.de>
9031 \family default
9041 \family default
9032 : for his many very useful suggestions and comments, and lots of help with
9042 : for his many very useful suggestions and comments, and lots of help with
9033 testing and documentation checking.
9043 testing and documentation checking.
9034 Many of IPython's newer features are a result of discussions with him (bugs
9044 Many of IPython's newer features are a result of discussions with him (bugs
9035 are still my fault, not his).
9045 are still my fault, not his).
9036 \layout Standard
9046 \layout Standard
9037
9047
9038 Obviously Guido van\SpecialChar ~
9048 Obviously Guido van\SpecialChar ~
9039 Rossum and the whole Python development team, that goes
9049 Rossum and the whole Python development team, that goes
9040 without saying.
9050 without saying.
9041 \layout Standard
9051 \layout Standard
9042
9052
9043 IPython's website is generously hosted at
9053 IPython's website is generously hosted at
9044 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
9054 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
9045
9055
9046 \end_inset
9056 \end_inset
9047
9057
9048 by Enthought (
9058 by Enthought (
9049 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
9059 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
9050
9060
9051 \end_inset
9061 \end_inset
9052
9062
9053 ).
9063 ).
9054 I am very grateful to them and all of the SciPy team for their contribution.
9064 I am very grateful to them and all of the SciPy team for their contribution.
9055 \layout Standard
9065 \layout Standard
9056
9066
9057
9067
9058 \begin_inset LatexCommand \label{figgins}
9068 \begin_inset LatexCommand \label{figgins}
9059
9069
9060 \end_inset
9070 \end_inset
9061
9071
9062 Fernando would also like to thank Stephen Figgins
9072 Fernando would also like to thank Stephen Figgins
9063 \family typewriter
9073 \family typewriter
9064 <fig-AT-monitor.net>
9074 <fig-AT-monitor.net>
9065 \family default
9075 \family default
9066 , an O'Reilly Python editor.
9076 , an O'Reilly Python editor.
9067 His Oct/11/2001 article about IPP and LazyPython, was what got this project
9077 His Oct/11/2001 article about IPP and LazyPython, was what got this project
9068 started.
9078 started.
9069 You can read it at:
9079 You can read it at:
9070 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html}
9080 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html}
9071
9081
9072 \end_inset
9082 \end_inset
9073
9083
9074 .
9084 .
9075 \layout Standard
9085 \layout Standard
9076
9086
9077 And last but not least, all the kind IPython users who have emailed new
9087 And last but not least, all the kind IPython users who have emailed new
9078 code, bug reports, fixes, comments and ideas.
9088 code, bug reports, fixes, comments and ideas.
9079 A brief list follows, please let me know if I have ommitted your name by
9089 A brief list follows, please let me know if I have ommitted your name by
9080 accident:
9090 accident:
9081 \layout List
9091 \layout List
9082 \labelwidthstring 00.00.0000
9092 \labelwidthstring 00.00.0000
9083
9093
9084 Jack\SpecialChar ~
9094 Jack\SpecialChar ~
9085 Moffit
9095 Moffit
9086 \family typewriter
9096 \family typewriter
9087 <jack-AT-xiph.org>
9097 <jack-AT-xiph.org>
9088 \family default
9098 \family default
9089 Bug fixes, including the infamous color problem.
9099 Bug fixes, including the infamous color problem.
9090 This bug alone caused many lost hours and frustration, many thanks to him
9100 This bug alone caused many lost hours and frustration, many thanks to him
9091 for the fix.
9101 for the fix.
9092 I've always been a fan of Ogg & friends, now I have one more reason to
9102 I've always been a fan of Ogg & friends, now I have one more reason to
9093 like these folks.
9103 like these folks.
9094 \newline
9104 \newline
9095 Jack is also contributing with Debian packaging and many other things.
9105 Jack is also contributing with Debian packaging and many other things.
9096 \layout List
9106 \layout List
9097 \labelwidthstring 00.00.0000
9107 \labelwidthstring 00.00.0000
9098
9108
9099 Alexander\SpecialChar ~
9109 Alexander\SpecialChar ~
9100 Schmolck
9110 Schmolck
9101 \family typewriter
9111 \family typewriter
9102 <a.schmolck-AT-gmx.net>
9112 <a.schmolck-AT-gmx.net>
9103 \family default
9113 \family default
9104 Emacs work, bug reports, bug fixes, ideas, lots more.
9114 Emacs work, bug reports, bug fixes, ideas, lots more.
9105 The ipython.el mode for (X)Emacs is Alex's code, providing full support
9115 The ipython.el mode for (X)Emacs is Alex's code, providing full support
9106 for IPython under (X)Emacs.
9116 for IPython under (X)Emacs.
9107 \layout List
9117 \layout List
9108 \labelwidthstring 00.00.0000
9118 \labelwidthstring 00.00.0000
9109
9119
9110 Andrea\SpecialChar ~
9120 Andrea\SpecialChar ~
9111 Riciputi
9121 Riciputi
9112 \family typewriter
9122 \family typewriter
9113 <andrea.riciputi-AT-libero.it>
9123 <andrea.riciputi-AT-libero.it>
9114 \family default
9124 \family default
9115 Mac OSX information, Fink package management.
9125 Mac OSX information, Fink package management.
9116 \layout List
9126 \layout List
9117 \labelwidthstring 00.00.0000
9127 \labelwidthstring 00.00.0000
9118
9128
9119 Gary\SpecialChar ~
9129 Gary\SpecialChar ~
9120 Bishop
9130 Bishop
9121 \family typewriter
9131 \family typewriter
9122 <gb-AT-cs.unc.edu>
9132 <gb-AT-cs.unc.edu>
9123 \family default
9133 \family default
9124 Bug reports, and patches to work around the exception handling idiosyncracies
9134 Bug reports, and patches to work around the exception handling idiosyncracies
9125 of WxPython.
9135 of WxPython.
9126 Readline and color support for Windows.
9136 Readline and color support for Windows.
9127 \layout List
9137 \layout List
9128 \labelwidthstring 00.00.0000
9138 \labelwidthstring 00.00.0000
9129
9139
9130 Jeffrey\SpecialChar ~
9140 Jeffrey\SpecialChar ~
9131 Collins
9141 Collins
9132 \family typewriter
9142 \family typewriter
9133 <Jeff.Collins-AT-vexcel.com>
9143 <Jeff.Collins-AT-vexcel.com>
9134 \family default
9144 \family default
9135 Bug reports.
9145 Bug reports.
9136 Much improved readline support, including fixes for Python 2.3.
9146 Much improved readline support, including fixes for Python 2.3.
9137 \layout List
9147 \layout List
9138 \labelwidthstring 00.00.0000
9148 \labelwidthstring 00.00.0000
9139
9149
9140 Dryice\SpecialChar ~
9150 Dryice\SpecialChar ~
9141 Liu
9151 Liu
9142 \family typewriter
9152 \family typewriter
9143 <dryice-AT-liu.com.cn>
9153 <dryice-AT-liu.com.cn>
9144 \family default
9154 \family default
9145 FreeBSD port.
9155 FreeBSD port.
9146 \layout List
9156 \layout List
9147 \labelwidthstring 00.00.0000
9157 \labelwidthstring 00.00.0000
9148
9158
9149 Mike\SpecialChar ~
9159 Mike\SpecialChar ~
9150 Heeter
9160 Heeter
9151 \family typewriter
9161 \family typewriter
9152 <korora-AT-SDF.LONESTAR.ORG>
9162 <korora-AT-SDF.LONESTAR.ORG>
9153 \layout List
9163 \layout List
9154 \labelwidthstring 00.00.0000
9164 \labelwidthstring 00.00.0000
9155
9165
9156 Christopher\SpecialChar ~
9166 Christopher\SpecialChar ~
9157 Hart
9167 Hart
9158 \family typewriter
9168 \family typewriter
9159 <hart-AT-caltech.edu>
9169 <hart-AT-caltech.edu>
9160 \family default
9170 \family default
9161 PDB integration.
9171 PDB integration.
9162 \layout List
9172 \layout List
9163 \labelwidthstring 00.00.0000
9173 \labelwidthstring 00.00.0000
9164
9174
9165 Milan\SpecialChar ~
9175 Milan\SpecialChar ~
9166 Zamazal
9176 Zamazal
9167 \family typewriter
9177 \family typewriter
9168 <pdm-AT-zamazal.org>
9178 <pdm-AT-zamazal.org>
9169 \family default
9179 \family default
9170 Emacs info.
9180 Emacs info.
9171 \layout List
9181 \layout List
9172 \labelwidthstring 00.00.0000
9182 \labelwidthstring 00.00.0000
9173
9183
9174 Philip\SpecialChar ~
9184 Philip\SpecialChar ~
9175 Hisley
9185 Hisley
9176 \family typewriter
9186 \family typewriter
9177 <compsys-AT-starpower.net>
9187 <compsys-AT-starpower.net>
9178 \layout List
9188 \layout List
9179 \labelwidthstring 00.00.0000
9189 \labelwidthstring 00.00.0000
9180
9190
9181 Holger\SpecialChar ~
9191 Holger\SpecialChar ~
9182 Krekel
9192 Krekel
9183 \family typewriter
9193 \family typewriter
9184 <pyth-AT-devel.trillke.net>
9194 <pyth-AT-devel.trillke.net>
9185 \family default
9195 \family default
9186 Tab completion, lots more.
9196 Tab completion, lots more.
9187 \layout List
9197 \layout List
9188 \labelwidthstring 00.00.0000
9198 \labelwidthstring 00.00.0000
9189
9199
9190 Robin\SpecialChar ~
9200 Robin\SpecialChar ~
9191 Siebler
9201 Siebler
9192 \family typewriter
9202 \family typewriter
9193 <robinsiebler-AT-starband.net>
9203 <robinsiebler-AT-starband.net>
9194 \layout List
9204 \layout List
9195 \labelwidthstring 00.00.0000
9205 \labelwidthstring 00.00.0000
9196
9206
9197 Ralf\SpecialChar ~
9207 Ralf\SpecialChar ~
9198 Ahlbrink
9208 Ahlbrink
9199 \family typewriter
9209 \family typewriter
9200 <ralf_ahlbrink-AT-web.de>
9210 <ralf_ahlbrink-AT-web.de>
9201 \layout List
9211 \layout List
9202 \labelwidthstring 00.00.0000
9212 \labelwidthstring 00.00.0000
9203
9213
9204 Thorsten\SpecialChar ~
9214 Thorsten\SpecialChar ~
9205 Kampe
9215 Kampe
9206 \family typewriter
9216 \family typewriter
9207 <thorsten-AT-thorstenkampe.de>
9217 <thorsten-AT-thorstenkampe.de>
9208 \layout List
9218 \layout List
9209 \labelwidthstring 00.00.0000
9219 \labelwidthstring 00.00.0000
9210
9220
9211 Fredrik\SpecialChar ~
9221 Fredrik\SpecialChar ~
9212 Kant
9222 Kant
9213 \family typewriter
9223 \family typewriter
9214 <fredrik.kant-AT-front.com>
9224 <fredrik.kant-AT-front.com>
9215 \family default
9225 \family default
9216 Windows setup.
9226 Windows setup.
9217 \layout List
9227 \layout List
9218 \labelwidthstring 00.00.0000
9228 \labelwidthstring 00.00.0000
9219
9229
9220 Syver\SpecialChar ~
9230 Syver\SpecialChar ~
9221 Enstad
9231 Enstad
9222 \family typewriter
9232 \family typewriter
9223 <syver-en-AT-online.no>
9233 <syver-en-AT-online.no>
9224 \family default
9234 \family default
9225 Windows setup.
9235 Windows setup.
9226 \layout List
9236 \layout List
9227 \labelwidthstring 00.00.0000
9237 \labelwidthstring 00.00.0000
9228
9238
9229 Richard
9239 Richard
9230 \family typewriter
9240 \family typewriter
9231 <rxe-AT-renre-europe.com>
9241 <rxe-AT-renre-europe.com>
9232 \family default
9242 \family default
9233 Global embedding.
9243 Global embedding.
9234 \layout List
9244 \layout List
9235 \labelwidthstring 00.00.0000
9245 \labelwidthstring 00.00.0000
9236
9246
9237 Hayden\SpecialChar ~
9247 Hayden\SpecialChar ~
9238 Callow
9248 Callow
9239 \family typewriter
9249 \family typewriter
9240 <h.callow-AT-elec.canterbury.ac.nz>
9250 <h.callow-AT-elec.canterbury.ac.nz>
9241 \family default
9251 \family default
9242 Gnuplot.py 1.6 compatibility.
9252 Gnuplot.py 1.6 compatibility.
9243 \layout List
9253 \layout List
9244 \labelwidthstring 00.00.0000
9254 \labelwidthstring 00.00.0000
9245
9255
9246 Leonardo\SpecialChar ~
9256 Leonardo\SpecialChar ~
9247 Santagada
9257 Santagada
9248 \family typewriter
9258 \family typewriter
9249 <retype-AT-terra.com.br>
9259 <retype-AT-terra.com.br>
9250 \family default
9260 \family default
9251 Fixes for Windows installation.
9261 Fixes for Windows installation.
9252 \layout List
9262 \layout List
9253 \labelwidthstring 00.00.0000
9263 \labelwidthstring 00.00.0000
9254
9264
9255 Christopher\SpecialChar ~
9265 Christopher\SpecialChar ~
9256 Armstrong
9266 Armstrong
9257 \family typewriter
9267 \family typewriter
9258 <radix-AT-twistedmatrix.com>
9268 <radix-AT-twistedmatrix.com>
9259 \family default
9269 \family default
9260 Bugfixes.
9270 Bugfixes.
9261 \layout List
9271 \layout List
9262 \labelwidthstring 00.00.0000
9272 \labelwidthstring 00.00.0000
9263
9273
9264 Francois\SpecialChar ~
9274 Francois\SpecialChar ~
9265 Pinard
9275 Pinard
9266 \family typewriter
9276 \family typewriter
9267 <pinard-AT-iro.umontreal.ca>
9277 <pinard-AT-iro.umontreal.ca>
9268 \family default
9278 \family default
9269 Code and documentation fixes.
9279 Code and documentation fixes.
9270 \layout List
9280 \layout List
9271 \labelwidthstring 00.00.0000
9281 \labelwidthstring 00.00.0000
9272
9282
9273 Cory\SpecialChar ~
9283 Cory\SpecialChar ~
9274 Dodt
9284 Dodt
9275 \family typewriter
9285 \family typewriter
9276 <cdodt-AT-fcoe.k12.ca.us>
9286 <cdodt-AT-fcoe.k12.ca.us>
9277 \family default
9287 \family default
9278 Bug reports and Windows ideas.
9288 Bug reports and Windows ideas.
9279 Patches for Windows installer.
9289 Patches for Windows installer.
9280 \layout List
9290 \layout List
9281 \labelwidthstring 00.00.0000
9291 \labelwidthstring 00.00.0000
9282
9292
9283 Olivier\SpecialChar ~
9293 Olivier\SpecialChar ~
9284 Aubert
9294 Aubert
9285 \family typewriter
9295 \family typewriter
9286 <oaubert-AT-bat710.univ-lyon1.fr>
9296 <oaubert-AT-bat710.univ-lyon1.fr>
9287 \family default
9297 \family default
9288 New magics.
9298 New magics.
9289 \layout List
9299 \layout List
9290 \labelwidthstring 00.00.0000
9300 \labelwidthstring 00.00.0000
9291
9301
9292 King\SpecialChar ~
9302 King\SpecialChar ~
9293 C.\SpecialChar ~
9303 C.\SpecialChar ~
9294 Shu
9304 Shu
9295 \family typewriter
9305 \family typewriter
9296 <kingshu-AT-myrealbox.com>
9306 <kingshu-AT-myrealbox.com>
9297 \family default
9307 \family default
9298 Autoindent patch.
9308 Autoindent patch.
9299 \layout List
9309 \layout List
9300 \labelwidthstring 00.00.0000
9310 \labelwidthstring 00.00.0000
9301
9311
9302 Chris\SpecialChar ~
9312 Chris\SpecialChar ~
9303 Drexler
9313 Drexler
9304 \family typewriter
9314 \family typewriter
9305 <chris-AT-ac-drexler.de>
9315 <chris-AT-ac-drexler.de>
9306 \family default
9316 \family default
9307 Readline packages for Win32/CygWin.
9317 Readline packages for Win32/CygWin.
9308 \layout List
9318 \layout List
9309 \labelwidthstring 00.00.0000
9319 \labelwidthstring 00.00.0000
9310
9320
9311 Gustavo\SpecialChar ~
9321 Gustavo\SpecialChar ~
9312 Cordova\SpecialChar ~
9322 Cordova\SpecialChar ~
9313 Avila
9323 Avila
9314 \family typewriter
9324 \family typewriter
9315 <gcordova-AT-sismex.com>
9325 <gcordova-AT-sismex.com>
9316 \family default
9326 \family default
9317 EvalDict code for nice, lightweight string interpolation.
9327 EvalDict code for nice, lightweight string interpolation.
9318 \layout List
9328 \layout List
9319 \labelwidthstring 00.00.0000
9329 \labelwidthstring 00.00.0000
9320
9330
9321 Kasper\SpecialChar ~
9331 Kasper\SpecialChar ~
9322 Souren
9332 Souren
9323 \family typewriter
9333 \family typewriter
9324 <Kasper.Souren-AT-ircam.fr>
9334 <Kasper.Souren-AT-ircam.fr>
9325 \family default
9335 \family default
9326 Bug reports, ideas.
9336 Bug reports, ideas.
9327 \layout List
9337 \layout List
9328 \labelwidthstring 00.00.0000
9338 \labelwidthstring 00.00.0000
9329
9339
9330 Gever\SpecialChar ~
9340 Gever\SpecialChar ~
9331 Tulley
9341 Tulley
9332 \family typewriter
9342 \family typewriter
9333 <gever-AT-helium.com>
9343 <gever-AT-helium.com>
9334 \family default
9344 \family default
9335 Code contributions.
9345 Code contributions.
9336 \layout List
9346 \layout List
9337 \labelwidthstring 00.00.0000
9347 \labelwidthstring 00.00.0000
9338
9348
9339 Ralf\SpecialChar ~
9349 Ralf\SpecialChar ~
9340 Schmitt
9350 Schmitt
9341 \family typewriter
9351 \family typewriter
9342 <ralf-AT-brainbot.com>
9352 <ralf-AT-brainbot.com>
9343 \family default
9353 \family default
9344 Bug reports & fixes.
9354 Bug reports & fixes.
9345 \layout List
9355 \layout List
9346 \labelwidthstring 00.00.0000
9356 \labelwidthstring 00.00.0000
9347
9357
9348 Oliver\SpecialChar ~
9358 Oliver\SpecialChar ~
9349 Sander
9359 Sander
9350 \family typewriter
9360 \family typewriter
9351 <osander-AT-gmx.de>
9361 <osander-AT-gmx.de>
9352 \family default
9362 \family default
9353 Bug reports.
9363 Bug reports.
9354 \layout List
9364 \layout List
9355 \labelwidthstring 00.00.0000
9365 \labelwidthstring 00.00.0000
9356
9366
9357 Rod\SpecialChar ~
9367 Rod\SpecialChar ~
9358 Holland
9368 Holland
9359 \family typewriter
9369 \family typewriter
9360 <rhh-AT-structurelabs.com>
9370 <rhh-AT-structurelabs.com>
9361 \family default
9371 \family default
9362 Bug reports and fixes to logging module.
9372 Bug reports and fixes to logging module.
9363 \layout List
9373 \layout List
9364 \labelwidthstring 00.00.0000
9374 \labelwidthstring 00.00.0000
9365
9375
9366 Daniel\SpecialChar ~
9376 Daniel\SpecialChar ~
9367 'Dang'\SpecialChar ~
9377 'Dang'\SpecialChar ~
9368 Griffith
9378 Griffith
9369 \family typewriter
9379 \family typewriter
9370 <pythondev-dang-AT-lazytwinacres.net>
9380 <pythondev-dang-AT-lazytwinacres.net>
9371 \family default
9381 \family default
9372 Fixes, enhancement suggestions for system shell use.
9382 Fixes, enhancement suggestions for system shell use.
9373 \layout List
9383 \layout List
9374 \labelwidthstring 00.00.0000
9384 \labelwidthstring 00.00.0000
9375
9385
9376 Viktor\SpecialChar ~
9386 Viktor\SpecialChar ~
9377 Ransmayr
9387 Ransmayr
9378 \family typewriter
9388 \family typewriter
9379 <viktor.ransmayr-AT-t-online.de>
9389 <viktor.ransmayr-AT-t-online.de>
9380 \family default
9390 \family default
9381 Tests and reports on Windows installation issues.
9391 Tests and reports on Windows installation issues.
9382 Contributed a true Windows binary installer.
9392 Contributed a true Windows binary installer.
9383 \layout List
9393 \layout List
9384 \labelwidthstring 00.00.0000
9394 \labelwidthstring 00.00.0000
9385
9395
9386 Mike\SpecialChar ~
9396 Mike\SpecialChar ~
9387 Salib
9397 Salib
9388 \family typewriter
9398 \family typewriter
9389 <msalib-AT-mit.edu>
9399 <msalib-AT-mit.edu>
9390 \family default
9400 \family default
9391 Help fixing a subtle bug related to traceback printing.
9401 Help fixing a subtle bug related to traceback printing.
9392 \layout List
9402 \layout List
9393 \labelwidthstring 00.00.0000
9403 \labelwidthstring 00.00.0000
9394
9404
9395 W.J.\SpecialChar ~
9405 W.J.\SpecialChar ~
9396 van\SpecialChar ~
9406 van\SpecialChar ~
9397 der\SpecialChar ~
9407 der\SpecialChar ~
9398 Laan
9408 Laan
9399 \family typewriter
9409 \family typewriter
9400 <gnufnork-AT-hetdigitalegat.nl>
9410 <gnufnork-AT-hetdigitalegat.nl>
9401 \family default
9411 \family default
9402 Bash-like prompt specials.
9412 Bash-like prompt specials.
9403 \layout List
9413 \layout List
9404 \labelwidthstring 00.00.0000
9414 \labelwidthstring 00.00.0000
9405
9415
9406 Antoon\SpecialChar ~
9416 Antoon\SpecialChar ~
9407 Pardon
9417 Pardon
9408 \family typewriter
9418 \family typewriter
9409 <Antoon.Pardon-AT-rece.vub.ac.be>
9419 <Antoon.Pardon-AT-rece.vub.ac.be>
9410 \family default
9420 \family default
9411 Critical fix for the multithreaded IPython.
9421 Critical fix for the multithreaded IPython.
9412 \layout List
9422 \layout List
9413 \labelwidthstring 00.00.0000
9423 \labelwidthstring 00.00.0000
9414
9424
9415 John\SpecialChar ~
9425 John\SpecialChar ~
9416 Hunter
9426 Hunter
9417 \family typewriter
9427 \family typewriter
9418 <jdhunter-AT-nitace.bsd.uchicago.edu>
9428 <jdhunter-AT-nitace.bsd.uchicago.edu>
9419 \family default
9429 \family default
9420 Matplotlib author, helped with all the development of support for matplotlib
9430 Matplotlib author, helped with all the development of support for matplotlib
9421 in IPyhton, including making necessary changes to matplotlib itself.
9431 in IPyhton, including making necessary changes to matplotlib itself.
9422 \layout List
9432 \layout List
9423 \labelwidthstring 00.00.0000
9433 \labelwidthstring 00.00.0000
9424
9434
9425 Matthew\SpecialChar ~
9435 Matthew\SpecialChar ~
9426 Arnison
9436 Arnison
9427 \family typewriter
9437 \family typewriter
9428 <maffew-AT-cat.org.au>
9438 <maffew-AT-cat.org.au>
9429 \family default
9439 \family default
9430 Bug reports, `
9440 Bug reports, `
9431 \family typewriter
9441 \family typewriter
9432 %run -d
9442 %run -d
9433 \family default
9443 \family default
9434 ' idea.
9444 ' idea.
9435 \layout List
9445 \layout List
9436 \labelwidthstring 00.00.0000
9446 \labelwidthstring 00.00.0000
9437
9447
9438 Prabhu\SpecialChar ~
9448 Prabhu\SpecialChar ~
9439 Ramachandran
9449 Ramachandran
9440 \family typewriter
9450 \family typewriter
9441 <prabhu_r-AT-users.sourceforge.net>
9451 <prabhu_r-AT-users.sourceforge.net>
9442 \family default
9452 \family default
9443 Help with (X)Emacs support, threading patches, ideas...
9453 Help with (X)Emacs support, threading patches, ideas...
9444 \layout List
9454 \layout List
9445 \labelwidthstring 00.00.0000
9455 \labelwidthstring 00.00.0000
9446
9456
9447 Norbert\SpecialChar ~
9457 Norbert\SpecialChar ~
9448 Tretkowski
9458 Tretkowski
9449 \family typewriter
9459 \family typewriter
9450 <tretkowski-AT-inittab.de>
9460 <tretkowski-AT-inittab.de>
9451 \family default
9461 \family default
9452 help with Debian packaging and distribution.
9462 help with Debian packaging and distribution.
9453 \layout List
9463 \layout List
9454 \labelwidthstring 00.00.0000
9464 \labelwidthstring 00.00.0000
9455
9465
9456 George\SpecialChar ~
9466 George\SpecialChar ~
9457 Sakkis <
9467 Sakkis <
9458 \family typewriter
9468 \family typewriter
9459 gsakkis-AT-eden.rutgers.edu>
9469 gsakkis-AT-eden.rutgers.edu>
9460 \family default
9470 \family default
9461 New matcher for tab-completing named arguments of user-defined functions.
9471 New matcher for tab-completing named arguments of user-defined functions.
9462 \layout List
9472 \layout List
9463 \labelwidthstring 00.00.0000
9473 \labelwidthstring 00.00.0000
9464
9474
9465 JοΏ½rgen\SpecialChar ~
9475 JοΏ½rgen\SpecialChar ~
9466 Stenarson
9476 Stenarson
9467 \family typewriter
9477 \family typewriter
9468 <jorgen.stenarson-AT-bostream.nu>
9478 <jorgen.stenarson-AT-bostream.nu>
9469 \family default
9479 \family default
9470 Wildcard support implementation for searching namespaces.
9480 Wildcard support implementation for searching namespaces.
9471 \layout List
9481 \layout List
9472 \labelwidthstring 00.00.0000
9482 \labelwidthstring 00.00.0000
9473
9483
9474 Vivian\SpecialChar ~
9484 Vivian\SpecialChar ~
9475 De\SpecialChar ~
9485 De\SpecialChar ~
9476 Smedt
9486 Smedt
9477 \family typewriter
9487 \family typewriter
9478 <vivian-AT-vdesmedt.com>
9488 <vivian-AT-vdesmedt.com>
9479 \family default
9489 \family default
9480 Debugger enhancements, so that when pdb is activated from within IPython,
9490 Debugger enhancements, so that when pdb is activated from within IPython,
9481 coloring, tab completion and other features continue to work seamlessly.
9491 coloring, tab completion and other features continue to work seamlessly.
9482 \layout List
9492 \layout List
9483 \labelwidthstring 00.00.0000
9493 \labelwidthstring 00.00.0000
9484
9494
9485 Scott\SpecialChar ~
9495 Scott\SpecialChar ~
9486 Tsai
9496 Tsai
9487 \family typewriter
9497 \family typewriter
9488 <scottt958-AT-yahoo.com.tw>
9498 <scottt958-AT-yahoo.com.tw>
9489 \family default
9499 \family default
9490 Support for automatic editor invocation on syntax errors (see
9500 Support for automatic editor invocation on syntax errors (see
9491 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython/issue36}
9501 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython/issue36}
9492
9502
9493 \end_inset
9503 \end_inset
9494
9504
9495 ).
9505 ).
9496 \layout List
9506 \layout List
9497 \labelwidthstring 00.00.0000
9507 \labelwidthstring 00.00.0000
9498
9508
9499 Alexander\SpecialChar ~
9509 Alexander\SpecialChar ~
9500 Belchenko
9510 Belchenko
9501 \family typewriter
9511 \family typewriter
9502 <bialix-AT-ukr.net>
9512 <bialix-AT-ukr.net>
9503 \family default
9513 \family default
9504 Improvements for win32 paging system.
9514 Improvements for win32 paging system.
9505 \the_end
9515 \the_end
General Comments 0
You need to be logged in to leave comments. Login now