##// END OF EJS Templates
Documentation fixes. Closes #151
fperez -
Show More
@@ -1,6649 +1,6654 b''
1 2007-05-10 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * ipython.1: update man page and full manual with information
4 about threads (remove outdated warning). Closes #151.
5
1 6 2007-05-09 Fernando Perez <Fernando.Perez@colorado.edu>
2 7
3 8 * IPython/Extensions/ipy_constants.py: Add Gael's constants module
4 9 in trunk (note that this made it into the 0.8.1 release already,
5 10 but the changelogs didn't get coordinated). Many thanks to Gael
6 11 Varoquaux <gael.varoquaux-AT-normalesup.org>
7 12
8 13 2007-05-09 *** Released version 0.8.1
9 14
10 15 2007-05-10 Walter Doerwald <walter@livinglogic.de>
11 16
12 17 * IPython/Extensions/igrid.py: Incorporate html help into
13 18 the module, so we don't have to search for the file.
14 19
15 20 2007-05-02 Fernando Perez <Fernando.Perez@colorado.edu>
16 21
17 22 * test/test_irunner.py (RunnerTestCase._test_runner): Close #147.
18 23
19 24 2007-04-30 Ville Vainio <vivainio@gmail.com>
20 25
21 26 * iplib.py: (pre_config_initialization) Catch UnicodeDecodeError if the
22 27 user has illegal (non-ascii) home directory name
23 28
24 29 2007-04-27 Ville Vainio <vivainio@gmail.com>
25 30
26 31 * platutils_win32.py: implement set_term_title for windows
27 32
28 33 * Update version number
29 34
30 35 * ipy_profile_sh.py: more informative prompt (2 dir levels)
31 36
32 37 2007-04-26 Walter Doerwald <walter@livinglogic.de>
33 38
34 39 * IPython/Extensions/igrid.py: (igrid) Fix bug that surfaced
35 40 when the igrid input raised an exception. (Patch by Nik Tautenhahn,
36 41 bug discovered by Ville).
37 42
38 43 2007-04-26 Ville Vainio <vivainio@gmail.com>
39 44
40 45 * Extensions/ipy_completers.py: Olivier's module completer now
41 46 saves the list of root modules if it takes > 4 secs on the first run.
42 47
43 48 * Magic.py (%rehashx): %rehashx now clears the completer cache
44 49
45 50
46 51 2007-04-26 Fernando Perez <Fernando.Perez@colorado.edu>
47 52
48 53 * ipython.el: fix incorrect color scheme, reported by Stefan.
49 54 Closes #149.
50 55
51 56 * IPython/PyColorize.py (Parser.format2): fix state-handling
52 57 logic. I still don't like how that code handles state, but at
53 58 least now it should be correct, if inelegant. Closes #146.
54 59
55 60 2007-04-25 Ville Vainio <vivainio@gmail.com>
56 61
57 62 * Extensions/ipy_which.py: added extension for %which magic, works
58 63 a lot like unix 'which' but also finds and expands aliases, and
59 64 allows wildcards.
60 65
61 66 * ipapi.py (expand_alias): Now actually *return* the expanded alias,
62 67 as opposed to returning nothing.
63 68
64 69 * UserConfig/ipy_user_conf.py, ipy_profile_sh.py: do not import
65 70 ipy_stock_completers on default profile, do import on sh profile.
66 71
67 72 2007-04-22 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
68 73
69 74 * Fix bug in iplib.py/safe_execfile when launching ipython with a script
70 75 like ipython.py foo.py which raised a IndexError.
71 76
72 77 2007-04-21 Ville Vainio <vivainio@gmail.com>
73 78
74 79 * Extensions/ipy_extutil.py: added extension to manage other ipython
75 80 extensions. Now only supports 'ls' == list extensions.
76 81
77 82 2007-04-20 Fernando Perez <Fernando.Perez@colorado.edu>
78 83
79 84 * IPython/Debugger.py (BdbQuit_excepthook): fix small bug that
80 85 would prevent use of the exception system outside of a running
81 86 IPython instance.
82 87
83 88 2007-04-20 Ville Vainio <vivainio@gmail.com>
84 89
85 90 * Extensions/ipy_render.py: added extension for easy
86 91 interactive text template rendering (to clipboard). Uses Ka-Ping Yee's
87 92 'Iptl' template notation,
88 93
89 94 * Extensions/ipy_completers.py: introduced Olivier Lauzanne's
90 95 safer & faster 'import' completer.
91 96
92 97 * ipapi.py: Introduced new ipapi methods, _ip.defmacro(name, value)
93 98 and _ip.defalias(name, command).
94 99
95 100 * Extensions/ipy_exportdb.py: New extension for exporting all the
96 101 %store'd data in a portable format (normal ipapi calls like
97 102 defmacro() etc.)
98 103
99 104 2007-04-19 Ville Vainio <vivainio@gmail.com>
100 105
101 106 * upgrade_dir.py: skip junk files like *.pyc
102 107
103 108 * Release.py: version number to 0.8.1
104 109
105 110 2007-04-18 Ville Vainio <vivainio@gmail.com>
106 111
107 112 * iplib.py (safe_execfile): make "ipython foo.py" work with 2.5.1c1
108 113 and later on win32.
109 114
110 115 2007-04-16 Ville Vainio <vivainio@gmail.com>
111 116
112 117 * iplib.py (showtraceback): Do not crash when running w/o readline.
113 118
114 119 2007-04-12 Walter Doerwald <walter@livinglogic.de>
115 120
116 121 * IPython/Extensions/ipipe.py: (ils) Directoy listings are now
117 122 sorted (case sensitive with files and dirs mixed).
118 123
119 124 2007-04-10 Fernando Perez <Fernando.Perez@colorado.edu>
120 125
121 126 * IPython/Release.py (version): Open trunk for 0.8.1 development.
122 127
123 128 2007-04-10 *** Released version 0.8.0
124 129
125 130 2007-04-07 Fernando Perez <Fernando.Perez@colorado.edu>
126 131
127 132 * Tag 0.8.0 for release.
128 133
129 134 * IPython/iplib.py (reloadhist): add API function to cleanly
130 135 reload the readline history, which was growing inappropriately on
131 136 every %run call.
132 137
133 138 * win32_manual_post_install.py (run): apply last part of Nicolas
134 139 Pernetty's patch (I'd accidentally applied it in a different
135 140 directory and this particular file didn't get patched).
136 141
137 142 2007-04-05 Fernando Perez <Fernando.Perez@colorado.edu>
138 143
139 144 * IPython/Shell.py (MAIN_THREAD_ID): get rid of my stupid hack to
140 145 find the main thread id and use the proper API call. Thanks to
141 146 Stefan for the fix.
142 147
143 148 * test/test_prefilter.py (esc_handler_tests): udpate one of Dan's
144 149 unit tests to reflect fixed ticket #52, and add more tests sent by
145 150 him.
146 151
147 152 * IPython/iplib.py (raw_input): restore the readline completer
148 153 state on every input, in case third-party code messed it up.
149 154 (_prefilter): revert recent addition of early-escape checks which
150 155 prevent many valid alias calls from working.
151 156
152 157 * IPython/Shell.py (MTInteractiveShell.runcode): add a tracking
153 158 flag for sigint handler so we don't run a full signal() call on
154 159 each runcode access.
155 160
156 161 * IPython/Magic.py (magic_whos): small improvement to diagnostic
157 162 message.
158 163
159 164 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
160 165
161 166 * IPython/Shell.py (sigint_handler): I *THINK* I finally got
162 167 asynchronous exceptions working, i.e., Ctrl-C can actually
163 168 interrupt long-running code in the multithreaded shells.
164 169
165 170 This is using Tomer Filiba's great ctypes-based trick:
166 171 http://sebulba.wikispaces.com/recipe+thread2. I'd already tried
167 172 this in the past, but hadn't been able to make it work before. So
168 173 far it looks like it's actually running, but this needs more
169 174 testing. If it really works, I'll be *very* happy, and we'll owe
170 175 a huge thank you to Tomer. My current implementation is ugly,
171 176 hackish and uses nasty globals, but I don't want to try and clean
172 177 anything up until we know if it actually works.
173 178
174 179 NOTE: this feature needs ctypes to work. ctypes is included in
175 180 Python2.5, but 2.4 users will need to manually install it. This
176 181 feature makes multi-threaded shells so much more usable that it's
177 182 a minor price to pay (ctypes is very easy to install, already a
178 183 requirement for win32 and available in major linux distros).
179 184
180 185 2007-04-04 Ville Vainio <vivainio@gmail.com>
181 186
182 187 * Extensions/ipy_completers.py, ipy_stock_completers.py:
183 188 Moved implementations of 'bundled' completers to ipy_completers.py,
184 189 they are only enabled in ipy_stock_completers.py.
185 190
186 191 2007-04-04 Fernando Perez <Fernando.Perez@colorado.edu>
187 192
188 193 * IPython/PyColorize.py (Parser.format2): Fix identation of
189 194 colorzied output and return early if color scheme is NoColor, to
190 195 avoid unnecessary and expensive tokenization. Closes #131.
191 196
192 197 2007-04-03 Fernando Perez <Fernando.Perez@colorado.edu>
193 198
194 199 * IPython/Debugger.py: disable the use of pydb version 1.17. It
195 200 has a critical bug (a missing import that makes post-mortem not
196 201 work at all). Unfortunately as of this time, this is the version
197 202 shipped with Ubuntu Edgy, so quite a few people have this one. I
198 203 hope Edgy will update to a more recent package.
199 204
200 205 2007-04-02 Fernando Perez <Fernando.Perez@colorado.edu>
201 206
202 207 * IPython/iplib.py (_prefilter): close #52, second part of a patch
203 208 set by Stefan (only the first part had been applied before).
204 209
205 210 * IPython/Extensions/ipy_stock_completers.py (module_completer):
206 211 remove usage of the dangerous pkgutil.walk_packages(). See
207 212 details in comments left in the code.
208 213
209 214 * IPython/Magic.py (magic_whos): add support for numpy arrays
210 215 similar to what we had for Numeric.
211 216
212 217 * IPython/completer.py (IPCompleter.complete): extend the
213 218 complete() call API to support completions by other mechanisms
214 219 than readline. Closes #109.
215 220
216 221 * IPython/iplib.py (safe_execfile): add a safeguard under Win32 to
217 222 protect against a bug in Python's execfile(). Closes #123.
218 223
219 224 2007-04-01 Fernando Perez <Fernando.Perez@colorado.edu>
220 225
221 226 * IPython/iplib.py (split_user_input): ensure that when splitting
222 227 user input, the part that can be treated as a python name is pure
223 228 ascii (Python identifiers MUST be pure ascii). Part of the
224 229 ongoing Unicode support work.
225 230
226 231 * IPython/Prompts.py (prompt_specials_color): Add \N for the
227 232 actual prompt number, without any coloring. This allows users to
228 233 produce numbered prompts with their own colors. Added after a
229 234 report/request by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
230 235
231 236 2007-03-31 Walter Doerwald <walter@livinglogic.de>
232 237
233 238 * IPython/Extensions/igrid.py: Map the return key
234 239 to enter() and shift-return to enterattr().
235 240
236 241 2007-03-30 Fernando Perez <Fernando.Perez@colorado.edu>
237 242
238 243 * IPython/Magic.py (magic_psearch): add unicode support by
239 244 encoding to ascii the input, since this routine also only deals
240 245 with valid Python names. Fixes a bug reported by Stefan.
241 246
242 247 2007-03-29 Fernando Perez <Fernando.Perez@colorado.edu>
243 248
244 249 * IPython/Magic.py (_inspect): convert unicode input into ascii
245 250 before trying to evaluate it as a Python identifier. This fixes a
246 251 problem that the new unicode support had introduced when analyzing
247 252 long definition lines for functions.
248 253
249 254 2007-03-24 Walter Doerwald <walter@livinglogic.de>
250 255
251 256 * IPython/Extensions/igrid.py: Fix picking. Using
252 257 igrid with wxPython 2.6 and -wthread should work now.
253 258 igrid.display() simply tries to create a frame without
254 259 an application. Only if this fails an application is created.
255 260
256 261 2007-03-23 Walter Doerwald <walter@livinglogic.de>
257 262
258 263 * IPython/Extensions/path.py: Updated to version 2.2.
259 264
260 265 2007-03-23 Ville Vainio <vivainio@gmail.com>
261 266
262 267 * iplib.py: recursive alias expansion now works better, so that
263 268 cases like 'top' -> 'd:/cygwin/top' -> 'ls :/cygwin/top'
264 269 doesn't trip up the process, if 'd' has been aliased to 'ls'.
265 270
266 271 * Extensions/ipy_gnuglobal.py added, provides %global magic
267 272 for users of http://www.gnu.org/software/global
268 273
269 274 * iplib.py: '!command /?' now doesn't invoke IPython's help system.
270 275 Closes #52. Patch by Stefan van der Walt.
271 276
272 277 2007-03-23 Fernando Perez <Fernando.Perez@colorado.edu>
273 278
274 279 * IPython/FakeModule.py (FakeModule.__init__): Small fix to
275 280 respect the __file__ attribute when using %run. Thanks to a bug
276 281 report by Sebastian Rooks <sebastian.rooks-AT-free.fr>.
277 282
278 283 2007-03-22 Fernando Perez <Fernando.Perez@colorado.edu>
279 284
280 285 * IPython/iplib.py (raw_input): Fix mishandling of unicode at
281 286 input. Patch sent by Stefan.
282 287
283 288 2007-03-20 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
284 289 * IPython/Extensions/ipy_stock_completer.py
285 290 shlex_split, fix bug in shlex_split. len function
286 291 call was missing an if statement. Caused shlex_split to
287 292 sometimes return "" as last element.
288 293
289 294 2007-03-18 Fernando Perez <Fernando.Perez@colorado.edu>
290 295
291 296 * IPython/completer.py
292 297 (IPCompleter.file_matches.single_dir_expand): fix a problem
293 298 reported by Stefan, where directories containign a single subdir
294 299 would be completed too early.
295 300
296 301 * IPython/Shell.py (_load_pylab): Make the execution of 'from
297 302 pylab import *' when -pylab is given be optional. A new flag,
298 303 pylab_import_all controls this behavior, the default is True for
299 304 backwards compatibility.
300 305
301 306 * IPython/ultraTB.py (_formatTracebackLines): Added (slightly
302 307 modified) R. Bernstein's patch for fully syntax highlighted
303 308 tracebacks. The functionality is also available under ultraTB for
304 309 non-ipython users (someone using ultraTB but outside an ipython
305 310 session). They can select the color scheme by setting the
306 311 module-level global DEFAULT_SCHEME. The highlight functionality
307 312 also works when debugging.
308 313
309 314 * IPython/genutils.py (IOStream.close): small patch by
310 315 R. Bernstein for improved pydb support.
311 316
312 317 * IPython/Debugger.py (Pdb.format_stack_entry): Added patch by
313 318 DaveS <davls@telus.net> to improve support of debugging under
314 319 NTEmacs, including improved pydb behavior.
315 320
316 321 * IPython/Magic.py (magic_prun): Fix saving of profile info for
317 322 Python 2.5, where the stats object API changed a little. Thanks
318 323 to a bug report by Paul Smith <paul.smith-AT-catugmt.com>.
319 324
320 325 * IPython/ColorANSI.py (InputTermColors.Normal): applied Nicolas
321 326 Pernetty's patch to improve support for (X)Emacs under Win32.
322 327
323 328 2007-03-17 Fernando Perez <Fernando.Perez@colorado.edu>
324 329
325 330 * IPython/Shell.py (hijack_wx): ipmort WX with current semantics
326 331 to quiet a deprecation warning that fires with Wx 2.8. Thanks to
327 332 a report by Nik Tautenhahn.
328 333
329 334 2007-03-16 Walter Doerwald <walter@livinglogic.de>
330 335
331 336 * setup.py: Add the igrid help files to the list of data files
332 337 to be installed alongside igrid.
333 338 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
334 339 Show the input object of the igrid browser as the window tile.
335 340 Show the object the cursor is on in the statusbar.
336 341
337 342 2007-03-15 Ville Vainio <vivainio@gmail.com>
338 343
339 344 * Extensions/ipy_stock_completers.py: Fixed exception
340 345 on mismatching quotes in %run completer. Patch by
341 346 JοΏ½rgen Stenarson. Closes #127.
342 347
343 348 2007-03-14 Ville Vainio <vivainio@gmail.com>
344 349
345 350 * Extensions/ext_rehashdir.py: Do not do auto_alias
346 351 in %rehashdir, it clobbers %store'd aliases.
347 352
348 353 * UserConfig/ipy_profile_sh.py: envpersist.py extension
349 354 (beefed up %env) imported for sh profile.
350 355
351 356 2007-03-10 Walter Doerwald <walter@livinglogic.de>
352 357
353 358 * IPython/Extensions/ipipe.py: Prefer ibrowse over igrid
354 359 as the default browser.
355 360 * IPython/Extensions/igrid.py: Make a few igrid attributes private.
356 361 As igrid displays all attributes it ever encounters, fetch() (which has
357 362 been renamed to _fetch()) doesn't have to recalculate the display attributes
358 363 every time a new item is fetched. This should speed up scrolling.
359 364
360 365 2007-03-10 Fernando Perez <Fernando.Perez@colorado.edu>
361 366
362 367 * IPython/iplib.py (InteractiveShell.__init__): fix for Alex
363 368 Schmolck's recently reported tab-completion bug (my previous one
364 369 had a problem). Patch by Dan Milstein <danmil-AT-comcast.net>.
365 370
366 371 2007-03-09 Walter Doerwald <walter@livinglogic.de>
367 372
368 373 * IPython/Extensions/igrid.py: Patch by Nik Tautenhahn:
369 374 Close help window if exiting igrid.
370 375
371 376 2007-03-02 JοΏ½rgen Stenarson <jorgen.stenarson@bostream.nu>
372 377
373 378 * IPython/Extensions/ipy_defaults.py: Check if readline is available
374 379 before calling functions from readline.
375 380
376 381 2007-03-02 Walter Doerwald <walter@livinglogic.de>
377 382
378 383 * IPython/Extensions/igrid.py: Add Nik Tautenhahns igrid extension.
379 384 igrid is a wxPython-based display object for ipipe. If your system has
380 385 wx installed igrid will be the default display. Without wx ipipe falls
381 386 back to ibrowse (which needs curses). If no curses is installed ipipe
382 387 falls back to idump.
383 388
384 389 2007-03-01 Fernando Perez <Fernando.Perez@colorado.edu>
385 390
386 391 * IPython/iplib.py (split_user_inputBROKEN): temporarily disable
387 392 my changes from yesterday, they introduced bugs. Will reactivate
388 393 once I get a correct solution, which will be much easier thanks to
389 394 Dan Milstein's new prefilter test suite.
390 395
391 396 2007-02-28 Fernando Perez <Fernando.Perez@colorado.edu>
392 397
393 398 * IPython/iplib.py (split_user_input): fix input splitting so we
394 399 don't attempt attribute accesses on things that can't possibly be
395 400 valid Python attributes. After a bug report by Alex Schmolck.
396 401 (InteractiveShell.__init__): brown-paper bag fix; regexp broke
397 402 %magic with explicit % prefix.
398 403
399 404 2007-02-27 Fernando Perez <Fernando.Perez@colorado.edu>
400 405
401 406 * IPython/Shell.py (IPShellGTK.mainloop): update threads calls to
402 407 avoid a DeprecationWarning from GTK.
403 408
404 409 2007-02-22 Fernando Perez <Fernando.Perez@colorado.edu>
405 410
406 411 * IPython/genutils.py (clock): I modified clock() to return total
407 412 time, user+system. This is a more commonly needed metric. I also
408 413 introduced the new clocku/clocks to get only user/system time if
409 414 one wants those instead.
410 415
411 416 ***WARNING: API CHANGE*** clock() used to return only user time,
412 417 so if you want exactly the same results as before, use clocku
413 418 instead.
414 419
415 420 2007-02-22 Ville Vainio <vivainio@gmail.com>
416 421
417 422 * IPython/Extensions/ipy_p4.py: Extension for improved
418 423 p4 (perforce version control system) experience.
419 424 Adds %p4 magic with p4 command completion and
420 425 automatic -G argument (marshall output as python dict)
421 426
422 427 2007-02-19 Fernando Perez <Fernando.Perez@colorado.edu>
423 428
424 429 * IPython/demo.py (Demo.re_stop): make dashes optional in demo
425 430 stop marks.
426 431 (ClearingMixin): a simple mixin to easily make a Demo class clear
427 432 the screen in between blocks and have empty marquees. The
428 433 ClearDemo and ClearIPDemo classes that use it are included.
429 434
430 435 2007-02-18 Fernando Perez <Fernando.Perez@colorado.edu>
431 436
432 437 * IPython/irunner.py (pexpect_monkeypatch): patch pexpect to
433 438 protect against exceptions at Python shutdown time. Patch
434 439 sumbmitted to upstream.
435 440
436 441 2007-02-14 Walter Doerwald <walter@livinglogic.de>
437 442
438 443 * IPython/Extensions/ibrowse.py: If entering the first object level
439 444 (i.e. the object for which the browser has been started) fails,
440 445 now the error is raised directly (aborting the browser) instead of
441 446 running into an empty levels list later.
442 447
443 448 2007-02-03 Walter Doerwald <walter@livinglogic.de>
444 449
445 450 * IPython/Extensions/ipipe.py: Add an xrepr implementation
446 451 for the noitem object.
447 452
448 453 2007-01-31 Fernando Perez <Fernando.Perez@colorado.edu>
449 454
450 455 * IPython/completer.py (Completer.attr_matches): Fix small
451 456 tab-completion bug with Enthought Traits objects with units.
452 457 Thanks to a bug report by Tom Denniston
453 458 <tom.denniston-AT-alum.dartmouth.org>.
454 459
455 460 2007-01-27 Fernando Perez <Fernando.Perez@colorado.edu>
456 461
457 462 * IPython/Extensions/ipy_stock_completers.py (runlistpy): fix a
458 463 bug where only .ipy or .py would be completed. Once the first
459 464 argument to %run has been given, all completions are valid because
460 465 they are the arguments to the script, which may well be non-python
461 466 filenames.
462 467
463 468 * IPython/irunner.py (InteractiveRunner.run_source): major updates
464 469 to irunner to allow it to correctly support real doctesting of
465 470 out-of-process ipython code.
466 471
467 472 * IPython/Magic.py (magic_cd): Make the setting of the terminal
468 473 title an option (-noterm_title) because it completely breaks
469 474 doctesting.
470 475
471 476 * IPython/demo.py: fix IPythonDemo class that was not actually working.
472 477
473 478 2007-01-24 Fernando Perez <Fernando.Perez@colorado.edu>
474 479
475 480 * IPython/irunner.py (main): fix small bug where extensions were
476 481 not being correctly recognized.
477 482
478 483 2007-01-23 Walter Doerwald <walter@livinglogic.de>
479 484
480 485 * IPython/Extensions/ipipe.py (xiter): Make sure that iterating
481 486 a string containing a single line yields the string itself as the
482 487 only item.
483 488
484 489 * IPython/Extensions/ibrowse.py (ibrowse): Avoid entering an
485 490 object if it's the same as the one on the last level (This avoids
486 491 infinite recursion for one line strings).
487 492
488 493 2007-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
489 494
490 495 * IPython/ultraTB.py (AutoFormattedTB.__call__): properly flush
491 496 all output streams before printing tracebacks. This ensures that
492 497 user output doesn't end up interleaved with traceback output.
493 498
494 499 2007-01-10 Ville Vainio <vivainio@gmail.com>
495 500
496 501 * Extensions/envpersist.py: Turbocharged %env that remembers
497 502 env vars across sessions; e.g. "%env PATH+=;/opt/scripts" or
498 503 "%env VISUAL=jed".
499 504
500 505 2007-01-05 Fernando Perez <Fernando.Perez@colorado.edu>
501 506
502 507 * IPython/iplib.py (showtraceback): ensure that we correctly call
503 508 custom handlers in all cases (some with pdb were slipping through,
504 509 but I'm not exactly sure why).
505 510
506 511 * IPython/Debugger.py (Tracer.__init__): added new class to
507 512 support set_trace-like usage of IPython's enhanced debugger.
508 513
509 514 2006-12-24 Ville Vainio <vivainio@gmail.com>
510 515
511 516 * ipmaker.py: more informative message when ipy_user_conf
512 517 import fails (suggest running %upgrade).
513 518
514 519 * tools/run_ipy_in_profiler.py: Utility to see where
515 520 the time during IPython startup is spent.
516 521
517 522 2006-12-20 Ville Vainio <vivainio@gmail.com>
518 523
519 524 * 0.7.3 is out - merge all from 0.7.3 branch to trunk
520 525
521 526 * ipapi.py: Add new ipapi method, expand_alias.
522 527
523 528 * Release.py: Bump up version to 0.7.4.svn
524 529
525 530 2006-12-17 Ville Vainio <vivainio@gmail.com>
526 531
527 532 * Extensions/jobctrl.py: Fixed &cmd arg arg...
528 533 to work properly on posix too
529 534
530 535 * Release.py: Update revnum (version is still just 0.7.3).
531 536
532 537 2006-12-15 Ville Vainio <vivainio@gmail.com>
533 538
534 539 * scripts/ipython_win_post_install: create ipython.py in
535 540 prefix + "/scripts".
536 541
537 542 * Release.py: Update version to 0.7.3.
538 543
539 544 2006-12-14 Ville Vainio <vivainio@gmail.com>
540 545
541 546 * scripts/ipython_win_post_install: Overwrite old shortcuts
542 547 if they already exist
543 548
544 549 * Release.py: release 0.7.3rc2
545 550
546 551 2006-12-13 Ville Vainio <vivainio@gmail.com>
547 552
548 553 * Branch and update Release.py for 0.7.3rc1
549 554
550 555 2006-12-13 Fernando Perez <Fernando.Perez@colorado.edu>
551 556
552 557 * IPython/Shell.py (IPShellWX): update for current WX naming
553 558 conventions, to avoid a deprecation warning with current WX
554 559 versions. Thanks to a report by Danny Shevitz.
555 560
556 561 2006-12-12 Ville Vainio <vivainio@gmail.com>
557 562
558 563 * ipmaker.py: apply david cournapeau's patch to make
559 564 import_some work properly even when ipythonrc does
560 565 import_some on empty list (it was an old bug!).
561 566
562 567 * UserConfig/ipy_user_conf.py, UserConfig/ipythonrc:
563 568 Add deprecation note to ipythonrc and a url to wiki
564 569 in ipy_user_conf.py
565 570
566 571
567 572 * Magic.py (%run): %run myscript.ipy now runs myscript.ipy
568 573 as if it was typed on IPython command prompt, i.e.
569 574 as IPython script.
570 575
571 576 * example-magic.py, magic_grepl.py: remove outdated examples
572 577
573 578 2006-12-11 Fernando Perez <Fernando.Perez@colorado.edu>
574 579
575 580 * IPython/iplib.py (debugger): prevent a nasty traceback if %debug
576 581 is called before any exception has occurred.
577 582
578 583 2006-12-08 Ville Vainio <vivainio@gmail.com>
579 584
580 585 * Extensions/ipy_stock_completers.py: fix cd completer
581 586 to translate /'s to \'s again.
582 587
583 588 * completer.py: prevent traceback on file completions w/
584 589 backslash.
585 590
586 591 * Release.py: Update release number to 0.7.3b3 for release
587 592
588 593 2006-12-07 Ville Vainio <vivainio@gmail.com>
589 594
590 595 * Extensions/ipy_signals.py: Ignore ctrl+C in IPython process
591 596 while executing external code. Provides more shell-like behaviour
592 597 and overall better response to ctrl + C / ctrl + break.
593 598
594 599 * tools/make_tarball.py: new script to create tarball straight from svn
595 600 (setup.py sdist doesn't work on win32).
596 601
597 602 * Extensions/ipy_stock_completers.py: fix cd completer to give up
598 603 on dirnames with spaces and use the default completer instead.
599 604
600 605 * Revision.py: Change version to 0.7.3b2 for release.
601 606
602 607 2006-12-05 Ville Vainio <vivainio@gmail.com>
603 608
604 609 * Magic.py, iplib.py, completer.py: Apply R. Bernstein's
605 610 pydb patch 4 (rm debug printing, py 2.5 checking)
606 611
607 612 2006-11-30 Walter Doerwald <walter@livinglogic.de>
608 613 * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse:
609 614 "refresh" (mapped to "r") refreshes the screen by restarting the iterator.
610 615 "refreshfind" (mapped to "R") does the same but tries to go back to the same
611 616 object the cursor was on before the refresh. The command "markrange" is
612 617 mapped to "%" now.
613 618 * IPython/Extensions/ibrowse.py: Make igrpentry and ipwdentry comparable.
614 619
615 620 2006-11-29 Fernando Perez <Fernando.Perez@colorado.edu>
616 621
617 622 * IPython/Magic.py (magic_debug): new %debug magic to activate the
618 623 interactive debugger on the last traceback, without having to call
619 624 %pdb and rerun your code. Made minor changes in various modules,
620 625 should automatically recognize pydb if available.
621 626
622 627 2006-11-28 Ville Vainio <vivainio@gmail.com>
623 628
624 629 * completer.py: If the text start with !, show file completions
625 630 properly. This helps when trying to complete command name
626 631 for shell escapes.
627 632
628 633 2006-11-27 Ville Vainio <vivainio@gmail.com>
629 634
630 635 * ipy_stock_completers.py: bzr completer submitted by Stefan van
631 636 der Walt. Clean up svn and hg completers by using a common
632 637 vcs_completer.
633 638
634 639 2006-11-26 Ville Vainio <vivainio@gmail.com>
635 640
636 641 * Remove ipconfig and %config; you should use _ip.options structure
637 642 directly instead!
638 643
639 644 * genutils.py: add wrap_deprecated function for deprecating callables
640 645
641 646 * iplib.py: deprecate ipmagic, ipsystem, ipalias. Use _ip.magic and
642 647 _ip.system instead. ipalias is redundant.
643 648
644 649 * Magic.py: %rehashdir no longer aliases 'cmdname' to 'cmdname.exe' on
645 650 win32, but just 'cmdname'. Other extensions (non-'exe') are still made
646 651 explicit.
647 652
648 653 * ipy_stock_completers.py: 'hg' (mercurial VCS) now has a custom
649 654 completer. Try it by entering 'hg ' and pressing tab.
650 655
651 656 * macro.py: Give Macro a useful __repr__ method
652 657
653 658 * Magic.py: %whos abbreviates the typename of Macro for brevity.
654 659
655 660 2006-11-24 Walter Doerwald <walter@livinglogic.de>
656 661 * IPython/Extensions/astyle.py: Do a relative import of ipipe, so that
657 662 we don't get a duplicate ipipe module, where registration of the xrepr
658 663 implementation for Text is useless.
659 664
660 665 * IPython/Extensions/ipipe.py: Fix __xrepr__() implementation for ils.
661 666
662 667 * IPython/Extensions/ibrowse.py: Fix keymapping for the enter command.
663 668
664 669 2006-11-24 Ville Vainio <vivainio@gmail.com>
665 670
666 671 * Magic.py, manual_base.lyx: Kirill Smelkov patch:
667 672 try to use "cProfile" instead of the slower pure python
668 673 "profile"
669 674
670 675 2006-11-23 Ville Vainio <vivainio@gmail.com>
671 676
672 677 * manual_base.lyx: Kirill Smelkov patch: Fix wrong
673 678 Qt+IPython+Designer link in documentation.
674 679
675 680 * Extensions/ipy_pydb.py: R. Bernstein's patch for passing
676 681 correct Pdb object to %pydb.
677 682
678 683
679 684 2006-11-22 Walter Doerwald <walter@livinglogic.de>
680 685 * IPython/Extensions/astyle.py: Text needs it's own implemenation of the
681 686 generic xrepr(), otherwise the list implementation would kick in.
682 687
683 688 2006-11-21 Ville Vainio <vivainio@gmail.com>
684 689
685 690 * upgrade_dir.py: Now actually overwrites a nonmodified user file
686 691 with one from UserConfig.
687 692
688 693 * ipy_profile_sh.py: Add dummy "depth" to var_expand lambda,
689 694 it was missing which broke the sh profile.
690 695
691 696 * completer.py: file completer now uses explicit '/' instead
692 697 of os.path.join, expansion of 'foo' was broken on win32
693 698 if there was one directory with name 'foobar'.
694 699
695 700 * A bunch of patches from Kirill Smelkov:
696 701
697 702 * [patch 9/9] doc: point bug-tracker URL to IPythons trac-tickets.
698 703
699 704 * [patch 7/9] Implement %page -r (page in raw mode) -
700 705
701 706 * [patch 5/9] ScientificPython webpage has moved
702 707
703 708 * [patch 4/9] The manual mentions %ds, should be %dhist
704 709
705 710 * [patch 3/9] Kill old bits from %prun doc.
706 711
707 712 * [patch 1/9] Fix typos here and there.
708 713
709 714 2006-11-08 Ville Vainio <vivainio@gmail.com>
710 715
711 716 * completer.py (attr_matches): catch all exceptions raised
712 717 by eval of expr with dots.
713 718
714 719 2006-11-07 Fernando Perez <Fernando.Perez@colorado.edu>
715 720
716 721 * IPython/iplib.py (runsource): Prepend an 'if 1:' to the user
717 722 input if it starts with whitespace. This allows you to paste
718 723 indented input from any editor without manually having to type in
719 724 the 'if 1:', which is convenient when working interactively.
720 725 Slightly modifed version of a patch by Bo Peng
721 726 <bpeng-AT-rice.edu>.
722 727
723 728 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
724 729
725 730 * IPython/irunner.py (main): modified irunner so it automatically
726 731 recognizes the right runner to use based on the extension (.py for
727 732 python, .ipy for ipython and .sage for sage).
728 733
729 734 * IPython/iplib.py (InteractiveShell.ipconfig): new builtin, also
730 735 visible in ipapi as ip.config(), to programatically control the
731 736 internal rc object. There's an accompanying %config magic for
732 737 interactive use, which has been enhanced to match the
733 738 funtionality in ipconfig.
734 739
735 740 * IPython/Magic.py (magic_system_verbose): Change %system_verbose
736 741 so it's not just a toggle, it now takes an argument. Add support
737 742 for a customizable header when making system calls, as the new
738 743 system_header variable in the ipythonrc file.
739 744
740 745 2006-11-03 Walter Doerwald <walter@livinglogic.de>
741 746
742 747 * IPython/Extensions/ipipe.py: xrepr(), xiter() and xattrs() are now
743 748 generic functions (using Philip J. Eby's simplegeneric package).
744 749 This makes it possible to customize the display of third-party classes
745 750 without having to monkeypatch them. xiter() no longer supports a mode
746 751 argument and the XMode class has been removed. The same functionality can
747 752 be implemented via IterAttributeDescriptor and IterMethodDescriptor.
748 753 One consequence of the switch to generic functions is that xrepr() and
749 754 xattrs() implementation must define the default value for the mode
750 755 argument themselves and xattrs() implementations must return real
751 756 descriptors.
752 757
753 758 * IPython/external: This new subpackage will contain all third-party
754 759 packages that are bundled with IPython. (The first one is simplegeneric).
755 760
756 761 * IPython/Extensions/ipipe.py (ifile/ils): Readd output of the parent
757 762 directory which as been dropped in r1703.
758 763
759 764 * IPython/Extensions/ipipe.py (iless): Fixed.
760 765
761 766 * IPython/Extensions/ibrowse: Fixed sorting under Python 2.3.
762 767
763 768 2006-11-03 Fernando Perez <Fernando.Perez@colorado.edu>
764 769
765 770 * IPython/iplib.py (InteractiveShell.var_expand): fix stack
766 771 handling in variable expansion so that shells and magics recognize
767 772 function local scopes correctly. Bug reported by Brian.
768 773
769 774 * scripts/ipython: remove the very first entry in sys.path which
770 775 Python auto-inserts for scripts, so that sys.path under IPython is
771 776 as similar as possible to that under plain Python.
772 777
773 778 * IPython/completer.py (IPCompleter.file_matches): Fix
774 779 tab-completion so that quotes are not closed unless the completion
775 780 is unambiguous. After a request by Stefan. Minor cleanups in
776 781 ipy_stock_completers.
777 782
778 783 2006-11-02 Ville Vainio <vivainio@gmail.com>
779 784
780 785 * ipy_stock_completers.py: Add %run and %cd completers.
781 786
782 787 * completer.py: Try running custom completer for both
783 788 "foo" and "%foo" if the command is just "foo". Ignore case
784 789 when filtering possible completions.
785 790
786 791 * UserConfig/ipy_user_conf.py: install stock completers as default
787 792
788 793 * iplib.py (history_saving_wrapper), debugger(), ipy_pydb.py:
789 794 simplified readline history save / restore through a wrapper
790 795 function
791 796
792 797
793 798 2006-10-31 Ville Vainio <vivainio@gmail.com>
794 799
795 800 * strdispatch.py, completer.py, ipy_stock_completers.py:
796 801 Allow str_key ("command") in completer hooks. Implement
797 802 trivial completer for 'import' (stdlib modules only). Rename
798 803 ipy_linux_package_managers.py to ipy_stock_completers.py.
799 804 SVN completer.
800 805
801 806 * Extensions/ledit.py: %magic line editor for easily and
802 807 incrementally manipulating lists of strings. The magic command
803 808 name is %led.
804 809
805 810 2006-10-30 Ville Vainio <vivainio@gmail.com>
806 811
807 812 * Debugger.py, iplib.py (debugger()): Add last set of Rocky
808 813 Bernsteins's patches for pydb integration.
809 814 http://bashdb.sourceforge.net/pydb/
810 815
811 816 * strdispatch.py, iplib.py, completer.py, IPython/__init__.py,
812 817 Extensions/ipy_linux_package_managers.py, hooks.py: Implement
813 818 custom completer hook to allow the users to implement their own
814 819 completers. See ipy_linux_package_managers.py for example. The
815 820 hook name is 'complete_command'.
816 821
817 822 2006-10-28 Fernando Perez <Fernando.Perez@colorado.edu>
818 823
819 824 * IPython/UserConfig/ipythonrc-scipy: minor cleanups to remove old
820 825 Numeric leftovers.
821 826
822 827 * ipython.el (py-execute-region): apply Stefan's patch to fix
823 828 garbled results if the python shell hasn't been previously started.
824 829
825 830 * IPython/genutils.py (arg_split): moved to genutils, since it's a
826 831 pretty generic function and useful for other things.
827 832
828 833 * IPython/OInspect.py (getsource): Add customizable source
829 834 extractor. After a request/patch form W. Stein (SAGE).
830 835
831 836 * IPython/irunner.py (InteractiveRunner.run_source): reset tty
832 837 window size to a more reasonable value from what pexpect does,
833 838 since their choice causes wrapping bugs with long input lines.
834 839
835 840 2006-10-28 Ville Vainio <vivainio@gmail.com>
836 841
837 842 * Magic.py (%run): Save and restore the readline history from
838 843 file around %run commands to prevent side effects from
839 844 %runned programs that might use readline (e.g. pydb).
840 845
841 846 * extensions/ipy_pydb.py: Adds %pydb magic when imported, for
842 847 invoking the pydb enhanced debugger.
843 848
844 849 2006-10-23 Walter Doerwald <walter@livinglogic.de>
845 850
846 851 * IPython/Extensions/ipipe.py (ifile): Remove all methods that
847 852 call the base class method and propagate the return value to
848 853 ifile. This is now done by path itself.
849 854
850 855 2006-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
851 856
852 857 * IPython/ipapi.py (IPApi.__init__): Added new entry to public
853 858 api: set_crash_handler(), to expose the ability to change the
854 859 internal crash handler.
855 860
856 861 * IPython/CrashHandler.py (CrashHandler.__init__): abstract out
857 862 the various parameters of the crash handler so that apps using
858 863 IPython as their engine can customize crash handling. Ipmlemented
859 864 at the request of SAGE.
860 865
861 866 2006-10-14 Ville Vainio <vivainio@gmail.com>
862 867
863 868 * Magic.py, ipython.el: applied first "safe" part of Rocky
864 869 Bernstein's patch set for pydb integration.
865 870
866 871 * Magic.py (%unalias, %alias): %store'd aliases can now be
867 872 removed with '%unalias'. %alias w/o args now shows most
868 873 interesting (stored / manually defined) aliases last
869 874 where they catch the eye w/o scrolling.
870 875
871 876 * Magic.py (%rehashx), ext_rehashdir.py: files with
872 877 'py' extension are always considered executable, even
873 878 when not in PATHEXT environment variable.
874 879
875 880 2006-10-12 Ville Vainio <vivainio@gmail.com>
876 881
877 882 * jobctrl.py: Add new "jobctrl" extension for spawning background
878 883 processes with "&find /". 'import jobctrl' to try it out. Requires
879 884 'subprocess' module, standard in python 2.4+.
880 885
881 886 * iplib.py (expand_aliases, handle_alias): Aliases expand transitively,
882 887 so if foo -> bar and bar -> baz, then foo -> baz.
883 888
884 889 2006-10-09 Fernando Perez <Fernando.Perez@colorado.edu>
885 890
886 891 * IPython/Magic.py (Magic.parse_options): add a new posix option
887 892 to allow parsing of input args in magics that doesn't strip quotes
888 893 (if posix=False). This also closes %timeit bug reported by
889 894 Stefan.
890 895
891 896 2006-10-03 Ville Vainio <vivainio@gmail.com>
892 897
893 898 * iplib.py (raw_input, interact): Return ValueError catching for
894 899 raw_input. Fixes infinite loop for sys.stdin.close() or
895 900 sys.stdout.close().
896 901
897 902 2006-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
898 903
899 904 * IPython/irunner.py (InteractiveRunner.run_source): small fixes
900 905 to help in handling doctests. irunner is now pretty useful for
901 906 running standalone scripts and simulate a full interactive session
902 907 in a format that can be then pasted as a doctest.
903 908
904 909 * IPython/iplib.py (InteractiveShell.__init__): Install exit/quit
905 910 on top of the default (useless) ones. This also fixes the nasty
906 911 way in which 2.5's Quitter() exits (reverted [1785]).
907 912
908 913 * IPython/Debugger.py (Pdb.__init__): Fix ipdb to work with python
909 914 2.5.
910 915
911 916 * IPython/ultraTB.py (TBTools.set_colors): Make sure that ipdb
912 917 color scheme is updated as well when color scheme is changed
913 918 interactively.
914 919
915 920 2006-09-27 Ville Vainio <vivainio@gmail.com>
916 921
917 922 * iplib.py (raw_input): python 2.5 closes stdin on quit -> avoid
918 923 infinite loop and just exit. It's a hack, but will do for a while.
919 924
920 925 2006-08-25 Walter Doerwald <walter@livinglogic.de>
921 926
922 927 * IPython/Extensions/ipipe.py (ils): Add arguments dirs and files to
923 928 the constructor, this makes it possible to get a list of only directories
924 929 or only files.
925 930
926 931 2006-08-12 Ville Vainio <vivainio@gmail.com>
927 932
928 933 * Fakemodule.py, OInspect.py: Reverted 2006-08-11 mods,
929 934 they broke unittest
930 935
931 936 2006-08-11 Ville Vainio <vivainio@gmail.com>
932 937
933 938 * Fakemodule.py, OInspect.py: remove 2006-08-09 monkepatch
934 939 by resolving issue properly, i.e. by inheriting FakeModule
935 940 from types.ModuleType. Pickling ipython interactive data
936 941 should still work as usual (testing appreciated).
937 942
938 943 2006-08-09 Fernando Perez <Fernando.Perez@colorado.edu>
939 944
940 945 * IPython/OInspect.py: monkeypatch inspect from the stdlib if
941 946 running under python 2.3 with code from 2.4 to fix a bug with
942 947 help(). Reported by the Debian maintainers, Norbert Tretkowski
943 948 <norbert-AT-tretkowski.de> and Alexandre Fayolle
944 949 <afayolle-AT-debian.org>.
945 950
946 951 2006-08-04 Walter Doerwald <walter@livinglogic.de>
947 952
948 953 * IPython/Extensions/ibrowse.py: Fixed the help message in the footer
949 954 (which was displaying "quit" twice).
950 955
951 956 2006-07-28 Walter Doerwald <walter@livinglogic.de>
952 957
953 958 * IPython/Extensions/ipipe.py: Fix isort.__iter__() (was still using
954 959 the mode argument).
955 960
956 961 2006-07-27 Walter Doerwald <walter@livinglogic.de>
957 962
958 963 * IPython/Extensions/ipipe.py: Fix getglobals() if we're
959 964 not running under IPython.
960 965
961 966 * IPython/Extensions/ipipe.py: Rename XAttr to AttributeDetail
962 967 and make it iterable (iterating over the attribute itself). Add two new
963 968 magic strings for __xattrs__(): If the string starts with "-", the attribute
964 969 will not be displayed in ibrowse's detail view (but it can still be
965 970 iterated over). This makes it possible to add attributes that are large
966 971 lists or generator methods to the detail view. Replace magic attribute names
967 972 and _attrname() and _getattr() with "descriptors": For each type of magic
968 973 attribute name there's a subclass of Descriptor: None -> SelfDescriptor();
969 974 "foo" -> AttributeDescriptor("foo"); "foo()" -> MethodDescriptor("foo");
970 975 "-foo" -> IterAttributeDescriptor("foo"); "-foo()" -> IterMethodDescriptor("foo");
971 976 foo() -> FunctionDescriptor(foo). Magic strings returned from __xattrs__()
972 977 are still supported.
973 978
974 979 * IPython/Extensions/ibrowse.py: If fetching the next row from the input
975 980 fails in ibrowse.fetch(), the exception object is added as the last item
976 981 and item fetching is canceled. This prevents ibrowse from aborting if e.g.
977 982 a generator throws an exception midway through execution.
978 983
979 984 * IPython/Extensions/ipipe.py: Turn ifile's properties mimetype and
980 985 encoding into methods.
981 986
982 987 2006-07-26 Ville Vainio <vivainio@gmail.com>
983 988
984 989 * iplib.py: history now stores multiline input as single
985 990 history entries. Patch by Jorgen Cederlof.
986 991
987 992 2006-07-18 Walter Doerwald <walter@livinglogic.de>
988 993
989 994 * IPython/Extensions/ibrowse.py: Make cursor visible over
990 995 non existing attributes.
991 996
992 997 2006-07-14 Walter Doerwald <walter@livinglogic.de>
993 998
994 999 * IPython/Extensions/ipipe.py (ix): Use os.popen4() so that the
995 1000 error output of the running command doesn't mess up the screen.
996 1001
997 1002 2006-07-13 Walter Doerwald <walter@livinglogic.de>
998 1003
999 1004 * IPython/Extensions/ipipe.py (isort): Make isort usable without
1000 1005 argument. This sorts the items themselves.
1001 1006
1002 1007 2006-07-12 Walter Doerwald <walter@livinglogic.de>
1003 1008
1004 1009 * IPython/Extensions/ipipe.py (eval, ifilter, isort, ieval):
1005 1010 Compile expression strings into code objects. This should speed
1006 1011 up ifilter and friends somewhat.
1007 1012
1008 1013 2006-07-08 Ville Vainio <vivainio@gmail.com>
1009 1014
1010 1015 * Magic.py: %cpaste now strips > from the beginning of lines
1011 1016 to ease pasting quoted code from emails. Contributed by
1012 1017 Stefan van der Walt.
1013 1018
1014 1019 2006-06-29 Ville Vainio <vivainio@gmail.com>
1015 1020
1016 1021 * ipmaker.py, Shell.py: qt4agg matplotlib backend support for pylab
1017 1022 mode, patch contributed by Darren Dale. NEEDS TESTING!
1018 1023
1019 1024 2006-06-28 Walter Doerwald <walter@livinglogic.de>
1020 1025
1021 1026 * IPython/Extensions/ibrowse.py: Give the ibrowse cursor row
1022 1027 a blue background. Fix fetching new display rows when the browser
1023 1028 scrolls more than a screenful (e.g. by using the goto command).
1024 1029
1025 1030 2006-06-27 Ville Vainio <vivainio@gmail.com>
1026 1031
1027 1032 * Magic.py (_inspect, _ofind) Apply David Huard's
1028 1033 patch for displaying the correct docstring for 'property'
1029 1034 attributes.
1030 1035
1031 1036 2006-06-23 Walter Doerwald <walter@livinglogic.de>
1032 1037
1033 1038 * IPython/Extensions/ibrowse.py: Put the documentation of the keyboard
1034 1039 commands into the methods implementing them.
1035 1040
1036 1041 2006-06-22 Fernando Perez <Fernando.Perez@colorado.edu>
1037 1042
1038 1043 * ipython.el (ipython-indentation-hook): cleanup patch, submitted
1039 1044 by Kov Chai <tchaikov-AT-gmail.com>. He notes that the original
1040 1045 autoindent support was authored by Jin Liu.
1041 1046
1042 1047 2006-06-22 Walter Doerwald <walter@livinglogic.de>
1043 1048
1044 1049 * IPython/Extensions/ibrowse.py: Replace the plain dictionaries used
1045 1050 for keymaps with a custom class that simplifies handling.
1046 1051
1047 1052 2006-06-19 Walter Doerwald <walter@livinglogic.de>
1048 1053
1049 1054 * IPython/Extensions/ibrowse.py: ibrowse now properly handles terminal
1050 1055 resizing. This requires Python 2.5 to work.
1051 1056
1052 1057 2006-06-16 Walter Doerwald <walter@livinglogic.de>
1053 1058
1054 1059 * IPython/Extensions/ibrowse.py: Add two new commands to
1055 1060 ibrowse: "hideattr" (mapped to "h") hides the attribute under
1056 1061 the cursor. "unhiderattrs" (mapped to "H") reveals all hidden
1057 1062 attributes again. Remapped the help command to "?". Display
1058 1063 keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e
1059 1064 as keys for the "home" and "end" commands. Add three new commands
1060 1065 to the input mode for "find" and friends: "delend" (CTRL-K)
1061 1066 deletes to the end of line. "incsearchup" searches upwards in the
1062 1067 command history for an input that starts with the text before the cursor.
1063 1068 "incsearchdown" does the same downwards. Removed a bogus mapping of
1064 1069 the x key to "delete".
1065 1070
1066 1071 2006-06-15 Ville Vainio <vivainio@gmail.com>
1067 1072
1068 1073 * iplib.py, hooks.py: Added new generate_prompt hook that can be
1069 1074 used to create prompts dynamically, instead of the "old" way of
1070 1075 assigning "magic" strings to prompt_in1 and prompt_in2. The old
1071 1076 way still works (it's invoked by the default hook), of course.
1072 1077
1073 1078 * Prompts.py: added generate_output_prompt hook for altering output
1074 1079 prompt
1075 1080
1076 1081 * Release.py: Changed version string to 0.7.3.svn.
1077 1082
1078 1083 2006-06-15 Walter Doerwald <walter@livinglogic.de>
1079 1084
1080 1085 * IPython/Extensions/ibrowse.py: Change _BrowserLevel.moveto() so that
1081 1086 the call to fetch() always tries to fetch enough data for at least one
1082 1087 full screen. This makes it possible to simply call moveto(0,0,True) in
1083 1088 the constructor. Fix typos and removed the obsolete goto attribute.
1084 1089
1085 1090 2006-06-12 Ville Vainio <vivainio@gmail.com>
1086 1091
1087 1092 * ipy_profile_sh.py: applied Krisha Mohan Gundu's patch for
1088 1093 allowing $variable interpolation within multiline statements,
1089 1094 though so far only with "sh" profile for a testing period.
1090 1095 The patch also enables splitting long commands with \ but it
1091 1096 doesn't work properly yet.
1092 1097
1093 1098 2006-06-12 Walter Doerwald <walter@livinglogic.de>
1094 1099
1095 1100 * IPython/Extensions/ibrowse.py (_dodisplay): Display the length of the
1096 1101 input history and the position of the cursor in the input history for
1097 1102 the find, findbackwards and goto command.
1098 1103
1099 1104 2006-06-10 Walter Doerwald <walter@livinglogic.de>
1100 1105
1101 1106 * IPython/Extensions/ibrowse.py: Add a class _CommandInput that
1102 1107 implements the basic functionality of browser commands that require
1103 1108 input. Reimplement the goto, find and findbackwards commands as
1104 1109 subclasses of _CommandInput. Add an input history and keymaps to those
1105 1110 commands. Add "\r" as a keyboard shortcut for the enterdefault and
1106 1111 execute commands.
1107 1112
1108 1113 2006-06-07 Ville Vainio <vivainio@gmail.com>
1109 1114
1110 1115 * iplib.py: ipython mybatch.ipy exits ipython immediately after
1111 1116 running the batch files instead of leaving the session open.
1112 1117
1113 1118 2006-06-07 Fernando Perez <Fernando.Perez@colorado.edu>
1114 1119
1115 1120 * IPython/iplib.py (InteractiveShell.__init__): update BSD fix, as
1116 1121 the original fix was incomplete. Patch submitted by W. Maier.
1117 1122
1118 1123 2006-06-07 Ville Vainio <vivainio@gmail.com>
1119 1124
1120 1125 * iplib.py,Magic.py, ipmaker.py (magic_rehashx):
1121 1126 Confirmation prompts can be supressed by 'quiet' option.
1122 1127 _ip.options.quiet = 1 means "assume yes for all yes/no queries".
1123 1128
1124 1129 2006-06-06 *** Released version 0.7.2
1125 1130
1126 1131 2006-06-06 Fernando Perez <Fernando.Perez@colorado.edu>
1127 1132
1128 1133 * IPython/Release.py (version): Made 0.7.2 final for release.
1129 1134 Repo tagged and release cut.
1130 1135
1131 1136 2006-06-05 Ville Vainio <vivainio@gmail.com>
1132 1137
1133 1138 * Magic.py (magic_rehashx): Honor no_alias list earlier in
1134 1139 %rehashx, to avoid clobbering builtins in ipy_profile_sh.py
1135 1140
1136 1141 * upgrade_dir.py: try import 'path' module a bit harder
1137 1142 (for %upgrade)
1138 1143
1139 1144 2006-06-03 Fernando Perez <Fernando.Perez@colorado.edu>
1140 1145
1141 1146 * IPython/genutils.py (ask_yes_no): treat EOF as a default answer
1142 1147 instead of looping 20 times.
1143 1148
1144 1149 * IPython/ipmaker.py (make_IPython): honor -ipythondir flag
1145 1150 correctly at initialization time. Bug reported by Krishna Mohan
1146 1151 Gundu <gkmohan-AT-gmail.com> on the user list.
1147 1152
1148 1153 * IPython/Release.py (version): Mark 0.7.2 version to start
1149 1154 testing for release on 06/06.
1150 1155
1151 1156 2006-05-31 Fernando Perez <Fernando.Perez@colorado.edu>
1152 1157
1153 1158 * scripts/irunner: thin script interface so users don't have to
1154 1159 find the module and call it as an executable, since modules rarely
1155 1160 live in people's PATH.
1156 1161
1157 1162 * IPython/irunner.py (InteractiveRunner.__init__): added
1158 1163 delaybeforesend attribute to control delays with newer versions of
1159 1164 pexpect. Thanks to detailed help from pexpect's author, Noah
1160 1165 Spurrier <noah-AT-noah.org>. Noted how to use the SAGE runner
1161 1166 correctly (it works in NoColor mode).
1162 1167
1163 1168 * IPython/iplib.py (handle_normal): fix nasty crash reported on
1164 1169 SAGE list, from improper log() calls.
1165 1170
1166 1171 2006-05-31 Ville Vainio <vivainio@gmail.com>
1167 1172
1168 1173 * upgrade_dir.py, Magic.py (magic_upgrade): call upgrade_dir
1169 1174 with args in parens to work correctly with dirs that have spaces.
1170 1175
1171 1176 2006-05-30 Fernando Perez <Fernando.Perez@colorado.edu>
1172 1177
1173 1178 * IPython/Logger.py (Logger.logstart): add option to log raw input
1174 1179 instead of the processed one. A -r flag was added to the
1175 1180 %logstart magic used for controlling logging.
1176 1181
1177 1182 2006-05-29 Fernando Perez <Fernando.Perez@colorado.edu>
1178 1183
1179 1184 * IPython/iplib.py (InteractiveShell.__init__): add check for the
1180 1185 *BSDs to omit --color from all 'ls' aliases, since *BSD ls doesn't
1181 1186 recognize the option. After a bug report by Will Maier. This
1182 1187 closes #64 (will do it after confirmation from W. Maier).
1183 1188
1184 1189 * IPython/irunner.py: New module to run scripts as if manually
1185 1190 typed into an interactive environment, based on pexpect. After a
1186 1191 submission by Ken Schutte <kschutte-AT-csail.mit.edu> on the
1187 1192 ipython-user list. Simple unittests in the tests/ directory.
1188 1193
1189 1194 * tools/release: add Will Maier, OpenBSD port maintainer, to
1190 1195 recepients list. We are now officially part of the OpenBSD ports:
1191 1196 http://www.openbsd.org/ports.html ! Many thanks to Will for the
1192 1197 work.
1193 1198
1194 1199 2006-05-26 Fernando Perez <Fernando.Perez@colorado.edu>
1195 1200
1196 1201 * IPython/ipmaker.py (make_IPython): modify sys.argv fix (below)
1197 1202 so that it doesn't break tkinter apps.
1198 1203
1199 1204 * IPython/iplib.py (_prefilter): fix bug where aliases would
1200 1205 shadow variables when autocall was fully off. Reported by SAGE
1201 1206 author William Stein.
1202 1207
1203 1208 * IPython/OInspect.py (Inspector.__init__): add a flag to control
1204 1209 at what detail level strings are computed when foo? is requested.
1205 1210 This allows users to ask for example that the string form of an
1206 1211 object is only computed when foo?? is called, or even never, by
1207 1212 setting the object_info_string_level >= 2 in the configuration
1208 1213 file. This new option has been added and documented. After a
1209 1214 request by SAGE to be able to control the printing of very large
1210 1215 objects more easily.
1211 1216
1212 1217 2006-05-25 Fernando Perez <Fernando.Perez@colorado.edu>
1213 1218
1214 1219 * IPython/ipmaker.py (make_IPython): remove the ipython call path
1215 1220 from sys.argv, to be 100% consistent with how Python itself works
1216 1221 (as seen for example with python -i file.py). After a bug report
1217 1222 by Jeffrey Collins.
1218 1223
1219 1224 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix
1220 1225 nasty bug which was preventing custom namespaces with -pylab,
1221 1226 reported by M. Foord. Minor cleanup, remove old matplotlib.matlab
1222 1227 compatibility (long gone from mpl).
1223 1228
1224 1229 * IPython/ipapi.py (make_session): name change: create->make. We
1225 1230 use make in other places (ipmaker,...), it's shorter and easier to
1226 1231 type and say, etc. I'm trying to clean things before 0.7.2 so
1227 1232 that I can keep things stable wrt to ipapi in the chainsaw branch.
1228 1233
1229 1234 * ipython.el: fix the py-pdbtrack-input-prompt variable so that
1230 1235 python-mode recognizes our debugger mode. Add support for
1231 1236 autoindent inside (X)emacs. After a patch sent in by Jin Liu
1232 1237 <m.liu.jin-AT-gmail.com> originally written by
1233 1238 doxgen-AT-newsmth.net (with minor modifications for xemacs
1234 1239 compatibility)
1235 1240
1236 1241 * IPython/Debugger.py (Pdb.format_stack_entry): fix formatting of
1237 1242 tracebacks when walking the stack so that the stack tracking system
1238 1243 in emacs' python-mode can identify the frames correctly.
1239 1244
1240 1245 * IPython/ipmaker.py (make_IPython): make the internal (and
1241 1246 default config) autoedit_syntax value false by default. Too many
1242 1247 users have complained to me (both on and off-list) about problems
1243 1248 with this option being on by default, so I'm making it default to
1244 1249 off. It can still be enabled by anyone via the usual mechanisms.
1245 1250
1246 1251 * IPython/completer.py (Completer.attr_matches): add support for
1247 1252 PyCrust-style _getAttributeNames magic method. Patch contributed
1248 1253 by <mscott-AT-goldenspud.com>. Closes #50.
1249 1254
1250 1255 * IPython/iplib.py (InteractiveShell.__init__): remove the
1251 1256 deletion of exit/quit from __builtin__, which can break
1252 1257 third-party tools like the Zope debugging console. The
1253 1258 %exit/%quit magics remain. In general, it's probably a good idea
1254 1259 not to delete anything from __builtin__, since we never know what
1255 1260 that will break. In any case, python now (for 2.5) will support
1256 1261 'real' exit/quit, so this issue is moot. Closes #55.
1257 1262
1258 1263 * IPython/genutils.py (with_obj): rename the 'with' function to
1259 1264 'withobj' to avoid incompatibilities with Python 2.5, where 'with'
1260 1265 becomes a language keyword. Closes #53.
1261 1266
1262 1267 * IPython/FakeModule.py (FakeModule.__init__): add a proper
1263 1268 __file__ attribute to this so it fools more things into thinking
1264 1269 it is a real module. Closes #59.
1265 1270
1266 1271 * IPython/Magic.py (magic_edit): add -n option to open the editor
1267 1272 at a specific line number. After a patch by Stefan van der Walt.
1268 1273
1269 1274 2006-05-23 Fernando Perez <Fernando.Perez@colorado.edu>
1270 1275
1271 1276 * IPython/iplib.py (edit_syntax_error): fix crash when for some
1272 1277 reason the file could not be opened. After automatic crash
1273 1278 reports sent by James Graham <jgraham-AT-ast.cam.ac.uk> and
1274 1279 Charles Dolan <charlespatrickdolan-AT-yahoo.com>.
1275 1280 (_should_recompile): Don't fire editor if using %bg, since there
1276 1281 is no file in the first place. From the same report as above.
1277 1282 (raw_input): protect against faulty third-party prefilters. After
1278 1283 an automatic crash report sent by Dirk Laurie <dirk-AT-sun.ac.za>
1279 1284 while running under SAGE.
1280 1285
1281 1286 2006-05-23 Ville Vainio <vivainio@gmail.com>
1282 1287
1283 1288 * ipapi.py: Stripped down ip.to_user_ns() to work only as
1284 1289 ip.to_user_ns("x1 y1"), which exposes vars x1 and y1. ipapi.get()
1285 1290 now returns None (again), unless dummy is specifically allowed by
1286 1291 ipapi.get(allow_dummy=True).
1287 1292
1288 1293 2006-05-18 Fernando Perez <Fernando.Perez@colorado.edu>
1289 1294
1290 1295 * IPython: remove all 2.2-compatibility objects and hacks from
1291 1296 everywhere, since we only support 2.3 at this point. Docs
1292 1297 updated.
1293 1298
1294 1299 * IPython/ipapi.py (IPApi.__init__): Cleanup of all getters.
1295 1300 Anything requiring extra validation can be turned into a Python
1296 1301 property in the future. I used a property for the db one b/c
1297 1302 there was a nasty circularity problem with the initialization
1298 1303 order, which right now I don't have time to clean up.
1299 1304
1300 1305 * IPython/Shell.py (MTInteractiveShell.runcode): Fix, I think,
1301 1306 another locking bug reported by Jorgen. I'm not 100% sure though,
1302 1307 so more testing is needed...
1303 1308
1304 1309 2006-05-17 Fernando Perez <Fernando.Perez@colorado.edu>
1305 1310
1306 1311 * IPython/ipapi.py (IPApi.to_user_ns): New function to inject
1307 1312 local variables from any routine in user code (typically executed
1308 1313 with %run) directly into the interactive namespace. Very useful
1309 1314 when doing complex debugging.
1310 1315 (IPythonNotRunning): Changed the default None object to a dummy
1311 1316 whose attributes can be queried as well as called without
1312 1317 exploding, to ease writing code which works transparently both in
1313 1318 and out of ipython and uses some of this API.
1314 1319
1315 1320 2006-05-16 Fernando Perez <Fernando.Perez@colorado.edu>
1316 1321
1317 1322 * IPython/hooks.py (result_display): Fix the fact that our display
1318 1323 hook was using str() instead of repr(), as the default python
1319 1324 console does. This had gone unnoticed b/c it only happened if
1320 1325 %Pprint was off, but the inconsistency was there.
1321 1326
1322 1327 2006-05-15 Ville Vainio <vivainio@gmail.com>
1323 1328
1324 1329 * Oinspect.py: Only show docstring for nonexisting/binary files
1325 1330 when doing object??, closing ticket #62
1326 1331
1327 1332 2006-05-13 Fernando Perez <Fernando.Perez@colorado.edu>
1328 1333
1329 1334 * IPython/Shell.py (MTInteractiveShell.runsource): Fix threading
1330 1335 bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock
1331 1336 was being released in a routine which hadn't checked if it had
1332 1337 been the one to acquire it.
1333 1338
1334 1339 2006-05-07 Fernando Perez <Fernando.Perez@colorado.edu>
1335 1340
1336 1341 * IPython/Release.py (version): put out 0.7.2.rc1 for testing.
1337 1342
1338 1343 2006-04-11 Ville Vainio <vivainio@gmail.com>
1339 1344
1340 1345 * iplib.py, ipmaker.py: .ipy extension now means "ipython batch file"
1341 1346 in command line. E.g. "ipython test.ipy" runs test.ipy with ipython
1342 1347 prefilters, allowing stuff like magics and aliases in the file.
1343 1348
1344 1349 * Prompts.py, Extensions/clearcmd.py, ipy_system_conf.py: %clear magic
1345 1350 added. Supported now are "%clear in" and "%clear out" (clear input and
1346 1351 output history, respectively). Also fixed CachedOutput.flush to
1347 1352 properly flush the output cache.
1348 1353
1349 1354 * Extensions/pspersistence.py: Fix %store to avoid "%store obj.attr"
1350 1355 half-success (and fail explicitly).
1351 1356
1352 1357 2006-03-28 Ville Vainio <vivainio@gmail.com>
1353 1358
1354 1359 * iplib.py: Fix quoting of aliases so that only argless ones
1355 1360 are quoted
1356 1361
1357 1362 2006-03-28 Ville Vainio <vivainio@gmail.com>
1358 1363
1359 1364 * iplib.py: Quote aliases with spaces in the name.
1360 1365 "c:\program files\blah\bin" is now legal alias target.
1361 1366
1362 1367 * ext_rehashdir.py: Space no longer allowed as arg
1363 1368 separator, since space is legal in path names.
1364 1369
1365 1370 2006-03-16 Ville Vainio <vivainio@gmail.com>
1366 1371
1367 1372 * upgrade_dir.py: Take path.py from Extensions, correcting
1368 1373 %upgrade magic
1369 1374
1370 1375 * ipmaker.py: Suggest using %upgrade if ipy_user_conf.py isn't found.
1371 1376
1372 1377 * hooks.py: Only enclose editor binary in quotes if legal and
1373 1378 necessary (space in the name, and is an existing file). Fixes a bug
1374 1379 reported by Zachary Pincus.
1375 1380
1376 1381 2006-03-13 Fernando Perez <Fernando.Perez@colorado.edu>
1377 1382
1378 1383 * Manual: thanks to a tip on proper color handling for Emacs, by
1379 1384 Eric J Haywiser <ejh1-AT-MIT.EDU>.
1380 1385
1381 1386 * ipython.el: close http://www.scipy.net/roundup/ipython/issue57
1382 1387 by applying the provided patch. Thanks to Liu Jin
1383 1388 <m.liu.jin-AT-gmail.com> for the contribution. No problems under
1384 1389 XEmacs/Linux, I'm trusting the submitter that it actually helps
1385 1390 under win32/GNU Emacs. Will revisit if any problems are reported.
1386 1391
1387 1392 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1388 1393
1389 1394 * IPython/Gnuplot2.py (_FileClass): update for current Gnuplot.py
1390 1395 from SVN, thanks to a patch by Ryan Woodard <rywo@bas.ac.uk>.
1391 1396
1392 1397 2006-03-12 Ville Vainio <vivainio@gmail.com>
1393 1398
1394 1399 * Magic.py (magic_timeit): Added %timeit magic, contributed by
1395 1400 Torsten Marek.
1396 1401
1397 1402 2006-03-12 Fernando Perez <Fernando.Perez@colorado.edu>
1398 1403
1399 1404 * IPython/Magic.py (magic_macro): fix so that the n1-n2 syntax for
1400 1405 line ranges works again.
1401 1406
1402 1407 2006-03-11 Fernando Perez <Fernando.Perez@colorado.edu>
1403 1408
1404 1409 * IPython/iplib.py (showtraceback): add back sys.last_traceback
1405 1410 and friends, after a discussion with Zach Pincus on ipython-user.
1406 1411 I'm not 100% sure, but after thinking about it quite a bit, it may
1407 1412 be OK. Testing with the multithreaded shells didn't reveal any
1408 1413 problems, but let's keep an eye out.
1409 1414
1410 1415 In the process, I fixed a few things which were calling
1411 1416 self.InteractiveTB() directly (like safe_execfile), which is a
1412 1417 mistake: ALL exception reporting should be done by calling
1413 1418 self.showtraceback(), which handles state and tab-completion and
1414 1419 more.
1415 1420
1416 1421 2006-03-01 Ville Vainio <vivainio@gmail.com>
1417 1422
1418 1423 * Extensions/ipipe.py: Added Walter Doerwald's "ipipe" module.
1419 1424 To use, do "from ipipe import *".
1420 1425
1421 1426 2006-02-24 Ville Vainio <vivainio@gmail.com>
1422 1427
1423 1428 * Magic.py, upgrade_dir.py: %upgrade magic added. Does things more
1424 1429 "cleanly" and safely than the older upgrade mechanism.
1425 1430
1426 1431 2006-02-21 Ville Vainio <vivainio@gmail.com>
1427 1432
1428 1433 * Magic.py: %save works again.
1429 1434
1430 1435 2006-02-15 Ville Vainio <vivainio@gmail.com>
1431 1436
1432 1437 * Magic.py: %Pprint works again
1433 1438
1434 1439 * Extensions/ipy_sane_defaults.py: Provide everything provided
1435 1440 in default ipythonrc, to make it possible to have a completely empty
1436 1441 ipythonrc (and thus completely rc-file free configuration)
1437 1442
1438 1443 2006-02-11 Fernando Perez <Fernando.Perez@colorado.edu>
1439 1444
1440 1445 * IPython/hooks.py (editor): quote the call to the editor command,
1441 1446 to allow commands with spaces in them. Problem noted by watching
1442 1447 Ian Oswald's video about textpad under win32 at
1443 1448 http://showmedo.com/videoListPage?listKey=PythonIPythonSeries
1444 1449
1445 1450 * IPython/UserConfig/ipythonrc: Replace @ signs with % when
1446 1451 describing magics (we haven't used @ for a loong time).
1447 1452
1448 1453 * IPython/ultraTB.py (VerboseTB.text.text_repr): Added patch
1449 1454 contributed by marienz to close
1450 1455 http://www.scipy.net/roundup/ipython/issue53.
1451 1456
1452 1457 2006-02-10 Ville Vainio <vivainio@gmail.com>
1453 1458
1454 1459 * genutils.py: getoutput now works in win32 too
1455 1460
1456 1461 * completer.py: alias and magic completion only invoked
1457 1462 at the first "item" in the line, to avoid "cd %store"
1458 1463 nonsense.
1459 1464
1460 1465 2006-02-09 Ville Vainio <vivainio@gmail.com>
1461 1466
1462 1467 * test/*: Added a unit testing framework (finally).
1463 1468 '%run runtests.py' to run test_*.
1464 1469
1465 1470 * ipapi.py: Exposed runlines and set_custom_exc
1466 1471
1467 1472 2006-02-07 Ville Vainio <vivainio@gmail.com>
1468 1473
1469 1474 * iplib.py: don't split "f 1 2" to "f(1,2)" in autocall,
1470 1475 instead use "f(1 2)" as before.
1471 1476
1472 1477 2006-02-05 Fernando Perez <Fernando.Perez@colorado.edu>
1473 1478
1474 1479 * IPython/demo.py (IPythonDemo): Add new classes to the demo
1475 1480 facilities, for demos processed by the IPython input filter
1476 1481 (IPythonDemo), and for running a script one-line-at-a-time as a
1477 1482 demo, both for pure Python (LineDemo) and for IPython-processed
1478 1483 input (IPythonLineDemo). After a request by Dave Kohel, from the
1479 1484 SAGE team.
1480 1485 (Demo.edit): added an edit() method to the demo objects, to edit
1481 1486 the in-memory copy of the last executed block.
1482 1487
1483 1488 * IPython/Magic.py (magic_edit): add '-r' option for 'raw'
1484 1489 processing to %edit, %macro and %save. These commands can now be
1485 1490 invoked on the unprocessed input as it was typed by the user
1486 1491 (without any prefilters applied). After requests by the SAGE team
1487 1492 at SAGE days 2006: http://modular.ucsd.edu/sage/days1/schedule.html.
1488 1493
1489 1494 2006-02-01 Ville Vainio <vivainio@gmail.com>
1490 1495
1491 1496 * setup.py, eggsetup.py: easy_install ipython==dev works
1492 1497 correctly now (on Linux)
1493 1498
1494 1499 * ipy_user_conf,ipmaker: user config changes, removed spurious
1495 1500 warnings
1496 1501
1497 1502 * iplib: if rc.banner is string, use it as is.
1498 1503
1499 1504 * Magic: %pycat accepts a string argument and pages it's contents.
1500 1505
1501 1506
1502 1507 2006-01-30 Ville Vainio <vivainio@gmail.com>
1503 1508
1504 1509 * pickleshare,pspersistence,ipapi,Magic: persistence overhaul.
1505 1510 Now %store and bookmarks work through PickleShare, meaning that
1506 1511 concurrent access is possible and all ipython sessions see the
1507 1512 same database situation all the time, instead of snapshot of
1508 1513 the situation when the session was started. Hence, %bookmark
1509 1514 results are immediately accessible from othes sessions. The database
1510 1515 is also available for use by user extensions. See:
1511 1516 http://www.python.org/pypi/pickleshare
1512 1517
1513 1518 * hooks.py: Two new hooks, 'shutdown_hook' and 'late_startup_hook'.
1514 1519
1515 1520 * aliases can now be %store'd
1516 1521
1517 1522 * path.py moved to Extensions so that pickleshare does not need
1518 1523 IPython-specific import. Extensions added to pythonpath right
1519 1524 at __init__.
1520 1525
1521 1526 * iplib.py: ipalias deprecated/redundant; aliases are converted and
1522 1527 called with _ip.system and the pre-transformed command string.
1523 1528
1524 1529 2006-01-29 Fernando Perez <Fernando.Perez@colorado.edu>
1525 1530
1526 1531 * IPython/iplib.py (interact): Fix that we were not catching
1527 1532 KeyboardInterrupt exceptions properly. I'm not quite sure why the
1528 1533 logic here had to change, but it's fixed now.
1529 1534
1530 1535 2006-01-29 Ville Vainio <vivainio@gmail.com>
1531 1536
1532 1537 * iplib.py: Try to import pyreadline on Windows.
1533 1538
1534 1539 2006-01-27 Ville Vainio <vivainio@gmail.com>
1535 1540
1536 1541 * iplib.py: Expose ipapi as _ip in builtin namespace.
1537 1542 Makes ipmagic (-> _ip.magic), ipsystem (-> _ip.system)
1538 1543 and ip_set_hook (-> _ip.set_hook) redundant. % and !
1539 1544 syntax now produce _ip.* variant of the commands.
1540 1545
1541 1546 * "_ip.options().autoedit_syntax = 2" automatically throws
1542 1547 user to editor for syntax error correction without prompting.
1543 1548
1544 1549 2006-01-27 Ville Vainio <vivainio@gmail.com>
1545 1550
1546 1551 * ipmaker.py: Give "realistic" sys.argv for scripts (without
1547 1552 'ipython' at argv[0]) executed through command line.
1548 1553 NOTE: this DEPRECATES calling ipython with multiple scripts
1549 1554 ("ipython a.py b.py c.py")
1550 1555
1551 1556 * iplib.py, hooks.py: Added configurable input prefilter,
1552 1557 named 'input_prefilter'. See ext_rescapture.py for example
1553 1558 usage.
1554 1559
1555 1560 * ext_rescapture.py, Magic.py: Better system command output capture
1556 1561 through 'var = !ls' (deprecates user-visible %sc). Same notation
1557 1562 applies for magics, 'var = %alias' assigns alias list to var.
1558 1563
1559 1564 * ipapi.py: added meta() for accessing extension-usable data store.
1560 1565
1561 1566 * iplib.py: added InteractiveShell.getapi(). New magics should be
1562 1567 written doing self.getapi() instead of using the shell directly.
1563 1568
1564 1569 * Magic.py: %store now allows doing %store foo > ~/myfoo.txt and
1565 1570 %store foo >> ~/myfoo.txt to store variables to files (in clean
1566 1571 textual form, not a restorable pickle).
1567 1572
1568 1573 * ipmaker.py: now import ipy_profile_PROFILENAME automatically
1569 1574
1570 1575 * usage.py, Magic.py: added %quickref
1571 1576
1572 1577 * iplib.py: ESC_PAREN fixes: /f 1 2 -> f(1,2), not f(1 2).
1573 1578
1574 1579 * GetoptErrors when invoking magics etc. with wrong args
1575 1580 are now more helpful:
1576 1581 GetoptError: option -l not recognized (allowed: "qb" )
1577 1582
1578 1583 2006-01-25 Fernando Perez <Fernando.Perez@colorado.edu>
1579 1584
1580 1585 * IPython/demo.py (Demo.show): Flush stdout after each block, so
1581 1586 computationally intensive blocks don't appear to stall the demo.
1582 1587
1583 1588 2006-01-24 Ville Vainio <vivainio@gmail.com>
1584 1589
1585 1590 * iplib.py, hooks.py: 'result_display' hook can return a non-None
1586 1591 value to manipulate resulting history entry.
1587 1592
1588 1593 * ipapi.py: Moved TryNext here from hooks.py. Moved functions
1589 1594 to instance methods of IPApi class, to make extending an embedded
1590 1595 IPython feasible. See ext_rehashdir.py for example usage.
1591 1596
1592 1597 * Merged 1071-1076 from branches/0.7.1
1593 1598
1594 1599
1595 1600 2006-01-23 Fernando Perez <Fernando.Perez@colorado.edu>
1596 1601
1597 1602 * tools/release (daystamp): Fix build tools to use the new
1598 1603 eggsetup.py script to build lightweight eggs.
1599 1604
1600 1605 * Applied changesets 1062 and 1064 before 0.7.1 release.
1601 1606
1602 1607 * IPython/Magic.py (magic_history): Add '-r' option to %hist, to
1603 1608 see the raw input history (without conversions like %ls ->
1604 1609 ipmagic("ls")). After a request from W. Stein, SAGE
1605 1610 (http://modular.ucsd.edu/sage) developer. This information is
1606 1611 stored in the input_hist_raw attribute of the IPython instance, so
1607 1612 developers can access it if needed (it's an InputList instance).
1608 1613
1609 1614 * Versionstring = 0.7.2.svn
1610 1615
1611 1616 * eggsetup.py: A separate script for constructing eggs, creates
1612 1617 proper launch scripts even on Windows (an .exe file in
1613 1618 \python24\scripts).
1614 1619
1615 1620 * ipapi.py: launch_new_instance, launch entry point needed for the
1616 1621 egg.
1617 1622
1618 1623 2006-01-23 Ville Vainio <vivainio@gmail.com>
1619 1624
1620 1625 * Added %cpaste magic for pasting python code
1621 1626
1622 1627 2006-01-22 Ville Vainio <vivainio@gmail.com>
1623 1628
1624 1629 * Merge from branches/0.7.1 into trunk, revs 1052-1057
1625 1630
1626 1631 * Versionstring = 0.7.2.svn
1627 1632
1628 1633 * eggsetup.py: A separate script for constructing eggs, creates
1629 1634 proper launch scripts even on Windows (an .exe file in
1630 1635 \python24\scripts).
1631 1636
1632 1637 * ipapi.py: launch_new_instance, launch entry point needed for the
1633 1638 egg.
1634 1639
1635 1640 2006-01-22 Fernando Perez <Fernando.Perez@colorado.edu>
1636 1641
1637 1642 * IPython/OInspect.py (Inspector.pinfo): fix bug where foo?? or
1638 1643 %pfile foo would print the file for foo even if it was a binary.
1639 1644 Now, extensions '.so' and '.dll' are skipped.
1640 1645
1641 1646 * IPython/Shell.py (MTInteractiveShell.__init__): Fix threading
1642 1647 bug, where macros would fail in all threaded modes. I'm not 100%
1643 1648 sure, so I'm going to put out an rc instead of making a release
1644 1649 today, and wait for feedback for at least a few days.
1645 1650
1646 1651 * IPython/iplib.py (handle_normal): fix (finally? somehow I doubt
1647 1652 it...) the handling of pasting external code with autoindent on.
1648 1653 To get out of a multiline input, the rule will appear for most
1649 1654 users unchanged: two blank lines or change the indent level
1650 1655 proposed by IPython. But there is a twist now: you can
1651 1656 add/subtract only *one or two spaces*. If you add/subtract three
1652 1657 or more (unless you completely delete the line), IPython will
1653 1658 accept that line, and you'll need to enter a second one of pure
1654 1659 whitespace. I know it sounds complicated, but I can't find a
1655 1660 different solution that covers all the cases, with the right
1656 1661 heuristics. Hopefully in actual use, nobody will really notice
1657 1662 all these strange rules and things will 'just work'.
1658 1663
1659 1664 2006-01-21 Fernando Perez <Fernando.Perez@colorado.edu>
1660 1665
1661 1666 * IPython/iplib.py (interact): catch exceptions which can be
1662 1667 triggered asynchronously by signal handlers. Thanks to an
1663 1668 automatic crash report, submitted by Colin Kingsley
1664 1669 <tercel-AT-gentoo.org>.
1665 1670
1666 1671 2006-01-20 Ville Vainio <vivainio@gmail.com>
1667 1672
1668 1673 * Ipython/Extensions/ext_rehashdir.py: Created a usable example
1669 1674 (%rehashdir, very useful, try it out) of how to extend ipython
1670 1675 with new magics. Also added Extensions dir to pythonpath to make
1671 1676 importing extensions easy.
1672 1677
1673 1678 * %store now complains when trying to store interactively declared
1674 1679 classes / instances of those classes.
1675 1680
1676 1681 * Extensions/ipy_system_conf.py, UserConfig/ipy_user_conf.py,
1677 1682 ipmaker.py: Config rehaul. Now ipy_..._conf.py are always imported
1678 1683 if they exist, and ipy_user_conf.py with some defaults is created for
1679 1684 the user.
1680 1685
1681 1686 * Startup rehashing done by the config file, not InterpreterExec.
1682 1687 This means system commands are available even without selecting the
1683 1688 pysh profile. It's the sensible default after all.
1684 1689
1685 1690 2006-01-20 Fernando Perez <Fernando.Perez@colorado.edu>
1686 1691
1687 1692 * IPython/iplib.py (raw_input): I _think_ I got the pasting of
1688 1693 multiline code with autoindent on working. But I am really not
1689 1694 sure, so this needs more testing. Will commit a debug-enabled
1690 1695 version for now, while I test it some more, so that Ville and
1691 1696 others may also catch any problems. Also made
1692 1697 self.indent_current_str() a method, to ensure that there's no
1693 1698 chance of the indent space count and the corresponding string
1694 1699 falling out of sync. All code needing the string should just call
1695 1700 the method.
1696 1701
1697 1702 2006-01-18 Fernando Perez <Fernando.Perez@colorado.edu>
1698 1703
1699 1704 * IPython/Magic.py (magic_edit): fix check for when users don't
1700 1705 save their output files, the try/except was in the wrong section.
1701 1706
1702 1707 2006-01-17 Fernando Perez <Fernando.Perez@colorado.edu>
1703 1708
1704 1709 * IPython/Magic.py (magic_run): fix __file__ global missing from
1705 1710 script's namespace when executed via %run. After a report by
1706 1711 Vivian.
1707 1712
1708 1713 * IPython/Debugger.py (Pdb.__init__): Fix breakage with '%run -d'
1709 1714 when using python 2.4. The parent constructor changed in 2.4, and
1710 1715 we need to track it directly (we can't call it, as it messes up
1711 1716 readline and tab-completion inside our pdb would stop working).
1712 1717 After a bug report by R. Bernstein <rocky-AT-panix.com>.
1713 1718
1714 1719 2006-01-16 Ville Vainio <vivainio@gmail.com>
1715 1720
1716 1721 * Ipython/magic.py: Reverted back to old %edit functionality
1717 1722 that returns file contents on exit.
1718 1723
1719 1724 * IPython/path.py: Added Jason Orendorff's "path" module to
1720 1725 IPython tree, http://www.jorendorff.com/articles/python/path/.
1721 1726 You can get path objects conveniently through %sc, and !!, e.g.:
1722 1727 sc files=ls
1723 1728 for p in files.paths: # or files.p
1724 1729 print p,p.mtime
1725 1730
1726 1731 * Ipython/iplib.py:"," and ";" autoquoting-upon-autocall
1727 1732 now work again without considering the exclusion regexp -
1728 1733 hence, things like ',foo my/path' turn to 'foo("my/path")'
1729 1734 instead of syntax error.
1730 1735
1731 1736
1732 1737 2006-01-14 Ville Vainio <vivainio@gmail.com>
1733 1738
1734 1739 * IPython/ipapi.py (ashook, asmagic, options): Added convenience
1735 1740 ipapi decorators for python 2.4 users, options() provides access to rc
1736 1741 data.
1737 1742
1738 1743 * IPython/Magic.py (magic_cd): %cd now accepts backslashes
1739 1744 as path separators (even on Linux ;-). Space character after
1740 1745 backslash (as yielded by tab completer) is still space;
1741 1746 "%cd long\ name" works as expected.
1742 1747
1743 1748 * IPython/ipapi.py,hooks.py,iplib.py: Hooks now implemented
1744 1749 as "chain of command", with priority. API stays the same,
1745 1750 TryNext exception raised by a hook function signals that
1746 1751 current hook failed and next hook should try handling it, as
1747 1752 suggested by Walter DΓΆrwald <walter@livinglogic.de>. Walter also
1748 1753 requested configurable display hook, which is now implemented.
1749 1754
1750 1755 2006-01-13 Ville Vainio <vivainio@gmail.com>
1751 1756
1752 1757 * IPython/platutils*.py: platform specific utility functions,
1753 1758 so far only set_term_title is implemented (change terminal
1754 1759 label in windowing systems). %cd now changes the title to
1755 1760 current dir.
1756 1761
1757 1762 * IPython/Release.py: Added myself to "authors" list,
1758 1763 had to create new files.
1759 1764
1760 1765 * IPython/iplib.py (handle_shell_escape): fixed logical flaw in
1761 1766 shell escape; not a known bug but had potential to be one in the
1762 1767 future.
1763 1768
1764 1769 * IPython/ipapi.py (added),OInspect.py,iplib.py: "Public"
1765 1770 extension API for IPython! See the module for usage example. Fix
1766 1771 OInspect for docstring-less magic functions.
1767 1772
1768 1773
1769 1774 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
1770 1775
1771 1776 * IPython/iplib.py (raw_input): temporarily deactivate all
1772 1777 attempts at allowing pasting of code with autoindent on. It
1773 1778 introduced bugs (reported by Prabhu) and I can't seem to find a
1774 1779 robust combination which works in all cases. Will have to revisit
1775 1780 later.
1776 1781
1777 1782 * IPython/genutils.py: remove isspace() function. We've dropped
1778 1783 2.2 compatibility, so it's OK to use the string method.
1779 1784
1780 1785 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1781 1786
1782 1787 * IPython/iplib.py (InteractiveShell.__init__): fix regexp
1783 1788 matching what NOT to autocall on, to include all python binary
1784 1789 operators (including things like 'and', 'or', 'is' and 'in').
1785 1790 Prompted by a bug report on 'foo & bar', but I realized we had
1786 1791 many more potential bug cases with other operators. The regexp is
1787 1792 self.re_exclude_auto, it's fairly commented.
1788 1793
1789 1794 2006-01-12 Ville Vainio <vivainio@gmail.com>
1790 1795
1791 1796 * IPython/iplib.py (make_quoted_expr,handle_shell_escape):
1792 1797 Prettified and hardened string/backslash quoting with ipsystem(),
1793 1798 ipalias() and ipmagic(). Now even \ characters are passed to
1794 1799 %magics, !shell escapes and aliases exactly as they are in the
1795 1800 ipython command line. Should improve backslash experience,
1796 1801 particularly in Windows (path delimiter for some commands that
1797 1802 won't understand '/'), but Unix benefits as well (regexps). %cd
1798 1803 magic still doesn't support backslash path delimiters, though. Also
1799 1804 deleted all pretense of supporting multiline command strings in
1800 1805 !system or %magic commands. Thanks to Jerry McRae for suggestions.
1801 1806
1802 1807 * doc/build_doc_instructions.txt added. Documentation on how to
1803 1808 use doc/update_manual.py, added yesterday. Both files contributed
1804 1809 by JΓΆrgen Stenarson <jorgen.stenarson-AT-bostream.nu>. This slates
1805 1810 doc/*.sh for deprecation at a later date.
1806 1811
1807 1812 * /ipython.py Added ipython.py to root directory for
1808 1813 zero-installation (tar xzvf ipython.tgz; cd ipython; python
1809 1814 ipython.py) and development convenience (no need to keep doing
1810 1815 "setup.py install" between changes).
1811 1816
1812 1817 * Made ! and !! shell escapes work (again) in multiline expressions:
1813 1818 if 1:
1814 1819 !ls
1815 1820 !!ls
1816 1821
1817 1822 2006-01-12 Fernando Perez <Fernando.Perez@colorado.edu>
1818 1823
1819 1824 * IPython/ipstruct.py (Struct): Rename IPython.Struct to
1820 1825 IPython.ipstruct, to avoid local shadowing of the stdlib 'struct'
1821 1826 module in case-insensitive installation. Was causing crashes
1822 1827 under win32. Closes http://www.scipy.net/roundup/ipython/issue49.
1823 1828
1824 1829 * IPython/Magic.py (magic_pycat): Fix pycat, patch by Marien Zwart
1825 1830 <marienz-AT-gentoo.org>, closes
1826 1831 http://www.scipy.net/roundup/ipython/issue51.
1827 1832
1828 1833 2006-01-11 Fernando Perez <Fernando.Perez@colorado.edu>
1829 1834
1830 1835 * IPython/Shell.py (IPShellGTK.on_timer): Finally fix the
1831 1836 problem of excessive CPU usage under *nix and keyboard lag under
1832 1837 win32.
1833 1838
1834 1839 2006-01-10 *** Released version 0.7.0
1835 1840
1836 1841 2006-01-10 Fernando Perez <Fernando.Perez@colorado.edu>
1837 1842
1838 1843 * IPython/Release.py (revision): tag version number to 0.7.0,
1839 1844 ready for release.
1840 1845
1841 1846 * IPython/Magic.py (magic_edit): Add print statement to %edit so
1842 1847 it informs the user of the name of the temp. file used. This can
1843 1848 help if you decide later to reuse that same file, so you know
1844 1849 where to copy the info from.
1845 1850
1846 1851 2006-01-09 Fernando Perez <Fernando.Perez@colorado.edu>
1847 1852
1848 1853 * setup_bdist_egg.py: little script to build an egg. Added
1849 1854 support in the release tools as well.
1850 1855
1851 1856 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1852 1857
1853 1858 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
1854 1859 version selection (new -wxversion command line and ipythonrc
1855 1860 parameter). Patch contributed by Arnd Baecker
1856 1861 <arnd.baecker-AT-web.de>.
1857 1862
1858 1863 * IPython/iplib.py (embed_mainloop): fix tab-completion in
1859 1864 embedded instances, for variables defined at the interactive
1860 1865 prompt of the embedded ipython. Reported by Arnd.
1861 1866
1862 1867 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
1863 1868 it can be used as a (stateful) toggle, or with a direct parameter.
1864 1869
1865 1870 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
1866 1871 could be triggered in certain cases and cause the traceback
1867 1872 printer not to work.
1868 1873
1869 1874 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
1870 1875
1871 1876 * IPython/iplib.py (_should_recompile): Small fix, closes
1872 1877 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
1873 1878
1874 1879 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
1875 1880
1876 1881 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
1877 1882 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
1878 1883 Moad for help with tracking it down.
1879 1884
1880 1885 * IPython/iplib.py (handle_auto): fix autocall handling for
1881 1886 objects which support BOTH __getitem__ and __call__ (so that f [x]
1882 1887 is left alone, instead of becoming f([x]) automatically).
1883 1888
1884 1889 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
1885 1890 Ville's patch.
1886 1891
1887 1892 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
1888 1893
1889 1894 * IPython/iplib.py (handle_auto): changed autocall semantics to
1890 1895 include 'smart' mode, where the autocall transformation is NOT
1891 1896 applied if there are no arguments on the line. This allows you to
1892 1897 just type 'foo' if foo is a callable to see its internal form,
1893 1898 instead of having it called with no arguments (typically a
1894 1899 mistake). The old 'full' autocall still exists: for that, you
1895 1900 need to set the 'autocall' parameter to 2 in your ipythonrc file.
1896 1901
1897 1902 * IPython/completer.py (Completer.attr_matches): add
1898 1903 tab-completion support for Enthoughts' traits. After a report by
1899 1904 Arnd and a patch by Prabhu.
1900 1905
1901 1906 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
1902 1907
1903 1908 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
1904 1909 Schmolck's patch to fix inspect.getinnerframes().
1905 1910
1906 1911 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
1907 1912 for embedded instances, regarding handling of namespaces and items
1908 1913 added to the __builtin__ one. Multiple embedded instances and
1909 1914 recursive embeddings should work better now (though I'm not sure
1910 1915 I've got all the corner cases fixed, that code is a bit of a brain
1911 1916 twister).
1912 1917
1913 1918 * IPython/Magic.py (magic_edit): added support to edit in-memory
1914 1919 macros (automatically creates the necessary temp files). %edit
1915 1920 also doesn't return the file contents anymore, it's just noise.
1916 1921
1917 1922 * IPython/completer.py (Completer.attr_matches): revert change to
1918 1923 complete only on attributes listed in __all__. I realized it
1919 1924 cripples the tab-completion system as a tool for exploring the
1920 1925 internals of unknown libraries (it renders any non-__all__
1921 1926 attribute off-limits). I got bit by this when trying to see
1922 1927 something inside the dis module.
1923 1928
1924 1929 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
1925 1930
1926 1931 * IPython/iplib.py (InteractiveShell.__init__): add .meta
1927 1932 namespace for users and extension writers to hold data in. This
1928 1933 follows the discussion in
1929 1934 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
1930 1935
1931 1936 * IPython/completer.py (IPCompleter.complete): small patch to help
1932 1937 tab-completion under Emacs, after a suggestion by John Barnard
1933 1938 <barnarj-AT-ccf.org>.
1934 1939
1935 1940 * IPython/Magic.py (Magic.extract_input_slices): added support for
1936 1941 the slice notation in magics to use N-M to represent numbers N...M
1937 1942 (closed endpoints). This is used by %macro and %save.
1938 1943
1939 1944 * IPython/completer.py (Completer.attr_matches): for modules which
1940 1945 define __all__, complete only on those. After a patch by Jeffrey
1941 1946 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
1942 1947 speed up this routine.
1943 1948
1944 1949 * IPython/Logger.py (Logger.log): fix a history handling bug. I
1945 1950 don't know if this is the end of it, but the behavior now is
1946 1951 certainly much more correct. Note that coupled with macros,
1947 1952 slightly surprising (at first) behavior may occur: a macro will in
1948 1953 general expand to multiple lines of input, so upon exiting, the
1949 1954 in/out counters will both be bumped by the corresponding amount
1950 1955 (as if the macro's contents had been typed interactively). Typing
1951 1956 %hist will reveal the intermediate (silently processed) lines.
1952 1957
1953 1958 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
1954 1959 pickle to fail (%run was overwriting __main__ and not restoring
1955 1960 it, but pickle relies on __main__ to operate).
1956 1961
1957 1962 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
1958 1963 using properties, but forgot to make the main InteractiveShell
1959 1964 class a new-style class. Properties fail silently, and
1960 1965 mysteriously, with old-style class (getters work, but
1961 1966 setters don't do anything).
1962 1967
1963 1968 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1964 1969
1965 1970 * IPython/Magic.py (magic_history): fix history reporting bug (I
1966 1971 know some nasties are still there, I just can't seem to find a
1967 1972 reproducible test case to track them down; the input history is
1968 1973 falling out of sync...)
1969 1974
1970 1975 * IPython/iplib.py (handle_shell_escape): fix bug where both
1971 1976 aliases and system accesses where broken for indented code (such
1972 1977 as loops).
1973 1978
1974 1979 * IPython/genutils.py (shell): fix small but critical bug for
1975 1980 win32 system access.
1976 1981
1977 1982 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
1978 1983
1979 1984 * IPython/iplib.py (showtraceback): remove use of the
1980 1985 sys.last_{type/value/traceback} structures, which are non
1981 1986 thread-safe.
1982 1987 (_prefilter): change control flow to ensure that we NEVER
1983 1988 introspect objects when autocall is off. This will guarantee that
1984 1989 having an input line of the form 'x.y', where access to attribute
1985 1990 'y' has side effects, doesn't trigger the side effect TWICE. It
1986 1991 is important to note that, with autocall on, these side effects
1987 1992 can still happen.
1988 1993 (ipsystem): new builtin, to complete the ip{magic/alias/system}
1989 1994 trio. IPython offers these three kinds of special calls which are
1990 1995 not python code, and it's a good thing to have their call method
1991 1996 be accessible as pure python functions (not just special syntax at
1992 1997 the command line). It gives us a better internal implementation
1993 1998 structure, as well as exposing these for user scripting more
1994 1999 cleanly.
1995 2000
1996 2001 * IPython/macro.py (Macro.__init__): moved macros to a standalone
1997 2002 file. Now that they'll be more likely to be used with the
1998 2003 persistance system (%store), I want to make sure their module path
1999 2004 doesn't change in the future, so that we don't break things for
2000 2005 users' persisted data.
2001 2006
2002 2007 * IPython/iplib.py (autoindent_update): move indentation
2003 2008 management into the _text_ processing loop, not the keyboard
2004 2009 interactive one. This is necessary to correctly process non-typed
2005 2010 multiline input (such as macros).
2006 2011
2007 2012 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
2008 2013 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
2009 2014 which was producing problems in the resulting manual.
2010 2015 (magic_whos): improve reporting of instances (show their class,
2011 2016 instead of simply printing 'instance' which isn't terribly
2012 2017 informative).
2013 2018
2014 2019 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
2015 2020 (minor mods) to support network shares under win32.
2016 2021
2017 2022 * IPython/winconsole.py (get_console_size): add new winconsole
2018 2023 module and fixes to page_dumb() to improve its behavior under
2019 2024 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
2020 2025
2021 2026 * IPython/Magic.py (Macro): simplified Macro class to just
2022 2027 subclass list. We've had only 2.2 compatibility for a very long
2023 2028 time, yet I was still avoiding subclassing the builtin types. No
2024 2029 more (I'm also starting to use properties, though I won't shift to
2025 2030 2.3-specific features quite yet).
2026 2031 (magic_store): added Ville's patch for lightweight variable
2027 2032 persistence, after a request on the user list by Matt Wilkie
2028 2033 <maphew-AT-gmail.com>. The new %store magic's docstring has full
2029 2034 details.
2030 2035
2031 2036 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2032 2037 changed the default logfile name from 'ipython.log' to
2033 2038 'ipython_log.py'. These logs are real python files, and now that
2034 2039 we have much better multiline support, people are more likely to
2035 2040 want to use them as such. Might as well name them correctly.
2036 2041
2037 2042 * IPython/Magic.py: substantial cleanup. While we can't stop
2038 2043 using magics as mixins, due to the existing customizations 'out
2039 2044 there' which rely on the mixin naming conventions, at least I
2040 2045 cleaned out all cross-class name usage. So once we are OK with
2041 2046 breaking compatibility, the two systems can be separated.
2042 2047
2043 2048 * IPython/Logger.py: major cleanup. This one is NOT a mixin
2044 2049 anymore, and the class is a fair bit less hideous as well. New
2045 2050 features were also introduced: timestamping of input, and logging
2046 2051 of output results. These are user-visible with the -t and -o
2047 2052 options to %logstart. Closes
2048 2053 http://www.scipy.net/roundup/ipython/issue11 and a request by
2049 2054 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
2050 2055
2051 2056 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
2052 2057
2053 2058 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
2054 2059 better handle backslashes in paths. See the thread 'More Windows
2055 2060 questions part 2 - \/ characters revisited' on the iypthon user
2056 2061 list:
2057 2062 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
2058 2063
2059 2064 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
2060 2065
2061 2066 (InteractiveShell.__init__): change threaded shells to not use the
2062 2067 ipython crash handler. This was causing more problems than not,
2063 2068 as exceptions in the main thread (GUI code, typically) would
2064 2069 always show up as a 'crash', when they really weren't.
2065 2070
2066 2071 The colors and exception mode commands (%colors/%xmode) have been
2067 2072 synchronized to also take this into account, so users can get
2068 2073 verbose exceptions for their threaded code as well. I also added
2069 2074 support for activating pdb inside this exception handler as well,
2070 2075 so now GUI authors can use IPython's enhanced pdb at runtime.
2071 2076
2072 2077 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
2073 2078 true by default, and add it to the shipped ipythonrc file. Since
2074 2079 this asks the user before proceeding, I think it's OK to make it
2075 2080 true by default.
2076 2081
2077 2082 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
2078 2083 of the previous special-casing of input in the eval loop. I think
2079 2084 this is cleaner, as they really are commands and shouldn't have
2080 2085 a special role in the middle of the core code.
2081 2086
2082 2087 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
2083 2088
2084 2089 * IPython/iplib.py (edit_syntax_error): added support for
2085 2090 automatically reopening the editor if the file had a syntax error
2086 2091 in it. Thanks to scottt who provided the patch at:
2087 2092 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
2088 2093 version committed).
2089 2094
2090 2095 * IPython/iplib.py (handle_normal): add suport for multi-line
2091 2096 input with emtpy lines. This fixes
2092 2097 http://www.scipy.net/roundup/ipython/issue43 and a similar
2093 2098 discussion on the user list.
2094 2099
2095 2100 WARNING: a behavior change is necessarily introduced to support
2096 2101 blank lines: now a single blank line with whitespace does NOT
2097 2102 break the input loop, which means that when autoindent is on, by
2098 2103 default hitting return on the next (indented) line does NOT exit.
2099 2104
2100 2105 Instead, to exit a multiline input you can either have:
2101 2106
2102 2107 - TWO whitespace lines (just hit return again), or
2103 2108 - a single whitespace line of a different length than provided
2104 2109 by the autoindent (add or remove a space).
2105 2110
2106 2111 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
2107 2112 module to better organize all readline-related functionality.
2108 2113 I've deleted FlexCompleter and put all completion clases here.
2109 2114
2110 2115 * IPython/iplib.py (raw_input): improve indentation management.
2111 2116 It is now possible to paste indented code with autoindent on, and
2112 2117 the code is interpreted correctly (though it still looks bad on
2113 2118 screen, due to the line-oriented nature of ipython).
2114 2119 (MagicCompleter.complete): change behavior so that a TAB key on an
2115 2120 otherwise empty line actually inserts a tab, instead of completing
2116 2121 on the entire global namespace. This makes it easier to use the
2117 2122 TAB key for indentation. After a request by Hans Meine
2118 2123 <hans_meine-AT-gmx.net>
2119 2124 (_prefilter): add support so that typing plain 'exit' or 'quit'
2120 2125 does a sensible thing. Originally I tried to deviate as little as
2121 2126 possible from the default python behavior, but even that one may
2122 2127 change in this direction (thread on python-dev to that effect).
2123 2128 Regardless, ipython should do the right thing even if CPython's
2124 2129 '>>>' prompt doesn't.
2125 2130 (InteractiveShell): removed subclassing code.InteractiveConsole
2126 2131 class. By now we'd overridden just about all of its methods: I've
2127 2132 copied the remaining two over, and now ipython is a standalone
2128 2133 class. This will provide a clearer picture for the chainsaw
2129 2134 branch refactoring.
2130 2135
2131 2136 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
2132 2137
2133 2138 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
2134 2139 failures for objects which break when dir() is called on them.
2135 2140
2136 2141 * IPython/FlexCompleter.py (Completer.__init__): Added support for
2137 2142 distinct local and global namespaces in the completer API. This
2138 2143 change allows us to properly handle completion with distinct
2139 2144 scopes, including in embedded instances (this had never really
2140 2145 worked correctly).
2141 2146
2142 2147 Note: this introduces a change in the constructor for
2143 2148 MagicCompleter, as a new global_namespace parameter is now the
2144 2149 second argument (the others were bumped one position).
2145 2150
2146 2151 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
2147 2152
2148 2153 * IPython/iplib.py (embed_mainloop): fix tab-completion in
2149 2154 embedded instances (which can be done now thanks to Vivian's
2150 2155 frame-handling fixes for pdb).
2151 2156 (InteractiveShell.__init__): Fix namespace handling problem in
2152 2157 embedded instances. We were overwriting __main__ unconditionally,
2153 2158 and this should only be done for 'full' (non-embedded) IPython;
2154 2159 embedded instances must respect the caller's __main__. Thanks to
2155 2160 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
2156 2161
2157 2162 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
2158 2163
2159 2164 * setup.py: added download_url to setup(). This registers the
2160 2165 download address at PyPI, which is not only useful to humans
2161 2166 browsing the site, but is also picked up by setuptools (the Eggs
2162 2167 machinery). Thanks to Ville and R. Kern for the info/discussion
2163 2168 on this.
2164 2169
2165 2170 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
2166 2171
2167 2172 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
2168 2173 This brings a lot of nice functionality to the pdb mode, which now
2169 2174 has tab-completion, syntax highlighting, and better stack handling
2170 2175 than before. Many thanks to Vivian De Smedt
2171 2176 <vivian-AT-vdesmedt.com> for the original patches.
2172 2177
2173 2178 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
2174 2179
2175 2180 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
2176 2181 sequence to consistently accept the banner argument. The
2177 2182 inconsistency was tripping SAGE, thanks to Gary Zablackis
2178 2183 <gzabl-AT-yahoo.com> for the report.
2179 2184
2180 2185 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2181 2186
2182 2187 * IPython/iplib.py (InteractiveShell.post_config_initialization):
2183 2188 Fix bug where a naked 'alias' call in the ipythonrc file would
2184 2189 cause a crash. Bug reported by Jorgen Stenarson.
2185 2190
2186 2191 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
2187 2192
2188 2193 * IPython/ipmaker.py (make_IPython): cleanups which should improve
2189 2194 startup time.
2190 2195
2191 2196 * IPython/iplib.py (runcode): my globals 'fix' for embedded
2192 2197 instances had introduced a bug with globals in normal code. Now
2193 2198 it's working in all cases.
2194 2199
2195 2200 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
2196 2201 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
2197 2202 has been introduced to set the default case sensitivity of the
2198 2203 searches. Users can still select either mode at runtime on a
2199 2204 per-search basis.
2200 2205
2201 2206 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
2202 2207
2203 2208 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
2204 2209 attributes in wildcard searches for subclasses. Modified version
2205 2210 of a patch by Jorgen.
2206 2211
2207 2212 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
2208 2213
2209 2214 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
2210 2215 embedded instances. I added a user_global_ns attribute to the
2211 2216 InteractiveShell class to handle this.
2212 2217
2213 2218 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
2214 2219
2215 2220 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
2216 2221 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
2217 2222 (reported under win32, but may happen also in other platforms).
2218 2223 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
2219 2224
2220 2225 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
2221 2226
2222 2227 * IPython/Magic.py (magic_psearch): new support for wildcard
2223 2228 patterns. Now, typing ?a*b will list all names which begin with a
2224 2229 and end in b, for example. The %psearch magic has full
2225 2230 docstrings. Many thanks to JΓΆrgen Stenarson
2226 2231 <jorgen.stenarson-AT-bostream.nu>, author of the patches
2227 2232 implementing this functionality.
2228 2233
2229 2234 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2230 2235
2231 2236 * Manual: fixed long-standing annoyance of double-dashes (as in
2232 2237 --prefix=~, for example) being stripped in the HTML version. This
2233 2238 is a latex2html bug, but a workaround was provided. Many thanks
2234 2239 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
2235 2240 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
2236 2241 rolling. This seemingly small issue had tripped a number of users
2237 2242 when first installing, so I'm glad to see it gone.
2238 2243
2239 2244 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
2240 2245
2241 2246 * IPython/Extensions/numeric_formats.py: fix missing import,
2242 2247 reported by Stephen Walton.
2243 2248
2244 2249 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
2245 2250
2246 2251 * IPython/demo.py: finish demo module, fully documented now.
2247 2252
2248 2253 * IPython/genutils.py (file_read): simple little utility to read a
2249 2254 file and ensure it's closed afterwards.
2250 2255
2251 2256 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
2252 2257
2253 2258 * IPython/demo.py (Demo.__init__): added support for individually
2254 2259 tagging blocks for automatic execution.
2255 2260
2256 2261 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
2257 2262 syntax-highlighted python sources, requested by John.
2258 2263
2259 2264 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
2260 2265
2261 2266 * IPython/demo.py (Demo.again): fix bug where again() blocks after
2262 2267 finishing.
2263 2268
2264 2269 * IPython/genutils.py (shlex_split): moved from Magic to here,
2265 2270 where all 2.2 compatibility stuff lives. I needed it for demo.py.
2266 2271
2267 2272 * IPython/demo.py (Demo.__init__): added support for silent
2268 2273 blocks, improved marks as regexps, docstrings written.
2269 2274 (Demo.__init__): better docstring, added support for sys.argv.
2270 2275
2271 2276 * IPython/genutils.py (marquee): little utility used by the demo
2272 2277 code, handy in general.
2273 2278
2274 2279 * IPython/demo.py (Demo.__init__): new class for interactive
2275 2280 demos. Not documented yet, I just wrote it in a hurry for
2276 2281 scipy'05. Will docstring later.
2277 2282
2278 2283 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
2279 2284
2280 2285 * IPython/Shell.py (sigint_handler): Drastic simplification which
2281 2286 also seems to make Ctrl-C work correctly across threads! This is
2282 2287 so simple, that I can't beleive I'd missed it before. Needs more
2283 2288 testing, though.
2284 2289 (KBINT): Never mind, revert changes. I'm sure I'd tried something
2285 2290 like this before...
2286 2291
2287 2292 * IPython/genutils.py (get_home_dir): add protection against
2288 2293 non-dirs in win32 registry.
2289 2294
2290 2295 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
2291 2296 bug where dict was mutated while iterating (pysh crash).
2292 2297
2293 2298 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2294 2299
2295 2300 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
2296 2301 spurious newlines added by this routine. After a report by
2297 2302 F. Mantegazza.
2298 2303
2299 2304 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2300 2305
2301 2306 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
2302 2307 calls. These were a leftover from the GTK 1.x days, and can cause
2303 2308 problems in certain cases (after a report by John Hunter).
2304 2309
2305 2310 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
2306 2311 os.getcwd() fails at init time. Thanks to patch from David Remahl
2307 2312 <chmod007-AT-mac.com>.
2308 2313 (InteractiveShell.__init__): prevent certain special magics from
2309 2314 being shadowed by aliases. Closes
2310 2315 http://www.scipy.net/roundup/ipython/issue41.
2311 2316
2312 2317 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
2313 2318
2314 2319 * IPython/iplib.py (InteractiveShell.complete): Added new
2315 2320 top-level completion method to expose the completion mechanism
2316 2321 beyond readline-based environments.
2317 2322
2318 2323 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
2319 2324
2320 2325 * tools/ipsvnc (svnversion): fix svnversion capture.
2321 2326
2322 2327 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
2323 2328 attribute to self, which was missing. Before, it was set by a
2324 2329 routine which in certain cases wasn't being called, so the
2325 2330 instance could end up missing the attribute. This caused a crash.
2326 2331 Closes http://www.scipy.net/roundup/ipython/issue40.
2327 2332
2328 2333 2005-08-16 Fernando Perez <fperez@colorado.edu>
2329 2334
2330 2335 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
2331 2336 contains non-string attribute. Closes
2332 2337 http://www.scipy.net/roundup/ipython/issue38.
2333 2338
2334 2339 2005-08-14 Fernando Perez <fperez@colorado.edu>
2335 2340
2336 2341 * tools/ipsvnc: Minor improvements, to add changeset info.
2337 2342
2338 2343 2005-08-12 Fernando Perez <fperez@colorado.edu>
2339 2344
2340 2345 * IPython/iplib.py (runsource): remove self.code_to_run_src
2341 2346 attribute. I realized this is nothing more than
2342 2347 '\n'.join(self.buffer), and having the same data in two different
2343 2348 places is just asking for synchronization bugs. This may impact
2344 2349 people who have custom exception handlers, so I need to warn
2345 2350 ipython-dev about it (F. Mantegazza may use them).
2346 2351
2347 2352 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
2348 2353
2349 2354 * IPython/genutils.py: fix 2.2 compatibility (generators)
2350 2355
2351 2356 2005-07-18 Fernando Perez <fperez@colorado.edu>
2352 2357
2353 2358 * IPython/genutils.py (get_home_dir): fix to help users with
2354 2359 invalid $HOME under win32.
2355 2360
2356 2361 2005-07-17 Fernando Perez <fperez@colorado.edu>
2357 2362
2358 2363 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
2359 2364 some old hacks and clean up a bit other routines; code should be
2360 2365 simpler and a bit faster.
2361 2366
2362 2367 * IPython/iplib.py (interact): removed some last-resort attempts
2363 2368 to survive broken stdout/stderr. That code was only making it
2364 2369 harder to abstract out the i/o (necessary for gui integration),
2365 2370 and the crashes it could prevent were extremely rare in practice
2366 2371 (besides being fully user-induced in a pretty violent manner).
2367 2372
2368 2373 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
2369 2374 Nothing major yet, but the code is simpler to read; this should
2370 2375 make it easier to do more serious modifications in the future.
2371 2376
2372 2377 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
2373 2378 which broke in .15 (thanks to a report by Ville).
2374 2379
2375 2380 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
2376 2381 be quite correct, I know next to nothing about unicode). This
2377 2382 will allow unicode strings to be used in prompts, amongst other
2378 2383 cases. It also will prevent ipython from crashing when unicode
2379 2384 shows up unexpectedly in many places. If ascii encoding fails, we
2380 2385 assume utf_8. Currently the encoding is not a user-visible
2381 2386 setting, though it could be made so if there is demand for it.
2382 2387
2383 2388 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
2384 2389
2385 2390 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
2386 2391
2387 2392 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
2388 2393
2389 2394 * IPython/genutils.py: Add 2.2 compatibility here, so all other
2390 2395 code can work transparently for 2.2/2.3.
2391 2396
2392 2397 2005-07-16 Fernando Perez <fperez@colorado.edu>
2393 2398
2394 2399 * IPython/ultraTB.py (ExceptionColors): Make a global variable
2395 2400 out of the color scheme table used for coloring exception
2396 2401 tracebacks. This allows user code to add new schemes at runtime.
2397 2402 This is a minimally modified version of the patch at
2398 2403 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
2399 2404 for the contribution.
2400 2405
2401 2406 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
2402 2407 slightly modified version of the patch in
2403 2408 http://www.scipy.net/roundup/ipython/issue34, which also allows me
2404 2409 to remove the previous try/except solution (which was costlier).
2405 2410 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
2406 2411
2407 2412 2005-06-08 Fernando Perez <fperez@colorado.edu>
2408 2413
2409 2414 * IPython/iplib.py (write/write_err): Add methods to abstract all
2410 2415 I/O a bit more.
2411 2416
2412 2417 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
2413 2418 warning, reported by Aric Hagberg, fix by JD Hunter.
2414 2419
2415 2420 2005-06-02 *** Released version 0.6.15
2416 2421
2417 2422 2005-06-01 Fernando Perez <fperez@colorado.edu>
2418 2423
2419 2424 * IPython/iplib.py (MagicCompleter.file_matches): Fix
2420 2425 tab-completion of filenames within open-quoted strings. Note that
2421 2426 this requires that in ~/.ipython/ipythonrc, users change the
2422 2427 readline delimiters configuration to read:
2423 2428
2424 2429 readline_remove_delims -/~
2425 2430
2426 2431
2427 2432 2005-05-31 *** Released version 0.6.14
2428 2433
2429 2434 2005-05-29 Fernando Perez <fperez@colorado.edu>
2430 2435
2431 2436 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
2432 2437 with files not on the filesystem. Reported by Eliyahu Sandler
2433 2438 <eli@gondolin.net>
2434 2439
2435 2440 2005-05-22 Fernando Perez <fperez@colorado.edu>
2436 2441
2437 2442 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
2438 2443 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
2439 2444
2440 2445 2005-05-19 Fernando Perez <fperez@colorado.edu>
2441 2446
2442 2447 * IPython/iplib.py (safe_execfile): close a file which could be
2443 2448 left open (causing problems in win32, which locks open files).
2444 2449 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
2445 2450
2446 2451 2005-05-18 Fernando Perez <fperez@colorado.edu>
2447 2452
2448 2453 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
2449 2454 keyword arguments correctly to safe_execfile().
2450 2455
2451 2456 2005-05-13 Fernando Perez <fperez@colorado.edu>
2452 2457
2453 2458 * ipython.1: Added info about Qt to manpage, and threads warning
2454 2459 to usage page (invoked with --help).
2455 2460
2456 2461 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
2457 2462 new matcher (it goes at the end of the priority list) to do
2458 2463 tab-completion on named function arguments. Submitted by George
2459 2464 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
2460 2465 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
2461 2466 for more details.
2462 2467
2463 2468 * IPython/Magic.py (magic_run): Added new -e flag to ignore
2464 2469 SystemExit exceptions in the script being run. Thanks to a report
2465 2470 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
2466 2471 producing very annoying behavior when running unit tests.
2467 2472
2468 2473 2005-05-12 Fernando Perez <fperez@colorado.edu>
2469 2474
2470 2475 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
2471 2476 which I'd broken (again) due to a changed regexp. In the process,
2472 2477 added ';' as an escape to auto-quote the whole line without
2473 2478 splitting its arguments. Thanks to a report by Jerry McRae
2474 2479 <qrs0xyc02-AT-sneakemail.com>.
2475 2480
2476 2481 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
2477 2482 possible crashes caused by a TokenError. Reported by Ed Schofield
2478 2483 <schofield-AT-ftw.at>.
2479 2484
2480 2485 2005-05-06 Fernando Perez <fperez@colorado.edu>
2481 2486
2482 2487 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
2483 2488
2484 2489 2005-04-29 Fernando Perez <fperez@colorado.edu>
2485 2490
2486 2491 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
2487 2492 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
2488 2493 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
2489 2494 which provides support for Qt interactive usage (similar to the
2490 2495 existing one for WX and GTK). This had been often requested.
2491 2496
2492 2497 2005-04-14 *** Released version 0.6.13
2493 2498
2494 2499 2005-04-08 Fernando Perez <fperez@colorado.edu>
2495 2500
2496 2501 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
2497 2502 from _ofind, which gets called on almost every input line. Now,
2498 2503 we only try to get docstrings if they are actually going to be
2499 2504 used (the overhead of fetching unnecessary docstrings can be
2500 2505 noticeable for certain objects, such as Pyro proxies).
2501 2506
2502 2507 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
2503 2508 for completers. For some reason I had been passing them the state
2504 2509 variable, which completers never actually need, and was in
2505 2510 conflict with the rlcompleter API. Custom completers ONLY need to
2506 2511 take the text parameter.
2507 2512
2508 2513 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
2509 2514 work correctly in pysh. I've also moved all the logic which used
2510 2515 to be in pysh.py here, which will prevent problems with future
2511 2516 upgrades. However, this time I must warn users to update their
2512 2517 pysh profile to include the line
2513 2518
2514 2519 import_all IPython.Extensions.InterpreterExec
2515 2520
2516 2521 because otherwise things won't work for them. They MUST also
2517 2522 delete pysh.py and the line
2518 2523
2519 2524 execfile pysh.py
2520 2525
2521 2526 from their ipythonrc-pysh.
2522 2527
2523 2528 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
2524 2529 robust in the face of objects whose dir() returns non-strings
2525 2530 (which it shouldn't, but some broken libs like ITK do). Thanks to
2526 2531 a patch by John Hunter (implemented differently, though). Also
2527 2532 minor improvements by using .extend instead of + on lists.
2528 2533
2529 2534 * pysh.py:
2530 2535
2531 2536 2005-04-06 Fernando Perez <fperez@colorado.edu>
2532 2537
2533 2538 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
2534 2539 by default, so that all users benefit from it. Those who don't
2535 2540 want it can still turn it off.
2536 2541
2537 2542 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
2538 2543 config file, I'd forgotten about this, so users were getting it
2539 2544 off by default.
2540 2545
2541 2546 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
2542 2547 consistency. Now magics can be called in multiline statements,
2543 2548 and python variables can be expanded in magic calls via $var.
2544 2549 This makes the magic system behave just like aliases or !system
2545 2550 calls.
2546 2551
2547 2552 2005-03-28 Fernando Perez <fperez@colorado.edu>
2548 2553
2549 2554 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
2550 2555 expensive string additions for building command. Add support for
2551 2556 trailing ';' when autocall is used.
2552 2557
2553 2558 2005-03-26 Fernando Perez <fperez@colorado.edu>
2554 2559
2555 2560 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
2556 2561 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
2557 2562 ipython.el robust against prompts with any number of spaces
2558 2563 (including 0) after the ':' character.
2559 2564
2560 2565 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
2561 2566 continuation prompt, which misled users to think the line was
2562 2567 already indented. Closes debian Bug#300847, reported to me by
2563 2568 Norbert Tretkowski <tretkowski-AT-inittab.de>.
2564 2569
2565 2570 2005-03-23 Fernando Perez <fperez@colorado.edu>
2566 2571
2567 2572 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
2568 2573 properly aligned if they have embedded newlines.
2569 2574
2570 2575 * IPython/iplib.py (runlines): Add a public method to expose
2571 2576 IPython's code execution machinery, so that users can run strings
2572 2577 as if they had been typed at the prompt interactively.
2573 2578 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
2574 2579 methods which can call the system shell, but with python variable
2575 2580 expansion. The three such methods are: __IPYTHON__.system,
2576 2581 .getoutput and .getoutputerror. These need to be documented in a
2577 2582 'public API' section (to be written) of the manual.
2578 2583
2579 2584 2005-03-20 Fernando Perez <fperez@colorado.edu>
2580 2585
2581 2586 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
2582 2587 for custom exception handling. This is quite powerful, and it
2583 2588 allows for user-installable exception handlers which can trap
2584 2589 custom exceptions at runtime and treat them separately from
2585 2590 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
2586 2591 Mantegazza <mantegazza-AT-ill.fr>.
2587 2592 (InteractiveShell.set_custom_completer): public API function to
2588 2593 add new completers at runtime.
2589 2594
2590 2595 2005-03-19 Fernando Perez <fperez@colorado.edu>
2591 2596
2592 2597 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
2593 2598 allow objects which provide their docstrings via non-standard
2594 2599 mechanisms (like Pyro proxies) to still be inspected by ipython's
2595 2600 ? system.
2596 2601
2597 2602 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
2598 2603 automatic capture system. I tried quite hard to make it work
2599 2604 reliably, and simply failed. I tried many combinations with the
2600 2605 subprocess module, but eventually nothing worked in all needed
2601 2606 cases (not blocking stdin for the child, duplicating stdout
2602 2607 without blocking, etc). The new %sc/%sx still do capture to these
2603 2608 magical list/string objects which make shell use much more
2604 2609 conveninent, so not all is lost.
2605 2610
2606 2611 XXX - FIX MANUAL for the change above!
2607 2612
2608 2613 (runsource): I copied code.py's runsource() into ipython to modify
2609 2614 it a bit. Now the code object and source to be executed are
2610 2615 stored in ipython. This makes this info accessible to third-party
2611 2616 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
2612 2617 Mantegazza <mantegazza-AT-ill.fr>.
2613 2618
2614 2619 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
2615 2620 history-search via readline (like C-p/C-n). I'd wanted this for a
2616 2621 long time, but only recently found out how to do it. For users
2617 2622 who already have their ipythonrc files made and want this, just
2618 2623 add:
2619 2624
2620 2625 readline_parse_and_bind "\e[A": history-search-backward
2621 2626 readline_parse_and_bind "\e[B": history-search-forward
2622 2627
2623 2628 2005-03-18 Fernando Perez <fperez@colorado.edu>
2624 2629
2625 2630 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
2626 2631 LSString and SList classes which allow transparent conversions
2627 2632 between list mode and whitespace-separated string.
2628 2633 (magic_r): Fix recursion problem in %r.
2629 2634
2630 2635 * IPython/genutils.py (LSString): New class to be used for
2631 2636 automatic storage of the results of all alias/system calls in _o
2632 2637 and _e (stdout/err). These provide a .l/.list attribute which
2633 2638 does automatic splitting on newlines. This means that for most
2634 2639 uses, you'll never need to do capturing of output with %sc/%sx
2635 2640 anymore, since ipython keeps this always done for you. Note that
2636 2641 only the LAST results are stored, the _o/e variables are
2637 2642 overwritten on each call. If you need to save their contents
2638 2643 further, simply bind them to any other name.
2639 2644
2640 2645 2005-03-17 Fernando Perez <fperez@colorado.edu>
2641 2646
2642 2647 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
2643 2648 prompt namespace handling.
2644 2649
2645 2650 2005-03-16 Fernando Perez <fperez@colorado.edu>
2646 2651
2647 2652 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
2648 2653 classic prompts to be '>>> ' (final space was missing, and it
2649 2654 trips the emacs python mode).
2650 2655 (BasePrompt.__str__): Added safe support for dynamic prompt
2651 2656 strings. Now you can set your prompt string to be '$x', and the
2652 2657 value of x will be printed from your interactive namespace. The
2653 2658 interpolation syntax includes the full Itpl support, so
2654 2659 ${foo()+x+bar()} is a valid prompt string now, and the function
2655 2660 calls will be made at runtime.
2656 2661
2657 2662 2005-03-15 Fernando Perez <fperez@colorado.edu>
2658 2663
2659 2664 * IPython/Magic.py (magic_history): renamed %hist to %history, to
2660 2665 avoid name clashes in pylab. %hist still works, it just forwards
2661 2666 the call to %history.
2662 2667
2663 2668 2005-03-02 *** Released version 0.6.12
2664 2669
2665 2670 2005-03-02 Fernando Perez <fperez@colorado.edu>
2666 2671
2667 2672 * IPython/iplib.py (handle_magic): log magic calls properly as
2668 2673 ipmagic() function calls.
2669 2674
2670 2675 * IPython/Magic.py (magic_time): Improved %time to support
2671 2676 statements and provide wall-clock as well as CPU time.
2672 2677
2673 2678 2005-02-27 Fernando Perez <fperez@colorado.edu>
2674 2679
2675 2680 * IPython/hooks.py: New hooks module, to expose user-modifiable
2676 2681 IPython functionality in a clean manner. For now only the editor
2677 2682 hook is actually written, and other thigns which I intend to turn
2678 2683 into proper hooks aren't yet there. The display and prefilter
2679 2684 stuff, for example, should be hooks. But at least now the
2680 2685 framework is in place, and the rest can be moved here with more
2681 2686 time later. IPython had had a .hooks variable for a long time for
2682 2687 this purpose, but I'd never actually used it for anything.
2683 2688
2684 2689 2005-02-26 Fernando Perez <fperez@colorado.edu>
2685 2690
2686 2691 * IPython/ipmaker.py (make_IPython): make the default ipython
2687 2692 directory be called _ipython under win32, to follow more the
2688 2693 naming peculiarities of that platform (where buggy software like
2689 2694 Visual Sourcesafe breaks with .named directories). Reported by
2690 2695 Ville Vainio.
2691 2696
2692 2697 2005-02-23 Fernando Perez <fperez@colorado.edu>
2693 2698
2694 2699 * IPython/iplib.py (InteractiveShell.__init__): removed a few
2695 2700 auto_aliases for win32 which were causing problems. Users can
2696 2701 define the ones they personally like.
2697 2702
2698 2703 2005-02-21 Fernando Perez <fperez@colorado.edu>
2699 2704
2700 2705 * IPython/Magic.py (magic_time): new magic to time execution of
2701 2706 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
2702 2707
2703 2708 2005-02-19 Fernando Perez <fperez@colorado.edu>
2704 2709
2705 2710 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
2706 2711 into keys (for prompts, for example).
2707 2712
2708 2713 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
2709 2714 prompts in case users want them. This introduces a small behavior
2710 2715 change: ipython does not automatically add a space to all prompts
2711 2716 anymore. To get the old prompts with a space, users should add it
2712 2717 manually to their ipythonrc file, so for example prompt_in1 should
2713 2718 now read 'In [\#]: ' instead of 'In [\#]:'.
2714 2719 (BasePrompt.__init__): New option prompts_pad_left (only in rc
2715 2720 file) to control left-padding of secondary prompts.
2716 2721
2717 2722 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
2718 2723 the profiler can't be imported. Fix for Debian, which removed
2719 2724 profile.py because of License issues. I applied a slightly
2720 2725 modified version of the original Debian patch at
2721 2726 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
2722 2727
2723 2728 2005-02-17 Fernando Perez <fperez@colorado.edu>
2724 2729
2725 2730 * IPython/genutils.py (native_line_ends): Fix bug which would
2726 2731 cause improper line-ends under win32 b/c I was not opening files
2727 2732 in binary mode. Bug report and fix thanks to Ville.
2728 2733
2729 2734 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
2730 2735 trying to catch spurious foo[1] autocalls. My fix actually broke
2731 2736 ',/' autoquote/call with explicit escape (bad regexp).
2732 2737
2733 2738 2005-02-15 *** Released version 0.6.11
2734 2739
2735 2740 2005-02-14 Fernando Perez <fperez@colorado.edu>
2736 2741
2737 2742 * IPython/background_jobs.py: New background job management
2738 2743 subsystem. This is implemented via a new set of classes, and
2739 2744 IPython now provides a builtin 'jobs' object for background job
2740 2745 execution. A convenience %bg magic serves as a lightweight
2741 2746 frontend for starting the more common type of calls. This was
2742 2747 inspired by discussions with B. Granger and the BackgroundCommand
2743 2748 class described in the book Python Scripting for Computational
2744 2749 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
2745 2750 (although ultimately no code from this text was used, as IPython's
2746 2751 system is a separate implementation).
2747 2752
2748 2753 * IPython/iplib.py (MagicCompleter.python_matches): add new option
2749 2754 to control the completion of single/double underscore names
2750 2755 separately. As documented in the example ipytonrc file, the
2751 2756 readline_omit__names variable can now be set to 2, to omit even
2752 2757 single underscore names. Thanks to a patch by Brian Wong
2753 2758 <BrianWong-AT-AirgoNetworks.Com>.
2754 2759 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
2755 2760 be autocalled as foo([1]) if foo were callable. A problem for
2756 2761 things which are both callable and implement __getitem__.
2757 2762 (init_readline): Fix autoindentation for win32. Thanks to a patch
2758 2763 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
2759 2764
2760 2765 2005-02-12 Fernando Perez <fperez@colorado.edu>
2761 2766
2762 2767 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
2763 2768 which I had written long ago to sort out user error messages which
2764 2769 may occur during startup. This seemed like a good idea initially,
2765 2770 but it has proven a disaster in retrospect. I don't want to
2766 2771 change much code for now, so my fix is to set the internal 'debug'
2767 2772 flag to true everywhere, whose only job was precisely to control
2768 2773 this subsystem. This closes issue 28 (as well as avoiding all
2769 2774 sorts of strange hangups which occur from time to time).
2770 2775
2771 2776 2005-02-07 Fernando Perez <fperez@colorado.edu>
2772 2777
2773 2778 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
2774 2779 previous call produced a syntax error.
2775 2780
2776 2781 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2777 2782 classes without constructor.
2778 2783
2779 2784 2005-02-06 Fernando Perez <fperez@colorado.edu>
2780 2785
2781 2786 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
2782 2787 completions with the results of each matcher, so we return results
2783 2788 to the user from all namespaces. This breaks with ipython
2784 2789 tradition, but I think it's a nicer behavior. Now you get all
2785 2790 possible completions listed, from all possible namespaces (python,
2786 2791 filesystem, magics...) After a request by John Hunter
2787 2792 <jdhunter-AT-nitace.bsd.uchicago.edu>.
2788 2793
2789 2794 2005-02-05 Fernando Perez <fperez@colorado.edu>
2790 2795
2791 2796 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
2792 2797 the call had quote characters in it (the quotes were stripped).
2793 2798
2794 2799 2005-01-31 Fernando Perez <fperez@colorado.edu>
2795 2800
2796 2801 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
2797 2802 Itpl.itpl() to make the code more robust against psyco
2798 2803 optimizations.
2799 2804
2800 2805 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
2801 2806 of causing an exception. Quicker, cleaner.
2802 2807
2803 2808 2005-01-28 Fernando Perez <fperez@colorado.edu>
2804 2809
2805 2810 * scripts/ipython_win_post_install.py (install): hardcode
2806 2811 sys.prefix+'python.exe' as the executable path. It turns out that
2807 2812 during the post-installation run, sys.executable resolves to the
2808 2813 name of the binary installer! I should report this as a distutils
2809 2814 bug, I think. I updated the .10 release with this tiny fix, to
2810 2815 avoid annoying the lists further.
2811 2816
2812 2817 2005-01-27 *** Released version 0.6.10
2813 2818
2814 2819 2005-01-27 Fernando Perez <fperez@colorado.edu>
2815 2820
2816 2821 * IPython/numutils.py (norm): Added 'inf' as optional name for
2817 2822 L-infinity norm, included references to mathworld.com for vector
2818 2823 norm definitions.
2819 2824 (amin/amax): added amin/amax for array min/max. Similar to what
2820 2825 pylab ships with after the recent reorganization of names.
2821 2826 (spike/spike_odd): removed deprecated spike/spike_odd functions.
2822 2827
2823 2828 * ipython.el: committed Alex's recent fixes and improvements.
2824 2829 Tested with python-mode from CVS, and it looks excellent. Since
2825 2830 python-mode hasn't released anything in a while, I'm temporarily
2826 2831 putting a copy of today's CVS (v 4.70) of python-mode in:
2827 2832 http://ipython.scipy.org/tmp/python-mode.el
2828 2833
2829 2834 * scripts/ipython_win_post_install.py (install): Win32 fix to use
2830 2835 sys.executable for the executable name, instead of assuming it's
2831 2836 called 'python.exe' (the post-installer would have produced broken
2832 2837 setups on systems with a differently named python binary).
2833 2838
2834 2839 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
2835 2840 references to os.linesep, to make the code more
2836 2841 platform-independent. This is also part of the win32 coloring
2837 2842 fixes.
2838 2843
2839 2844 * IPython/genutils.py (page_dumb): Remove attempts to chop long
2840 2845 lines, which actually cause coloring bugs because the length of
2841 2846 the line is very difficult to correctly compute with embedded
2842 2847 escapes. This was the source of all the coloring problems under
2843 2848 Win32. I think that _finally_, Win32 users have a properly
2844 2849 working ipython in all respects. This would never have happened
2845 2850 if not for Gary Bishop and Viktor Ransmayr's great help and work.
2846 2851
2847 2852 2005-01-26 *** Released version 0.6.9
2848 2853
2849 2854 2005-01-25 Fernando Perez <fperez@colorado.edu>
2850 2855
2851 2856 * setup.py: finally, we have a true Windows installer, thanks to
2852 2857 the excellent work of Viktor Ransmayr
2853 2858 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
2854 2859 Windows users. The setup routine is quite a bit cleaner thanks to
2855 2860 this, and the post-install script uses the proper functions to
2856 2861 allow a clean de-installation using the standard Windows Control
2857 2862 Panel.
2858 2863
2859 2864 * IPython/genutils.py (get_home_dir): changed to use the $HOME
2860 2865 environment variable under all OSes (including win32) if
2861 2866 available. This will give consistency to win32 users who have set
2862 2867 this variable for any reason. If os.environ['HOME'] fails, the
2863 2868 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
2864 2869
2865 2870 2005-01-24 Fernando Perez <fperez@colorado.edu>
2866 2871
2867 2872 * IPython/numutils.py (empty_like): add empty_like(), similar to
2868 2873 zeros_like() but taking advantage of the new empty() Numeric routine.
2869 2874
2870 2875 2005-01-23 *** Released version 0.6.8
2871 2876
2872 2877 2005-01-22 Fernando Perez <fperez@colorado.edu>
2873 2878
2874 2879 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
2875 2880 automatic show() calls. After discussing things with JDH, it
2876 2881 turns out there are too many corner cases where this can go wrong.
2877 2882 It's best not to try to be 'too smart', and simply have ipython
2878 2883 reproduce as much as possible the default behavior of a normal
2879 2884 python shell.
2880 2885
2881 2886 * IPython/iplib.py (InteractiveShell.__init__): Modified the
2882 2887 line-splitting regexp and _prefilter() to avoid calling getattr()
2883 2888 on assignments. This closes
2884 2889 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
2885 2890 readline uses getattr(), so a simple <TAB> keypress is still
2886 2891 enough to trigger getattr() calls on an object.
2887 2892
2888 2893 2005-01-21 Fernando Perez <fperez@colorado.edu>
2889 2894
2890 2895 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
2891 2896 docstring under pylab so it doesn't mask the original.
2892 2897
2893 2898 2005-01-21 *** Released version 0.6.7
2894 2899
2895 2900 2005-01-21 Fernando Perez <fperez@colorado.edu>
2896 2901
2897 2902 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
2898 2903 signal handling for win32 users in multithreaded mode.
2899 2904
2900 2905 2005-01-17 Fernando Perez <fperez@colorado.edu>
2901 2906
2902 2907 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
2903 2908 instances with no __init__. After a crash report by Norbert Nemec
2904 2909 <Norbert-AT-nemec-online.de>.
2905 2910
2906 2911 2005-01-14 Fernando Perez <fperez@colorado.edu>
2907 2912
2908 2913 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
2909 2914 names for verbose exceptions, when multiple dotted names and the
2910 2915 'parent' object were present on the same line.
2911 2916
2912 2917 2005-01-11 Fernando Perez <fperez@colorado.edu>
2913 2918
2914 2919 * IPython/genutils.py (flag_calls): new utility to trap and flag
2915 2920 calls in functions. I need it to clean up matplotlib support.
2916 2921 Also removed some deprecated code in genutils.
2917 2922
2918 2923 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
2919 2924 that matplotlib scripts called with %run, which don't call show()
2920 2925 themselves, still have their plotting windows open.
2921 2926
2922 2927 2005-01-05 Fernando Perez <fperez@colorado.edu>
2923 2928
2924 2929 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
2925 2930 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
2926 2931
2927 2932 2004-12-19 Fernando Perez <fperez@colorado.edu>
2928 2933
2929 2934 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
2930 2935 parent_runcode, which was an eyesore. The same result can be
2931 2936 obtained with Python's regular superclass mechanisms.
2932 2937
2933 2938 2004-12-17 Fernando Perez <fperez@colorado.edu>
2934 2939
2935 2940 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
2936 2941 reported by Prabhu.
2937 2942 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
2938 2943 sys.stderr) instead of explicitly calling sys.stderr. This helps
2939 2944 maintain our I/O abstractions clean, for future GUI embeddings.
2940 2945
2941 2946 * IPython/genutils.py (info): added new utility for sys.stderr
2942 2947 unified info message handling (thin wrapper around warn()).
2943 2948
2944 2949 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
2945 2950 composite (dotted) names on verbose exceptions.
2946 2951 (VerboseTB.nullrepr): harden against another kind of errors which
2947 2952 Python's inspect module can trigger, and which were crashing
2948 2953 IPython. Thanks to a report by Marco Lombardi
2949 2954 <mlombard-AT-ma010192.hq.eso.org>.
2950 2955
2951 2956 2004-12-13 *** Released version 0.6.6
2952 2957
2953 2958 2004-12-12 Fernando Perez <fperez@colorado.edu>
2954 2959
2955 2960 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
2956 2961 generated by pygtk upon initialization if it was built without
2957 2962 threads (for matplotlib users). After a crash reported by
2958 2963 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
2959 2964
2960 2965 * IPython/ipmaker.py (make_IPython): fix small bug in the
2961 2966 import_some parameter for multiple imports.
2962 2967
2963 2968 * IPython/iplib.py (ipmagic): simplified the interface of
2964 2969 ipmagic() to take a single string argument, just as it would be
2965 2970 typed at the IPython cmd line.
2966 2971 (ipalias): Added new ipalias() with an interface identical to
2967 2972 ipmagic(). This completes exposing a pure python interface to the
2968 2973 alias and magic system, which can be used in loops or more complex
2969 2974 code where IPython's automatic line mangling is not active.
2970 2975
2971 2976 * IPython/genutils.py (timing): changed interface of timing to
2972 2977 simply run code once, which is the most common case. timings()
2973 2978 remains unchanged, for the cases where you want multiple runs.
2974 2979
2975 2980 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
2976 2981 bug where Python2.2 crashes with exec'ing code which does not end
2977 2982 in a single newline. Python 2.3 is OK, so I hadn't noticed this
2978 2983 before.
2979 2984
2980 2985 2004-12-10 Fernando Perez <fperez@colorado.edu>
2981 2986
2982 2987 * IPython/Magic.py (Magic.magic_prun): changed name of option from
2983 2988 -t to -T, to accomodate the new -t flag in %run (the %run and
2984 2989 %prun options are kind of intermixed, and it's not easy to change
2985 2990 this with the limitations of python's getopt).
2986 2991
2987 2992 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
2988 2993 the execution of scripts. It's not as fine-tuned as timeit.py,
2989 2994 but it works from inside ipython (and under 2.2, which lacks
2990 2995 timeit.py). Optionally a number of runs > 1 can be given for
2991 2996 timing very short-running code.
2992 2997
2993 2998 * IPython/genutils.py (uniq_stable): new routine which returns a
2994 2999 list of unique elements in any iterable, but in stable order of
2995 3000 appearance. I needed this for the ultraTB fixes, and it's a handy
2996 3001 utility.
2997 3002
2998 3003 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
2999 3004 dotted names in Verbose exceptions. This had been broken since
3000 3005 the very start, now x.y will properly be printed in a Verbose
3001 3006 traceback, instead of x being shown and y appearing always as an
3002 3007 'undefined global'. Getting this to work was a bit tricky,
3003 3008 because by default python tokenizers are stateless. Saved by
3004 3009 python's ability to easily add a bit of state to an arbitrary
3005 3010 function (without needing to build a full-blown callable object).
3006 3011
3007 3012 Also big cleanup of this code, which had horrendous runtime
3008 3013 lookups of zillions of attributes for colorization. Moved all
3009 3014 this code into a few templates, which make it cleaner and quicker.
3010 3015
3011 3016 Printout quality was also improved for Verbose exceptions: one
3012 3017 variable per line, and memory addresses are printed (this can be
3013 3018 quite handy in nasty debugging situations, which is what Verbose
3014 3019 is for).
3015 3020
3016 3021 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
3017 3022 the command line as scripts to be loaded by embedded instances.
3018 3023 Doing so has the potential for an infinite recursion if there are
3019 3024 exceptions thrown in the process. This fixes a strange crash
3020 3025 reported by Philippe MULLER <muller-AT-irit.fr>.
3021 3026
3022 3027 2004-12-09 Fernando Perez <fperez@colorado.edu>
3023 3028
3024 3029 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
3025 3030 to reflect new names in matplotlib, which now expose the
3026 3031 matlab-compatible interface via a pylab module instead of the
3027 3032 'matlab' name. The new code is backwards compatible, so users of
3028 3033 all matplotlib versions are OK. Patch by J. Hunter.
3029 3034
3030 3035 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
3031 3036 of __init__ docstrings for instances (class docstrings are already
3032 3037 automatically printed). Instances with customized docstrings
3033 3038 (indep. of the class) are also recognized and all 3 separate
3034 3039 docstrings are printed (instance, class, constructor). After some
3035 3040 comments/suggestions by J. Hunter.
3036 3041
3037 3042 2004-12-05 Fernando Perez <fperez@colorado.edu>
3038 3043
3039 3044 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
3040 3045 warnings when tab-completion fails and triggers an exception.
3041 3046
3042 3047 2004-12-03 Fernando Perez <fperez@colorado.edu>
3043 3048
3044 3049 * IPython/Magic.py (magic_prun): Fix bug where an exception would
3045 3050 be triggered when using 'run -p'. An incorrect option flag was
3046 3051 being set ('d' instead of 'D').
3047 3052 (manpage): fix missing escaped \- sign.
3048 3053
3049 3054 2004-11-30 *** Released version 0.6.5
3050 3055
3051 3056 2004-11-30 Fernando Perez <fperez@colorado.edu>
3052 3057
3053 3058 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
3054 3059 setting with -d option.
3055 3060
3056 3061 * setup.py (docfiles): Fix problem where the doc glob I was using
3057 3062 was COMPLETELY BROKEN. It was giving the right files by pure
3058 3063 accident, but failed once I tried to include ipython.el. Note:
3059 3064 glob() does NOT allow you to do exclusion on multiple endings!
3060 3065
3061 3066 2004-11-29 Fernando Perez <fperez@colorado.edu>
3062 3067
3063 3068 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
3064 3069 the manpage as the source. Better formatting & consistency.
3065 3070
3066 3071 * IPython/Magic.py (magic_run): Added new -d option, to run
3067 3072 scripts under the control of the python pdb debugger. Note that
3068 3073 this required changing the %prun option -d to -D, to avoid a clash
3069 3074 (since %run must pass options to %prun, and getopt is too dumb to
3070 3075 handle options with string values with embedded spaces). Thanks
3071 3076 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
3072 3077 (magic_who_ls): added type matching to %who and %whos, so that one
3073 3078 can filter their output to only include variables of certain
3074 3079 types. Another suggestion by Matthew.
3075 3080 (magic_whos): Added memory summaries in kb and Mb for arrays.
3076 3081 (magic_who): Improve formatting (break lines every 9 vars).
3077 3082
3078 3083 2004-11-28 Fernando Perez <fperez@colorado.edu>
3079 3084
3080 3085 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
3081 3086 cache when empty lines were present.
3082 3087
3083 3088 2004-11-24 Fernando Perez <fperez@colorado.edu>
3084 3089
3085 3090 * IPython/usage.py (__doc__): document the re-activated threading
3086 3091 options for WX and GTK.
3087 3092
3088 3093 2004-11-23 Fernando Perez <fperez@colorado.edu>
3089 3094
3090 3095 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
3091 3096 the -wthread and -gthread options, along with a new -tk one to try
3092 3097 and coordinate Tk threading with wx/gtk. The tk support is very
3093 3098 platform dependent, since it seems to require Tcl and Tk to be
3094 3099 built with threads (Fedora1/2 appears NOT to have it, but in
3095 3100 Prabhu's Debian boxes it works OK). But even with some Tk
3096 3101 limitations, this is a great improvement.
3097 3102
3098 3103 * IPython/Prompts.py (prompt_specials_color): Added \t for time
3099 3104 info in user prompts. Patch by Prabhu.
3100 3105
3101 3106 2004-11-18 Fernando Perez <fperez@colorado.edu>
3102 3107
3103 3108 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
3104 3109 EOFErrors and bail, to avoid infinite loops if a non-terminating
3105 3110 file is fed into ipython. Patch submitted in issue 19 by user,
3106 3111 many thanks.
3107 3112
3108 3113 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
3109 3114 autoquote/parens in continuation prompts, which can cause lots of
3110 3115 problems. Closes roundup issue 20.
3111 3116
3112 3117 2004-11-17 Fernando Perez <fperez@colorado.edu>
3113 3118
3114 3119 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
3115 3120 reported as debian bug #280505. I'm not sure my local changelog
3116 3121 entry has the proper debian format (Jack?).
3117 3122
3118 3123 2004-11-08 *** Released version 0.6.4
3119 3124
3120 3125 2004-11-08 Fernando Perez <fperez@colorado.edu>
3121 3126
3122 3127 * IPython/iplib.py (init_readline): Fix exit message for Windows
3123 3128 when readline is active. Thanks to a report by Eric Jones
3124 3129 <eric-AT-enthought.com>.
3125 3130
3126 3131 2004-11-07 Fernando Perez <fperez@colorado.edu>
3127 3132
3128 3133 * IPython/genutils.py (page): Add a trap for OSError exceptions,
3129 3134 sometimes seen by win2k/cygwin users.
3130 3135
3131 3136 2004-11-06 Fernando Perez <fperez@colorado.edu>
3132 3137
3133 3138 * IPython/iplib.py (interact): Change the handling of %Exit from
3134 3139 trying to propagate a SystemExit to an internal ipython flag.
3135 3140 This is less elegant than using Python's exception mechanism, but
3136 3141 I can't get that to work reliably with threads, so under -pylab
3137 3142 %Exit was hanging IPython. Cross-thread exception handling is
3138 3143 really a bitch. Thaks to a bug report by Stephen Walton
3139 3144 <stephen.walton-AT-csun.edu>.
3140 3145
3141 3146 2004-11-04 Fernando Perez <fperez@colorado.edu>
3142 3147
3143 3148 * IPython/iplib.py (raw_input_original): store a pointer to the
3144 3149 true raw_input to harden against code which can modify it
3145 3150 (wx.py.PyShell does this and would otherwise crash ipython).
3146 3151 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
3147 3152
3148 3153 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
3149 3154 Ctrl-C problem, which does not mess up the input line.
3150 3155
3151 3156 2004-11-03 Fernando Perez <fperez@colorado.edu>
3152 3157
3153 3158 * IPython/Release.py: Changed licensing to BSD, in all files.
3154 3159 (name): lowercase name for tarball/RPM release.
3155 3160
3156 3161 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
3157 3162 use throughout ipython.
3158 3163
3159 3164 * IPython/Magic.py (Magic._ofind): Switch to using the new
3160 3165 OInspect.getdoc() function.
3161 3166
3162 3167 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
3163 3168 of the line currently being canceled via Ctrl-C. It's extremely
3164 3169 ugly, but I don't know how to do it better (the problem is one of
3165 3170 handling cross-thread exceptions).
3166 3171
3167 3172 2004-10-28 Fernando Perez <fperez@colorado.edu>
3168 3173
3169 3174 * IPython/Shell.py (signal_handler): add signal handlers to trap
3170 3175 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
3171 3176 report by Francesc Alted.
3172 3177
3173 3178 2004-10-21 Fernando Perez <fperez@colorado.edu>
3174 3179
3175 3180 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
3176 3181 to % for pysh syntax extensions.
3177 3182
3178 3183 2004-10-09 Fernando Perez <fperez@colorado.edu>
3179 3184
3180 3185 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
3181 3186 arrays to print a more useful summary, without calling str(arr).
3182 3187 This avoids the problem of extremely lengthy computations which
3183 3188 occur if arr is large, and appear to the user as a system lockup
3184 3189 with 100% cpu activity. After a suggestion by Kristian Sandberg
3185 3190 <Kristian.Sandberg@colorado.edu>.
3186 3191 (Magic.__init__): fix bug in global magic escapes not being
3187 3192 correctly set.
3188 3193
3189 3194 2004-10-08 Fernando Perez <fperez@colorado.edu>
3190 3195
3191 3196 * IPython/Magic.py (__license__): change to absolute imports of
3192 3197 ipython's own internal packages, to start adapting to the absolute
3193 3198 import requirement of PEP-328.
3194 3199
3195 3200 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
3196 3201 files, and standardize author/license marks through the Release
3197 3202 module instead of having per/file stuff (except for files with
3198 3203 particular licenses, like the MIT/PSF-licensed codes).
3199 3204
3200 3205 * IPython/Debugger.py: remove dead code for python 2.1
3201 3206
3202 3207 2004-10-04 Fernando Perez <fperez@colorado.edu>
3203 3208
3204 3209 * IPython/iplib.py (ipmagic): New function for accessing magics
3205 3210 via a normal python function call.
3206 3211
3207 3212 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
3208 3213 from '@' to '%', to accomodate the new @decorator syntax of python
3209 3214 2.4.
3210 3215
3211 3216 2004-09-29 Fernando Perez <fperez@colorado.edu>
3212 3217
3213 3218 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
3214 3219 matplotlib.use to prevent running scripts which try to switch
3215 3220 interactive backends from within ipython. This will just crash
3216 3221 the python interpreter, so we can't allow it (but a detailed error
3217 3222 is given to the user).
3218 3223
3219 3224 2004-09-28 Fernando Perez <fperez@colorado.edu>
3220 3225
3221 3226 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
3222 3227 matplotlib-related fixes so that using @run with non-matplotlib
3223 3228 scripts doesn't pop up spurious plot windows. This requires
3224 3229 matplotlib >= 0.63, where I had to make some changes as well.
3225 3230
3226 3231 * IPython/ipmaker.py (make_IPython): update version requirement to
3227 3232 python 2.2.
3228 3233
3229 3234 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
3230 3235 banner arg for embedded customization.
3231 3236
3232 3237 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
3233 3238 explicit uses of __IP as the IPython's instance name. Now things
3234 3239 are properly handled via the shell.name value. The actual code
3235 3240 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
3236 3241 is much better than before. I'll clean things completely when the
3237 3242 magic stuff gets a real overhaul.
3238 3243
3239 3244 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
3240 3245 minor changes to debian dir.
3241 3246
3242 3247 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
3243 3248 pointer to the shell itself in the interactive namespace even when
3244 3249 a user-supplied dict is provided. This is needed for embedding
3245 3250 purposes (found by tests with Michel Sanner).
3246 3251
3247 3252 2004-09-27 Fernando Perez <fperez@colorado.edu>
3248 3253
3249 3254 * IPython/UserConfig/ipythonrc: remove []{} from
3250 3255 readline_remove_delims, so that things like [modname.<TAB> do
3251 3256 proper completion. This disables [].TAB, but that's a less common
3252 3257 case than module names in list comprehensions, for example.
3253 3258 Thanks to a report by Andrea Riciputi.
3254 3259
3255 3260 2004-09-09 Fernando Perez <fperez@colorado.edu>
3256 3261
3257 3262 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
3258 3263 blocking problems in win32 and osx. Fix by John.
3259 3264
3260 3265 2004-09-08 Fernando Perez <fperez@colorado.edu>
3261 3266
3262 3267 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
3263 3268 for Win32 and OSX. Fix by John Hunter.
3264 3269
3265 3270 2004-08-30 *** Released version 0.6.3
3266 3271
3267 3272 2004-08-30 Fernando Perez <fperez@colorado.edu>
3268 3273
3269 3274 * setup.py (isfile): Add manpages to list of dependent files to be
3270 3275 updated.
3271 3276
3272 3277 2004-08-27 Fernando Perez <fperez@colorado.edu>
3273 3278
3274 3279 * IPython/Shell.py (start): I've disabled -wthread and -gthread
3275 3280 for now. They don't really work with standalone WX/GTK code
3276 3281 (though matplotlib IS working fine with both of those backends).
3277 3282 This will neeed much more testing. I disabled most things with
3278 3283 comments, so turning it back on later should be pretty easy.
3279 3284
3280 3285 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
3281 3286 autocalling of expressions like r'foo', by modifying the line
3282 3287 split regexp. Closes
3283 3288 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
3284 3289 Riley <ipythonbugs-AT-sabi.net>.
3285 3290 (InteractiveShell.mainloop): honor --nobanner with banner
3286 3291 extensions.
3287 3292
3288 3293 * IPython/Shell.py: Significant refactoring of all classes, so
3289 3294 that we can really support ALL matplotlib backends and threading
3290 3295 models (John spotted a bug with Tk which required this). Now we
3291 3296 should support single-threaded, WX-threads and GTK-threads, both
3292 3297 for generic code and for matplotlib.
3293 3298
3294 3299 * IPython/ipmaker.py (__call__): Changed -mpthread option to
3295 3300 -pylab, to simplify things for users. Will also remove the pylab
3296 3301 profile, since now all of matplotlib configuration is directly
3297 3302 handled here. This also reduces startup time.
3298 3303
3299 3304 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
3300 3305 shell wasn't being correctly called. Also in IPShellWX.
3301 3306
3302 3307 * IPython/iplib.py (InteractiveShell.__init__): Added option to
3303 3308 fine-tune banner.
3304 3309
3305 3310 * IPython/numutils.py (spike): Deprecate these spike functions,
3306 3311 delete (long deprecated) gnuplot_exec handler.
3307 3312
3308 3313 2004-08-26 Fernando Perez <fperez@colorado.edu>
3309 3314
3310 3315 * ipython.1: Update for threading options, plus some others which
3311 3316 were missing.
3312 3317
3313 3318 * IPython/ipmaker.py (__call__): Added -wthread option for
3314 3319 wxpython thread handling. Make sure threading options are only
3315 3320 valid at the command line.
3316 3321
3317 3322 * scripts/ipython: moved shell selection into a factory function
3318 3323 in Shell.py, to keep the starter script to a minimum.
3319 3324
3320 3325 2004-08-25 Fernando Perez <fperez@colorado.edu>
3321 3326
3322 3327 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
3323 3328 John. Along with some recent changes he made to matplotlib, the
3324 3329 next versions of both systems should work very well together.
3325 3330
3326 3331 2004-08-24 Fernando Perez <fperez@colorado.edu>
3327 3332
3328 3333 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
3329 3334 tried to switch the profiling to using hotshot, but I'm getting
3330 3335 strange errors from prof.runctx() there. I may be misreading the
3331 3336 docs, but it looks weird. For now the profiling code will
3332 3337 continue to use the standard profiler.
3333 3338
3334 3339 2004-08-23 Fernando Perez <fperez@colorado.edu>
3335 3340
3336 3341 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
3337 3342 threaded shell, by John Hunter. It's not quite ready yet, but
3338 3343 close.
3339 3344
3340 3345 2004-08-22 Fernando Perez <fperez@colorado.edu>
3341 3346
3342 3347 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
3343 3348 in Magic and ultraTB.
3344 3349
3345 3350 * ipython.1: document threading options in manpage.
3346 3351
3347 3352 * scripts/ipython: Changed name of -thread option to -gthread,
3348 3353 since this is GTK specific. I want to leave the door open for a
3349 3354 -wthread option for WX, which will most likely be necessary. This
3350 3355 change affects usage and ipmaker as well.
3351 3356
3352 3357 * IPython/Shell.py (matplotlib_shell): Add a factory function to
3353 3358 handle the matplotlib shell issues. Code by John Hunter
3354 3359 <jdhunter-AT-nitace.bsd.uchicago.edu>.
3355 3360 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
3356 3361 broken (and disabled for end users) for now, but it puts the
3357 3362 infrastructure in place.
3358 3363
3359 3364 2004-08-21 Fernando Perez <fperez@colorado.edu>
3360 3365
3361 3366 * ipythonrc-pylab: Add matplotlib support.
3362 3367
3363 3368 * matplotlib_config.py: new files for matplotlib support, part of
3364 3369 the pylab profile.
3365 3370
3366 3371 * IPython/usage.py (__doc__): documented the threading options.
3367 3372
3368 3373 2004-08-20 Fernando Perez <fperez@colorado.edu>
3369 3374
3370 3375 * ipython: Modified the main calling routine to handle the -thread
3371 3376 and -mpthread options. This needs to be done as a top-level hack,
3372 3377 because it determines which class to instantiate for IPython
3373 3378 itself.
3374 3379
3375 3380 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
3376 3381 classes to support multithreaded GTK operation without blocking,
3377 3382 and matplotlib with all backends. This is a lot of still very
3378 3383 experimental code, and threads are tricky. So it may still have a
3379 3384 few rough edges... This code owes a lot to
3380 3385 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
3381 3386 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
3382 3387 to John Hunter for all the matplotlib work.
3383 3388
3384 3389 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
3385 3390 options for gtk thread and matplotlib support.
3386 3391
3387 3392 2004-08-16 Fernando Perez <fperez@colorado.edu>
3388 3393
3389 3394 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
3390 3395 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
3391 3396 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
3392 3397
3393 3398 2004-08-11 Fernando Perez <fperez@colorado.edu>
3394 3399
3395 3400 * setup.py (isfile): Fix build so documentation gets updated for
3396 3401 rpms (it was only done for .tgz builds).
3397 3402
3398 3403 2004-08-10 Fernando Perez <fperez@colorado.edu>
3399 3404
3400 3405 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
3401 3406
3402 3407 * iplib.py : Silence syntax error exceptions in tab-completion.
3403 3408
3404 3409 2004-08-05 Fernando Perez <fperez@colorado.edu>
3405 3410
3406 3411 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
3407 3412 'color off' mark for continuation prompts. This was causing long
3408 3413 continuation lines to mis-wrap.
3409 3414
3410 3415 2004-08-01 Fernando Perez <fperez@colorado.edu>
3411 3416
3412 3417 * IPython/ipmaker.py (make_IPython): Allow the shell class used
3413 3418 for building ipython to be a parameter. All this is necessary
3414 3419 right now to have a multithreaded version, but this insane
3415 3420 non-design will be cleaned up soon. For now, it's a hack that
3416 3421 works.
3417 3422
3418 3423 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
3419 3424 args in various places. No bugs so far, but it's a dangerous
3420 3425 practice.
3421 3426
3422 3427 2004-07-31 Fernando Perez <fperez@colorado.edu>
3423 3428
3424 3429 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
3425 3430 fix completion of files with dots in their names under most
3426 3431 profiles (pysh was OK because the completion order is different).
3427 3432
3428 3433 2004-07-27 Fernando Perez <fperez@colorado.edu>
3429 3434
3430 3435 * IPython/iplib.py (InteractiveShell.__init__): build dict of
3431 3436 keywords manually, b/c the one in keyword.py was removed in python
3432 3437 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
3433 3438 This is NOT a bug under python 2.3 and earlier.
3434 3439
3435 3440 2004-07-26 Fernando Perez <fperez@colorado.edu>
3436 3441
3437 3442 * IPython/ultraTB.py (VerboseTB.text): Add another
3438 3443 linecache.checkcache() call to try to prevent inspect.py from
3439 3444 crashing under python 2.3. I think this fixes
3440 3445 http://www.scipy.net/roundup/ipython/issue17.
3441 3446
3442 3447 2004-07-26 *** Released version 0.6.2
3443 3448
3444 3449 2004-07-26 Fernando Perez <fperez@colorado.edu>
3445 3450
3446 3451 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
3447 3452 fail for any number.
3448 3453 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
3449 3454 empty bookmarks.
3450 3455
3451 3456 2004-07-26 *** Released version 0.6.1
3452 3457
3453 3458 2004-07-26 Fernando Perez <fperez@colorado.edu>
3454 3459
3455 3460 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
3456 3461
3457 3462 * IPython/iplib.py (protect_filename): Applied Ville's patch for
3458 3463 escaping '()[]{}' in filenames.
3459 3464
3460 3465 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
3461 3466 Python 2.2 users who lack a proper shlex.split.
3462 3467
3463 3468 2004-07-19 Fernando Perez <fperez@colorado.edu>
3464 3469
3465 3470 * IPython/iplib.py (InteractiveShell.init_readline): Add support
3466 3471 for reading readline's init file. I follow the normal chain:
3467 3472 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
3468 3473 report by Mike Heeter. This closes
3469 3474 http://www.scipy.net/roundup/ipython/issue16.
3470 3475
3471 3476 2004-07-18 Fernando Perez <fperez@colorado.edu>
3472 3477
3473 3478 * IPython/iplib.py (__init__): Add better handling of '\' under
3474 3479 Win32 for filenames. After a patch by Ville.
3475 3480
3476 3481 2004-07-17 Fernando Perez <fperez@colorado.edu>
3477 3482
3478 3483 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
3479 3484 autocalling would be triggered for 'foo is bar' if foo is
3480 3485 callable. I also cleaned up the autocall detection code to use a
3481 3486 regexp, which is faster. Bug reported by Alexander Schmolck.
3482 3487
3483 3488 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
3484 3489 '?' in them would confuse the help system. Reported by Alex
3485 3490 Schmolck.
3486 3491
3487 3492 2004-07-16 Fernando Perez <fperez@colorado.edu>
3488 3493
3489 3494 * IPython/GnuplotInteractive.py (__all__): added plot2.
3490 3495
3491 3496 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
3492 3497 plotting dictionaries, lists or tuples of 1d arrays.
3493 3498
3494 3499 * IPython/Magic.py (Magic.magic_hist): small clenaups and
3495 3500 optimizations.
3496 3501
3497 3502 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
3498 3503 the information which was there from Janko's original IPP code:
3499 3504
3500 3505 03.05.99 20:53 porto.ifm.uni-kiel.de
3501 3506 --Started changelog.
3502 3507 --make clear do what it say it does
3503 3508 --added pretty output of lines from inputcache
3504 3509 --Made Logger a mixin class, simplifies handling of switches
3505 3510 --Added own completer class. .string<TAB> expands to last history
3506 3511 line which starts with string. The new expansion is also present
3507 3512 with Ctrl-r from the readline library. But this shows, who this
3508 3513 can be done for other cases.
3509 3514 --Added convention that all shell functions should accept a
3510 3515 parameter_string This opens the door for different behaviour for
3511 3516 each function. @cd is a good example of this.
3512 3517
3513 3518 04.05.99 12:12 porto.ifm.uni-kiel.de
3514 3519 --added logfile rotation
3515 3520 --added new mainloop method which freezes first the namespace
3516 3521
3517 3522 07.05.99 21:24 porto.ifm.uni-kiel.de
3518 3523 --added the docreader classes. Now there is a help system.
3519 3524 -This is only a first try. Currently it's not easy to put new
3520 3525 stuff in the indices. But this is the way to go. Info would be
3521 3526 better, but HTML is every where and not everybody has an info
3522 3527 system installed and it's not so easy to change html-docs to info.
3523 3528 --added global logfile option
3524 3529 --there is now a hook for object inspection method pinfo needs to
3525 3530 be provided for this. Can be reached by two '??'.
3526 3531
3527 3532 08.05.99 20:51 porto.ifm.uni-kiel.de
3528 3533 --added a README
3529 3534 --bug in rc file. Something has changed so functions in the rc
3530 3535 file need to reference the shell and not self. Not clear if it's a
3531 3536 bug or feature.
3532 3537 --changed rc file for new behavior
3533 3538
3534 3539 2004-07-15 Fernando Perez <fperez@colorado.edu>
3535 3540
3536 3541 * IPython/Logger.py (Logger.log): fixed recent bug where the input
3537 3542 cache was falling out of sync in bizarre manners when multi-line
3538 3543 input was present. Minor optimizations and cleanup.
3539 3544
3540 3545 (Logger): Remove old Changelog info for cleanup. This is the
3541 3546 information which was there from Janko's original code:
3542 3547
3543 3548 Changes to Logger: - made the default log filename a parameter
3544 3549
3545 3550 - put a check for lines beginning with !@? in log(). Needed
3546 3551 (even if the handlers properly log their lines) for mid-session
3547 3552 logging activation to work properly. Without this, lines logged
3548 3553 in mid session, which get read from the cache, would end up
3549 3554 'bare' (with !@? in the open) in the log. Now they are caught
3550 3555 and prepended with a #.
3551 3556
3552 3557 * IPython/iplib.py (InteractiveShell.init_readline): added check
3553 3558 in case MagicCompleter fails to be defined, so we don't crash.
3554 3559
3555 3560 2004-07-13 Fernando Perez <fperez@colorado.edu>
3556 3561
3557 3562 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
3558 3563 of EPS if the requested filename ends in '.eps'.
3559 3564
3560 3565 2004-07-04 Fernando Perez <fperez@colorado.edu>
3561 3566
3562 3567 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
3563 3568 escaping of quotes when calling the shell.
3564 3569
3565 3570 2004-07-02 Fernando Perez <fperez@colorado.edu>
3566 3571
3567 3572 * IPython/Prompts.py (CachedOutput.update): Fix problem with
3568 3573 gettext not working because we were clobbering '_'. Fixes
3569 3574 http://www.scipy.net/roundup/ipython/issue6.
3570 3575
3571 3576 2004-07-01 Fernando Perez <fperez@colorado.edu>
3572 3577
3573 3578 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
3574 3579 into @cd. Patch by Ville.
3575 3580
3576 3581 * IPython/iplib.py (InteractiveShell.post_config_initialization):
3577 3582 new function to store things after ipmaker runs. Patch by Ville.
3578 3583 Eventually this will go away once ipmaker is removed and the class
3579 3584 gets cleaned up, but for now it's ok. Key functionality here is
3580 3585 the addition of the persistent storage mechanism, a dict for
3581 3586 keeping data across sessions (for now just bookmarks, but more can
3582 3587 be implemented later).
3583 3588
3584 3589 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
3585 3590 persistent across sections. Patch by Ville, I modified it
3586 3591 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
3587 3592 added a '-l' option to list all bookmarks.
3588 3593
3589 3594 * IPython/iplib.py (InteractiveShell.atexit_operations): new
3590 3595 center for cleanup. Registered with atexit.register(). I moved
3591 3596 here the old exit_cleanup(). After a patch by Ville.
3592 3597
3593 3598 * IPython/Magic.py (get_py_filename): added '~' to the accepted
3594 3599 characters in the hacked shlex_split for python 2.2.
3595 3600
3596 3601 * IPython/iplib.py (file_matches): more fixes to filenames with
3597 3602 whitespace in them. It's not perfect, but limitations in python's
3598 3603 readline make it impossible to go further.
3599 3604
3600 3605 2004-06-29 Fernando Perez <fperez@colorado.edu>
3601 3606
3602 3607 * IPython/iplib.py (file_matches): escape whitespace correctly in
3603 3608 filename completions. Bug reported by Ville.
3604 3609
3605 3610 2004-06-28 Fernando Perez <fperez@colorado.edu>
3606 3611
3607 3612 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
3608 3613 the history file will be called 'history-PROFNAME' (or just
3609 3614 'history' if no profile is loaded). I was getting annoyed at
3610 3615 getting my Numerical work history clobbered by pysh sessions.
3611 3616
3612 3617 * IPython/iplib.py (InteractiveShell.__init__): Internal
3613 3618 getoutputerror() function so that we can honor the system_verbose
3614 3619 flag for _all_ system calls. I also added escaping of #
3615 3620 characters here to avoid confusing Itpl.
3616 3621
3617 3622 * IPython/Magic.py (shlex_split): removed call to shell in
3618 3623 parse_options and replaced it with shlex.split(). The annoying
3619 3624 part was that in Python 2.2, shlex.split() doesn't exist, so I had
3620 3625 to backport it from 2.3, with several frail hacks (the shlex
3621 3626 module is rather limited in 2.2). Thanks to a suggestion by Ville
3622 3627 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
3623 3628 problem.
3624 3629
3625 3630 (Magic.magic_system_verbose): new toggle to print the actual
3626 3631 system calls made by ipython. Mainly for debugging purposes.
3627 3632
3628 3633 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
3629 3634 doesn't support persistence. Reported (and fix suggested) by
3630 3635 Travis Caldwell <travis_caldwell2000@yahoo.com>.
3631 3636
3632 3637 2004-06-26 Fernando Perez <fperez@colorado.edu>
3633 3638
3634 3639 * IPython/Logger.py (Logger.log): fix to handle correctly empty
3635 3640 continue prompts.
3636 3641
3637 3642 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
3638 3643 function (basically a big docstring) and a few more things here to
3639 3644 speedup startup. pysh.py is now very lightweight. We want because
3640 3645 it gets execfile'd, while InterpreterExec gets imported, so
3641 3646 byte-compilation saves time.
3642 3647
3643 3648 2004-06-25 Fernando Perez <fperez@colorado.edu>
3644 3649
3645 3650 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
3646 3651 -NUM', which was recently broken.
3647 3652
3648 3653 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
3649 3654 in multi-line input (but not !!, which doesn't make sense there).
3650 3655
3651 3656 * IPython/UserConfig/ipythonrc: made autoindent on by default.
3652 3657 It's just too useful, and people can turn it off in the less
3653 3658 common cases where it's a problem.
3654 3659
3655 3660 2004-06-24 Fernando Perez <fperez@colorado.edu>
3656 3661
3657 3662 * IPython/iplib.py (InteractiveShell._prefilter): big change -
3658 3663 special syntaxes (like alias calling) is now allied in multi-line
3659 3664 input. This is still _very_ experimental, but it's necessary for
3660 3665 efficient shell usage combining python looping syntax with system
3661 3666 calls. For now it's restricted to aliases, I don't think it
3662 3667 really even makes sense to have this for magics.
3663 3668
3664 3669 2004-06-23 Fernando Perez <fperez@colorado.edu>
3665 3670
3666 3671 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
3667 3672 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
3668 3673
3669 3674 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
3670 3675 extensions under Windows (after code sent by Gary Bishop). The
3671 3676 extensions considered 'executable' are stored in IPython's rc
3672 3677 structure as win_exec_ext.
3673 3678
3674 3679 * IPython/genutils.py (shell): new function, like system() but
3675 3680 without return value. Very useful for interactive shell work.
3676 3681
3677 3682 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
3678 3683 delete aliases.
3679 3684
3680 3685 * IPython/iplib.py (InteractiveShell.alias_table_update): make
3681 3686 sure that the alias table doesn't contain python keywords.
3682 3687
3683 3688 2004-06-21 Fernando Perez <fperez@colorado.edu>
3684 3689
3685 3690 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
3686 3691 non-existent items are found in $PATH. Reported by Thorsten.
3687 3692
3688 3693 2004-06-20 Fernando Perez <fperez@colorado.edu>
3689 3694
3690 3695 * IPython/iplib.py (complete): modified the completer so that the
3691 3696 order of priorities can be easily changed at runtime.
3692 3697
3693 3698 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
3694 3699 Modified to auto-execute all lines beginning with '~', '/' or '.'.
3695 3700
3696 3701 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
3697 3702 expand Python variables prepended with $ in all system calls. The
3698 3703 same was done to InteractiveShell.handle_shell_escape. Now all
3699 3704 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
3700 3705 expansion of python variables and expressions according to the
3701 3706 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
3702 3707
3703 3708 Though PEP-215 has been rejected, a similar (but simpler) one
3704 3709 seems like it will go into Python 2.4, PEP-292 -
3705 3710 http://www.python.org/peps/pep-0292.html.
3706 3711
3707 3712 I'll keep the full syntax of PEP-215, since IPython has since the
3708 3713 start used Ka-Ping Yee's reference implementation discussed there
3709 3714 (Itpl), and I actually like the powerful semantics it offers.
3710 3715
3711 3716 In order to access normal shell variables, the $ has to be escaped
3712 3717 via an extra $. For example:
3713 3718
3714 3719 In [7]: PATH='a python variable'
3715 3720
3716 3721 In [8]: !echo $PATH
3717 3722 a python variable
3718 3723
3719 3724 In [9]: !echo $$PATH
3720 3725 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
3721 3726
3722 3727 (Magic.parse_options): escape $ so the shell doesn't evaluate
3723 3728 things prematurely.
3724 3729
3725 3730 * IPython/iplib.py (InteractiveShell.call_alias): added the
3726 3731 ability for aliases to expand python variables via $.
3727 3732
3728 3733 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
3729 3734 system, now there's a @rehash/@rehashx pair of magics. These work
3730 3735 like the csh rehash command, and can be invoked at any time. They
3731 3736 build a table of aliases to everything in the user's $PATH
3732 3737 (@rehash uses everything, @rehashx is slower but only adds
3733 3738 executable files). With this, the pysh.py-based shell profile can
3734 3739 now simply call rehash upon startup, and full access to all
3735 3740 programs in the user's path is obtained.
3736 3741
3737 3742 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
3738 3743 functionality is now fully in place. I removed the old dynamic
3739 3744 code generation based approach, in favor of a much lighter one
3740 3745 based on a simple dict. The advantage is that this allows me to
3741 3746 now have thousands of aliases with negligible cost (unthinkable
3742 3747 with the old system).
3743 3748
3744 3749 2004-06-19 Fernando Perez <fperez@colorado.edu>
3745 3750
3746 3751 * IPython/iplib.py (__init__): extended MagicCompleter class to
3747 3752 also complete (last in priority) on user aliases.
3748 3753
3749 3754 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
3750 3755 call to eval.
3751 3756 (ItplNS.__init__): Added a new class which functions like Itpl,
3752 3757 but allows configuring the namespace for the evaluation to occur
3753 3758 in.
3754 3759
3755 3760 2004-06-18 Fernando Perez <fperez@colorado.edu>
3756 3761
3757 3762 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
3758 3763 better message when 'exit' or 'quit' are typed (a common newbie
3759 3764 confusion).
3760 3765
3761 3766 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
3762 3767 check for Windows users.
3763 3768
3764 3769 * IPython/iplib.py (InteractiveShell.user_setup): removed
3765 3770 disabling of colors for Windows. I'll test at runtime and issue a
3766 3771 warning if Gary's readline isn't found, as to nudge users to
3767 3772 download it.
3768 3773
3769 3774 2004-06-16 Fernando Perez <fperez@colorado.edu>
3770 3775
3771 3776 * IPython/genutils.py (Stream.__init__): changed to print errors
3772 3777 to sys.stderr. I had a circular dependency here. Now it's
3773 3778 possible to run ipython as IDLE's shell (consider this pre-alpha,
3774 3779 since true stdout things end up in the starting terminal instead
3775 3780 of IDLE's out).
3776 3781
3777 3782 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
3778 3783 users who haven't # updated their prompt_in2 definitions. Remove
3779 3784 eventually.
3780 3785 (multiple_replace): added credit to original ASPN recipe.
3781 3786
3782 3787 2004-06-15 Fernando Perez <fperez@colorado.edu>
3783 3788
3784 3789 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
3785 3790 list of auto-defined aliases.
3786 3791
3787 3792 2004-06-13 Fernando Perez <fperez@colorado.edu>
3788 3793
3789 3794 * setup.py (scriptfiles): Don't trigger win_post_install unless an
3790 3795 install was really requested (so setup.py can be used for other
3791 3796 things under Windows).
3792 3797
3793 3798 2004-06-10 Fernando Perez <fperez@colorado.edu>
3794 3799
3795 3800 * IPython/Logger.py (Logger.create_log): Manually remove any old
3796 3801 backup, since os.remove may fail under Windows. Fixes bug
3797 3802 reported by Thorsten.
3798 3803
3799 3804 2004-06-09 Fernando Perez <fperez@colorado.edu>
3800 3805
3801 3806 * examples/example-embed.py: fixed all references to %n (replaced
3802 3807 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
3803 3808 for all examples and the manual as well.
3804 3809
3805 3810 2004-06-08 Fernando Perez <fperez@colorado.edu>
3806 3811
3807 3812 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
3808 3813 alignment and color management. All 3 prompt subsystems now
3809 3814 inherit from BasePrompt.
3810 3815
3811 3816 * tools/release: updates for windows installer build and tag rpms
3812 3817 with python version (since paths are fixed).
3813 3818
3814 3819 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
3815 3820 which will become eventually obsolete. Also fixed the default
3816 3821 prompt_in2 to use \D, so at least new users start with the correct
3817 3822 defaults.
3818 3823 WARNING: Users with existing ipythonrc files will need to apply
3819 3824 this fix manually!
3820 3825
3821 3826 * setup.py: make windows installer (.exe). This is finally the
3822 3827 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
3823 3828 which I hadn't included because it required Python 2.3 (or recent
3824 3829 distutils).
3825 3830
3826 3831 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
3827 3832 usage of new '\D' escape.
3828 3833
3829 3834 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
3830 3835 lacks os.getuid())
3831 3836 (CachedOutput.set_colors): Added the ability to turn coloring
3832 3837 on/off with @colors even for manually defined prompt colors. It
3833 3838 uses a nasty global, but it works safely and via the generic color
3834 3839 handling mechanism.
3835 3840 (Prompt2.__init__): Introduced new escape '\D' for continuation
3836 3841 prompts. It represents the counter ('\#') as dots.
3837 3842 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
3838 3843 need to update their ipythonrc files and replace '%n' with '\D' in
3839 3844 their prompt_in2 settings everywhere. Sorry, but there's
3840 3845 otherwise no clean way to get all prompts to properly align. The
3841 3846 ipythonrc shipped with IPython has been updated.
3842 3847
3843 3848 2004-06-07 Fernando Perez <fperez@colorado.edu>
3844 3849
3845 3850 * setup.py (isfile): Pass local_icons option to latex2html, so the
3846 3851 resulting HTML file is self-contained. Thanks to
3847 3852 dryice-AT-liu.com.cn for the tip.
3848 3853
3849 3854 * pysh.py: I created a new profile 'shell', which implements a
3850 3855 _rudimentary_ IPython-based shell. This is in NO WAY a realy
3851 3856 system shell, nor will it become one anytime soon. It's mainly
3852 3857 meant to illustrate the use of the new flexible bash-like prompts.
3853 3858 I guess it could be used by hardy souls for true shell management,
3854 3859 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
3855 3860 profile. This uses the InterpreterExec extension provided by
3856 3861 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
3857 3862
3858 3863 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
3859 3864 auto-align itself with the length of the previous input prompt
3860 3865 (taking into account the invisible color escapes).
3861 3866 (CachedOutput.__init__): Large restructuring of this class. Now
3862 3867 all three prompts (primary1, primary2, output) are proper objects,
3863 3868 managed by the 'parent' CachedOutput class. The code is still a
3864 3869 bit hackish (all prompts share state via a pointer to the cache),
3865 3870 but it's overall far cleaner than before.
3866 3871
3867 3872 * IPython/genutils.py (getoutputerror): modified to add verbose,
3868 3873 debug and header options. This makes the interface of all getout*
3869 3874 functions uniform.
3870 3875 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
3871 3876
3872 3877 * IPython/Magic.py (Magic.default_option): added a function to
3873 3878 allow registering default options for any magic command. This
3874 3879 makes it easy to have profiles which customize the magics globally
3875 3880 for a certain use. The values set through this function are
3876 3881 picked up by the parse_options() method, which all magics should
3877 3882 use to parse their options.
3878 3883
3879 3884 * IPython/genutils.py (warn): modified the warnings framework to
3880 3885 use the Term I/O class. I'm trying to slowly unify all of
3881 3886 IPython's I/O operations to pass through Term.
3882 3887
3883 3888 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
3884 3889 the secondary prompt to correctly match the length of the primary
3885 3890 one for any prompt. Now multi-line code will properly line up
3886 3891 even for path dependent prompts, such as the new ones available
3887 3892 via the prompt_specials.
3888 3893
3889 3894 2004-06-06 Fernando Perez <fperez@colorado.edu>
3890 3895
3891 3896 * IPython/Prompts.py (prompt_specials): Added the ability to have
3892 3897 bash-like special sequences in the prompts, which get
3893 3898 automatically expanded. Things like hostname, current working
3894 3899 directory and username are implemented already, but it's easy to
3895 3900 add more in the future. Thanks to a patch by W.J. van der Laan
3896 3901 <gnufnork-AT-hetdigitalegat.nl>
3897 3902 (prompt_specials): Added color support for prompt strings, so
3898 3903 users can define arbitrary color setups for their prompts.
3899 3904
3900 3905 2004-06-05 Fernando Perez <fperez@colorado.edu>
3901 3906
3902 3907 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
3903 3908 code to load Gary Bishop's readline and configure it
3904 3909 automatically. Thanks to Gary for help on this.
3905 3910
3906 3911 2004-06-01 Fernando Perez <fperez@colorado.edu>
3907 3912
3908 3913 * IPython/Logger.py (Logger.create_log): fix bug for logging
3909 3914 with no filename (previous fix was incomplete).
3910 3915
3911 3916 2004-05-25 Fernando Perez <fperez@colorado.edu>
3912 3917
3913 3918 * IPython/Magic.py (Magic.parse_options): fix bug where naked
3914 3919 parens would get passed to the shell.
3915 3920
3916 3921 2004-05-20 Fernando Perez <fperez@colorado.edu>
3917 3922
3918 3923 * IPython/Magic.py (Magic.magic_prun): changed default profile
3919 3924 sort order to 'time' (the more common profiling need).
3920 3925
3921 3926 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
3922 3927 so that source code shown is guaranteed in sync with the file on
3923 3928 disk (also changed in psource). Similar fix to the one for
3924 3929 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
3925 3930 <yann.ledu-AT-noos.fr>.
3926 3931
3927 3932 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
3928 3933 with a single option would not be correctly parsed. Closes
3929 3934 http://www.scipy.net/roundup/ipython/issue14. This bug had been
3930 3935 introduced in 0.6.0 (on 2004-05-06).
3931 3936
3932 3937 2004-05-13 *** Released version 0.6.0
3933 3938
3934 3939 2004-05-13 Fernando Perez <fperez@colorado.edu>
3935 3940
3936 3941 * debian/: Added debian/ directory to CVS, so that debian support
3937 3942 is publicly accessible. The debian package is maintained by Jack
3938 3943 Moffit <jack-AT-xiph.org>.
3939 3944
3940 3945 * Documentation: included the notes about an ipython-based system
3941 3946 shell (the hypothetical 'pysh') into the new_design.pdf document,
3942 3947 so that these ideas get distributed to users along with the
3943 3948 official documentation.
3944 3949
3945 3950 2004-05-10 Fernando Perez <fperez@colorado.edu>
3946 3951
3947 3952 * IPython/Logger.py (Logger.create_log): fix recently introduced
3948 3953 bug (misindented line) where logstart would fail when not given an
3949 3954 explicit filename.
3950 3955
3951 3956 2004-05-09 Fernando Perez <fperez@colorado.edu>
3952 3957
3953 3958 * IPython/Magic.py (Magic.parse_options): skip system call when
3954 3959 there are no options to look for. Faster, cleaner for the common
3955 3960 case.
3956 3961
3957 3962 * Documentation: many updates to the manual: describing Windows
3958 3963 support better, Gnuplot updates, credits, misc small stuff. Also
3959 3964 updated the new_design doc a bit.
3960 3965
3961 3966 2004-05-06 *** Released version 0.6.0.rc1
3962 3967
3963 3968 2004-05-06 Fernando Perez <fperez@colorado.edu>
3964 3969
3965 3970 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
3966 3971 operations to use the vastly more efficient list/''.join() method.
3967 3972 (FormattedTB.text): Fix
3968 3973 http://www.scipy.net/roundup/ipython/issue12 - exception source
3969 3974 extract not updated after reload. Thanks to Mike Salib
3970 3975 <msalib-AT-mit.edu> for pinning the source of the problem.
3971 3976 Fortunately, the solution works inside ipython and doesn't require
3972 3977 any changes to python proper.
3973 3978
3974 3979 * IPython/Magic.py (Magic.parse_options): Improved to process the
3975 3980 argument list as a true shell would (by actually using the
3976 3981 underlying system shell). This way, all @magics automatically get
3977 3982 shell expansion for variables. Thanks to a comment by Alex
3978 3983 Schmolck.
3979 3984
3980 3985 2004-04-04 Fernando Perez <fperez@colorado.edu>
3981 3986
3982 3987 * IPython/iplib.py (InteractiveShell.interact): Added a special
3983 3988 trap for a debugger quit exception, which is basically impossible
3984 3989 to handle by normal mechanisms, given what pdb does to the stack.
3985 3990 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
3986 3991
3987 3992 2004-04-03 Fernando Perez <fperez@colorado.edu>
3988 3993
3989 3994 * IPython/genutils.py (Term): Standardized the names of the Term
3990 3995 class streams to cin/cout/cerr, following C++ naming conventions
3991 3996 (I can't use in/out/err because 'in' is not a valid attribute
3992 3997 name).
3993 3998
3994 3999 * IPython/iplib.py (InteractiveShell.interact): don't increment
3995 4000 the prompt if there's no user input. By Daniel 'Dang' Griffith
3996 4001 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
3997 4002 Francois Pinard.
3998 4003
3999 4004 2004-04-02 Fernando Perez <fperez@colorado.edu>
4000 4005
4001 4006 * IPython/genutils.py (Stream.__init__): Modified to survive at
4002 4007 least importing in contexts where stdin/out/err aren't true file
4003 4008 objects, such as PyCrust (they lack fileno() and mode). However,
4004 4009 the recovery facilities which rely on these things existing will
4005 4010 not work.
4006 4011
4007 4012 2004-04-01 Fernando Perez <fperez@colorado.edu>
4008 4013
4009 4014 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
4010 4015 use the new getoutputerror() function, so it properly
4011 4016 distinguishes stdout/err.
4012 4017
4013 4018 * IPython/genutils.py (getoutputerror): added a function to
4014 4019 capture separately the standard output and error of a command.
4015 4020 After a comment from dang on the mailing lists. This code is
4016 4021 basically a modified version of commands.getstatusoutput(), from
4017 4022 the standard library.
4018 4023
4019 4024 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
4020 4025 '!!' as a special syntax (shorthand) to access @sx.
4021 4026
4022 4027 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
4023 4028 command and return its output as a list split on '\n'.
4024 4029
4025 4030 2004-03-31 Fernando Perez <fperez@colorado.edu>
4026 4031
4027 4032 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
4028 4033 method to dictionaries used as FakeModule instances if they lack
4029 4034 it. At least pydoc in python2.3 breaks for runtime-defined
4030 4035 functions without this hack. At some point I need to _really_
4031 4036 understand what FakeModule is doing, because it's a gross hack.
4032 4037 But it solves Arnd's problem for now...
4033 4038
4034 4039 2004-02-27 Fernando Perez <fperez@colorado.edu>
4035 4040
4036 4041 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
4037 4042 mode would behave erratically. Also increased the number of
4038 4043 possible logs in rotate mod to 999. Thanks to Rod Holland
4039 4044 <rhh@StructureLABS.com> for the report and fixes.
4040 4045
4041 4046 2004-02-26 Fernando Perez <fperez@colorado.edu>
4042 4047
4043 4048 * IPython/genutils.py (page): Check that the curses module really
4044 4049 has the initscr attribute before trying to use it. For some
4045 4050 reason, the Solaris curses module is missing this. I think this
4046 4051 should be considered a Solaris python bug, but I'm not sure.
4047 4052
4048 4053 2004-01-17 Fernando Perez <fperez@colorado.edu>
4049 4054
4050 4055 * IPython/genutils.py (Stream.__init__): Changes to try to make
4051 4056 ipython robust against stdin/out/err being closed by the user.
4052 4057 This is 'user error' (and blocks a normal python session, at least
4053 4058 the stdout case). However, Ipython should be able to survive such
4054 4059 instances of abuse as gracefully as possible. To simplify the
4055 4060 coding and maintain compatibility with Gary Bishop's Term
4056 4061 contributions, I've made use of classmethods for this. I think
4057 4062 this introduces a dependency on python 2.2.
4058 4063
4059 4064 2004-01-13 Fernando Perez <fperez@colorado.edu>
4060 4065
4061 4066 * IPython/numutils.py (exp_safe): simplified the code a bit and
4062 4067 removed the need for importing the kinds module altogether.
4063 4068
4064 4069 2004-01-06 Fernando Perez <fperez@colorado.edu>
4065 4070
4066 4071 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
4067 4072 a magic function instead, after some community feedback. No
4068 4073 special syntax will exist for it, but its name is deliberately
4069 4074 very short.
4070 4075
4071 4076 2003-12-20 Fernando Perez <fperez@colorado.edu>
4072 4077
4073 4078 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
4074 4079 new functionality, to automagically assign the result of a shell
4075 4080 command to a variable. I'll solicit some community feedback on
4076 4081 this before making it permanent.
4077 4082
4078 4083 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
4079 4084 requested about callables for which inspect couldn't obtain a
4080 4085 proper argspec. Thanks to a crash report sent by Etienne
4081 4086 Posthumus <etienne-AT-apple01.cs.vu.nl>.
4082 4087
4083 4088 2003-12-09 Fernando Perez <fperez@colorado.edu>
4084 4089
4085 4090 * IPython/genutils.py (page): patch for the pager to work across
4086 4091 various versions of Windows. By Gary Bishop.
4087 4092
4088 4093 2003-12-04 Fernando Perez <fperez@colorado.edu>
4089 4094
4090 4095 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
4091 4096 Gnuplot.py version 1.7, whose internal names changed quite a bit.
4092 4097 While I tested this and it looks ok, there may still be corner
4093 4098 cases I've missed.
4094 4099
4095 4100 2003-12-01 Fernando Perez <fperez@colorado.edu>
4096 4101
4097 4102 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
4098 4103 where a line like 'p,q=1,2' would fail because the automagic
4099 4104 system would be triggered for @p.
4100 4105
4101 4106 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
4102 4107 cleanups, code unmodified.
4103 4108
4104 4109 * IPython/genutils.py (Term): added a class for IPython to handle
4105 4110 output. In most cases it will just be a proxy for stdout/err, but
4106 4111 having this allows modifications to be made for some platforms,
4107 4112 such as handling color escapes under Windows. All of this code
4108 4113 was contributed by Gary Bishop, with minor modifications by me.
4109 4114 The actual changes affect many files.
4110 4115
4111 4116 2003-11-30 Fernando Perez <fperez@colorado.edu>
4112 4117
4113 4118 * IPython/iplib.py (file_matches): new completion code, courtesy
4114 4119 of Jeff Collins. This enables filename completion again under
4115 4120 python 2.3, which disabled it at the C level.
4116 4121
4117 4122 2003-11-11 Fernando Perez <fperez@colorado.edu>
4118 4123
4119 4124 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
4120 4125 for Numeric.array(map(...)), but often convenient.
4121 4126
4122 4127 2003-11-05 Fernando Perez <fperez@colorado.edu>
4123 4128
4124 4129 * IPython/numutils.py (frange): Changed a call from int() to
4125 4130 int(round()) to prevent a problem reported with arange() in the
4126 4131 numpy list.
4127 4132
4128 4133 2003-10-06 Fernando Perez <fperez@colorado.edu>
4129 4134
4130 4135 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
4131 4136 prevent crashes if sys lacks an argv attribute (it happens with
4132 4137 embedded interpreters which build a bare-bones sys module).
4133 4138 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
4134 4139
4135 4140 2003-09-24 Fernando Perez <fperez@colorado.edu>
4136 4141
4137 4142 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
4138 4143 to protect against poorly written user objects where __getattr__
4139 4144 raises exceptions other than AttributeError. Thanks to a bug
4140 4145 report by Oliver Sander <osander-AT-gmx.de>.
4141 4146
4142 4147 * IPython/FakeModule.py (FakeModule.__repr__): this method was
4143 4148 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
4144 4149
4145 4150 2003-09-09 Fernando Perez <fperez@colorado.edu>
4146 4151
4147 4152 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
4148 4153 unpacking a list whith a callable as first element would
4149 4154 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
4150 4155 Collins.
4151 4156
4152 4157 2003-08-25 *** Released version 0.5.0
4153 4158
4154 4159 2003-08-22 Fernando Perez <fperez@colorado.edu>
4155 4160
4156 4161 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
4157 4162 improperly defined user exceptions. Thanks to feedback from Mark
4158 4163 Russell <mrussell-AT-verio.net>.
4159 4164
4160 4165 2003-08-20 Fernando Perez <fperez@colorado.edu>
4161 4166
4162 4167 * IPython/OInspect.py (Inspector.pinfo): changed String Form
4163 4168 printing so that it would print multi-line string forms starting
4164 4169 with a new line. This way the formatting is better respected for
4165 4170 objects which work hard to make nice string forms.
4166 4171
4167 4172 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
4168 4173 autocall would overtake data access for objects with both
4169 4174 __getitem__ and __call__.
4170 4175
4171 4176 2003-08-19 *** Released version 0.5.0-rc1
4172 4177
4173 4178 2003-08-19 Fernando Perez <fperez@colorado.edu>
4174 4179
4175 4180 * IPython/deep_reload.py (load_tail): single tiny change here
4176 4181 seems to fix the long-standing bug of dreload() failing to work
4177 4182 for dotted names. But this module is pretty tricky, so I may have
4178 4183 missed some subtlety. Needs more testing!.
4179 4184
4180 4185 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
4181 4186 exceptions which have badly implemented __str__ methods.
4182 4187 (VerboseTB.text): harden against inspect.getinnerframes crashing,
4183 4188 which I've been getting reports about from Python 2.3 users. I
4184 4189 wish I had a simple test case to reproduce the problem, so I could
4185 4190 either write a cleaner workaround or file a bug report if
4186 4191 necessary.
4187 4192
4188 4193 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
4189 4194 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
4190 4195 a bug report by Tjabo Kloppenburg.
4191 4196
4192 4197 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
4193 4198 crashes. Wrapped the pdb call in a blanket try/except, since pdb
4194 4199 seems rather unstable. Thanks to a bug report by Tjabo
4195 4200 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
4196 4201
4197 4202 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
4198 4203 this out soon because of the critical fixes in the inner loop for
4199 4204 generators.
4200 4205
4201 4206 * IPython/Magic.py (Magic.getargspec): removed. This (and
4202 4207 _get_def) have been obsoleted by OInspect for a long time, I
4203 4208 hadn't noticed that they were dead code.
4204 4209 (Magic._ofind): restored _ofind functionality for a few literals
4205 4210 (those in ["''",'""','[]','{}','()']). But it won't work anymore
4206 4211 for things like "hello".capitalize?, since that would require a
4207 4212 potentially dangerous eval() again.
4208 4213
4209 4214 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
4210 4215 logic a bit more to clean up the escapes handling and minimize the
4211 4216 use of _ofind to only necessary cases. The interactive 'feel' of
4212 4217 IPython should have improved quite a bit with the changes in
4213 4218 _prefilter and _ofind (besides being far safer than before).
4214 4219
4215 4220 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
4216 4221 obscure, never reported). Edit would fail to find the object to
4217 4222 edit under some circumstances.
4218 4223 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
4219 4224 which were causing double-calling of generators. Those eval calls
4220 4225 were _very_ dangerous, since code with side effects could be
4221 4226 triggered. As they say, 'eval is evil'... These were the
4222 4227 nastiest evals in IPython. Besides, _ofind is now far simpler,
4223 4228 and it should also be quite a bit faster. Its use of inspect is
4224 4229 also safer, so perhaps some of the inspect-related crashes I've
4225 4230 seen lately with Python 2.3 might be taken care of. That will
4226 4231 need more testing.
4227 4232
4228 4233 2003-08-17 Fernando Perez <fperez@colorado.edu>
4229 4234
4230 4235 * IPython/iplib.py (InteractiveShell._prefilter): significant
4231 4236 simplifications to the logic for handling user escapes. Faster
4232 4237 and simpler code.
4233 4238
4234 4239 2003-08-14 Fernando Perez <fperez@colorado.edu>
4235 4240
4236 4241 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
4237 4242 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
4238 4243 but it should be quite a bit faster. And the recursive version
4239 4244 generated O(log N) intermediate storage for all rank>1 arrays,
4240 4245 even if they were contiguous.
4241 4246 (l1norm): Added this function.
4242 4247 (norm): Added this function for arbitrary norms (including
4243 4248 l-infinity). l1 and l2 are still special cases for convenience
4244 4249 and speed.
4245 4250
4246 4251 2003-08-03 Fernando Perez <fperez@colorado.edu>
4247 4252
4248 4253 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
4249 4254 exceptions, which now raise PendingDeprecationWarnings in Python
4250 4255 2.3. There were some in Magic and some in Gnuplot2.
4251 4256
4252 4257 2003-06-30 Fernando Perez <fperez@colorado.edu>
4253 4258
4254 4259 * IPython/genutils.py (page): modified to call curses only for
4255 4260 terminals where TERM=='xterm'. After problems under many other
4256 4261 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
4257 4262
4258 4263 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
4259 4264 would be triggered when readline was absent. This was just an old
4260 4265 debugging statement I'd forgotten to take out.
4261 4266
4262 4267 2003-06-20 Fernando Perez <fperez@colorado.edu>
4263 4268
4264 4269 * IPython/genutils.py (clock): modified to return only user time
4265 4270 (not counting system time), after a discussion on scipy. While
4266 4271 system time may be a useful quantity occasionally, it may much
4267 4272 more easily be skewed by occasional swapping or other similar
4268 4273 activity.
4269 4274
4270 4275 2003-06-05 Fernando Perez <fperez@colorado.edu>
4271 4276
4272 4277 * IPython/numutils.py (identity): new function, for building
4273 4278 arbitrary rank Kronecker deltas (mostly backwards compatible with
4274 4279 Numeric.identity)
4275 4280
4276 4281 2003-06-03 Fernando Perez <fperez@colorado.edu>
4277 4282
4278 4283 * IPython/iplib.py (InteractiveShell.handle_magic): protect
4279 4284 arguments passed to magics with spaces, to allow trailing '\' to
4280 4285 work normally (mainly for Windows users).
4281 4286
4282 4287 2003-05-29 Fernando Perez <fperez@colorado.edu>
4283 4288
4284 4289 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
4285 4290 instead of pydoc.help. This fixes a bizarre behavior where
4286 4291 printing '%s' % locals() would trigger the help system. Now
4287 4292 ipython behaves like normal python does.
4288 4293
4289 4294 Note that if one does 'from pydoc import help', the bizarre
4290 4295 behavior returns, but this will also happen in normal python, so
4291 4296 it's not an ipython bug anymore (it has to do with how pydoc.help
4292 4297 is implemented).
4293 4298
4294 4299 2003-05-22 Fernando Perez <fperez@colorado.edu>
4295 4300
4296 4301 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
4297 4302 return [] instead of None when nothing matches, also match to end
4298 4303 of line. Patch by Gary Bishop.
4299 4304
4300 4305 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
4301 4306 protection as before, for files passed on the command line. This
4302 4307 prevents the CrashHandler from kicking in if user files call into
4303 4308 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
4304 4309 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
4305 4310
4306 4311 2003-05-20 *** Released version 0.4.0
4307 4312
4308 4313 2003-05-20 Fernando Perez <fperez@colorado.edu>
4309 4314
4310 4315 * setup.py: added support for manpages. It's a bit hackish b/c of
4311 4316 a bug in the way the bdist_rpm distutils target handles gzipped
4312 4317 manpages, but it works. After a patch by Jack.
4313 4318
4314 4319 2003-05-19 Fernando Perez <fperez@colorado.edu>
4315 4320
4316 4321 * IPython/numutils.py: added a mockup of the kinds module, since
4317 4322 it was recently removed from Numeric. This way, numutils will
4318 4323 work for all users even if they are missing kinds.
4319 4324
4320 4325 * IPython/Magic.py (Magic._ofind): Harden against an inspect
4321 4326 failure, which can occur with SWIG-wrapped extensions. After a
4322 4327 crash report from Prabhu.
4323 4328
4324 4329 2003-05-16 Fernando Perez <fperez@colorado.edu>
4325 4330
4326 4331 * IPython/iplib.py (InteractiveShell.excepthook): New method to
4327 4332 protect ipython from user code which may call directly
4328 4333 sys.excepthook (this looks like an ipython crash to the user, even
4329 4334 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4330 4335 This is especially important to help users of WxWindows, but may
4331 4336 also be useful in other cases.
4332 4337
4333 4338 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
4334 4339 an optional tb_offset to be specified, and to preserve exception
4335 4340 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
4336 4341
4337 4342 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
4338 4343
4339 4344 2003-05-15 Fernando Perez <fperez@colorado.edu>
4340 4345
4341 4346 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
4342 4347 installing for a new user under Windows.
4343 4348
4344 4349 2003-05-12 Fernando Perez <fperez@colorado.edu>
4345 4350
4346 4351 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
4347 4352 handler for Emacs comint-based lines. Currently it doesn't do
4348 4353 much (but importantly, it doesn't update the history cache). In
4349 4354 the future it may be expanded if Alex needs more functionality
4350 4355 there.
4351 4356
4352 4357 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
4353 4358 info to crash reports.
4354 4359
4355 4360 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
4356 4361 just like Python's -c. Also fixed crash with invalid -color
4357 4362 option value at startup. Thanks to Will French
4358 4363 <wfrench-AT-bestweb.net> for the bug report.
4359 4364
4360 4365 2003-05-09 Fernando Perez <fperez@colorado.edu>
4361 4366
4362 4367 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
4363 4368 to EvalDict (it's a mapping, after all) and simplified its code
4364 4369 quite a bit, after a nice discussion on c.l.py where Gustavo
4365 4370 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
4366 4371
4367 4372 2003-04-30 Fernando Perez <fperez@colorado.edu>
4368 4373
4369 4374 * IPython/genutils.py (timings_out): modified it to reduce its
4370 4375 overhead in the common reps==1 case.
4371 4376
4372 4377 2003-04-29 Fernando Perez <fperez@colorado.edu>
4373 4378
4374 4379 * IPython/genutils.py (timings_out): Modified to use the resource
4375 4380 module, which avoids the wraparound problems of time.clock().
4376 4381
4377 4382 2003-04-17 *** Released version 0.2.15pre4
4378 4383
4379 4384 2003-04-17 Fernando Perez <fperez@colorado.edu>
4380 4385
4381 4386 * setup.py (scriptfiles): Split windows-specific stuff over to a
4382 4387 separate file, in an attempt to have a Windows GUI installer.
4383 4388 That didn't work, but part of the groundwork is done.
4384 4389
4385 4390 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
4386 4391 indent/unindent with 4 spaces. Particularly useful in combination
4387 4392 with the new auto-indent option.
4388 4393
4389 4394 2003-04-16 Fernando Perez <fperez@colorado.edu>
4390 4395
4391 4396 * IPython/Magic.py: various replacements of self.rc for
4392 4397 self.shell.rc. A lot more remains to be done to fully disentangle
4393 4398 this class from the main Shell class.
4394 4399
4395 4400 * IPython/GnuplotRuntime.py: added checks for mouse support so
4396 4401 that we don't try to enable it if the current gnuplot doesn't
4397 4402 really support it. Also added checks so that we don't try to
4398 4403 enable persist under Windows (where Gnuplot doesn't recognize the
4399 4404 option).
4400 4405
4401 4406 * IPython/iplib.py (InteractiveShell.interact): Added optional
4402 4407 auto-indenting code, after a patch by King C. Shu
4403 4408 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
4404 4409 get along well with pasting indented code. If I ever figure out
4405 4410 how to make that part go well, it will become on by default.
4406 4411
4407 4412 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
4408 4413 crash ipython if there was an unmatched '%' in the user's prompt
4409 4414 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4410 4415
4411 4416 * IPython/iplib.py (InteractiveShell.interact): removed the
4412 4417 ability to ask the user whether he wants to crash or not at the
4413 4418 'last line' exception handler. Calling functions at that point
4414 4419 changes the stack, and the error reports would have incorrect
4415 4420 tracebacks.
4416 4421
4417 4422 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
4418 4423 pass through a peger a pretty-printed form of any object. After a
4419 4424 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
4420 4425
4421 4426 2003-04-14 Fernando Perez <fperez@colorado.edu>
4422 4427
4423 4428 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
4424 4429 all files in ~ would be modified at first install (instead of
4425 4430 ~/.ipython). This could be potentially disastrous, as the
4426 4431 modification (make line-endings native) could damage binary files.
4427 4432
4428 4433 2003-04-10 Fernando Perez <fperez@colorado.edu>
4429 4434
4430 4435 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
4431 4436 handle only lines which are invalid python. This now means that
4432 4437 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
4433 4438 for the bug report.
4434 4439
4435 4440 2003-04-01 Fernando Perez <fperez@colorado.edu>
4436 4441
4437 4442 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
4438 4443 where failing to set sys.last_traceback would crash pdb.pm().
4439 4444 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
4440 4445 report.
4441 4446
4442 4447 2003-03-25 Fernando Perez <fperez@colorado.edu>
4443 4448
4444 4449 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
4445 4450 before printing it (it had a lot of spurious blank lines at the
4446 4451 end).
4447 4452
4448 4453 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
4449 4454 output would be sent 21 times! Obviously people don't use this
4450 4455 too often, or I would have heard about it.
4451 4456
4452 4457 2003-03-24 Fernando Perez <fperez@colorado.edu>
4453 4458
4454 4459 * setup.py (scriptfiles): renamed the data_files parameter from
4455 4460 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
4456 4461 for the patch.
4457 4462
4458 4463 2003-03-20 Fernando Perez <fperez@colorado.edu>
4459 4464
4460 4465 * IPython/genutils.py (error): added error() and fatal()
4461 4466 functions.
4462 4467
4463 4468 2003-03-18 *** Released version 0.2.15pre3
4464 4469
4465 4470 2003-03-18 Fernando Perez <fperez@colorado.edu>
4466 4471
4467 4472 * setupext/install_data_ext.py
4468 4473 (install_data_ext.initialize_options): Class contributed by Jack
4469 4474 Moffit for fixing the old distutils hack. He is sending this to
4470 4475 the distutils folks so in the future we may not need it as a
4471 4476 private fix.
4472 4477
4473 4478 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
4474 4479 changes for Debian packaging. See his patch for full details.
4475 4480 The old distutils hack of making the ipythonrc* files carry a
4476 4481 bogus .py extension is gone, at last. Examples were moved to a
4477 4482 separate subdir under doc/, and the separate executable scripts
4478 4483 now live in their own directory. Overall a great cleanup. The
4479 4484 manual was updated to use the new files, and setup.py has been
4480 4485 fixed for this setup.
4481 4486
4482 4487 * IPython/PyColorize.py (Parser.usage): made non-executable and
4483 4488 created a pycolor wrapper around it to be included as a script.
4484 4489
4485 4490 2003-03-12 *** Released version 0.2.15pre2
4486 4491
4487 4492 2003-03-12 Fernando Perez <fperez@colorado.edu>
4488 4493
4489 4494 * IPython/ColorANSI.py (make_color_table): Finally fixed the
4490 4495 long-standing problem with garbage characters in some terminals.
4491 4496 The issue was really that the \001 and \002 escapes must _only_ be
4492 4497 passed to input prompts (which call readline), but _never_ to
4493 4498 normal text to be printed on screen. I changed ColorANSI to have
4494 4499 two classes: TermColors and InputTermColors, each with the
4495 4500 appropriate escapes for input prompts or normal text. The code in
4496 4501 Prompts.py got slightly more complicated, but this very old and
4497 4502 annoying bug is finally fixed.
4498 4503
4499 4504 All the credit for nailing down the real origin of this problem
4500 4505 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
4501 4506 *Many* thanks to him for spending quite a bit of effort on this.
4502 4507
4503 4508 2003-03-05 *** Released version 0.2.15pre1
4504 4509
4505 4510 2003-03-03 Fernando Perez <fperez@colorado.edu>
4506 4511
4507 4512 * IPython/FakeModule.py: Moved the former _FakeModule to a
4508 4513 separate file, because it's also needed by Magic (to fix a similar
4509 4514 pickle-related issue in @run).
4510 4515
4511 4516 2003-03-02 Fernando Perez <fperez@colorado.edu>
4512 4517
4513 4518 * IPython/Magic.py (Magic.magic_autocall): new magic to control
4514 4519 the autocall option at runtime.
4515 4520 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
4516 4521 across Magic.py to start separating Magic from InteractiveShell.
4517 4522 (Magic._ofind): Fixed to return proper namespace for dotted
4518 4523 names. Before, a dotted name would always return 'not currently
4519 4524 defined', because it would find the 'parent'. s.x would be found,
4520 4525 but since 'x' isn't defined by itself, it would get confused.
4521 4526 (Magic.magic_run): Fixed pickling problems reported by Ralf
4522 4527 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
4523 4528 that I'd used when Mike Heeter reported similar issues at the
4524 4529 top-level, but now for @run. It boils down to injecting the
4525 4530 namespace where code is being executed with something that looks
4526 4531 enough like a module to fool pickle.dump(). Since a pickle stores
4527 4532 a named reference to the importing module, we need this for
4528 4533 pickles to save something sensible.
4529 4534
4530 4535 * IPython/ipmaker.py (make_IPython): added an autocall option.
4531 4536
4532 4537 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
4533 4538 the auto-eval code. Now autocalling is an option, and the code is
4534 4539 also vastly safer. There is no more eval() involved at all.
4535 4540
4536 4541 2003-03-01 Fernando Perez <fperez@colorado.edu>
4537 4542
4538 4543 * IPython/Magic.py (Magic._ofind): Changed interface to return a
4539 4544 dict with named keys instead of a tuple.
4540 4545
4541 4546 * IPython: Started using CVS for IPython as of 0.2.15pre1.
4542 4547
4543 4548 * setup.py (make_shortcut): Fixed message about directories
4544 4549 created during Windows installation (the directories were ok, just
4545 4550 the printed message was misleading). Thanks to Chris Liechti
4546 4551 <cliechti-AT-gmx.net> for the heads up.
4547 4552
4548 4553 2003-02-21 Fernando Perez <fperez@colorado.edu>
4549 4554
4550 4555 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
4551 4556 of ValueError exception when checking for auto-execution. This
4552 4557 one is raised by things like Numeric arrays arr.flat when the
4553 4558 array is non-contiguous.
4554 4559
4555 4560 2003-01-31 Fernando Perez <fperez@colorado.edu>
4556 4561
4557 4562 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
4558 4563 not return any value at all (even though the command would get
4559 4564 executed).
4560 4565 (xsys): Flush stdout right after printing the command to ensure
4561 4566 proper ordering of commands and command output in the total
4562 4567 output.
4563 4568 (SystemExec/xsys/bq): Switched the names of xsys/bq and
4564 4569 system/getoutput as defaults. The old ones are kept for
4565 4570 compatibility reasons, so no code which uses this library needs
4566 4571 changing.
4567 4572
4568 4573 2003-01-27 *** Released version 0.2.14
4569 4574
4570 4575 2003-01-25 Fernando Perez <fperez@colorado.edu>
4571 4576
4572 4577 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
4573 4578 functions defined in previous edit sessions could not be re-edited
4574 4579 (because the temp files were immediately removed). Now temp files
4575 4580 are removed only at IPython's exit.
4576 4581 (Magic.magic_run): Improved @run to perform shell-like expansions
4577 4582 on its arguments (~users and $VARS). With this, @run becomes more
4578 4583 like a normal command-line.
4579 4584
4580 4585 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
4581 4586 bugs related to embedding and cleaned up that code. A fairly
4582 4587 important one was the impossibility to access the global namespace
4583 4588 through the embedded IPython (only local variables were visible).
4584 4589
4585 4590 2003-01-14 Fernando Perez <fperez@colorado.edu>
4586 4591
4587 4592 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
4588 4593 auto-calling to be a bit more conservative. Now it doesn't get
4589 4594 triggered if any of '!=()<>' are in the rest of the input line, to
4590 4595 allow comparing callables. Thanks to Alex for the heads up.
4591 4596
4592 4597 2003-01-07 Fernando Perez <fperez@colorado.edu>
4593 4598
4594 4599 * IPython/genutils.py (page): fixed estimation of the number of
4595 4600 lines in a string to be paged to simply count newlines. This
4596 4601 prevents over-guessing due to embedded escape sequences. A better
4597 4602 long-term solution would involve stripping out the control chars
4598 4603 for the count, but it's potentially so expensive I just don't
4599 4604 think it's worth doing.
4600 4605
4601 4606 2002-12-19 *** Released version 0.2.14pre50
4602 4607
4603 4608 2002-12-19 Fernando Perez <fperez@colorado.edu>
4604 4609
4605 4610 * tools/release (version): Changed release scripts to inform
4606 4611 Andrea and build a NEWS file with a list of recent changes.
4607 4612
4608 4613 * IPython/ColorANSI.py (__all__): changed terminal detection
4609 4614 code. Seems to work better for xterms without breaking
4610 4615 konsole. Will need more testing to determine if WinXP and Mac OSX
4611 4616 also work ok.
4612 4617
4613 4618 2002-12-18 *** Released version 0.2.14pre49
4614 4619
4615 4620 2002-12-18 Fernando Perez <fperez@colorado.edu>
4616 4621
4617 4622 * Docs: added new info about Mac OSX, from Andrea.
4618 4623
4619 4624 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
4620 4625 allow direct plotting of python strings whose format is the same
4621 4626 of gnuplot data files.
4622 4627
4623 4628 2002-12-16 Fernando Perez <fperez@colorado.edu>
4624 4629
4625 4630 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
4626 4631 value of exit question to be acknowledged.
4627 4632
4628 4633 2002-12-03 Fernando Perez <fperez@colorado.edu>
4629 4634
4630 4635 * IPython/ipmaker.py: removed generators, which had been added
4631 4636 by mistake in an earlier debugging run. This was causing trouble
4632 4637 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
4633 4638 for pointing this out.
4634 4639
4635 4640 2002-11-17 Fernando Perez <fperez@colorado.edu>
4636 4641
4637 4642 * Manual: updated the Gnuplot section.
4638 4643
4639 4644 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
4640 4645 a much better split of what goes in Runtime and what goes in
4641 4646 Interactive.
4642 4647
4643 4648 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
4644 4649 being imported from iplib.
4645 4650
4646 4651 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
4647 4652 for command-passing. Now the global Gnuplot instance is called
4648 4653 'gp' instead of 'g', which was really a far too fragile and
4649 4654 common name.
4650 4655
4651 4656 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
4652 4657 bounding boxes generated by Gnuplot for square plots.
4653 4658
4654 4659 * IPython/genutils.py (popkey): new function added. I should
4655 4660 suggest this on c.l.py as a dict method, it seems useful.
4656 4661
4657 4662 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
4658 4663 to transparently handle PostScript generation. MUCH better than
4659 4664 the previous plot_eps/replot_eps (which I removed now). The code
4660 4665 is also fairly clean and well documented now (including
4661 4666 docstrings).
4662 4667
4663 4668 2002-11-13 Fernando Perez <fperez@colorado.edu>
4664 4669
4665 4670 * IPython/Magic.py (Magic.magic_edit): fixed docstring
4666 4671 (inconsistent with options).
4667 4672
4668 4673 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
4669 4674 manually disabled, I don't know why. Fixed it.
4670 4675 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
4671 4676 eps output.
4672 4677
4673 4678 2002-11-12 Fernando Perez <fperez@colorado.edu>
4674 4679
4675 4680 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
4676 4681 don't propagate up to caller. Fixes crash reported by François
4677 4682 Pinard.
4678 4683
4679 4684 2002-11-09 Fernando Perez <fperez@colorado.edu>
4680 4685
4681 4686 * IPython/ipmaker.py (make_IPython): fixed problem with writing
4682 4687 history file for new users.
4683 4688 (make_IPython): fixed bug where initial install would leave the
4684 4689 user running in the .ipython dir.
4685 4690 (make_IPython): fixed bug where config dir .ipython would be
4686 4691 created regardless of the given -ipythondir option. Thanks to Cory
4687 4692 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
4688 4693
4689 4694 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
4690 4695 type confirmations. Will need to use it in all of IPython's code
4691 4696 consistently.
4692 4697
4693 4698 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
4694 4699 context to print 31 lines instead of the default 5. This will make
4695 4700 the crash reports extremely detailed in case the problem is in
4696 4701 libraries I don't have access to.
4697 4702
4698 4703 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
4699 4704 line of defense' code to still crash, but giving users fair
4700 4705 warning. I don't want internal errors to go unreported: if there's
4701 4706 an internal problem, IPython should crash and generate a full
4702 4707 report.
4703 4708
4704 4709 2002-11-08 Fernando Perez <fperez@colorado.edu>
4705 4710
4706 4711 * IPython/iplib.py (InteractiveShell.interact): added code to trap
4707 4712 otherwise uncaught exceptions which can appear if people set
4708 4713 sys.stdout to something badly broken. Thanks to a crash report
4709 4714 from henni-AT-mail.brainbot.com.
4710 4715
4711 4716 2002-11-04 Fernando Perez <fperez@colorado.edu>
4712 4717
4713 4718 * IPython/iplib.py (InteractiveShell.interact): added
4714 4719 __IPYTHON__active to the builtins. It's a flag which goes on when
4715 4720 the interaction starts and goes off again when it stops. This
4716 4721 allows embedding code to detect being inside IPython. Before this
4717 4722 was done via __IPYTHON__, but that only shows that an IPython
4718 4723 instance has been created.
4719 4724
4720 4725 * IPython/Magic.py (Magic.magic_env): I realized that in a
4721 4726 UserDict, instance.data holds the data as a normal dict. So I
4722 4727 modified @env to return os.environ.data instead of rebuilding a
4723 4728 dict by hand.
4724 4729
4725 4730 2002-11-02 Fernando Perez <fperez@colorado.edu>
4726 4731
4727 4732 * IPython/genutils.py (warn): changed so that level 1 prints no
4728 4733 header. Level 2 is now the default (with 'WARNING' header, as
4729 4734 before). I think I tracked all places where changes were needed in
4730 4735 IPython, but outside code using the old level numbering may have
4731 4736 broken.
4732 4737
4733 4738 * IPython/iplib.py (InteractiveShell.runcode): added this to
4734 4739 handle the tracebacks in SystemExit traps correctly. The previous
4735 4740 code (through interact) was printing more of the stack than
4736 4741 necessary, showing IPython internal code to the user.
4737 4742
4738 4743 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
4739 4744 default. Now that the default at the confirmation prompt is yes,
4740 4745 it's not so intrusive. François' argument that ipython sessions
4741 4746 tend to be complex enough not to lose them from an accidental C-d,
4742 4747 is a valid one.
4743 4748
4744 4749 * IPython/iplib.py (InteractiveShell.interact): added a
4745 4750 showtraceback() call to the SystemExit trap, and modified the exit
4746 4751 confirmation to have yes as the default.
4747 4752
4748 4753 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
4749 4754 this file. It's been gone from the code for a long time, this was
4750 4755 simply leftover junk.
4751 4756
4752 4757 2002-11-01 Fernando Perez <fperez@colorado.edu>
4753 4758
4754 4759 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
4755 4760 added. If set, IPython now traps EOF and asks for
4756 4761 confirmation. After a request by François Pinard.
4757 4762
4758 4763 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
4759 4764 of @abort, and with a new (better) mechanism for handling the
4760 4765 exceptions.
4761 4766
4762 4767 2002-10-27 Fernando Perez <fperez@colorado.edu>
4763 4768
4764 4769 * IPython/usage.py (__doc__): updated the --help information and
4765 4770 the ipythonrc file to indicate that -log generates
4766 4771 ./ipython.log. Also fixed the corresponding info in @logstart.
4767 4772 This and several other fixes in the manuals thanks to reports by
4768 4773 François Pinard <pinard-AT-iro.umontreal.ca>.
4769 4774
4770 4775 * IPython/Logger.py (Logger.switch_log): Fixed error message to
4771 4776 refer to @logstart (instead of @log, which doesn't exist).
4772 4777
4773 4778 * IPython/iplib.py (InteractiveShell._prefilter): fixed
4774 4779 AttributeError crash. Thanks to Christopher Armstrong
4775 4780 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
4776 4781 introduced recently (in 0.2.14pre37) with the fix to the eval
4777 4782 problem mentioned below.
4778 4783
4779 4784 2002-10-17 Fernando Perez <fperez@colorado.edu>
4780 4785
4781 4786 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
4782 4787 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
4783 4788
4784 4789 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
4785 4790 this function to fix a problem reported by Alex Schmolck. He saw
4786 4791 it with list comprehensions and generators, which were getting
4787 4792 called twice. The real problem was an 'eval' call in testing for
4788 4793 automagic which was evaluating the input line silently.
4789 4794
4790 4795 This is a potentially very nasty bug, if the input has side
4791 4796 effects which must not be repeated. The code is much cleaner now,
4792 4797 without any blanket 'except' left and with a regexp test for
4793 4798 actual function names.
4794 4799
4795 4800 But an eval remains, which I'm not fully comfortable with. I just
4796 4801 don't know how to find out if an expression could be a callable in
4797 4802 the user's namespace without doing an eval on the string. However
4798 4803 that string is now much more strictly checked so that no code
4799 4804 slips by, so the eval should only happen for things that can
4800 4805 really be only function/method names.
4801 4806
4802 4807 2002-10-15 Fernando Perez <fperez@colorado.edu>
4803 4808
4804 4809 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
4805 4810 OSX information to main manual, removed README_Mac_OSX file from
4806 4811 distribution. Also updated credits for recent additions.
4807 4812
4808 4813 2002-10-10 Fernando Perez <fperez@colorado.edu>
4809 4814
4810 4815 * README_Mac_OSX: Added a README for Mac OSX users for fixing
4811 4816 terminal-related issues. Many thanks to Andrea Riciputi
4812 4817 <andrea.riciputi-AT-libero.it> for writing it.
4813 4818
4814 4819 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
4815 4820 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
4816 4821
4817 4822 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
4818 4823 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
4819 4824 <syver-en-AT-online.no> who both submitted patches for this problem.
4820 4825
4821 4826 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
4822 4827 global embedding to make sure that things don't overwrite user
4823 4828 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
4824 4829
4825 4830 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
4826 4831 compatibility. Thanks to Hayden Callow
4827 4832 <h.callow-AT-elec.canterbury.ac.nz>
4828 4833
4829 4834 2002-10-04 Fernando Perez <fperez@colorado.edu>
4830 4835
4831 4836 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
4832 4837 Gnuplot.File objects.
4833 4838
4834 4839 2002-07-23 Fernando Perez <fperez@colorado.edu>
4835 4840
4836 4841 * IPython/genutils.py (timing): Added timings() and timing() for
4837 4842 quick access to the most commonly needed data, the execution
4838 4843 times. Old timing() renamed to timings_out().
4839 4844
4840 4845 2002-07-18 Fernando Perez <fperez@colorado.edu>
4841 4846
4842 4847 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
4843 4848 bug with nested instances disrupting the parent's tab completion.
4844 4849
4845 4850 * IPython/iplib.py (all_completions): Added Alex Schmolck's
4846 4851 all_completions code to begin the emacs integration.
4847 4852
4848 4853 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
4849 4854 argument to allow titling individual arrays when plotting.
4850 4855
4851 4856 2002-07-15 Fernando Perez <fperez@colorado.edu>
4852 4857
4853 4858 * setup.py (make_shortcut): changed to retrieve the value of
4854 4859 'Program Files' directory from the registry (this value changes in
4855 4860 non-english versions of Windows). Thanks to Thomas Fanslau
4856 4861 <tfanslau-AT-gmx.de> for the report.
4857 4862
4858 4863 2002-07-10 Fernando Perez <fperez@colorado.edu>
4859 4864
4860 4865 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
4861 4866 a bug in pdb, which crashes if a line with only whitespace is
4862 4867 entered. Bug report submitted to sourceforge.
4863 4868
4864 4869 2002-07-09 Fernando Perez <fperez@colorado.edu>
4865 4870
4866 4871 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
4867 4872 reporting exceptions (it's a bug in inspect.py, I just set a
4868 4873 workaround).
4869 4874
4870 4875 2002-07-08 Fernando Perez <fperez@colorado.edu>
4871 4876
4872 4877 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
4873 4878 __IPYTHON__ in __builtins__ to show up in user_ns.
4874 4879
4875 4880 2002-07-03 Fernando Perez <fperez@colorado.edu>
4876 4881
4877 4882 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
4878 4883 name from @gp_set_instance to @gp_set_default.
4879 4884
4880 4885 * IPython/ipmaker.py (make_IPython): default editor value set to
4881 4886 '0' (a string), to match the rc file. Otherwise will crash when
4882 4887 .strip() is called on it.
4883 4888
4884 4889
4885 4890 2002-06-28 Fernando Perez <fperez@colorado.edu>
4886 4891
4887 4892 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
4888 4893 of files in current directory when a file is executed via
4889 4894 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
4890 4895
4891 4896 * setup.py (manfiles): fix for rpm builds, submitted by RA
4892 4897 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
4893 4898
4894 4899 * IPython/ipmaker.py (make_IPython): fixed lookup of default
4895 4900 editor when set to '0'. Problem was, '0' evaluates to True (it's a
4896 4901 string!). A. Schmolck caught this one.
4897 4902
4898 4903 2002-06-27 Fernando Perez <fperez@colorado.edu>
4899 4904
4900 4905 * IPython/ipmaker.py (make_IPython): fixed bug when running user
4901 4906 defined files at the cmd line. __name__ wasn't being set to
4902 4907 __main__.
4903 4908
4904 4909 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
4905 4910 regular lists and tuples besides Numeric arrays.
4906 4911
4907 4912 * IPython/Prompts.py (CachedOutput.__call__): Added output
4908 4913 supression for input ending with ';'. Similar to Mathematica and
4909 4914 Matlab. The _* vars and Out[] list are still updated, just like
4910 4915 Mathematica behaves.
4911 4916
4912 4917 2002-06-25 Fernando Perez <fperez@colorado.edu>
4913 4918
4914 4919 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
4915 4920 .ini extensions for profiels under Windows.
4916 4921
4917 4922 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
4918 4923 string form. Fix contributed by Alexander Schmolck
4919 4924 <a.schmolck-AT-gmx.net>
4920 4925
4921 4926 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
4922 4927 pre-configured Gnuplot instance.
4923 4928
4924 4929 2002-06-21 Fernando Perez <fperez@colorado.edu>
4925 4930
4926 4931 * IPython/numutils.py (exp_safe): new function, works around the
4927 4932 underflow problems in Numeric.
4928 4933 (log2): New fn. Safe log in base 2: returns exact integer answer
4929 4934 for exact integer powers of 2.
4930 4935
4931 4936 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
4932 4937 properly.
4933 4938
4934 4939 2002-06-20 Fernando Perez <fperez@colorado.edu>
4935 4940
4936 4941 * IPython/genutils.py (timing): new function like
4937 4942 Mathematica's. Similar to time_test, but returns more info.
4938 4943
4939 4944 2002-06-18 Fernando Perez <fperez@colorado.edu>
4940 4945
4941 4946 * IPython/Magic.py (Magic.magic_save): modified @save and @r
4942 4947 according to Mike Heeter's suggestions.
4943 4948
4944 4949 2002-06-16 Fernando Perez <fperez@colorado.edu>
4945 4950
4946 4951 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
4947 4952 system. GnuplotMagic is gone as a user-directory option. New files
4948 4953 make it easier to use all the gnuplot stuff both from external
4949 4954 programs as well as from IPython. Had to rewrite part of
4950 4955 hardcopy() b/c of a strange bug: often the ps files simply don't
4951 4956 get created, and require a repeat of the command (often several
4952 4957 times).
4953 4958
4954 4959 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
4955 4960 resolve output channel at call time, so that if sys.stderr has
4956 4961 been redirected by user this gets honored.
4957 4962
4958 4963 2002-06-13 Fernando Perez <fperez@colorado.edu>
4959 4964
4960 4965 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
4961 4966 IPShell. Kept a copy with the old names to avoid breaking people's
4962 4967 embedded code.
4963 4968
4964 4969 * IPython/ipython: simplified it to the bare minimum after
4965 4970 Holger's suggestions. Added info about how to use it in
4966 4971 PYTHONSTARTUP.
4967 4972
4968 4973 * IPython/Shell.py (IPythonShell): changed the options passing
4969 4974 from a string with funky %s replacements to a straight list. Maybe
4970 4975 a bit more typing, but it follows sys.argv conventions, so there's
4971 4976 less special-casing to remember.
4972 4977
4973 4978 2002-06-12 Fernando Perez <fperez@colorado.edu>
4974 4979
4975 4980 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
4976 4981 command. Thanks to a suggestion by Mike Heeter.
4977 4982 (Magic.magic_pfile): added behavior to look at filenames if given
4978 4983 arg is not a defined object.
4979 4984 (Magic.magic_save): New @save function to save code snippets. Also
4980 4985 a Mike Heeter idea.
4981 4986
4982 4987 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
4983 4988 plot() and replot(). Much more convenient now, especially for
4984 4989 interactive use.
4985 4990
4986 4991 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
4987 4992 filenames.
4988 4993
4989 4994 2002-06-02 Fernando Perez <fperez@colorado.edu>
4990 4995
4991 4996 * IPython/Struct.py (Struct.__init__): modified to admit
4992 4997 initialization via another struct.
4993 4998
4994 4999 * IPython/genutils.py (SystemExec.__init__): New stateful
4995 5000 interface to xsys and bq. Useful for writing system scripts.
4996 5001
4997 5002 2002-05-30 Fernando Perez <fperez@colorado.edu>
4998 5003
4999 5004 * MANIFEST.in: Changed docfile selection to exclude all the lyx
5000 5005 documents. This will make the user download smaller (it's getting
5001 5006 too big).
5002 5007
5003 5008 2002-05-29 Fernando Perez <fperez@colorado.edu>
5004 5009
5005 5010 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
5006 5011 fix problems with shelve and pickle. Seems to work, but I don't
5007 5012 know if corner cases break it. Thanks to Mike Heeter
5008 5013 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
5009 5014
5010 5015 2002-05-24 Fernando Perez <fperez@colorado.edu>
5011 5016
5012 5017 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
5013 5018 macros having broken.
5014 5019
5015 5020 2002-05-21 Fernando Perez <fperez@colorado.edu>
5016 5021
5017 5022 * IPython/Magic.py (Magic.magic_logstart): fixed recently
5018 5023 introduced logging bug: all history before logging started was
5019 5024 being written one character per line! This came from the redesign
5020 5025 of the input history as a special list which slices to strings,
5021 5026 not to lists.
5022 5027
5023 5028 2002-05-20 Fernando Perez <fperez@colorado.edu>
5024 5029
5025 5030 * IPython/Prompts.py (CachedOutput.__init__): made the color table
5026 5031 be an attribute of all classes in this module. The design of these
5027 5032 classes needs some serious overhauling.
5028 5033
5029 5034 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
5030 5035 which was ignoring '_' in option names.
5031 5036
5032 5037 * IPython/ultraTB.py (FormattedTB.__init__): Changed
5033 5038 'Verbose_novars' to 'Context' and made it the new default. It's a
5034 5039 bit more readable and also safer than verbose.
5035 5040
5036 5041 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
5037 5042 triple-quoted strings.
5038 5043
5039 5044 * IPython/OInspect.py (__all__): new module exposing the object
5040 5045 introspection facilities. Now the corresponding magics are dummy
5041 5046 wrappers around this. Having this module will make it much easier
5042 5047 to put these functions into our modified pdb.
5043 5048 This new object inspector system uses the new colorizing module,
5044 5049 so source code and other things are nicely syntax highlighted.
5045 5050
5046 5051 2002-05-18 Fernando Perez <fperez@colorado.edu>
5047 5052
5048 5053 * IPython/ColorANSI.py: Split the coloring tools into a separate
5049 5054 module so I can use them in other code easier (they were part of
5050 5055 ultraTB).
5051 5056
5052 5057 2002-05-17 Fernando Perez <fperez@colorado.edu>
5053 5058
5054 5059 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5055 5060 fixed it to set the global 'g' also to the called instance, as
5056 5061 long as 'g' was still a gnuplot instance (so it doesn't overwrite
5057 5062 user's 'g' variables).
5058 5063
5059 5064 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
5060 5065 global variables (aliases to _ih,_oh) so that users which expect
5061 5066 In[5] or Out[7] to work aren't unpleasantly surprised.
5062 5067 (InputList.__getslice__): new class to allow executing slices of
5063 5068 input history directly. Very simple class, complements the use of
5064 5069 macros.
5065 5070
5066 5071 2002-05-16 Fernando Perez <fperez@colorado.edu>
5067 5072
5068 5073 * setup.py (docdirbase): make doc directory be just doc/IPython
5069 5074 without version numbers, it will reduce clutter for users.
5070 5075
5071 5076 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
5072 5077 execfile call to prevent possible memory leak. See for details:
5073 5078 http://mail.python.org/pipermail/python-list/2002-February/088476.html
5074 5079
5075 5080 2002-05-15 Fernando Perez <fperez@colorado.edu>
5076 5081
5077 5082 * IPython/Magic.py (Magic.magic_psource): made the object
5078 5083 introspection names be more standard: pdoc, pdef, pfile and
5079 5084 psource. They all print/page their output, and it makes
5080 5085 remembering them easier. Kept old names for compatibility as
5081 5086 aliases.
5082 5087
5083 5088 2002-05-14 Fernando Perez <fperez@colorado.edu>
5084 5089
5085 5090 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
5086 5091 what the mouse problem was. The trick is to use gnuplot with temp
5087 5092 files and NOT with pipes (for data communication), because having
5088 5093 both pipes and the mouse on is bad news.
5089 5094
5090 5095 2002-05-13 Fernando Perez <fperez@colorado.edu>
5091 5096
5092 5097 * IPython/Magic.py (Magic._ofind): fixed namespace order search
5093 5098 bug. Information would be reported about builtins even when
5094 5099 user-defined functions overrode them.
5095 5100
5096 5101 2002-05-11 Fernando Perez <fperez@colorado.edu>
5097 5102
5098 5103 * IPython/__init__.py (__all__): removed FlexCompleter from
5099 5104 __all__ so that things don't fail in platforms without readline.
5100 5105
5101 5106 2002-05-10 Fernando Perez <fperez@colorado.edu>
5102 5107
5103 5108 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
5104 5109 it requires Numeric, effectively making Numeric a dependency for
5105 5110 IPython.
5106 5111
5107 5112 * Released 0.2.13
5108 5113
5109 5114 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
5110 5115 profiler interface. Now all the major options from the profiler
5111 5116 module are directly supported in IPython, both for single
5112 5117 expressions (@prun) and for full programs (@run -p).
5113 5118
5114 5119 2002-05-09 Fernando Perez <fperez@colorado.edu>
5115 5120
5116 5121 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
5117 5122 magic properly formatted for screen.
5118 5123
5119 5124 * setup.py (make_shortcut): Changed things to put pdf version in
5120 5125 doc/ instead of doc/manual (had to change lyxport a bit).
5121 5126
5122 5127 * IPython/Magic.py (Profile.string_stats): made profile runs go
5123 5128 through pager (they are long and a pager allows searching, saving,
5124 5129 etc.)
5125 5130
5126 5131 2002-05-08 Fernando Perez <fperez@colorado.edu>
5127 5132
5128 5133 * Released 0.2.12
5129 5134
5130 5135 2002-05-06 Fernando Perez <fperez@colorado.edu>
5131 5136
5132 5137 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
5133 5138 introduced); 'hist n1 n2' was broken.
5134 5139 (Magic.magic_pdb): added optional on/off arguments to @pdb
5135 5140 (Magic.magic_run): added option -i to @run, which executes code in
5136 5141 the IPython namespace instead of a clean one. Also added @irun as
5137 5142 an alias to @run -i.
5138 5143
5139 5144 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
5140 5145 fixed (it didn't really do anything, the namespaces were wrong).
5141 5146
5142 5147 * IPython/Debugger.py (__init__): Added workaround for python 2.1
5143 5148
5144 5149 * IPython/__init__.py (__all__): Fixed package namespace, now
5145 5150 'import IPython' does give access to IPython.<all> as
5146 5151 expected. Also renamed __release__ to Release.
5147 5152
5148 5153 * IPython/Debugger.py (__license__): created new Pdb class which
5149 5154 functions like a drop-in for the normal pdb.Pdb but does NOT
5150 5155 import readline by default. This way it doesn't muck up IPython's
5151 5156 readline handling, and now tab-completion finally works in the
5152 5157 debugger -- sort of. It completes things globally visible, but the
5153 5158 completer doesn't track the stack as pdb walks it. That's a bit
5154 5159 tricky, and I'll have to implement it later.
5155 5160
5156 5161 2002-05-05 Fernando Perez <fperez@colorado.edu>
5157 5162
5158 5163 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
5159 5164 magic docstrings when printed via ? (explicit \'s were being
5160 5165 printed).
5161 5166
5162 5167 * IPython/ipmaker.py (make_IPython): fixed namespace
5163 5168 identification bug. Now variables loaded via logs or command-line
5164 5169 files are recognized in the interactive namespace by @who.
5165 5170
5166 5171 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
5167 5172 log replay system stemming from the string form of Structs.
5168 5173
5169 5174 * IPython/Magic.py (Macro.__init__): improved macros to properly
5170 5175 handle magic commands in them.
5171 5176 (Magic.magic_logstart): usernames are now expanded so 'logstart
5172 5177 ~/mylog' now works.
5173 5178
5174 5179 * IPython/iplib.py (complete): fixed bug where paths starting with
5175 5180 '/' would be completed as magic names.
5176 5181
5177 5182 2002-05-04 Fernando Perez <fperez@colorado.edu>
5178 5183
5179 5184 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
5180 5185 allow running full programs under the profiler's control.
5181 5186
5182 5187 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
5183 5188 mode to report exceptions verbosely but without formatting
5184 5189 variables. This addresses the issue of ipython 'freezing' (it's
5185 5190 not frozen, but caught in an expensive formatting loop) when huge
5186 5191 variables are in the context of an exception.
5187 5192 (VerboseTB.text): Added '--->' markers at line where exception was
5188 5193 triggered. Much clearer to read, especially in NoColor modes.
5189 5194
5190 5195 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
5191 5196 implemented in reverse when changing to the new parse_options().
5192 5197
5193 5198 2002-05-03 Fernando Perez <fperez@colorado.edu>
5194 5199
5195 5200 * IPython/Magic.py (Magic.parse_options): new function so that
5196 5201 magics can parse options easier.
5197 5202 (Magic.magic_prun): new function similar to profile.run(),
5198 5203 suggested by Chris Hart.
5199 5204 (Magic.magic_cd): fixed behavior so that it only changes if
5200 5205 directory actually is in history.
5201 5206
5202 5207 * IPython/usage.py (__doc__): added information about potential
5203 5208 slowness of Verbose exception mode when there are huge data
5204 5209 structures to be formatted (thanks to Archie Paulson).
5205 5210
5206 5211 * IPython/ipmaker.py (make_IPython): Changed default logging
5207 5212 (when simply called with -log) to use curr_dir/ipython.log in
5208 5213 rotate mode. Fixed crash which was occuring with -log before
5209 5214 (thanks to Jim Boyle).
5210 5215
5211 5216 2002-05-01 Fernando Perez <fperez@colorado.edu>
5212 5217
5213 5218 * Released 0.2.11 for these fixes (mainly the ultraTB one which
5214 5219 was nasty -- though somewhat of a corner case).
5215 5220
5216 5221 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
5217 5222 text (was a bug).
5218 5223
5219 5224 2002-04-30 Fernando Perez <fperez@colorado.edu>
5220 5225
5221 5226 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
5222 5227 a print after ^D or ^C from the user so that the In[] prompt
5223 5228 doesn't over-run the gnuplot one.
5224 5229
5225 5230 2002-04-29 Fernando Perez <fperez@colorado.edu>
5226 5231
5227 5232 * Released 0.2.10
5228 5233
5229 5234 * IPython/__release__.py (version): get date dynamically.
5230 5235
5231 5236 * Misc. documentation updates thanks to Arnd's comments. Also ran
5232 5237 a full spellcheck on the manual (hadn't been done in a while).
5233 5238
5234 5239 2002-04-27 Fernando Perez <fperez@colorado.edu>
5235 5240
5236 5241 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
5237 5242 starting a log in mid-session would reset the input history list.
5238 5243
5239 5244 2002-04-26 Fernando Perez <fperez@colorado.edu>
5240 5245
5241 5246 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
5242 5247 all files were being included in an update. Now anything in
5243 5248 UserConfig that matches [A-Za-z]*.py will go (this excludes
5244 5249 __init__.py)
5245 5250
5246 5251 2002-04-25 Fernando Perez <fperez@colorado.edu>
5247 5252
5248 5253 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
5249 5254 to __builtins__ so that any form of embedded or imported code can
5250 5255 test for being inside IPython.
5251 5256
5252 5257 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
5253 5258 changed to GnuplotMagic because it's now an importable module,
5254 5259 this makes the name follow that of the standard Gnuplot module.
5255 5260 GnuplotMagic can now be loaded at any time in mid-session.
5256 5261
5257 5262 2002-04-24 Fernando Perez <fperez@colorado.edu>
5258 5263
5259 5264 * IPython/numutils.py: removed SIUnits. It doesn't properly set
5260 5265 the globals (IPython has its own namespace) and the
5261 5266 PhysicalQuantity stuff is much better anyway.
5262 5267
5263 5268 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
5264 5269 embedding example to standard user directory for
5265 5270 distribution. Also put it in the manual.
5266 5271
5267 5272 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
5268 5273 instance as first argument (so it doesn't rely on some obscure
5269 5274 hidden global).
5270 5275
5271 5276 * IPython/UserConfig/ipythonrc.py: put () back in accepted
5272 5277 delimiters. While it prevents ().TAB from working, it allows
5273 5278 completions in open (... expressions. This is by far a more common
5274 5279 case.
5275 5280
5276 5281 2002-04-23 Fernando Perez <fperez@colorado.edu>
5277 5282
5278 5283 * IPython/Extensions/InterpreterPasteInput.py: new
5279 5284 syntax-processing module for pasting lines with >>> or ... at the
5280 5285 start.
5281 5286
5282 5287 * IPython/Extensions/PhysicalQ_Interactive.py
5283 5288 (PhysicalQuantityInteractive.__int__): fixed to work with either
5284 5289 Numeric or math.
5285 5290
5286 5291 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
5287 5292 provided profiles. Now we have:
5288 5293 -math -> math module as * and cmath with its own namespace.
5289 5294 -numeric -> Numeric as *, plus gnuplot & grace
5290 5295 -physics -> same as before
5291 5296
5292 5297 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
5293 5298 user-defined magics wouldn't be found by @magic if they were
5294 5299 defined as class methods. Also cleaned up the namespace search
5295 5300 logic and the string building (to use %s instead of many repeated
5296 5301 string adds).
5297 5302
5298 5303 * IPython/UserConfig/example-magic.py (magic_foo): updated example
5299 5304 of user-defined magics to operate with class methods (cleaner, in
5300 5305 line with the gnuplot code).
5301 5306
5302 5307 2002-04-22 Fernando Perez <fperez@colorado.edu>
5303 5308
5304 5309 * setup.py: updated dependency list so that manual is updated when
5305 5310 all included files change.
5306 5311
5307 5312 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
5308 5313 the delimiter removal option (the fix is ugly right now).
5309 5314
5310 5315 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
5311 5316 all of the math profile (quicker loading, no conflict between
5312 5317 g-9.8 and g-gnuplot).
5313 5318
5314 5319 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
5315 5320 name of post-mortem files to IPython_crash_report.txt.
5316 5321
5317 5322 * Cleanup/update of the docs. Added all the new readline info and
5318 5323 formatted all lists as 'real lists'.
5319 5324
5320 5325 * IPython/ipmaker.py (make_IPython): removed now-obsolete
5321 5326 tab-completion options, since the full readline parse_and_bind is
5322 5327 now accessible.
5323 5328
5324 5329 * IPython/iplib.py (InteractiveShell.init_readline): Changed
5325 5330 handling of readline options. Now users can specify any string to
5326 5331 be passed to parse_and_bind(), as well as the delimiters to be
5327 5332 removed.
5328 5333 (InteractiveShell.__init__): Added __name__ to the global
5329 5334 namespace so that things like Itpl which rely on its existence
5330 5335 don't crash.
5331 5336 (InteractiveShell._prefilter): Defined the default with a _ so
5332 5337 that prefilter() is easier to override, while the default one
5333 5338 remains available.
5334 5339
5335 5340 2002-04-18 Fernando Perez <fperez@colorado.edu>
5336 5341
5337 5342 * Added information about pdb in the docs.
5338 5343
5339 5344 2002-04-17 Fernando Perez <fperez@colorado.edu>
5340 5345
5341 5346 * IPython/ipmaker.py (make_IPython): added rc_override option to
5342 5347 allow passing config options at creation time which may override
5343 5348 anything set in the config files or command line. This is
5344 5349 particularly useful for configuring embedded instances.
5345 5350
5346 5351 2002-04-15 Fernando Perez <fperez@colorado.edu>
5347 5352
5348 5353 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
5349 5354 crash embedded instances because of the input cache falling out of
5350 5355 sync with the output counter.
5351 5356
5352 5357 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
5353 5358 mode which calls pdb after an uncaught exception in IPython itself.
5354 5359
5355 5360 2002-04-14 Fernando Perez <fperez@colorado.edu>
5356 5361
5357 5362 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
5358 5363 readline, fix it back after each call.
5359 5364
5360 5365 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
5361 5366 method to force all access via __call__(), which guarantees that
5362 5367 traceback references are properly deleted.
5363 5368
5364 5369 * IPython/Prompts.py (CachedOutput._display): minor fixes to
5365 5370 improve printing when pprint is in use.
5366 5371
5367 5372 2002-04-13 Fernando Perez <fperez@colorado.edu>
5368 5373
5369 5374 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
5370 5375 exceptions aren't caught anymore. If the user triggers one, he
5371 5376 should know why he's doing it and it should go all the way up,
5372 5377 just like any other exception. So now @abort will fully kill the
5373 5378 embedded interpreter and the embedding code (unless that happens
5374 5379 to catch SystemExit).
5375 5380
5376 5381 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
5377 5382 and a debugger() method to invoke the interactive pdb debugger
5378 5383 after printing exception information. Also added the corresponding
5379 5384 -pdb option and @pdb magic to control this feature, and updated
5380 5385 the docs. After a suggestion from Christopher Hart
5381 5386 (hart-AT-caltech.edu).
5382 5387
5383 5388 2002-04-12 Fernando Perez <fperez@colorado.edu>
5384 5389
5385 5390 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
5386 5391 the exception handlers defined by the user (not the CrashHandler)
5387 5392 so that user exceptions don't trigger an ipython bug report.
5388 5393
5389 5394 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
5390 5395 configurable (it should have always been so).
5391 5396
5392 5397 2002-03-26 Fernando Perez <fperez@colorado.edu>
5393 5398
5394 5399 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
5395 5400 and there to fix embedding namespace issues. This should all be
5396 5401 done in a more elegant way.
5397 5402
5398 5403 2002-03-25 Fernando Perez <fperez@colorado.edu>
5399 5404
5400 5405 * IPython/genutils.py (get_home_dir): Try to make it work under
5401 5406 win9x also.
5402 5407
5403 5408 2002-03-20 Fernando Perez <fperez@colorado.edu>
5404 5409
5405 5410 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
5406 5411 sys.displayhook untouched upon __init__.
5407 5412
5408 5413 2002-03-19 Fernando Perez <fperez@colorado.edu>
5409 5414
5410 5415 * Released 0.2.9 (for embedding bug, basically).
5411 5416
5412 5417 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
5413 5418 exceptions so that enclosing shell's state can be restored.
5414 5419
5415 5420 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
5416 5421 naming conventions in the .ipython/ dir.
5417 5422
5418 5423 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
5419 5424 from delimiters list so filenames with - in them get expanded.
5420 5425
5421 5426 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
5422 5427 sys.displayhook not being properly restored after an embedded call.
5423 5428
5424 5429 2002-03-18 Fernando Perez <fperez@colorado.edu>
5425 5430
5426 5431 * Released 0.2.8
5427 5432
5428 5433 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
5429 5434 some files weren't being included in a -upgrade.
5430 5435 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
5431 5436 on' so that the first tab completes.
5432 5437 (InteractiveShell.handle_magic): fixed bug with spaces around
5433 5438 quotes breaking many magic commands.
5434 5439
5435 5440 * setup.py: added note about ignoring the syntax error messages at
5436 5441 installation.
5437 5442
5438 5443 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
5439 5444 streamlining the gnuplot interface, now there's only one magic @gp.
5440 5445
5441 5446 2002-03-17 Fernando Perez <fperez@colorado.edu>
5442 5447
5443 5448 * IPython/UserConfig/magic_gnuplot.py: new name for the
5444 5449 example-magic_pm.py file. Much enhanced system, now with a shell
5445 5450 for communicating directly with gnuplot, one command at a time.
5446 5451
5447 5452 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
5448 5453 setting __name__=='__main__'.
5449 5454
5450 5455 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
5451 5456 mini-shell for accessing gnuplot from inside ipython. Should
5452 5457 extend it later for grace access too. Inspired by Arnd's
5453 5458 suggestion.
5454 5459
5455 5460 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
5456 5461 calling magic functions with () in their arguments. Thanks to Arnd
5457 5462 Baecker for pointing this to me.
5458 5463
5459 5464 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
5460 5465 infinitely for integer or complex arrays (only worked with floats).
5461 5466
5462 5467 2002-03-16 Fernando Perez <fperez@colorado.edu>
5463 5468
5464 5469 * setup.py: Merged setup and setup_windows into a single script
5465 5470 which properly handles things for windows users.
5466 5471
5467 5472 2002-03-15 Fernando Perez <fperez@colorado.edu>
5468 5473
5469 5474 * Big change to the manual: now the magics are all automatically
5470 5475 documented. This information is generated from their docstrings
5471 5476 and put in a latex file included by the manual lyx file. This way
5472 5477 we get always up to date information for the magics. The manual
5473 5478 now also has proper version information, also auto-synced.
5474 5479
5475 5480 For this to work, an undocumented --magic_docstrings option was added.
5476 5481
5477 5482 2002-03-13 Fernando Perez <fperez@colorado.edu>
5478 5483
5479 5484 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
5480 5485 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
5481 5486
5482 5487 2002-03-12 Fernando Perez <fperez@colorado.edu>
5483 5488
5484 5489 * IPython/ultraTB.py (TermColors): changed color escapes again to
5485 5490 fix the (old, reintroduced) line-wrapping bug. Basically, if
5486 5491 \001..\002 aren't given in the color escapes, lines get wrapped
5487 5492 weirdly. But giving those screws up old xterms and emacs terms. So
5488 5493 I added some logic for emacs terms to be ok, but I can't identify old
5489 5494 xterms separately ($TERM=='xterm' for many terminals, like konsole).
5490 5495
5491 5496 2002-03-10 Fernando Perez <fperez@colorado.edu>
5492 5497
5493 5498 * IPython/usage.py (__doc__): Various documentation cleanups and
5494 5499 updates, both in usage docstrings and in the manual.
5495 5500
5496 5501 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
5497 5502 handling of caching. Set minimum acceptabe value for having a
5498 5503 cache at 20 values.
5499 5504
5500 5505 * IPython/iplib.py (InteractiveShell.user_setup): moved the
5501 5506 install_first_time function to a method, renamed it and added an
5502 5507 'upgrade' mode. Now people can update their config directory with
5503 5508 a simple command line switch (-upgrade, also new).
5504 5509
5505 5510 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
5506 5511 @file (convenient for automagic users under Python >= 2.2).
5507 5512 Removed @files (it seemed more like a plural than an abbrev. of
5508 5513 'file show').
5509 5514
5510 5515 * IPython/iplib.py (install_first_time): Fixed crash if there were
5511 5516 backup files ('~') in .ipython/ install directory.
5512 5517
5513 5518 * IPython/ipmaker.py (make_IPython): fixes for new prompt
5514 5519 system. Things look fine, but these changes are fairly
5515 5520 intrusive. Test them for a few days.
5516 5521
5517 5522 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
5518 5523 the prompts system. Now all in/out prompt strings are user
5519 5524 controllable. This is particularly useful for embedding, as one
5520 5525 can tag embedded instances with particular prompts.
5521 5526
5522 5527 Also removed global use of sys.ps1/2, which now allows nested
5523 5528 embeddings without any problems. Added command-line options for
5524 5529 the prompt strings.
5525 5530
5526 5531 2002-03-08 Fernando Perez <fperez@colorado.edu>
5527 5532
5528 5533 * IPython/UserConfig/example-embed-short.py (ipshell): added
5529 5534 example file with the bare minimum code for embedding.
5530 5535
5531 5536 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
5532 5537 functionality for the embeddable shell to be activated/deactivated
5533 5538 either globally or at each call.
5534 5539
5535 5540 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
5536 5541 rewriting the prompt with '--->' for auto-inputs with proper
5537 5542 coloring. Now the previous UGLY hack in handle_auto() is gone, and
5538 5543 this is handled by the prompts class itself, as it should.
5539 5544
5540 5545 2002-03-05 Fernando Perez <fperez@colorado.edu>
5541 5546
5542 5547 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
5543 5548 @logstart to avoid name clashes with the math log function.
5544 5549
5545 5550 * Big updates to X/Emacs section of the manual.
5546 5551
5547 5552 * Removed ipython_emacs. Milan explained to me how to pass
5548 5553 arguments to ipython through Emacs. Some day I'm going to end up
5549 5554 learning some lisp...
5550 5555
5551 5556 2002-03-04 Fernando Perez <fperez@colorado.edu>
5552 5557
5553 5558 * IPython/ipython_emacs: Created script to be used as the
5554 5559 py-python-command Emacs variable so we can pass IPython
5555 5560 parameters. I can't figure out how to tell Emacs directly to pass
5556 5561 parameters to IPython, so a dummy shell script will do it.
5557 5562
5558 5563 Other enhancements made for things to work better under Emacs'
5559 5564 various types of terminals. Many thanks to Milan Zamazal
5560 5565 <pdm-AT-zamazal.org> for all the suggestions and pointers.
5561 5566
5562 5567 2002-03-01 Fernando Perez <fperez@colorado.edu>
5563 5568
5564 5569 * IPython/ipmaker.py (make_IPython): added a --readline! option so
5565 5570 that loading of readline is now optional. This gives better
5566 5571 control to emacs users.
5567 5572
5568 5573 * IPython/ultraTB.py (__date__): Modified color escape sequences
5569 5574 and now things work fine under xterm and in Emacs' term buffers
5570 5575 (though not shell ones). Well, in emacs you get colors, but all
5571 5576 seem to be 'light' colors (no difference between dark and light
5572 5577 ones). But the garbage chars are gone, and also in xterms. It
5573 5578 seems that now I'm using 'cleaner' ansi sequences.
5574 5579
5575 5580 2002-02-21 Fernando Perez <fperez@colorado.edu>
5576 5581
5577 5582 * Released 0.2.7 (mainly to publish the scoping fix).
5578 5583
5579 5584 * IPython/Logger.py (Logger.logstate): added. A corresponding
5580 5585 @logstate magic was created.
5581 5586
5582 5587 * IPython/Magic.py: fixed nested scoping problem under Python
5583 5588 2.1.x (automagic wasn't working).
5584 5589
5585 5590 2002-02-20 Fernando Perez <fperez@colorado.edu>
5586 5591
5587 5592 * Released 0.2.6.
5588 5593
5589 5594 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
5590 5595 option so that logs can come out without any headers at all.
5591 5596
5592 5597 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
5593 5598 SciPy.
5594 5599
5595 5600 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
5596 5601 that embedded IPython calls don't require vars() to be explicitly
5597 5602 passed. Now they are extracted from the caller's frame (code
5598 5603 snatched from Eric Jones' weave). Added better documentation to
5599 5604 the section on embedding and the example file.
5600 5605
5601 5606 * IPython/genutils.py (page): Changed so that under emacs, it just
5602 5607 prints the string. You can then page up and down in the emacs
5603 5608 buffer itself. This is how the builtin help() works.
5604 5609
5605 5610 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
5606 5611 macro scoping: macros need to be executed in the user's namespace
5607 5612 to work as if they had been typed by the user.
5608 5613
5609 5614 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
5610 5615 execute automatically (no need to type 'exec...'). They then
5611 5616 behave like 'true macros'. The printing system was also modified
5612 5617 for this to work.
5613 5618
5614 5619 2002-02-19 Fernando Perez <fperez@colorado.edu>
5615 5620
5616 5621 * IPython/genutils.py (page_file): new function for paging files
5617 5622 in an OS-independent way. Also necessary for file viewing to work
5618 5623 well inside Emacs buffers.
5619 5624 (page): Added checks for being in an emacs buffer.
5620 5625 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
5621 5626 same bug in iplib.
5622 5627
5623 5628 2002-02-18 Fernando Perez <fperez@colorado.edu>
5624 5629
5625 5630 * IPython/iplib.py (InteractiveShell.init_readline): modified use
5626 5631 of readline so that IPython can work inside an Emacs buffer.
5627 5632
5628 5633 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
5629 5634 method signatures (they weren't really bugs, but it looks cleaner
5630 5635 and keeps PyChecker happy).
5631 5636
5632 5637 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
5633 5638 for implementing various user-defined hooks. Currently only
5634 5639 display is done.
5635 5640
5636 5641 * IPython/Prompts.py (CachedOutput._display): changed display
5637 5642 functions so that they can be dynamically changed by users easily.
5638 5643
5639 5644 * IPython/Extensions/numeric_formats.py (num_display): added an
5640 5645 extension for printing NumPy arrays in flexible manners. It
5641 5646 doesn't do anything yet, but all the structure is in
5642 5647 place. Ultimately the plan is to implement output format control
5643 5648 like in Octave.
5644 5649
5645 5650 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
5646 5651 methods are found at run-time by all the automatic machinery.
5647 5652
5648 5653 2002-02-17 Fernando Perez <fperez@colorado.edu>
5649 5654
5650 5655 * setup_Windows.py (make_shortcut): documented. Cleaned up the
5651 5656 whole file a little.
5652 5657
5653 5658 * ToDo: closed this document. Now there's a new_design.lyx
5654 5659 document for all new ideas. Added making a pdf of it for the
5655 5660 end-user distro.
5656 5661
5657 5662 * IPython/Logger.py (Logger.switch_log): Created this to replace
5658 5663 logon() and logoff(). It also fixes a nasty crash reported by
5659 5664 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
5660 5665
5661 5666 * IPython/iplib.py (complete): got auto-completion to work with
5662 5667 automagic (I had wanted this for a long time).
5663 5668
5664 5669 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
5665 5670 to @file, since file() is now a builtin and clashes with automagic
5666 5671 for @file.
5667 5672
5668 5673 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
5669 5674 of this was previously in iplib, which had grown to more than 2000
5670 5675 lines, way too long. No new functionality, but it makes managing
5671 5676 the code a bit easier.
5672 5677
5673 5678 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
5674 5679 information to crash reports.
5675 5680
5676 5681 2002-02-12 Fernando Perez <fperez@colorado.edu>
5677 5682
5678 5683 * Released 0.2.5.
5679 5684
5680 5685 2002-02-11 Fernando Perez <fperez@colorado.edu>
5681 5686
5682 5687 * Wrote a relatively complete Windows installer. It puts
5683 5688 everything in place, creates Start Menu entries and fixes the
5684 5689 color issues. Nothing fancy, but it works.
5685 5690
5686 5691 2002-02-10 Fernando Perez <fperez@colorado.edu>
5687 5692
5688 5693 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
5689 5694 os.path.expanduser() call so that we can type @run ~/myfile.py and
5690 5695 have thigs work as expected.
5691 5696
5692 5697 * IPython/genutils.py (page): fixed exception handling so things
5693 5698 work both in Unix and Windows correctly. Quitting a pager triggers
5694 5699 an IOError/broken pipe in Unix, and in windows not finding a pager
5695 5700 is also an IOError, so I had to actually look at the return value
5696 5701 of the exception, not just the exception itself. Should be ok now.
5697 5702
5698 5703 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
5699 5704 modified to allow case-insensitive color scheme changes.
5700 5705
5701 5706 2002-02-09 Fernando Perez <fperez@colorado.edu>
5702 5707
5703 5708 * IPython/genutils.py (native_line_ends): new function to leave
5704 5709 user config files with os-native line-endings.
5705 5710
5706 5711 * README and manual updates.
5707 5712
5708 5713 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
5709 5714 instead of StringType to catch Unicode strings.
5710 5715
5711 5716 * IPython/genutils.py (filefind): fixed bug for paths with
5712 5717 embedded spaces (very common in Windows).
5713 5718
5714 5719 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
5715 5720 files under Windows, so that they get automatically associated
5716 5721 with a text editor. Windows makes it a pain to handle
5717 5722 extension-less files.
5718 5723
5719 5724 * IPython/iplib.py (InteractiveShell.init_readline): Made the
5720 5725 warning about readline only occur for Posix. In Windows there's no
5721 5726 way to get readline, so why bother with the warning.
5722 5727
5723 5728 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
5724 5729 for __str__ instead of dir(self), since dir() changed in 2.2.
5725 5730
5726 5731 * Ported to Windows! Tested on XP, I suspect it should work fine
5727 5732 on NT/2000, but I don't think it will work on 98 et al. That
5728 5733 series of Windows is such a piece of junk anyway that I won't try
5729 5734 porting it there. The XP port was straightforward, showed a few
5730 5735 bugs here and there (fixed all), in particular some string
5731 5736 handling stuff which required considering Unicode strings (which
5732 5737 Windows uses). This is good, but hasn't been too tested :) No
5733 5738 fancy installer yet, I'll put a note in the manual so people at
5734 5739 least make manually a shortcut.
5735 5740
5736 5741 * IPython/iplib.py (Magic.magic_colors): Unified the color options
5737 5742 into a single one, "colors". This now controls both prompt and
5738 5743 exception color schemes, and can be changed both at startup
5739 5744 (either via command-line switches or via ipythonrc files) and at
5740 5745 runtime, with @colors.
5741 5746 (Magic.magic_run): renamed @prun to @run and removed the old
5742 5747 @run. The two were too similar to warrant keeping both.
5743 5748
5744 5749 2002-02-03 Fernando Perez <fperez@colorado.edu>
5745 5750
5746 5751 * IPython/iplib.py (install_first_time): Added comment on how to
5747 5752 configure the color options for first-time users. Put a <return>
5748 5753 request at the end so that small-terminal users get a chance to
5749 5754 read the startup info.
5750 5755
5751 5756 2002-01-23 Fernando Perez <fperez@colorado.edu>
5752 5757
5753 5758 * IPython/iplib.py (CachedOutput.update): Changed output memory
5754 5759 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
5755 5760 input history we still use _i. Did this b/c these variable are
5756 5761 very commonly used in interactive work, so the less we need to
5757 5762 type the better off we are.
5758 5763 (Magic.magic_prun): updated @prun to better handle the namespaces
5759 5764 the file will run in, including a fix for __name__ not being set
5760 5765 before.
5761 5766
5762 5767 2002-01-20 Fernando Perez <fperez@colorado.edu>
5763 5768
5764 5769 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
5765 5770 extra garbage for Python 2.2. Need to look more carefully into
5766 5771 this later.
5767 5772
5768 5773 2002-01-19 Fernando Perez <fperez@colorado.edu>
5769 5774
5770 5775 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
5771 5776 display SyntaxError exceptions properly formatted when they occur
5772 5777 (they can be triggered by imported code).
5773 5778
5774 5779 2002-01-18 Fernando Perez <fperez@colorado.edu>
5775 5780
5776 5781 * IPython/iplib.py (InteractiveShell.safe_execfile): now
5777 5782 SyntaxError exceptions are reported nicely formatted, instead of
5778 5783 spitting out only offset information as before.
5779 5784 (Magic.magic_prun): Added the @prun function for executing
5780 5785 programs with command line args inside IPython.
5781 5786
5782 5787 2002-01-16 Fernando Perez <fperez@colorado.edu>
5783 5788
5784 5789 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
5785 5790 to *not* include the last item given in a range. This brings their
5786 5791 behavior in line with Python's slicing:
5787 5792 a[n1:n2] -> a[n1]...a[n2-1]
5788 5793 It may be a bit less convenient, but I prefer to stick to Python's
5789 5794 conventions *everywhere*, so users never have to wonder.
5790 5795 (Magic.magic_macro): Added @macro function to ease the creation of
5791 5796 macros.
5792 5797
5793 5798 2002-01-05 Fernando Perez <fperez@colorado.edu>
5794 5799
5795 5800 * Released 0.2.4.
5796 5801
5797 5802 * IPython/iplib.py (Magic.magic_pdef):
5798 5803 (InteractiveShell.safe_execfile): report magic lines and error
5799 5804 lines without line numbers so one can easily copy/paste them for
5800 5805 re-execution.
5801 5806
5802 5807 * Updated manual with recent changes.
5803 5808
5804 5809 * IPython/iplib.py (Magic.magic_oinfo): added constructor
5805 5810 docstring printing when class? is called. Very handy for knowing
5806 5811 how to create class instances (as long as __init__ is well
5807 5812 documented, of course :)
5808 5813 (Magic.magic_doc): print both class and constructor docstrings.
5809 5814 (Magic.magic_pdef): give constructor info if passed a class and
5810 5815 __call__ info for callable object instances.
5811 5816
5812 5817 2002-01-04 Fernando Perez <fperez@colorado.edu>
5813 5818
5814 5819 * Made deep_reload() off by default. It doesn't always work
5815 5820 exactly as intended, so it's probably safer to have it off. It's
5816 5821 still available as dreload() anyway, so nothing is lost.
5817 5822
5818 5823 2002-01-02 Fernando Perez <fperez@colorado.edu>
5819 5824
5820 5825 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
5821 5826 so I wanted an updated release).
5822 5827
5823 5828 2001-12-27 Fernando Perez <fperez@colorado.edu>
5824 5829
5825 5830 * IPython/iplib.py (InteractiveShell.interact): Added the original
5826 5831 code from 'code.py' for this module in order to change the
5827 5832 handling of a KeyboardInterrupt. This was necessary b/c otherwise
5828 5833 the history cache would break when the user hit Ctrl-C, and
5829 5834 interact() offers no way to add any hooks to it.
5830 5835
5831 5836 2001-12-23 Fernando Perez <fperez@colorado.edu>
5832 5837
5833 5838 * setup.py: added check for 'MANIFEST' before trying to remove
5834 5839 it. Thanks to Sean Reifschneider.
5835 5840
5836 5841 2001-12-22 Fernando Perez <fperez@colorado.edu>
5837 5842
5838 5843 * Released 0.2.2.
5839 5844
5840 5845 * Finished (reasonably) writing the manual. Later will add the
5841 5846 python-standard navigation stylesheets, but for the time being
5842 5847 it's fairly complete. Distribution will include html and pdf
5843 5848 versions.
5844 5849
5845 5850 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
5846 5851 (MayaVi author).
5847 5852
5848 5853 2001-12-21 Fernando Perez <fperez@colorado.edu>
5849 5854
5850 5855 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
5851 5856 good public release, I think (with the manual and the distutils
5852 5857 installer). The manual can use some work, but that can go
5853 5858 slowly. Otherwise I think it's quite nice for end users. Next
5854 5859 summer, rewrite the guts of it...
5855 5860
5856 5861 * Changed format of ipythonrc files to use whitespace as the
5857 5862 separator instead of an explicit '='. Cleaner.
5858 5863
5859 5864 2001-12-20 Fernando Perez <fperez@colorado.edu>
5860 5865
5861 5866 * Started a manual in LyX. For now it's just a quick merge of the
5862 5867 various internal docstrings and READMEs. Later it may grow into a
5863 5868 nice, full-blown manual.
5864 5869
5865 5870 * Set up a distutils based installer. Installation should now be
5866 5871 trivially simple for end-users.
5867 5872
5868 5873 2001-12-11 Fernando Perez <fperez@colorado.edu>
5869 5874
5870 5875 * Released 0.2.0. First public release, announced it at
5871 5876 comp.lang.python. From now on, just bugfixes...
5872 5877
5873 5878 * Went through all the files, set copyright/license notices and
5874 5879 cleaned up things. Ready for release.
5875 5880
5876 5881 2001-12-10 Fernando Perez <fperez@colorado.edu>
5877 5882
5878 5883 * Changed the first-time installer not to use tarfiles. It's more
5879 5884 robust now and less unix-dependent. Also makes it easier for
5880 5885 people to later upgrade versions.
5881 5886
5882 5887 * Changed @exit to @abort to reflect the fact that it's pretty
5883 5888 brutal (a sys.exit()). The difference between @abort and Ctrl-D
5884 5889 becomes significant only when IPyhton is embedded: in that case,
5885 5890 C-D closes IPython only, but @abort kills the enclosing program
5886 5891 too (unless it had called IPython inside a try catching
5887 5892 SystemExit).
5888 5893
5889 5894 * Created Shell module which exposes the actuall IPython Shell
5890 5895 classes, currently the normal and the embeddable one. This at
5891 5896 least offers a stable interface we won't need to change when
5892 5897 (later) the internals are rewritten. That rewrite will be confined
5893 5898 to iplib and ipmaker, but the Shell interface should remain as is.
5894 5899
5895 5900 * Added embed module which offers an embeddable IPShell object,
5896 5901 useful to fire up IPython *inside* a running program. Great for
5897 5902 debugging or dynamical data analysis.
5898 5903
5899 5904 2001-12-08 Fernando Perez <fperez@colorado.edu>
5900 5905
5901 5906 * Fixed small bug preventing seeing info from methods of defined
5902 5907 objects (incorrect namespace in _ofind()).
5903 5908
5904 5909 * Documentation cleanup. Moved the main usage docstrings to a
5905 5910 separate file, usage.py (cleaner to maintain, and hopefully in the
5906 5911 future some perlpod-like way of producing interactive, man and
5907 5912 html docs out of it will be found).
5908 5913
5909 5914 * Added @profile to see your profile at any time.
5910 5915
5911 5916 * Added @p as an alias for 'print'. It's especially convenient if
5912 5917 using automagic ('p x' prints x).
5913 5918
5914 5919 * Small cleanups and fixes after a pychecker run.
5915 5920
5916 5921 * Changed the @cd command to handle @cd - and @cd -<n> for
5917 5922 visiting any directory in _dh.
5918 5923
5919 5924 * Introduced _dh, a history of visited directories. @dhist prints
5920 5925 it out with numbers.
5921 5926
5922 5927 2001-12-07 Fernando Perez <fperez@colorado.edu>
5923 5928
5924 5929 * Released 0.1.22
5925 5930
5926 5931 * Made initialization a bit more robust against invalid color
5927 5932 options in user input (exit, not traceback-crash).
5928 5933
5929 5934 * Changed the bug crash reporter to write the report only in the
5930 5935 user's .ipython directory. That way IPython won't litter people's
5931 5936 hard disks with crash files all over the place. Also print on
5932 5937 screen the necessary mail command.
5933 5938
5934 5939 * With the new ultraTB, implemented LightBG color scheme for light
5935 5940 background terminals. A lot of people like white backgrounds, so I
5936 5941 guess we should at least give them something readable.
5937 5942
5938 5943 2001-12-06 Fernando Perez <fperez@colorado.edu>
5939 5944
5940 5945 * Modified the structure of ultraTB. Now there's a proper class
5941 5946 for tables of color schemes which allow adding schemes easily and
5942 5947 switching the active scheme without creating a new instance every
5943 5948 time (which was ridiculous). The syntax for creating new schemes
5944 5949 is also cleaner. I think ultraTB is finally done, with a clean
5945 5950 class structure. Names are also much cleaner (now there's proper
5946 5951 color tables, no need for every variable to also have 'color' in
5947 5952 its name).
5948 5953
5949 5954 * Broke down genutils into separate files. Now genutils only
5950 5955 contains utility functions, and classes have been moved to their
5951 5956 own files (they had enough independent functionality to warrant
5952 5957 it): ConfigLoader, OutputTrap, Struct.
5953 5958
5954 5959 2001-12-05 Fernando Perez <fperez@colorado.edu>
5955 5960
5956 5961 * IPython turns 21! Released version 0.1.21, as a candidate for
5957 5962 public consumption. If all goes well, release in a few days.
5958 5963
5959 5964 * Fixed path bug (files in Extensions/ directory wouldn't be found
5960 5965 unless IPython/ was explicitly in sys.path).
5961 5966
5962 5967 * Extended the FlexCompleter class as MagicCompleter to allow
5963 5968 completion of @-starting lines.
5964 5969
5965 5970 * Created __release__.py file as a central repository for release
5966 5971 info that other files can read from.
5967 5972
5968 5973 * Fixed small bug in logging: when logging was turned on in
5969 5974 mid-session, old lines with special meanings (!@?) were being
5970 5975 logged without the prepended comment, which is necessary since
5971 5976 they are not truly valid python syntax. This should make session
5972 5977 restores produce less errors.
5973 5978
5974 5979 * The namespace cleanup forced me to make a FlexCompleter class
5975 5980 which is nothing but a ripoff of rlcompleter, but with selectable
5976 5981 namespace (rlcompleter only works in __main__.__dict__). I'll try
5977 5982 to submit a note to the authors to see if this change can be
5978 5983 incorporated in future rlcompleter releases (Dec.6: done)
5979 5984
5980 5985 * More fixes to namespace handling. It was a mess! Now all
5981 5986 explicit references to __main__.__dict__ are gone (except when
5982 5987 really needed) and everything is handled through the namespace
5983 5988 dicts in the IPython instance. We seem to be getting somewhere
5984 5989 with this, finally...
5985 5990
5986 5991 * Small documentation updates.
5987 5992
5988 5993 * Created the Extensions directory under IPython (with an
5989 5994 __init__.py). Put the PhysicalQ stuff there. This directory should
5990 5995 be used for all special-purpose extensions.
5991 5996
5992 5997 * File renaming:
5993 5998 ipythonlib --> ipmaker
5994 5999 ipplib --> iplib
5995 6000 This makes a bit more sense in terms of what these files actually do.
5996 6001
5997 6002 * Moved all the classes and functions in ipythonlib to ipplib, so
5998 6003 now ipythonlib only has make_IPython(). This will ease up its
5999 6004 splitting in smaller functional chunks later.
6000 6005
6001 6006 * Cleaned up (done, I think) output of @whos. Better column
6002 6007 formatting, and now shows str(var) for as much as it can, which is
6003 6008 typically what one gets with a 'print var'.
6004 6009
6005 6010 2001-12-04 Fernando Perez <fperez@colorado.edu>
6006 6011
6007 6012 * Fixed namespace problems. Now builtin/IPyhton/user names get
6008 6013 properly reported in their namespace. Internal namespace handling
6009 6014 is finally getting decent (not perfect yet, but much better than
6010 6015 the ad-hoc mess we had).
6011 6016
6012 6017 * Removed -exit option. If people just want to run a python
6013 6018 script, that's what the normal interpreter is for. Less
6014 6019 unnecessary options, less chances for bugs.
6015 6020
6016 6021 * Added a crash handler which generates a complete post-mortem if
6017 6022 IPython crashes. This will help a lot in tracking bugs down the
6018 6023 road.
6019 6024
6020 6025 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
6021 6026 which were boud to functions being reassigned would bypass the
6022 6027 logger, breaking the sync of _il with the prompt counter. This
6023 6028 would then crash IPython later when a new line was logged.
6024 6029
6025 6030 2001-12-02 Fernando Perez <fperez@colorado.edu>
6026 6031
6027 6032 * Made IPython a package. This means people don't have to clutter
6028 6033 their sys.path with yet another directory. Changed the INSTALL
6029 6034 file accordingly.
6030 6035
6031 6036 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
6032 6037 sorts its output (so @who shows it sorted) and @whos formats the
6033 6038 table according to the width of the first column. Nicer, easier to
6034 6039 read. Todo: write a generic table_format() which takes a list of
6035 6040 lists and prints it nicely formatted, with optional row/column
6036 6041 separators and proper padding and justification.
6037 6042
6038 6043 * Released 0.1.20
6039 6044
6040 6045 * Fixed bug in @log which would reverse the inputcache list (a
6041 6046 copy operation was missing).
6042 6047
6043 6048 * Code cleanup. @config was changed to use page(). Better, since
6044 6049 its output is always quite long.
6045 6050
6046 6051 * Itpl is back as a dependency. I was having too many problems
6047 6052 getting the parametric aliases to work reliably, and it's just
6048 6053 easier to code weird string operations with it than playing %()s
6049 6054 games. It's only ~6k, so I don't think it's too big a deal.
6050 6055
6051 6056 * Found (and fixed) a very nasty bug with history. !lines weren't
6052 6057 getting cached, and the out of sync caches would crash
6053 6058 IPython. Fixed it by reorganizing the prefilter/handlers/logger
6054 6059 division of labor a bit better. Bug fixed, cleaner structure.
6055 6060
6056 6061 2001-12-01 Fernando Perez <fperez@colorado.edu>
6057 6062
6058 6063 * Released 0.1.19
6059 6064
6060 6065 * Added option -n to @hist to prevent line number printing. Much
6061 6066 easier to copy/paste code this way.
6062 6067
6063 6068 * Created global _il to hold the input list. Allows easy
6064 6069 re-execution of blocks of code by slicing it (inspired by Janko's
6065 6070 comment on 'macros').
6066 6071
6067 6072 * Small fixes and doc updates.
6068 6073
6069 6074 * Rewrote @history function (was @h). Renamed it to @hist, @h is
6070 6075 much too fragile with automagic. Handles properly multi-line
6071 6076 statements and takes parameters.
6072 6077
6073 6078 2001-11-30 Fernando Perez <fperez@colorado.edu>
6074 6079
6075 6080 * Version 0.1.18 released.
6076 6081
6077 6082 * Fixed nasty namespace bug in initial module imports.
6078 6083
6079 6084 * Added copyright/license notes to all code files (except
6080 6085 DPyGetOpt). For the time being, LGPL. That could change.
6081 6086
6082 6087 * Rewrote a much nicer README, updated INSTALL, cleaned up
6083 6088 ipythonrc-* samples.
6084 6089
6085 6090 * Overall code/documentation cleanup. Basically ready for
6086 6091 release. Only remaining thing: licence decision (LGPL?).
6087 6092
6088 6093 * Converted load_config to a class, ConfigLoader. Now recursion
6089 6094 control is better organized. Doesn't include the same file twice.
6090 6095
6091 6096 2001-11-29 Fernando Perez <fperez@colorado.edu>
6092 6097
6093 6098 * Got input history working. Changed output history variables from
6094 6099 _p to _o so that _i is for input and _o for output. Just cleaner
6095 6100 convention.
6096 6101
6097 6102 * Implemented parametric aliases. This pretty much allows the
6098 6103 alias system to offer full-blown shell convenience, I think.
6099 6104
6100 6105 * Version 0.1.17 released, 0.1.18 opened.
6101 6106
6102 6107 * dot_ipython/ipythonrc (alias): added documentation.
6103 6108 (xcolor): Fixed small bug (xcolors -> xcolor)
6104 6109
6105 6110 * Changed the alias system. Now alias is a magic command to define
6106 6111 aliases just like the shell. Rationale: the builtin magics should
6107 6112 be there for things deeply connected to IPython's
6108 6113 architecture. And this is a much lighter system for what I think
6109 6114 is the really important feature: allowing users to define quickly
6110 6115 magics that will do shell things for them, so they can customize
6111 6116 IPython easily to match their work habits. If someone is really
6112 6117 desperate to have another name for a builtin alias, they can
6113 6118 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
6114 6119 works.
6115 6120
6116 6121 2001-11-28 Fernando Perez <fperez@colorado.edu>
6117 6122
6118 6123 * Changed @file so that it opens the source file at the proper
6119 6124 line. Since it uses less, if your EDITOR environment is
6120 6125 configured, typing v will immediately open your editor of choice
6121 6126 right at the line where the object is defined. Not as quick as
6122 6127 having a direct @edit command, but for all intents and purposes it
6123 6128 works. And I don't have to worry about writing @edit to deal with
6124 6129 all the editors, less does that.
6125 6130
6126 6131 * Version 0.1.16 released, 0.1.17 opened.
6127 6132
6128 6133 * Fixed some nasty bugs in the page/page_dumb combo that could
6129 6134 crash IPython.
6130 6135
6131 6136 2001-11-27 Fernando Perez <fperez@colorado.edu>
6132 6137
6133 6138 * Version 0.1.15 released, 0.1.16 opened.
6134 6139
6135 6140 * Finally got ? and ?? to work for undefined things: now it's
6136 6141 possible to type {}.get? and get information about the get method
6137 6142 of dicts, or os.path? even if only os is defined (so technically
6138 6143 os.path isn't). Works at any level. For example, after import os,
6139 6144 os?, os.path?, os.path.abspath? all work. This is great, took some
6140 6145 work in _ofind.
6141 6146
6142 6147 * Fixed more bugs with logging. The sanest way to do it was to add
6143 6148 to @log a 'mode' parameter. Killed two in one shot (this mode
6144 6149 option was a request of Janko's). I think it's finally clean
6145 6150 (famous last words).
6146 6151
6147 6152 * Added a page_dumb() pager which does a decent job of paging on
6148 6153 screen, if better things (like less) aren't available. One less
6149 6154 unix dependency (someday maybe somebody will port this to
6150 6155 windows).
6151 6156
6152 6157 * Fixed problem in magic_log: would lock of logging out if log
6153 6158 creation failed (because it would still think it had succeeded).
6154 6159
6155 6160 * Improved the page() function using curses to auto-detect screen
6156 6161 size. Now it can make a much better decision on whether to print
6157 6162 or page a string. Option screen_length was modified: a value 0
6158 6163 means auto-detect, and that's the default now.
6159 6164
6160 6165 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
6161 6166 go out. I'll test it for a few days, then talk to Janko about
6162 6167 licences and announce it.
6163 6168
6164 6169 * Fixed the length of the auto-generated ---> prompt which appears
6165 6170 for auto-parens and auto-quotes. Getting this right isn't trivial,
6166 6171 with all the color escapes, different prompt types and optional
6167 6172 separators. But it seems to be working in all the combinations.
6168 6173
6169 6174 2001-11-26 Fernando Perez <fperez@colorado.edu>
6170 6175
6171 6176 * Wrote a regexp filter to get option types from the option names
6172 6177 string. This eliminates the need to manually keep two duplicate
6173 6178 lists.
6174 6179
6175 6180 * Removed the unneeded check_option_names. Now options are handled
6176 6181 in a much saner manner and it's easy to visually check that things
6177 6182 are ok.
6178 6183
6179 6184 * Updated version numbers on all files I modified to carry a
6180 6185 notice so Janko and Nathan have clear version markers.
6181 6186
6182 6187 * Updated docstring for ultraTB with my changes. I should send
6183 6188 this to Nathan.
6184 6189
6185 6190 * Lots of small fixes. Ran everything through pychecker again.
6186 6191
6187 6192 * Made loading of deep_reload an cmd line option. If it's not too
6188 6193 kosher, now people can just disable it. With -nodeep_reload it's
6189 6194 still available as dreload(), it just won't overwrite reload().
6190 6195
6191 6196 * Moved many options to the no| form (-opt and -noopt
6192 6197 accepted). Cleaner.
6193 6198
6194 6199 * Changed magic_log so that if called with no parameters, it uses
6195 6200 'rotate' mode. That way auto-generated logs aren't automatically
6196 6201 over-written. For normal logs, now a backup is made if it exists
6197 6202 (only 1 level of backups). A new 'backup' mode was added to the
6198 6203 Logger class to support this. This was a request by Janko.
6199 6204
6200 6205 * Added @logoff/@logon to stop/restart an active log.
6201 6206
6202 6207 * Fixed a lot of bugs in log saving/replay. It was pretty
6203 6208 broken. Now special lines (!@,/) appear properly in the command
6204 6209 history after a log replay.
6205 6210
6206 6211 * Tried and failed to implement full session saving via pickle. My
6207 6212 idea was to pickle __main__.__dict__, but modules can't be
6208 6213 pickled. This would be a better alternative to replaying logs, but
6209 6214 seems quite tricky to get to work. Changed -session to be called
6210 6215 -logplay, which more accurately reflects what it does. And if we
6211 6216 ever get real session saving working, -session is now available.
6212 6217
6213 6218 * Implemented color schemes for prompts also. As for tracebacks,
6214 6219 currently only NoColor and Linux are supported. But now the
6215 6220 infrastructure is in place, based on a generic ColorScheme
6216 6221 class. So writing and activating new schemes both for the prompts
6217 6222 and the tracebacks should be straightforward.
6218 6223
6219 6224 * Version 0.1.13 released, 0.1.14 opened.
6220 6225
6221 6226 * Changed handling of options for output cache. Now counter is
6222 6227 hardwired starting at 1 and one specifies the maximum number of
6223 6228 entries *in the outcache* (not the max prompt counter). This is
6224 6229 much better, since many statements won't increase the cache
6225 6230 count. It also eliminated some confusing options, now there's only
6226 6231 one: cache_size.
6227 6232
6228 6233 * Added 'alias' magic function and magic_alias option in the
6229 6234 ipythonrc file. Now the user can easily define whatever names he
6230 6235 wants for the magic functions without having to play weird
6231 6236 namespace games. This gives IPython a real shell-like feel.
6232 6237
6233 6238 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
6234 6239 @ or not).
6235 6240
6236 6241 This was one of the last remaining 'visible' bugs (that I know
6237 6242 of). I think if I can clean up the session loading so it works
6238 6243 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
6239 6244 about licensing).
6240 6245
6241 6246 2001-11-25 Fernando Perez <fperez@colorado.edu>
6242 6247
6243 6248 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
6244 6249 there's a cleaner distinction between what ? and ?? show.
6245 6250
6246 6251 * Added screen_length option. Now the user can define his own
6247 6252 screen size for page() operations.
6248 6253
6249 6254 * Implemented magic shell-like functions with automatic code
6250 6255 generation. Now adding another function is just a matter of adding
6251 6256 an entry to a dict, and the function is dynamically generated at
6252 6257 run-time. Python has some really cool features!
6253 6258
6254 6259 * Renamed many options to cleanup conventions a little. Now all
6255 6260 are lowercase, and only underscores where needed. Also in the code
6256 6261 option name tables are clearer.
6257 6262
6258 6263 * Changed prompts a little. Now input is 'In [n]:' instead of
6259 6264 'In[n]:='. This allows it the numbers to be aligned with the
6260 6265 Out[n] numbers, and removes usage of ':=' which doesn't exist in
6261 6266 Python (it was a Mathematica thing). The '...' continuation prompt
6262 6267 was also changed a little to align better.
6263 6268
6264 6269 * Fixed bug when flushing output cache. Not all _p<n> variables
6265 6270 exist, so their deletion needs to be wrapped in a try:
6266 6271
6267 6272 * Figured out how to properly use inspect.formatargspec() (it
6268 6273 requires the args preceded by *). So I removed all the code from
6269 6274 _get_pdef in Magic, which was just replicating that.
6270 6275
6271 6276 * Added test to prefilter to allow redefining magic function names
6272 6277 as variables. This is ok, since the @ form is always available,
6273 6278 but whe should allow the user to define a variable called 'ls' if
6274 6279 he needs it.
6275 6280
6276 6281 * Moved the ToDo information from README into a separate ToDo.
6277 6282
6278 6283 * General code cleanup and small bugfixes. I think it's close to a
6279 6284 state where it can be released, obviously with a big 'beta'
6280 6285 warning on it.
6281 6286
6282 6287 * Got the magic function split to work. Now all magics are defined
6283 6288 in a separate class. It just organizes things a bit, and now
6284 6289 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
6285 6290 was too long).
6286 6291
6287 6292 * Changed @clear to @reset to avoid potential confusions with
6288 6293 the shell command clear. Also renamed @cl to @clear, which does
6289 6294 exactly what people expect it to from their shell experience.
6290 6295
6291 6296 Added a check to the @reset command (since it's so
6292 6297 destructive, it's probably a good idea to ask for confirmation).
6293 6298 But now reset only works for full namespace resetting. Since the
6294 6299 del keyword is already there for deleting a few specific
6295 6300 variables, I don't see the point of having a redundant magic
6296 6301 function for the same task.
6297 6302
6298 6303 2001-11-24 Fernando Perez <fperez@colorado.edu>
6299 6304
6300 6305 * Updated the builtin docs (esp. the ? ones).
6301 6306
6302 6307 * Ran all the code through pychecker. Not terribly impressed with
6303 6308 it: lots of spurious warnings and didn't really find anything of
6304 6309 substance (just a few modules being imported and not used).
6305 6310
6306 6311 * Implemented the new ultraTB functionality into IPython. New
6307 6312 option: xcolors. This chooses color scheme. xmode now only selects
6308 6313 between Plain and Verbose. Better orthogonality.
6309 6314
6310 6315 * Large rewrite of ultraTB. Much cleaner now, with a separation of
6311 6316 mode and color scheme for the exception handlers. Now it's
6312 6317 possible to have the verbose traceback with no coloring.
6313 6318
6314 6319 2001-11-23 Fernando Perez <fperez@colorado.edu>
6315 6320
6316 6321 * Version 0.1.12 released, 0.1.13 opened.
6317 6322
6318 6323 * Removed option to set auto-quote and auto-paren escapes by
6319 6324 user. The chances of breaking valid syntax are just too high. If
6320 6325 someone *really* wants, they can always dig into the code.
6321 6326
6322 6327 * Made prompt separators configurable.
6323 6328
6324 6329 2001-11-22 Fernando Perez <fperez@colorado.edu>
6325 6330
6326 6331 * Small bugfixes in many places.
6327 6332
6328 6333 * Removed the MyCompleter class from ipplib. It seemed redundant
6329 6334 with the C-p,C-n history search functionality. Less code to
6330 6335 maintain.
6331 6336
6332 6337 * Moved all the original ipython.py code into ipythonlib.py. Right
6333 6338 now it's just one big dump into a function called make_IPython, so
6334 6339 no real modularity has been gained. But at least it makes the
6335 6340 wrapper script tiny, and since ipythonlib is a module, it gets
6336 6341 compiled and startup is much faster.
6337 6342
6338 6343 This is a reasobably 'deep' change, so we should test it for a
6339 6344 while without messing too much more with the code.
6340 6345
6341 6346 2001-11-21 Fernando Perez <fperez@colorado.edu>
6342 6347
6343 6348 * Version 0.1.11 released, 0.1.12 opened for further work.
6344 6349
6345 6350 * Removed dependency on Itpl. It was only needed in one place. It
6346 6351 would be nice if this became part of python, though. It makes life
6347 6352 *a lot* easier in some cases.
6348 6353
6349 6354 * Simplified the prefilter code a bit. Now all handlers are
6350 6355 expected to explicitly return a value (at least a blank string).
6351 6356
6352 6357 * Heavy edits in ipplib. Removed the help system altogether. Now
6353 6358 obj?/?? is used for inspecting objects, a magic @doc prints
6354 6359 docstrings, and full-blown Python help is accessed via the 'help'
6355 6360 keyword. This cleans up a lot of code (less to maintain) and does
6356 6361 the job. Since 'help' is now a standard Python component, might as
6357 6362 well use it and remove duplicate functionality.
6358 6363
6359 6364 Also removed the option to use ipplib as a standalone program. By
6360 6365 now it's too dependent on other parts of IPython to function alone.
6361 6366
6362 6367 * Fixed bug in genutils.pager. It would crash if the pager was
6363 6368 exited immediately after opening (broken pipe).
6364 6369
6365 6370 * Trimmed down the VerboseTB reporting a little. The header is
6366 6371 much shorter now and the repeated exception arguments at the end
6367 6372 have been removed. For interactive use the old header seemed a bit
6368 6373 excessive.
6369 6374
6370 6375 * Fixed small bug in output of @whos for variables with multi-word
6371 6376 types (only first word was displayed).
6372 6377
6373 6378 2001-11-17 Fernando Perez <fperez@colorado.edu>
6374 6379
6375 6380 * Version 0.1.10 released, 0.1.11 opened for further work.
6376 6381
6377 6382 * Modified dirs and friends. dirs now *returns* the stack (not
6378 6383 prints), so one can manipulate it as a variable. Convenient to
6379 6384 travel along many directories.
6380 6385
6381 6386 * Fixed bug in magic_pdef: would only work with functions with
6382 6387 arguments with default values.
6383 6388
6384 6389 2001-11-14 Fernando Perez <fperez@colorado.edu>
6385 6390
6386 6391 * Added the PhysicsInput stuff to dot_ipython so it ships as an
6387 6392 example with IPython. Various other minor fixes and cleanups.
6388 6393
6389 6394 * Version 0.1.9 released, 0.1.10 opened for further work.
6390 6395
6391 6396 * Added sys.path to the list of directories searched in the
6392 6397 execfile= option. It used to be the current directory and the
6393 6398 user's IPYTHONDIR only.
6394 6399
6395 6400 2001-11-13 Fernando Perez <fperez@colorado.edu>
6396 6401
6397 6402 * Reinstated the raw_input/prefilter separation that Janko had
6398 6403 initially. This gives a more convenient setup for extending the
6399 6404 pre-processor from the outside: raw_input always gets a string,
6400 6405 and prefilter has to process it. We can then redefine prefilter
6401 6406 from the outside and implement extensions for special
6402 6407 purposes.
6403 6408
6404 6409 Today I got one for inputting PhysicalQuantity objects
6405 6410 (from Scientific) without needing any function calls at
6406 6411 all. Extremely convenient, and it's all done as a user-level
6407 6412 extension (no IPython code was touched). Now instead of:
6408 6413 a = PhysicalQuantity(4.2,'m/s**2')
6409 6414 one can simply say
6410 6415 a = 4.2 m/s**2
6411 6416 or even
6412 6417 a = 4.2 m/s^2
6413 6418
6414 6419 I use this, but it's also a proof of concept: IPython really is
6415 6420 fully user-extensible, even at the level of the parsing of the
6416 6421 command line. It's not trivial, but it's perfectly doable.
6417 6422
6418 6423 * Added 'add_flip' method to inclusion conflict resolver. Fixes
6419 6424 the problem of modules being loaded in the inverse order in which
6420 6425 they were defined in
6421 6426
6422 6427 * Version 0.1.8 released, 0.1.9 opened for further work.
6423 6428
6424 6429 * Added magics pdef, source and file. They respectively show the
6425 6430 definition line ('prototype' in C), source code and full python
6426 6431 file for any callable object. The object inspector oinfo uses
6427 6432 these to show the same information.
6428 6433
6429 6434 * Version 0.1.7 released, 0.1.8 opened for further work.
6430 6435
6431 6436 * Separated all the magic functions into a class called Magic. The
6432 6437 InteractiveShell class was becoming too big for Xemacs to handle
6433 6438 (de-indenting a line would lock it up for 10 seconds while it
6434 6439 backtracked on the whole class!)
6435 6440
6436 6441 FIXME: didn't work. It can be done, but right now namespaces are
6437 6442 all messed up. Do it later (reverted it for now, so at least
6438 6443 everything works as before).
6439 6444
6440 6445 * Got the object introspection system (magic_oinfo) working! I
6441 6446 think this is pretty much ready for release to Janko, so he can
6442 6447 test it for a while and then announce it. Pretty much 100% of what
6443 6448 I wanted for the 'phase 1' release is ready. Happy, tired.
6444 6449
6445 6450 2001-11-12 Fernando Perez <fperez@colorado.edu>
6446 6451
6447 6452 * Version 0.1.6 released, 0.1.7 opened for further work.
6448 6453
6449 6454 * Fixed bug in printing: it used to test for truth before
6450 6455 printing, so 0 wouldn't print. Now checks for None.
6451 6456
6452 6457 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
6453 6458 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
6454 6459 reaches by hand into the outputcache. Think of a better way to do
6455 6460 this later.
6456 6461
6457 6462 * Various small fixes thanks to Nathan's comments.
6458 6463
6459 6464 * Changed magic_pprint to magic_Pprint. This way it doesn't
6460 6465 collide with pprint() and the name is consistent with the command
6461 6466 line option.
6462 6467
6463 6468 * Changed prompt counter behavior to be fully like
6464 6469 Mathematica's. That is, even input that doesn't return a result
6465 6470 raises the prompt counter. The old behavior was kind of confusing
6466 6471 (getting the same prompt number several times if the operation
6467 6472 didn't return a result).
6468 6473
6469 6474 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
6470 6475
6471 6476 * Fixed -Classic mode (wasn't working anymore).
6472 6477
6473 6478 * Added colored prompts using Nathan's new code. Colors are
6474 6479 currently hardwired, they can be user-configurable. For
6475 6480 developers, they can be chosen in file ipythonlib.py, at the
6476 6481 beginning of the CachedOutput class def.
6477 6482
6478 6483 2001-11-11 Fernando Perez <fperez@colorado.edu>
6479 6484
6480 6485 * Version 0.1.5 released, 0.1.6 opened for further work.
6481 6486
6482 6487 * Changed magic_env to *return* the environment as a dict (not to
6483 6488 print it). This way it prints, but it can also be processed.
6484 6489
6485 6490 * Added Verbose exception reporting to interactive
6486 6491 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
6487 6492 traceback. Had to make some changes to the ultraTB file. This is
6488 6493 probably the last 'big' thing in my mental todo list. This ties
6489 6494 in with the next entry:
6490 6495
6491 6496 * Changed -Xi and -Xf to a single -xmode option. Now all the user
6492 6497 has to specify is Plain, Color or Verbose for all exception
6493 6498 handling.
6494 6499
6495 6500 * Removed ShellServices option. All this can really be done via
6496 6501 the magic system. It's easier to extend, cleaner and has automatic
6497 6502 namespace protection and documentation.
6498 6503
6499 6504 2001-11-09 Fernando Perez <fperez@colorado.edu>
6500 6505
6501 6506 * Fixed bug in output cache flushing (missing parameter to
6502 6507 __init__). Other small bugs fixed (found using pychecker).
6503 6508
6504 6509 * Version 0.1.4 opened for bugfixing.
6505 6510
6506 6511 2001-11-07 Fernando Perez <fperez@colorado.edu>
6507 6512
6508 6513 * Version 0.1.3 released, mainly because of the raw_input bug.
6509 6514
6510 6515 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
6511 6516 and when testing for whether things were callable, a call could
6512 6517 actually be made to certain functions. They would get called again
6513 6518 once 'really' executed, with a resulting double call. A disaster
6514 6519 in many cases (list.reverse() would never work!).
6515 6520
6516 6521 * Removed prefilter() function, moved its code to raw_input (which
6517 6522 after all was just a near-empty caller for prefilter). This saves
6518 6523 a function call on every prompt, and simplifies the class a tiny bit.
6519 6524
6520 6525 * Fix _ip to __ip name in magic example file.
6521 6526
6522 6527 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
6523 6528 work with non-gnu versions of tar.
6524 6529
6525 6530 2001-11-06 Fernando Perez <fperez@colorado.edu>
6526 6531
6527 6532 * Version 0.1.2. Just to keep track of the recent changes.
6528 6533
6529 6534 * Fixed nasty bug in output prompt routine. It used to check 'if
6530 6535 arg != None...'. Problem is, this fails if arg implements a
6531 6536 special comparison (__cmp__) which disallows comparing to
6532 6537 None. Found it when trying to use the PhysicalQuantity module from
6533 6538 ScientificPython.
6534 6539
6535 6540 2001-11-05 Fernando Perez <fperez@colorado.edu>
6536 6541
6537 6542 * Also added dirs. Now the pushd/popd/dirs family functions
6538 6543 basically like the shell, with the added convenience of going home
6539 6544 when called with no args.
6540 6545
6541 6546 * pushd/popd slightly modified to mimic shell behavior more
6542 6547 closely.
6543 6548
6544 6549 * Added env,pushd,popd from ShellServices as magic functions. I
6545 6550 think the cleanest will be to port all desired functions from
6546 6551 ShellServices as magics and remove ShellServices altogether. This
6547 6552 will provide a single, clean way of adding functionality
6548 6553 (shell-type or otherwise) to IP.
6549 6554
6550 6555 2001-11-04 Fernando Perez <fperez@colorado.edu>
6551 6556
6552 6557 * Added .ipython/ directory to sys.path. This way users can keep
6553 6558 customizations there and access them via import.
6554 6559
6555 6560 2001-11-03 Fernando Perez <fperez@colorado.edu>
6556 6561
6557 6562 * Opened version 0.1.1 for new changes.
6558 6563
6559 6564 * Changed version number to 0.1.0: first 'public' release, sent to
6560 6565 Nathan and Janko.
6561 6566
6562 6567 * Lots of small fixes and tweaks.
6563 6568
6564 6569 * Minor changes to whos format. Now strings are shown, snipped if
6565 6570 too long.
6566 6571
6567 6572 * Changed ShellServices to work on __main__ so they show up in @who
6568 6573
6569 6574 * Help also works with ? at the end of a line:
6570 6575 ?sin and sin?
6571 6576 both produce the same effect. This is nice, as often I use the
6572 6577 tab-complete to find the name of a method, but I used to then have
6573 6578 to go to the beginning of the line to put a ? if I wanted more
6574 6579 info. Now I can just add the ? and hit return. Convenient.
6575 6580
6576 6581 2001-11-02 Fernando Perez <fperez@colorado.edu>
6577 6582
6578 6583 * Python version check (>=2.1) added.
6579 6584
6580 6585 * Added LazyPython documentation. At this point the docs are quite
6581 6586 a mess. A cleanup is in order.
6582 6587
6583 6588 * Auto-installer created. For some bizarre reason, the zipfiles
6584 6589 module isn't working on my system. So I made a tar version
6585 6590 (hopefully the command line options in various systems won't kill
6586 6591 me).
6587 6592
6588 6593 * Fixes to Struct in genutils. Now all dictionary-like methods are
6589 6594 protected (reasonably).
6590 6595
6591 6596 * Added pager function to genutils and changed ? to print usage
6592 6597 note through it (it was too long).
6593 6598
6594 6599 * Added the LazyPython functionality. Works great! I changed the
6595 6600 auto-quote escape to ';', it's on home row and next to '. But
6596 6601 both auto-quote and auto-paren (still /) escapes are command-line
6597 6602 parameters.
6598 6603
6599 6604
6600 6605 2001-11-01 Fernando Perez <fperez@colorado.edu>
6601 6606
6602 6607 * Version changed to 0.0.7. Fairly large change: configuration now
6603 6608 is all stored in a directory, by default .ipython. There, all
6604 6609 config files have normal looking names (not .names)
6605 6610
6606 6611 * Version 0.0.6 Released first to Lucas and Archie as a test
6607 6612 run. Since it's the first 'semi-public' release, change version to
6608 6613 > 0.0.6 for any changes now.
6609 6614
6610 6615 * Stuff I had put in the ipplib.py changelog:
6611 6616
6612 6617 Changes to InteractiveShell:
6613 6618
6614 6619 - Made the usage message a parameter.
6615 6620
6616 6621 - Require the name of the shell variable to be given. It's a bit
6617 6622 of a hack, but allows the name 'shell' not to be hardwired in the
6618 6623 magic (@) handler, which is problematic b/c it requires
6619 6624 polluting the global namespace with 'shell'. This in turn is
6620 6625 fragile: if a user redefines a variable called shell, things
6621 6626 break.
6622 6627
6623 6628 - magic @: all functions available through @ need to be defined
6624 6629 as magic_<name>, even though they can be called simply as
6625 6630 @<name>. This allows the special command @magic to gather
6626 6631 information automatically about all existing magic functions,
6627 6632 even if they are run-time user extensions, by parsing the shell
6628 6633 instance __dict__ looking for special magic_ names.
6629 6634
6630 6635 - mainloop: added *two* local namespace parameters. This allows
6631 6636 the class to differentiate between parameters which were there
6632 6637 before and after command line initialization was processed. This
6633 6638 way, later @who can show things loaded at startup by the
6634 6639 user. This trick was necessary to make session saving/reloading
6635 6640 really work: ideally after saving/exiting/reloading a session,
6636 6641 *everything* should look the same, including the output of @who. I
6637 6642 was only able to make this work with this double namespace
6638 6643 trick.
6639 6644
6640 6645 - added a header to the logfile which allows (almost) full
6641 6646 session restoring.
6642 6647
6643 6648 - prepend lines beginning with @ or !, with a and log
6644 6649 them. Why? !lines: may be useful to know what you did @lines:
6645 6650 they may affect session state. So when restoring a session, at
6646 6651 least inform the user of their presence. I couldn't quite get
6647 6652 them to properly re-execute, but at least the user is warned.
6648 6653
6649 6654 * Started ChangeLog.
@@ -1,406 +1,391 b''
1 1 .\" Hey, EMACS: -*- nroff -*-
2 2 .\" First parameter, NAME, should be all caps
3 3 .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
4 4 .\" other parameters are allowed: see man(7), man(1)
5 5 .TH IPYTHON 1 "November 30, 2004"
6 6 .\" Please adjust this date whenever revising the manpage.
7 7 .\"
8 8 .\" Some roff macros, for reference:
9 9 .\" .nh disable hyphenation
10 10 .\" .hy enable hyphenation
11 11 .\" .ad l left justify
12 12 .\" .ad b justify to both left and right margins
13 13 .\" .nf disable filling
14 14 .\" .fi enable filling
15 15 .\" .br insert line break
16 16 .\" .sp <n> insert n+1 empty lines
17 17 .\" for manpage-specific macros, see man(7) and groff_man(7)
18 18 .\" .SH section heading
19 19 .\" .SS secondary section heading
20 20 .\"
21 21 .\"
22 22 .\" To preview this page as plain text: nroff -man ipython.1
23 23 .\"
24 24 .SH NAME
25 25 ipython \- An Enhanced Interactive Python
26 26 .SH SYNOPSIS
27 27 .B ipython
28 28 .RI [ options ] " files" ...
29 29 .SH DESCRIPTION
30 30 An interactive Python shell with automatic history (input and output),
31 31 dynamic object introspection, easier configuration, command
32 32 completion, access to the system shell, integration with numerical and
33 33 scientific computing tools, and more.
34 34 .SH SPECIAL THREADING OPTIONS
35 35 The following special options are ONLY valid at the beginning of the command
36 36 line, and not later. This is because they control the initialization of
37 37 ipython itself, before the normal option-handling mechanism is active.
38 38 .TP
39 39 .B \-gthread, \-qthread, \-q4thread, \-wthread, \-pylab
40 40 Only ONE of these can be given, and it can only be given as the first option
41 41 passed to IPython (it will have no effect in any other position). They provide
42 42 threading support for the GTK, QT3, QT4 and WXWidgets toolkits, and for the
43 43 matplotlib library.
44 44 .br
45 45 .sp 1
46 46 With any of the first four options, IPython starts running a separate thread
47 47 for the graphical toolkit's operation, so that you can open and control
48 48 graphical elements from within an IPython command line, without blocking. All
49 49 four provide essentially the same functionality, respectively for GTK, QT3, QT4
50 50 and WXWidgets (via their Python interfaces).
51 51 .br
52 52 .sp 1
53 53 Note that with \-wthread, you can additionally use the \-wxversion option to
54 54 request a specific version of wx to be used. This requires that you have the
55 55 'wxversion' Python module installed, which is part of recent wxPython
56 56 distributions.
57 57 .br
58 58 .sp 1
59 59 If \-pylab is given, IPython loads special support for the matplotlib library
60 60 (http://matplotlib.sourceforge.net), allowing interactive usage of any of its
61 61 backends as defined in the user's .matplotlibrc file. It automatically
62 62 activates GTK, QT or WX threading for IPyhton if the choice of matplotlib
63 63 backend requires it. It also modifies the %run command to correctly execute
64 64 (without blocking) any matplotlib-based script which calls show() at the end.
65 65 .TP
66 66 .B \-tk
67 67 The \-g/q/q4/wthread options, and \-pylab (if matplotlib is configured to use
68 68 GTK, QT or WX), will normally block Tk graphical interfaces. This means that
69 69 when GTK, QT or WX threading is active, any attempt to open a Tk GUI will
70 70 result in a dead window, and possibly cause the Python interpreter to crash.
71 71 An extra option, \-tk, is available to address this issue. It can ONLY be
72 72 given as a SECOND option after any of the above (\-gthread, \-qthread,
73 73 \-wthread or \-pylab).
74 74 .br
75 75 .sp 1
76 76 If \-tk is given, IPython will try to coordinate Tk threading with GTK, QT or
77 77 WX. This is however potentially unreliable, and you will have to test on your
78 78 platform and Python configuration to determine whether it works for you.
79 79 Debian users have reported success, apparently due to the fact that Debian
80 80 builds all of Tcl, Tk, Tkinter and Python with pthreads support. Under other
81 81 Linux environments (such as Fedora Core 2), this option has caused random
82 82 crashes and lockups of the Python interpreter. Under other operating systems
83 83 (Mac OSX and Windows), you'll need to try it to find out, since currently no
84 84 user reports are available.
85 85 .br
86 86 .sp 1
87 87 There is unfortunately no way for IPython to determine at runtime whether \-tk
88 88 will work reliably or not, so you will need to do some experiments before
89 89 relying on it for regular work.
90 90 .
91 .SS A WARNING ABOUT SIGNALS AND THREADS
92 When any of the thread systems (GTK, QT or WX) are active, either directly or
93 via \-pylab with a threaded backend, it is impossible to interrupt
94 long-running Python code via Ctrl\-C. IPython can not pass the
95 KeyboardInterrupt exception (or the underlying SIGINT) across threads, so any
96 long-running process started from IPython will run to completion, or will have
97 to be killed via an external (OS-based) mechanism.
98 .br
99 .sp 1
100 To the best of my knowledge, this limitation is imposed by the Python
101 interpreter itself, and it comes from the difficulty of writing portable
102 signal/threaded code. If any user is an expert on this topic and can suggest
103 a better solution, I would love to hear about it. In the IPython sources,
104 look at the Shell.py module, and in particular at the runcode() method.
105 .
106 91 .SH REGULAR OPTIONS
107 92 After the above threading options have been given, regular options can follow
108 93 in any order. All options can be abbreviated to their shortest non-ambiguous
109 94 form and are case-sensitive. One or two dashes can be used. Some options
110 95 have an alternate short form, indicated after a |.
111 96 .br
112 97 .sp 1
113 98 Most options can also be set from your ipythonrc configuration file.
114 99 See the provided examples for assistance. Options given on the
115 100 commandline override the values set in the ipythonrc file.
116 101 .br
117 102 .sp 1
118 103 All options with a [no] prepended can be specified in negated form
119 104 (\-nooption instead of \-option) to turn the feature off.
120 105 .TP
121 106 .B \-h, \-\-help
122 107 Show summary of options.
123 108 .TP
124 109 .B \-autocall <val>
125 110 Make IPython automatically call any callable object even if you didn't type
126 111 explicit parentheses. For example, 'str 43' becomes
127 112 'str(43)' automatically. The value can be '0' to disable the
128 113 feature, '1' for 'smart' autocall, where it is not applied if
129 114 there are no more arguments on the line, and '2' for 'full'
130 115 autocall, where all callable objects are automatically called
131 116 (even if no arguments are present). The default is '1'.
132 117 .TP
133 118 .B \-[no]autoindent
134 119 Turn automatic indentation on/off.
135 120 .TP
136 121 .B \-[no]automagic
137 122 Make magic commands automatic (without needing their first character
138 123 to be %). Type %magic at the IPython prompt for more information.
139 124 .TP
140 125 .B \-[no]autoedit_syntax
141 126 When a syntax error occurs after editing a file, automatically open the file
142 127 to the trouble causing line for convenient fixing.
143 128 .TP
144 129 .B \-[no]banner
145 130 Print the intial information banner (default on).
146 131 .TP
147 132 .B \-c <command>
148 133 Execute the given command string, and set sys.argv to ['c']. This is similar
149 134 to the \-c option in the normal Python interpreter.
150 135 .TP
151 136 .B \-cache_size|cs <n>
152 137 Size of the output cache (maximum number of entries to hold in
153 138 memory). The default is 1000, you can change it permanently in your
154 139 config file. Setting it to 0 completely disables the caching system,
155 140 and the minimum value accepted is 20 (if you provide a value less than
156 141 20, it is reset to 0 and a warning is issued). This limit is defined
157 142 because otherwise you'll spend more time re-flushing a too small cache
158 143 than working.
159 144 .TP
160 145 .B \-classic|cl
161 146 Gives IPython a similar feel to the classic Python prompt.
162 147 .TP
163 148 .B \-colors <scheme>
164 149 Color scheme for prompts and exception reporting. Currently
165 150 implemented: NoColor, Linux, and LightBG.
166 151 .TP
167 152 .B \-[no]color_info
168 153 IPython can display information about objects via a set of functions,
169 154 and optionally can use colors for this, syntax highlighting source
170 155 code and various other elements. However, because this information is
171 156 passed through a pager (like 'less') and many pagers get confused with
172 157 color codes, this option is off by default. You can test it and turn
173 158 it on permanently in your ipythonrc file if it works for you. As a
174 159 reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
175 160 that in RedHat 7.2 doesn't.
176 161 .br
177 162 .sp 1
178 163 Test it and turn it on permanently if it works with your system. The
179 164 magic function @color_info allows you to toggle this interactively for
180 165 testing.
181 166 .TP
182 167 .B \-[no]confirm_exit
183 168 Set to confirm when you try to exit IPython with an EOF (Control-D in
184 169 Unix, Control-Z/Enter in Windows). Note that using the magic functions
185 170 @Exit or @Quit you can force a direct exit, bypassing any
186 171 confirmation.
187 172 .TP
188 173 .B \-[no]debug
189 174 Show information about the loading process. Very useful to pin down
190 175 problems with your configuration files or to get details about session
191 176 restores.
192 177 .TP
193 178 .B \-[no]deep_reload
194 179 IPython can use the deep_reload module which reloads changes in
195 180 modules recursively (it replaces the reload() function, so you don't
196 181 need to change anything to use it). deep_reload() forces a full reload
197 182 of modules whose code may have changed, which the default reload()
198 183 function does not.
199 184 .br
200 185 .sp 1
201 186 When deep_reload is off, IPython will use the normal reload(), but
202 187 deep_reload will still be available as dreload(). This feature is off
203 188 by default [which means that you have both normal reload() and
204 189 dreload()].
205 190 .TP
206 191 .B \-editor <name>
207 192 Which editor to use with the @edit command. By default, IPython will
208 193 honor your EDITOR environment variable (if not set, vi is the Unix
209 194 default and notepad the Windows one). Since this editor is invoked on
210 195 the fly by IPython and is meant for editing small code snippets, you
211 196 may want to use a small, lightweight editor here (in case your default
212 197 EDITOR is something like Emacs).
213 198 .TP
214 199 .B \-ipythondir <name>
215 200 The name of your IPython configuration directory IPYTHONDIR. This can
216 201 also be specified through the environment variable IPYTHONDIR.
217 202 .TP
218 203 .B \-log|l
219 204 Generate a log file of all input. The file is named ipython_log.py in your
220 205 current directory (which prevents logs from multiple IPython sessions from
221 206 trampling each other). You can use this to later restore a session by loading
222 207 your logfile as a file to be executed with option -logplay (see below).
223 208 .TP
224 209 .B \-logfile|lf
225 210 Specify the name of your logfile.
226 211 .TP
227 212 .B \-logplay|lp
228 213 Replay a previous log. For restoring a session as close as possible to
229 214 the state you left it in, use this option (don't just run the
230 215 logfile). With \-logplay, IPython will try to reconstruct the previous
231 216 working environment in full, not just execute the commands in the
232 217 logfile.
233 218 .br
234 219 .sh 1
235 220 When a session is restored, logging is automatically turned on again
236 221 with the name of the logfile it was invoked with (it is read from the
237 222 log header). So once you've turned logging on for a session, you can
238 223 quit IPython and reload it as many times as you want and it will
239 224 continue to log its history and restore from the beginning every time.
240 225 .br
241 226 .sp 1
242 227 Caveats: there are limitations in this option. The history variables
243 228 _i*,_* and _dh don't get restored properly. In the future we will try
244 229 to implement full session saving by writing and retrieving a
245 230 'snapshot' of the memory state of IPython. But our first attempts
246 231 failed because of inherent limitations of Python's Pickle module, so
247 232 this may have to wait.
248 233 .TP
249 234 .B \-[no]messages
250 235 Print messages which IPython collects about its startup process
251 236 (default on).
252 237 .TP
253 238 .B \-[no]pdb
254 239 Automatically call the pdb debugger after every uncaught exception. If
255 240 you are used to debugging using pdb, this puts you automatically
256 241 inside of it after any call (either in IPython or in code called by
257 242 it) which triggers an exception which goes uncaught.
258 243 .TP
259 244 .B \-[no]pprint
260 245 IPython can optionally use the pprint (pretty printer) module for
261 246 displaying results. pprint tends to give a nicer display of nested
262 247 data structures. If you like it, you can turn it on permanently in
263 248 your config file (default off).
264 249 .TP
265 250 .B \-profile|p <name>
266 251 Assume that your config file is ipythonrc-<name> (looks in current dir
267 252 first, then in IPYTHONDIR). This is a quick way to keep and load
268 253 multiple config files for different tasks, especially if you use the
269 254 include option of config files. You can keep a basic
270 255 IPYTHONDIR/ipythonrc file and then have other 'profiles' which include
271 256 this one and load extra things for particular tasks. For example:
272 257 .br
273 258 .sp 1
274 259 1) $HOME/.ipython/ipythonrc : load basic things you always want.
275 260 .br
276 261 2) $HOME/.ipython/ipythonrc-math : load (1) and basic math-related
277 262 modules.
278 263 .br
279 264 3) $HOME/.ipython/ipythonrc-numeric : load (1) and Numeric and
280 265 plotting modules.
281 266 .br
282 267 .sp 1
283 268 Since it is possible to create an endless loop by having circular file
284 269 inclusions, IPython will stop if it reaches 15 recursive inclusions.
285 270 .TP
286 271 .B \-prompt_in1|pi1 <string>
287 272 Specify the string used for input prompts. Note that if you are using
288 273 numbered prompts, the number is represented with a '\\#' in the
289 274 string. Don't forget to quote strings with spaces embedded in
290 275 them. Default: 'In [\\#]: '.
291 276 .br
292 277 .sp 1
293 278 Most bash-like escapes can be used to customize IPython's prompts, as well as
294 279 a few additional ones which are IPython-specific. All valid prompt escapes
295 280 are described in detail in the Customization section of the IPython HTML/PDF
296 281 manual.
297 282 .TP
298 283 .B \-prompt_in2|pi2 <string>
299 284 Similar to the previous option, but used for the continuation prompts. The
300 285 special sequence '\\D' is similar to '\\#', but with all digits replaced dots
301 286 (so you can have your continuation prompt aligned with your input
302 287 prompt). Default: ' .\\D.: ' (note three spaces at the start for alignment
303 288 with 'In [\\#]').
304 289 .TP
305 290 .B \-prompt_out|po <string>
306 291 String used for output prompts, also uses numbers like prompt_in1.
307 292 Default: 'Out[\\#]:'.
308 293 .TP
309 294 .B \-quick
310 295 Start in bare bones mode (no config file loaded).
311 296 .TP
312 297 .B \-rcfile <name>
313 298 Name of your IPython resource configuration file. normally IPython
314 299 loads ipythonrc (from current directory) or IPYTHONDIR/ipythonrc. If
315 300 the loading of your config file fails, IPython starts with a bare
316 301 bones configuration (no modules loaded at all).
317 302 .TP
318 303 .B \-[no]readline
319 304 Use the readline library, which is needed to support name completion
320 305 and command history, among other things. It is enabled by default, but
321 306 may cause problems for users of X/Emacs in Python comint or shell
322 307 buffers.
323 308 .br
324 309 .sp 1
325 310 Note that emacs 'eterm' buffers (opened with M-x term) support
326 311 IPython's readline and syntax coloring fine, only 'emacs' (M-x shell
327 312 and C-c !) buffers do not.
328 313 .TP
329 314 .B \-screen_length|sl <n>
330 315 Number of lines of your screen. This is used to control printing of
331 316 very long strings. Strings longer than this number of lines will be
332 317 sent through a pager instead of directly printed.
333 318 .br
334 319 .sp 1
335 320 The default value for this is 0, which means IPython will auto-detect
336 321 your screen size every time it needs to print certain potentially long
337 322 strings (this doesn't change the behavior of the 'print' keyword, it's
338 323 only triggered internally). If for some reason this isn't working well
339 324 (it needs curses support), specify it yourself. Otherwise don't change
340 325 the default.
341 326 .TP
342 327 .B \-separate_in|si <string>
343 328 Separator before input prompts. Default '\n'.
344 329 .TP
345 330 .B \-separate_out|so <string>
346 331 Separator before output prompts. Default: 0 (nothing).
347 332 .TP
348 333 .B \-separate_out2|so2 <string>
349 334 Separator after output prompts. Default: 0 (nothing).
350 335 .TP
351 336 .B \-nosep
352 337 Shorthand for '\-separate_in 0 \-separate_out 0 \-separate_out2 0'.
353 338 Simply removes all input/output separators.
354 339 .TP
355 340 .B \-upgrade
356 341 Allows you to upgrade your IPYTHONDIR configuration when you install a
357 342 new version of IPython. Since new versions may include new command
358 343 lines options or example files, this copies updated ipythonrc-type
359 344 files. However, it backs up (with a .old extension) all files which
360 345 it overwrites so that you can merge back any custimizations you might
361 346 have in your personal files.
362 347 .TP
363 348 .B \-Version
364 349 Print version information and exit.
365 350 .TP
366 351 .B -wxversion <string>
367 352 Select a specific version of wxPython (used in conjunction with
368 353 \-wthread). Requires the wxversion module, part of recent wxPython
369 354 distributions.
370 355 .TP
371 356 .B \-xmode <modename>
372 357 Mode for exception reporting. The valid modes are Plain, Context, and
373 358 Verbose.
374 359 .br
375 360 .sp 1
376 361 \- Plain: similar to python's normal traceback printing.
377 362 .br
378 363 .sp 1
379 364 \- Context: prints 5 lines of context source code around each line in the
380 365 traceback.
381 366 .br
382 367 .sp 1
383 368 \- Verbose: similar to Context, but additionally prints the variables
384 369 currently visible where the exception happened (shortening their strings if
385 370 too long). This can potentially be very slow, if you happen to have a huge
386 371 data structure whose string representation is complex to compute. Your
387 372 computer may appear to freeze for a while with cpu usage at 100%. If this
388 373 occurs, you can cancel the traceback with Ctrl-C (maybe hitting it more than
389 374 once).
390 375 .
391 376 .SH EMBEDDING
392 377 It is possible to start an IPython instance inside your own Python
393 378 programs. In the documentation example files there are some
394 379 illustrations on how to do this.
395 380 .br
396 381 .sp 1
397 382 This feature allows you to evalutate dynamically the state of your
398 383 code, operate with your variables, analyze them, etc. Note however
399 384 that any changes you make to values while in the shell do NOT
400 385 propagate back to the running code, so it is safe to modify your
401 386 values because you won't break your code in bizarre ways by doing so.
402 387 .SH AUTHOR
403 388 IPython was written by Fernando Perez <fperez@colorado.edu>, based on earlier
404 389 code by Janko Hauser <jh@comunit.de> and Nathaniel Gray
405 390 <n8gray@caltech.edu>. This manual page was written by Jack Moffitt
406 391 <jack@xiph.org>, for the Debian project (but may be used by others).
@@ -1,10507 +1,10467 b''
1 1 #LyX 1.4.3 created this file. For more info see http://www.lyx.org/
2 2 \lyxformat 245
3 3 \begin_document
4 4 \begin_header
5 5 \textclass article
6 6 \begin_preamble
7 7 %\usepackage{ae,aecompl}
8 8 \usepackage{color}
9 9
10 10 % A few colors to replace the defaults for certain link types
11 11 \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
12 12 \definecolor{darkorange}{rgb}{.71,0.21,0.01}
13 13 \definecolor{darkred}{rgb}{.52,0.08,0.01}
14 14 \definecolor{darkgreen}{rgb}{.12,.54,.11}
15 15
16 16 % Use and configure listings package for nicely formatted code
17 17 \usepackage{listings}
18 18 \lstset{
19 19 language=Python,
20 20 basicstyle=\small\ttfamily,
21 21 commentstyle=\ttfamily\color{blue},
22 22 stringstyle=\ttfamily\color{darkorange},
23 23 showstringspaces=false,
24 24 breaklines=true,
25 25 postbreak = \space\dots
26 26 }
27 27
28 28 \usepackage[%pdftex, % needed for pdflatex
29 29 breaklinks=true, % so long urls are correctly broken across lines
30 30 colorlinks=true,
31 31 urlcolor=blue,
32 32 linkcolor=darkred,
33 33 citecolor=darkgreen,
34 34 ]{hyperref}
35 35
36 36 \usepackage{html}
37 37
38 38 % This helps prevent overly long lines that stretch beyond the margins
39 39 \sloppy
40 40
41 41 % Define a \codelist command which either uses listings for latex, or
42 42 % plain verbatim for html (since latex2html doesn't understand the
43 43 % listings package).
44 44 \usepackage{verbatim}
45 45 \newcommand{\codelist}[1] {
46 46 \latex{\lstinputlisting{#1}}
47 47 \html{\verbatiminput{#1}}
48 48 }
49 49 \end_preamble
50 50 \language english
51 51 \inputencoding latin1
52 52 \fontscheme palatino
53 53 \graphics default
54 54 \paperfontsize 11
55 55 \spacing single
56 56 \papersize default
57 57 \use_geometry true
58 58 \use_amsmath 1
59 59 \cite_engine basic
60 60 \use_bibtopic false
61 61 \paperorientation portrait
62 62 \leftmargin 1in
63 63 \topmargin 1in
64 64 \rightmargin 1in
65 65 \bottommargin 1in
66 66 \secnumdepth 3
67 67 \tocdepth 3
68 68 \paragraph_separation skip
69 69 \defskip medskip
70 70 \quotes_language english
71 71 \papercolumns 1
72 72 \papersides 2
73 73 \paperpagestyle fancy
74 74 \tracking_changes false
75 75 \output_changes true
76 76 \end_header
77 77
78 78 \begin_body
79 79
80 80 \begin_layout Title
81 81 IPython
82 82 \newline
83 83
84 84 \size larger
85 85 An enhanced Interactive Python
86 86 \size large
87 87
88 88 \newline
89 89 User Manual, v.
90 90 __version__
91 91 \end_layout
92 92
93 93 \begin_layout Author
94 94 Fernando PοΏ½rez
95 95 \begin_inset Foot
96 96 status collapsed
97 97
98 98 \begin_layout Standard
99 99
100 100 \size scriptsize
101 101 Department of Applied Mathematics, University of Colorado at Boulder.
102 102
103 103 \family typewriter
104 104 <Fernando.Perez@colorado.edu>
105 105 \end_layout
106 106
107 107 \end_inset
108 108
109 109
110 110 \end_layout
111 111
112 112 \begin_layout Standard
113 113 \begin_inset ERT
114 114 status collapsed
115 115
116 116 \begin_layout Standard
117 117
118 118
119 119 \backslash
120 120 latex{
121 121 \end_layout
122 122
123 123 \end_inset
124 124
125 125
126 126 \begin_inset LatexCommand \tableofcontents{}
127 127
128 128 \end_inset
129 129
130 130
131 131 \begin_inset ERT
132 132 status collapsed
133 133
134 134 \begin_layout Standard
135 135
136 136 }
137 137 \end_layout
138 138
139 139 \end_inset
140 140
141 141
142 142 \end_layout
143 143
144 144 \begin_layout Standard
145 145 \begin_inset ERT
146 146 status open
147 147
148 148 \begin_layout Standard
149 149
150 150
151 151 \backslash
152 152 html{
153 153 \backslash
154 154 bodytext{bgcolor=#ffffff}}
155 155 \end_layout
156 156
157 157 \end_inset
158 158
159 159
160 160 \end_layout
161 161
162 162 \begin_layout Standard
163 163
164 164 \newpage
165 165
166 166 \end_layout
167 167
168 168 \begin_layout Section
169 169 Overview
170 170 \end_layout
171 171
172 172 \begin_layout Standard
173 173 One of Python's most useful features is its interactive interpreter.
174 174 This system allows very fast testing of ideas without the overhead of creating
175 175 test files as is typical in most programming languages.
176 176 However, the interpreter supplied with the standard Python distribution
177 177 is somewhat limited for extended interactive use.
178 178 \end_layout
179 179
180 180 \begin_layout Standard
181 181 IPython is a free software project (released under the BSD license) which
182 182 tries to:
183 183 \end_layout
184 184
185 185 \begin_layout Enumerate
186 186 Provide an interactive shell superior to Python's default.
187 187 IPython has many features for object introspection, system shell access,
188 188 and its own special command system for adding functionality when working
189 189 interactively.
190 190 It tries to be a very efficient environment both for Python code development
191 191 and for exploration of problems using Python objects (in situations like
192 192 data analysis).
193 193 \end_layout
194 194
195 195 \begin_layout Enumerate
196 196 Serve as an embeddable, ready to use interpreter for your own programs.
197 197 IPython can be started with a single call from inside another program,
198 198 providing access to the current namespace.
199 199 This can be very useful both for debugging purposes and for situations
200 200 where a blend of batch-processing and interactive exploration are needed.
201 201 \end_layout
202 202
203 203 \begin_layout Enumerate
204 204 Offer a flexible framework which can be used as the base environment for
205 205 other systems with Python as the underlying language.
206 206 Specifically scientific environments like Mathematica, IDL and Matlab inspired
207 207 its design, but similar ideas can be useful in many fields.
208 208 \end_layout
209 209
210 210 \begin_layout Enumerate
211 211 Allow interactive testing of threaded graphical toolkits.
212 212 IPython has support for interactive, non-blocking control of GTK, Qt and
213 213 WX applications via special threading flags.
214 214 The normal Python shell can only do this for Tkinter applications.
215 215 \end_layout
216 216
217 217 \begin_layout Subsection
218 218 Main features
219 219 \end_layout
220 220
221 221 \begin_layout Itemize
222 222 Dynamic object introspection.
223 223 One can access docstrings, function definition prototypes, source code,
224 224 source files and other details of any object accessible to the interpreter
225 225 with a single keystroke (`
226 226 \family typewriter
227 227 ?
228 228 \family default
229 229 ', and using `
230 230 \family typewriter
231 231 ??
232 232 \family default
233 233 ' provides additional detail).
234 234 \end_layout
235 235
236 236 \begin_layout Itemize
237 237 Searching through modules and namespaces with `
238 238 \family typewriter
239 239 *
240 240 \family default
241 241 ' wildcards, both when using the `
242 242 \family typewriter
243 243 ?
244 244 \family default
245 245 ' system and via the
246 246 \family typewriter
247 247 %psearch
248 248 \family default
249 249 command.
250 250 \end_layout
251 251
252 252 \begin_layout Itemize
253 253 Completion in the local namespace, by typing TAB at the prompt.
254 254 This works for keywords, methods, variables and files in the current directory.
255 255 This is supported via the readline library, and full access to configuring
256 256 readline's behavior is provided.
257 257 \end_layout
258 258
259 259 \begin_layout Itemize
260 260 Numbered input/output prompts with command history (persistent across sessions
261 261 and tied to each profile), full searching in this history and caching of
262 262 all input and output.
263 263 \end_layout
264 264
265 265 \begin_layout Itemize
266 266 User-extensible `magic' commands.
267 267 A set of commands prefixed with
268 268 \family typewriter
269 269 %
270 270 \family default
271 271 is available for controlling IPython itself and provides directory control,
272 272 namespace information and many aliases to common system shell commands.
273 273 \end_layout
274 274
275 275 \begin_layout Itemize
276 276 Alias facility for defining your own system aliases.
277 277 \end_layout
278 278
279 279 \begin_layout Itemize
280 280 Complete system shell access.
281 281 Lines starting with ! are passed directly to the system shell, and using
282 282 !! captures shell output into python variables for further use.
283 283 \end_layout
284 284
285 285 \begin_layout Itemize
286 286 Background execution of Python commands in a separate thread.
287 287 IPython has an internal job manager called
288 288 \family typewriter
289 289 jobs
290 290 \family default
291 291 , and a conveninence backgrounding magic function called
292 292 \family typewriter
293 293 %bg
294 294 \family default
295 295 .
296 296 \end_layout
297 297
298 298 \begin_layout Itemize
299 299 The ability to expand python variables when calling the system shell.
300 300 In a shell command, any python variable prefixed with
301 301 \family typewriter
302 302 $
303 303 \family default
304 304 is expanded.
305 305 A double
306 306 \family typewriter
307 307 $$
308 308 \family default
309 309 allows passing a literal
310 310 \family typewriter
311 311 $
312 312 \family default
313 313 to the shell (for access to shell and environment variables like
314 314 \family typewriter
315 315 $PATH
316 316 \family default
317 317 ).
318 318 \end_layout
319 319
320 320 \begin_layout Itemize
321 321 Filesystem navigation, via a magic
322 322 \family typewriter
323 323 %cd
324 324 \family default
325 325 command, along with a persistent bookmark system (using
326 326 \family typewriter
327 327 %bookmark
328 328 \family default
329 329 ) for fast access to frequently visited directories.
330 330 \end_layout
331 331
332 332 \begin_layout Itemize
333 333 A lightweight persistence framework via the
334 334 \family typewriter
335 335 %store
336 336 \family default
337 337 command, which allows you to save arbitrary Python variables.
338 338 These get restored automatically when your session restarts.
339 339 \end_layout
340 340
341 341 \begin_layout Itemize
342 342 Automatic indentation (optional) of code as you type (through the readline
343 343 library).
344 344 \end_layout
345 345
346 346 \begin_layout Itemize
347 347 Macro system for quickly re-executing multiple lines of previous input with
348 348 a single name.
349 349 Macros can be stored persistently via
350 350 \family typewriter
351 351 %store
352 352 \family default
353 353 and edited via
354 354 \family typewriter
355 355 %edit
356 356 \family default
357 357 .
358 358
359 359 \end_layout
360 360
361 361 \begin_layout Itemize
362 362 Session logging (you can then later use these logs as code in your programs).
363 363 Logs can optionally timestamp all input, and also store session output
364 364 (marked as comments, so the log remains valid Python source code).
365 365 \end_layout
366 366
367 367 \begin_layout Itemize
368 368 Session restoring: logs can be replayed to restore a previous session to
369 369 the state where you left it.
370 370 \end_layout
371 371
372 372 \begin_layout Itemize
373 373 Verbose and colored exception traceback printouts.
374 374 Easier to parse visually, and in verbose mode they produce a lot of useful
375 375 debugging information (basically a terminal version of the cgitb module).
376 376 \end_layout
377 377
378 378 \begin_layout Itemize
379 379 Auto-parentheses: callable objects can be executed without parentheses:
380 380
381 381 \family typewriter
382 382 `sin 3'
383 383 \family default
384 384 is automatically converted to
385 385 \family typewriter
386 386 `sin(3)
387 387 \family default
388 388 '.
389 389 \end_layout
390 390
391 391 \begin_layout Itemize
392 392 Auto-quoting: using `
393 393 \family typewriter
394 394 ,
395 395 \family default
396 396 ' or `
397 397 \family typewriter
398 398 ;
399 399 \family default
400 400 ' as the first character forces auto-quoting of the rest of the line:
401 401 \family typewriter
402 402 `,my_function a\InsetSpace ~
403 403 b'
404 404 \family default
405 405 becomes automatically
406 406 \family typewriter
407 407 `my_function("a","b")'
408 408 \family default
409 409 , while
410 410 \family typewriter
411 411 `;my_function a\InsetSpace ~
412 412 b'
413 413 \family default
414 414 becomes
415 415 \family typewriter
416 416 `my_function("a b")'
417 417 \family default
418 418 .
419 419 \end_layout
420 420
421 421 \begin_layout Itemize
422 422 Extensible input syntax.
423 423 You can define filters that pre-process user input to simplify input in
424 424 special situations.
425 425 This allows for example pasting multi-line code fragments which start with
426 426
427 427 \family typewriter
428 428 `>>>'
429 429 \family default
430 430 or
431 431 \family typewriter
432 432 `...'
433 433 \family default
434 434 such as those from other python sessions or the standard Python documentation.
435 435 \end_layout
436 436
437 437 \begin_layout Itemize
438 438 Flexible configuration system.
439 439 It uses a configuration file which allows permanent setting of all command-line
440 440 options, module loading, code and file execution.
441 441 The system allows recursive file inclusion, so you can have a base file
442 442 with defaults and layers which load other customizations for particular
443 443 projects.
444 444 \end_layout
445 445
446 446 \begin_layout Itemize
447 447 Embeddable.
448 448 You can call IPython as a python shell inside your own python programs.
449 449 This can be used both for debugging code or for providing interactive abilities
450 450 to your programs with knowledge about the local namespaces (very useful
451 451 in debugging and data analysis situations).
452 452 \end_layout
453 453
454 454 \begin_layout Itemize
455 455 Easy debugger access.
456 456 You can set IPython to call up an enhanced version of the Python debugger
457 457 (
458 458 \family typewriter
459 459 pdb
460 460 \family default
461 461 ) every time there is an uncaught exception.
462 462 This drops you inside the code which triggered the exception with all the
463 463 data live and it is possible to navigate the stack to rapidly isolate the
464 464 source of a bug.
465 465 The
466 466 \family typewriter
467 467 %run
468 468 \family default
469 469 magic command --with the
470 470 \family typewriter
471 471 -d
472 472 \family default
473 473 option-- can run any script under
474 474 \family typewriter
475 475 pdb
476 476 \family default
477 477 's control, automatically setting initial breakpoints for you.
478 478 This version of
479 479 \family typewriter
480 480 pdb
481 481 \family default
482 482 has IPython-specific improvements, including tab-completion and traceback
483 483 coloring support.
484 484 \end_layout
485 485
486 486 \begin_layout Itemize
487 487 Profiler support.
488 488 You can run single statements (similar to
489 489 \family typewriter
490 490 profile.run()
491 491 \family default
492 492 ) or complete programs under the profiler's control.
493 493 While this is possible with standard
494 494 \family typewriter
495 495 cProfile
496 496 \family default
497 497 or
498 498 \family typewriter
499 499 profile
500 500 \family default
501 501 modules, IPython wraps this functionality with magic commands (see
502 502 \family typewriter
503 503 `%prun'
504 504 \family default
505 505 and
506 506 \family typewriter
507 507 `%run -p
508 508 \family default
509 509 ') convenient for rapid interactive work.
510 510 \end_layout
511 511
512 512 \begin_layout Subsection
513 513 Portability and Python requirements
514 514 \end_layout
515 515
516 516 \begin_layout Standard
517 517
518 518 \series bold
519 519 Python requirements:
520 520 \series default
521 521 IPython requires with Python version 2.3 or newer.
522 522 If you are still using Python 2.2 and can not upgrade, the last version
523 523 of IPython which worked with Python 2.2 was 0.6.15, so you will have to use
524 524 that.
525 525 \end_layout
526 526
527 527 \begin_layout Standard
528 528 IPython is developed under
529 529 \series bold
530 530 Linux
531 531 \series default
532 532 , but it should work in any reasonable Unix-type system (tested OK under
533 533 Solaris and the *BSD family, for which a port exists thanks to Dryice Liu).
534 534 \end_layout
535 535
536 536 \begin_layout Standard
537 537
538 538 \series bold
539 539 Mac OS X
540 540 \series default
541 541 : it works, apparently without any problems (thanks to Jim Boyle at Lawrence
542 542 Livermore for the information).
543 543 Thanks to Andrea Riciputi, Fink support is available.
544 544 \end_layout
545 545
546 546 \begin_layout Standard
547 547
548 548 \series bold
549 549 CygWin
550 550 \series default
551 551 : it works mostly OK, though some users have reported problems with prompt
552 552 coloring.
553 553 No satisfactory solution to this has been found so far, you may want to
554 554 disable colors permanently in the
555 555 \family typewriter
556 556 ipythonrc
557 557 \family default
558 558 configuration file if you experience problems.
559 559 If you have proper color support under cygwin, please post to the IPython
560 560 mailing list so this issue can be resolved for all users.
561 561 \end_layout
562 562
563 563 \begin_layout Standard
564 564
565 565 \series bold
566 566 Windows
567 567 \series default
568 568 : it works well under Windows XP/2k, and I suspect NT should behave similarly.
569 569 Section\InsetSpace ~
570 570
571 571 \begin_inset LatexCommand \ref{sub:Under-Windows}
572 572
573 573 \end_inset
574 574
575 575 describes installation details for Windows, including some additional tools
576 576 needed on this platform.
577 577 \end_layout
578 578
579 579 \begin_layout Standard
580 580 Windows 9x support is present, and has been reported to work fine (at least
581 581 on WinME).
582 582 \end_layout
583 583
584 584 \begin_layout Standard
585 585 Note, that I have very little access to and experience with Windows development.
586 586 However, an excellent group of Win32 users (led by Ville Vainio), consistently
587 587 contribute bugfixes and platform-specific enhancements, so they more than
588 588 make up for my deficiencies on that front.
589 589 In fact, Win32 users report using IPython as a system shell (see Sec.\InsetSpace ~
590 590
591 591 \begin_inset LatexCommand \ref{sec:IPython-as-shell}
592 592
593 593 \end_inset
594 594
595 595 for details), as it offers a level of control and features which the default
596 596
597 597 \family typewriter
598 598 cmd.exe
599 599 \family default
600 600 doesn't provide.
601 601 \end_layout
602 602
603 603 \begin_layout Subsection
604 604 Location
605 605 \end_layout
606 606
607 607 \begin_layout Standard
608 608 IPython is generously hosted at
609 609 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
610 610
611 611 \end_inset
612 612
613 613 by the Enthought, Inc and the SciPy project.
614 614 This site offers downloads, subversion access, mailing lists and a bug
615 615 tracking system.
616 616 I am very grateful to Enthought (
617 617 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
618 618
619 619 \end_inset
620 620
621 621 ) and all of the SciPy team for their contribution.
622 622 \end_layout
623 623
624 624 \begin_layout Section
625 625 \begin_inset LatexCommand \label{sec:install}
626 626
627 627 \end_inset
628 628
629 629 Installation
630 630 \end_layout
631 631
632 632 \begin_layout Subsection
633 633 Instant instructions
634 634 \end_layout
635 635
636 636 \begin_layout Standard
637 637 If you are of the impatient kind, under Linux/Unix simply untar/unzip the
638 638 download, then install with
639 639 \family typewriter
640 640 `python setup.py install'
641 641 \family default
642 642 .
643 643 Under Windows, double-click on the provided
644 644 \family typewriter
645 645 .exe
646 646 \family default
647 647 binary installer.
648 648 \end_layout
649 649
650 650 \begin_layout Standard
651 651 Then, take a look at Sections
652 652 \begin_inset LatexCommand \ref{sec:good_config}
653 653
654 654 \end_inset
655 655
656 656 for configuring things optimally and
657 657 \begin_inset LatexCommand \ref{sec:quick_tips}
658 658
659 659 \end_inset
660 660
661 661 for quick tips on efficient use of IPython.
662 662 You can later refer to the rest of the manual for all the gory details.
663 663 \end_layout
664 664
665 665 \begin_layout Standard
666 666 See the notes in sec.
667 667
668 668 \begin_inset LatexCommand \ref{sec:upgrade}
669 669
670 670 \end_inset
671 671
672 672 for upgrading IPython versions.
673 673 \end_layout
674 674
675 675 \begin_layout Subsection
676 676 Detailed Unix instructions (Linux, Mac OS X, etc.)
677 677 \end_layout
678 678
679 679 \begin_layout Standard
680 680 For RPM based systems, simply install the supplied package in the usual
681 681 manner.
682 682 If you download the tar archive, the process is:
683 683 \end_layout
684 684
685 685 \begin_layout Enumerate
686 686 Unzip/untar the
687 687 \family typewriter
688 688 ipython-XXX.tar.gz
689 689 \family default
690 690 file wherever you want (
691 691 \family typewriter
692 692 XXX
693 693 \family default
694 694 is the version number).
695 695 It will make a directory called
696 696 \family typewriter
697 697 ipython-XXX.
698 698
699 699 \family default
700 700 Change into that directory where you will find the files
701 701 \family typewriter
702 702 README
703 703 \family default
704 704 and
705 705 \family typewriter
706 706 setup.py
707 707 \family default
708 708 .
709 709
710 710 \family typewriter
711 711 O
712 712 \family default
713 713 nce you've completed the installation, you can safely remove this directory.
714 714
715 715 \end_layout
716 716
717 717 \begin_layout Enumerate
718 718 If you are installing over a previous installation of version 0.2.0 or earlier,
719 719 first remove your
720 720 \family typewriter
721 721 $HOME/.ipython
722 722 \family default
723 723 directory, since the configuration file format has changed somewhat (the
724 724 '=' were removed from all option specifications).
725 725 Or you can call ipython with the
726 726 \family typewriter
727 727 -upgrade
728 728 \family default
729 729 option and it will do this automatically for you.
730 730 \end_layout
731 731
732 732 \begin_layout Enumerate
733 733 IPython uses distutils, so you can install it by simply typing at the system
734 734 prompt (don't type the
735 735 \family typewriter
736 736 $
737 737 \family default
738 738 )
739 739 \newline
740 740
741 741 \family typewriter
742 742 $ python setup.py install
743 743 \family default
744 744
745 745 \newline
746 746 Note that this assumes you have root access to your machine.
747 747 If you don't have root access or don't want IPython to go in the default
748 748 python directories, you'll need to use the
749 749 \begin_inset ERT
750 750 status collapsed
751 751
752 752 \begin_layout Standard
753 753
754 754
755 755 \backslash
756 756 verb|--home|
757 757 \end_layout
758 758
759 759 \end_inset
760 760
761 761 option (or
762 762 \begin_inset ERT
763 763 status collapsed
764 764
765 765 \begin_layout Standard
766 766
767 767
768 768 \backslash
769 769 verb|--prefix|
770 770 \end_layout
771 771
772 772 \end_inset
773 773
774 774 ).
775 775 For example:
776 776 \newline
777 777
778 778 \begin_inset ERT
779 779 status collapsed
780 780
781 781 \begin_layout Standard
782 782
783 783
784 784 \backslash
785 785 verb|$ python setup.py install --home $HOME/local|
786 786 \end_layout
787 787
788 788 \end_inset
789 789
790 790
791 791 \newline
792 792 will install IPython into
793 793 \family typewriter
794 794 $HOME/local
795 795 \family default
796 796 and its subdirectories (creating them if necessary).
797 797 \newline
798 798 You can type
799 799 \newline
800 800
801 801 \begin_inset ERT
802 802 status collapsed
803 803
804 804 \begin_layout Standard
805 805
806 806
807 807 \backslash
808 808 verb|$ python setup.py --help|
809 809 \end_layout
810 810
811 811 \end_inset
812 812
813 813
814 814 \newline
815 815 for more details.
816 816 \newline
817 817 Note that if you change the default location for
818 818 \begin_inset ERT
819 819 status collapsed
820 820
821 821 \begin_layout Standard
822 822
823 823
824 824 \backslash
825 825 verb|--home|
826 826 \end_layout
827 827
828 828 \end_inset
829 829
830 830 at installation, IPython may end up installed at a location which is not
831 831 part of your
832 832 \family typewriter
833 833 $PYTHONPATH
834 834 \family default
835 835 environment variable.
836 836 In this case, you'll need to configure this variable to include the actual
837 837 directory where the
838 838 \family typewriter
839 839 IPython/
840 840 \family default
841 841 directory ended (typically the value you give to
842 842 \begin_inset ERT
843 843 status collapsed
844 844
845 845 \begin_layout Standard
846 846
847 847
848 848 \backslash
849 849 verb|--home|
850 850 \end_layout
851 851
852 852 \end_inset
853 853
854 854 plus
855 855 \family typewriter
856 856 /lib/python
857 857 \family default
858 858 ).
859 859 \end_layout
860 860
861 861 \begin_layout Subsubsection
862 862 Mac OSX information
863 863 \end_layout
864 864
865 865 \begin_layout Standard
866 866 Under OSX, there is a choice you need to make.
867 867 Apple ships its own build of Python, which lives in the core OSX filesystem
868 868 hierarchy.
869 869 You can also manually install a separate Python, either purely by hand
870 870 (typically in
871 871 \family typewriter
872 872 /usr/local
873 873 \family default
874 874 ) or by using Fink, which puts everything under
875 875 \family typewriter
876 876 /sw
877 877 \family default
878 878 .
879 879 Which route to follow is a matter of personal preference, as I've seen
880 880 users who favor each of the approaches.
881 881 Here I will simply list the known installation issues under OSX, along
882 882 with their solutions.
883 883 \end_layout
884 884
885 885 \begin_layout Standard
886 886 This page:
887 887 \begin_inset LatexCommand \htmlurl{http://geosci.uchicago.edu/~tobis/pylab.html}
888 888
889 889 \end_inset
890 890
891 891 contains information on this topic, with additional details on how to make
892 892 IPython and matplotlib play nicely under OSX.
893 893 \end_layout
894 894
895 895 \begin_layout Subsubsection*
896 896 GUI problems
897 897 \end_layout
898 898
899 899 \begin_layout Standard
900 900 The following instructions apply to an install of IPython under OSX from
901 901 unpacking the
902 902 \family typewriter
903 903 .tar.gz
904 904 \family default
905 905 distribution and installing it for the default Python interpreter shipped
906 906 by Apple.
907 907 If you are using a fink install, fink will take care of these details for
908 908 you, by installing IPython against fink's Python.
909 909 \end_layout
910 910
911 911 \begin_layout Standard
912 912 IPython offers various forms of support for interacting with graphical applicati
913 913 ons from the command line, from simple Tk apps (which are in principle always
914 914 supported by Python) to interactive control of WX, Qt and GTK apps.
915 915 Under OSX, however, this requires that ipython is installed by calling
916 916 the special
917 917 \family typewriter
918 918 pythonw
919 919 \family default
920 920 script at installation time, which takes care of coordinating things with
921 921 Apple's graphical environment.
922 922 \end_layout
923 923
924 924 \begin_layout Standard
925 925 So when installing under OSX, it is best to use the following command:
926 926 \family typewriter
927 927
928 928 \newline
929 929
930 930 \family default
931 931
932 932 \begin_inset ERT
933 933 status collapsed
934 934
935 935 \begin_layout Standard
936 936
937 937
938 938 \backslash
939 939 verb| $ sudo pythonw setup.py install --install-scripts=/usr/local/bin|
940 940 \end_layout
941 941
942 942 \end_inset
943 943
944 944
945 945 \newline
946 946 or
947 947 \newline
948 948
949 949 \begin_inset ERT
950 950 status collapsed
951 951
952 952 \begin_layout Standard
953 953
954 954
955 955 \backslash
956 956 verb| $ sudo pythonw setup.py install --install-scripts=/usr/bin|
957 957 \end_layout
958 958
959 959 \end_inset
960 960
961 961
962 962 \newline
963 963 depending on where you like to keep hand-installed executables.
964 964 \end_layout
965 965
966 966 \begin_layout Standard
967 967 The resulting script will have an appropriate shebang line (the first line
968 968 in the script whic begins with
969 969 \family typewriter
970 970 #!...
971 971 \family default
972 972 ) such that the ipython interpreter can interact with the OS X GUI.
973 973 If the installed version does not work and has a shebang line that points
974 974 to, for example, just
975 975 \family typewriter
976 976 /usr/bin/python
977 977 \family default
978 978 , then you might have a stale, cached version in your
979 979 \family typewriter
980 980 build/scripts-<python-version>
981 981 \family default
982 982 directory.
983 983 Delete that directory and rerun the
984 984 \family typewriter
985 985 setup.py
986 986 \family default
987 987 .
988 988
989 989 \end_layout
990 990
991 991 \begin_layout Standard
992 992 It is also a good idea to use the special flag
993 993 \begin_inset ERT
994 994 status collapsed
995 995
996 996 \begin_layout Standard
997 997
998 998
999 999 \backslash
1000 1000 verb|--install-scripts|
1001 1001 \end_layout
1002 1002
1003 1003 \end_inset
1004 1004
1005 1005 as indicated above, to ensure that the ipython scripts end up in a location
1006 1006 which is part of your
1007 1007 \family typewriter
1008 1008 $PATH
1009 1009 \family default
1010 1010 .
1011 1011 Otherwise Apple's Python will put the scripts in an internal directory
1012 1012 not available by default at the command line (if you use
1013 1013 \family typewriter
1014 1014 /usr/local/bin
1015 1015 \family default
1016 1016 , you need to make sure this is in your
1017 1017 \family typewriter
1018 1018 $PATH
1019 1019 \family default
1020 1020 , which may not be true by default).
1021 1021 \end_layout
1022 1022
1023 1023 \begin_layout Subsubsection*
1024 1024 Readline problems
1025 1025 \end_layout
1026 1026
1027 1027 \begin_layout Standard
1028 1028 By default, the Python version shipped by Apple does
1029 1029 \emph on
1030 1030 not
1031 1031 \emph default
1032 1032 include the readline library, so central to IPython's behavior.
1033 1033 If you install IPython against Apple's Python, you will not have arrow
1034 1034 keys, tab completion, etc.
1035 1035 For Mac OSX 10.3 (Panther), you can find a prebuilt readline library here:
1036 1036 \newline
1037 1037
1038 1038 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip}
1039 1039
1040 1040 \end_inset
1041 1041
1042 1042
1043 1043 \end_layout
1044 1044
1045 1045 \begin_layout Standard
1046 1046 If you are using OSX 10.4 (Tiger), after installing this package you need
1047 1047 to either:
1048 1048 \end_layout
1049 1049
1050 1050 \begin_layout Enumerate
1051 1051 move
1052 1052 \family typewriter
1053 1053 readline.so
1054 1054 \family default
1055 1055 from
1056 1056 \family typewriter
1057 1057 /Library/Python/2.3
1058 1058 \family default
1059 1059 to
1060 1060 \family typewriter
1061 1061 /Library/Python/2.3/site-packages
1062 1062 \family default
1063 1063 , or
1064 1064 \end_layout
1065 1065
1066 1066 \begin_layout Enumerate
1067 1067 install
1068 1068 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/TigerPython23Compat.pkg.zip}
1069 1069
1070 1070 \end_inset
1071 1071
1072 1072
1073 1073 \end_layout
1074 1074
1075 1075 \begin_layout Standard
1076 1076 Users installing against Fink's Python or a properly hand-built one should
1077 1077 not have this problem.
1078 1078 \end_layout
1079 1079
1080 1080 \begin_layout Subsubsection*
1081 1081 DarwinPorts
1082 1082 \end_layout
1083 1083
1084 1084 \begin_layout Standard
1085 1085 I report here a message from an OSX user, who suggests an alternative means
1086 1086 of using IPython under this operating system with good results.
1087 1087 Please let me know of any updates that may be useful for this section.
1088 1088 His message is reproduced verbatim below:
1089 1089 \end_layout
1090 1090
1091 1091 \begin_layout Quote
1092 1092 From: Markus Banfi
1093 1093 \family typewriter
1094 1094 <markus.banfi-AT-mospheira.net>
1095 1095 \end_layout
1096 1096
1097 1097 \begin_layout Quote
1098 1098 As a MacOS X (10.4.2) user I prefer to install software using DawinPorts instead
1099 1099 of Fink.
1100 1100 I had no problems installing ipython with DarwinPorts.
1101 1101 It's just:
1102 1102 \end_layout
1103 1103
1104 1104 \begin_layout Quote
1105 1105
1106 1106 \family typewriter
1107 1107 sudo port install py-ipython
1108 1108 \end_layout
1109 1109
1110 1110 \begin_layout Quote
1111 1111 It automatically resolved all dependencies (python24, readline, py-readline).
1112 1112 So far I did not encounter any problems with the DarwinPorts port of ipython.
1113 1113
1114 1114 \end_layout
1115 1115
1116 1116 \begin_layout Subsection
1117 1117 \begin_inset LatexCommand \label{sub:Under-Windows}
1118 1118
1119 1119 \end_inset
1120 1120
1121 1121 Windows instructions
1122 1122 \end_layout
1123 1123
1124 1124 \begin_layout Standard
1125 1125 Some of IPython's very useful features are:
1126 1126 \end_layout
1127 1127
1128 1128 \begin_layout Itemize
1129 1129 Integrated readline support (Tab-based file, object and attribute completion,
1130 1130 input history across sessions, editable command line, etc.)
1131 1131 \end_layout
1132 1132
1133 1133 \begin_layout Itemize
1134 1134 Coloring of prompts, code and tracebacks.
1135 1135 \end_layout
1136 1136
1137 1137 \begin_layout Standard
1138 1138 These, by default, are only available under Unix-like operating systems.
1139 1139 However, thanks to Gary Bishop's work, Windows XP/2k users can also benefit
1140 1140 from them.
1141 1141 His readline library originally implemented both GNU readline functionality
1142 1142 and color support, so that IPython under Windows XP/2k can be as friendly
1143 1143 and powerful as under Unix-like environments.
1144 1144
1145 1145 \end_layout
1146 1146
1147 1147 \begin_layout Standard
1148 1148 This library, now named
1149 1149 \family typewriter
1150 1150 PyReadline
1151 1151 \family default
1152 1152 , has been absorbed by the IPython team (JοΏ½rgen Stenarson, in particular),
1153 1153 and it continues to be developed with new features, as well as being distribute
1154 1154 d directly from the IPython site.
1155 1155 \end_layout
1156 1156
1157 1157 \begin_layout Standard
1158 1158 The
1159 1159 \family typewriter
1160 1160 PyReadline
1161 1161 \family default
1162 1162 extension requires
1163 1163 \family typewriter
1164 1164 CTypes
1165 1165 \family default
1166 1166 and the windows IPython installer needs
1167 1167 \family typewriter
1168 1168 PyWin32
1169 1169 \family default
1170 1170 , so in all you need:
1171 1171 \end_layout
1172 1172
1173 1173 \begin_layout Enumerate
1174 1174
1175 1175 \family typewriter
1176 1176 PyWin32
1177 1177 \family default
1178 1178 from
1179 1179 \begin_inset LatexCommand \htmlurl{http://sourceforge.net/projects/pywin32}
1180 1180
1181 1181 \end_inset
1182 1182
1183 1183 .
1184 1184 \end_layout
1185 1185
1186 1186 \begin_layout Enumerate
1187 1187
1188 1188 \family typewriter
1189 1189 PyReadline
1190 1190 \family default
1191 1191 for Windows from
1192 1192 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org/moin/PyReadline/Intro}
1193 1193
1194 1194 \end_inset
1195 1195
1196 1196 .
1197 1197 That page contains further details on using and configuring the system
1198 1198 to your liking.
1199 1199 \end_layout
1200 1200
1201 1201 \begin_layout Enumerate
1202 1202 Finally,
1203 1203 \emph on
1204 1204 only
1205 1205 \emph default
1206 1206 if you are using Python 2.3 or 2.4, you need
1207 1207 \family typewriter
1208 1208 CTypes
1209 1209 \family default
1210 1210 from
1211 1211 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/theller/ctypes}
1212 1212
1213 1213 \end_inset
1214 1214
1215 1215 (you
1216 1216 \emph on
1217 1217 must
1218 1218 \emph default
1219 1219 use version 0.9.1 or newer).
1220 1220 This package is included in Python 2.5, so you don't need to manually get
1221 1221 it if your Python version is 2.5 or newer.
1222 1222 \end_layout
1223 1223
1224 1224 \begin_layout Standard
1225 1225
1226 1226 \series bold
1227 1227 Warning about a broken readline-like library:
1228 1228 \series default
1229 1229 several users have reported problems stemming from using the pseudo-readline
1230 1230 library at
1231 1231 \begin_inset LatexCommand \htmlurl{http://newcenturycomputers.net/projects/readline.html}
1232 1232
1233 1233 \end_inset
1234 1234
1235 1235 .
1236 1236 This is a broken library which, while called readline, only implements
1237 1237 an incomplete subset of the readline API.
1238 1238 Since it is still called readline, it fools IPython's detection mechanisms
1239 1239 and causes unpredictable crashes later.
1240 1240 If you wish to use IPython under Windows, you must NOT use this library,
1241 1241 which for all purposes is (at least as of version 1.6) terminally broken.
1242 1242 \end_layout
1243 1243
1244 1244 \begin_layout Subsubsection
1245 1245 Installation procedure
1246 1246 \end_layout
1247 1247
1248 1248 \begin_layout Standard
1249 1249 Once you have the above installed, from the IPython download directory grab
1250 1250 the
1251 1251 \family typewriter
1252 1252 ipython-XXX.win32.exe
1253 1253 \family default
1254 1254 file, where
1255 1255 \family typewriter
1256 1256 XXX
1257 1257 \family default
1258 1258 represents the version number.
1259 1259 This is a regular windows executable installer, which you can simply double-cli
1260 1260 ck to install.
1261 1261 It will add an entry for IPython to your Start Menu, as well as registering
1262 1262 IPython in the Windows list of applications, so you can later uninstall
1263 1263 it from the Control Panel.
1264 1264
1265 1265 \end_layout
1266 1266
1267 1267 \begin_layout Standard
1268 1268 IPython tries to install the configuration information in a directory named
1269 1269
1270 1270 \family typewriter
1271 1271 .ipython
1272 1272 \family default
1273 1273 (
1274 1274 \family typewriter
1275 1275 _ipython
1276 1276 \family default
1277 1277 under Windows) located in your `home' directory.
1278 1278 IPython sets this directory by looking for a
1279 1279 \family typewriter
1280 1280 HOME
1281 1281 \family default
1282 1282 environment variable; if such a variable does not exist, it uses
1283 1283 \family typewriter
1284 1284 HOMEDRIVE
1285 1285 \backslash
1286 1286 HOMEPATH
1287 1287 \family default
1288 1288 (these are always defined by Windows).
1289 1289 This typically gives something like
1290 1290 \family typewriter
1291 1291 C:
1292 1292 \backslash
1293 1293 Documents and Settings
1294 1294 \backslash
1295 1295 YourUserName
1296 1296 \family default
1297 1297 , but your local details may vary.
1298 1298 In this directory you will find all the files that configure IPython's
1299 1299 defaults, and you can put there your profiles and extensions.
1300 1300 This directory is automatically added by IPython to
1301 1301 \family typewriter
1302 1302 sys.path
1303 1303 \family default
1304 1304 , so anything you place there can be found by
1305 1305 \family typewriter
1306 1306 import
1307 1307 \family default
1308 1308 statements.
1309 1309 \end_layout
1310 1310
1311 1311 \begin_layout Paragraph
1312 1312 Upgrading
1313 1313 \end_layout
1314 1314
1315 1315 \begin_layout Standard
1316 1316 For an IPython upgrade, you should first uninstall the previous version.
1317 1317 This will ensure that all files and directories (such as the documentation)
1318 1318 which carry embedded version strings in their names are properly removed.
1319 1319 \end_layout
1320 1320
1321 1321 \begin_layout Paragraph
1322 1322 Manual installation under Win32
1323 1323 \end_layout
1324 1324
1325 1325 \begin_layout Standard
1326 1326 In case the automatic installer does not work for some reason, you can download
1327 1327 the
1328 1328 \family typewriter
1329 1329 ipython-XXX.tar.gz
1330 1330 \family default
1331 1331 file, which contains the full IPython source distribution (the popular
1332 1332 WinZip can read
1333 1333 \family typewriter
1334 1334 .tar.gz
1335 1335 \family default
1336 1336 files).
1337 1337 After uncompressing the archive, you can install it at a command terminal
1338 1338 just like any other Python module, by using
1339 1339 \family typewriter
1340 1340 `python setup.py install'
1341 1341 \family default
1342 1342 .
1343 1343
1344 1344 \end_layout
1345 1345
1346 1346 \begin_layout Standard
1347 1347 After the installation, run the supplied
1348 1348 \family typewriter
1349 1349 win32_manual_post_install.py
1350 1350 \family default
1351 1351 script, which creates the necessary Start Menu shortcuts for you.
1352 1352 \end_layout
1353 1353
1354 1354 \begin_layout Subsection
1355 1355 \begin_inset LatexCommand \label{sec:upgrade}
1356 1356
1357 1357 \end_inset
1358 1358
1359 1359 Upgrading from a previous version
1360 1360 \end_layout
1361 1361
1362 1362 \begin_layout Standard
1363 1363 If you are upgrading from a previous version of IPython, after doing the
1364 1364 routine installation described above, you should call IPython with the
1365 1365
1366 1366 \family typewriter
1367 1367 -upgrade
1368 1368 \family default
1369 1369 option the first time you run your new copy.
1370 1370 This will automatically update your configuration directory while preserving
1371 1371 copies of your old files.
1372 1372 You can then later merge back any personal customizations you may have
1373 1373 made into the new files.
1374 1374 It is a good idea to do this as there may be new options available in the
1375 1375 new configuration files which you will not have.
1376 1376 \end_layout
1377 1377
1378 1378 \begin_layout Standard
1379 1379 Under Windows, if you don't know how to call python scripts with arguments
1380 1380 from a command line, simply delete the old config directory and IPython
1381 1381 will make a new one.
1382 1382 Win2k and WinXP users will find it in
1383 1383 \family typewriter
1384 1384 C:
1385 1385 \backslash
1386 1386 Documents and Settings
1387 1387 \backslash
1388 1388 YourUserName
1389 1389 \backslash
1390 1390 _ipython
1391 1391 \family default
1392 1392 , and Win 9x users under
1393 1393 \family typewriter
1394 1394 C:
1395 1395 \backslash
1396 1396 Program Files
1397 1397 \backslash
1398 1398 IPython
1399 1399 \backslash
1400 1400 _ipython.
1401 1401 \end_layout
1402 1402
1403 1403 \begin_layout Section
1404 1404 \begin_inset LatexCommand \label{sec:good_config}
1405 1405
1406 1406 \end_inset
1407 1407
1408 1408
1409 1409 \begin_inset OptArg
1410 1410 status collapsed
1411 1411
1412 1412 \begin_layout Standard
1413 1413 Initial configuration
1414 1414 \begin_inset ERT
1415 1415 status collapsed
1416 1416
1417 1417 \begin_layout Standard
1418 1418
1419 1419
1420 1420 \backslash
1421 1421 ldots
1422 1422 \end_layout
1423 1423
1424 1424 \end_inset
1425 1425
1426 1426
1427 1427 \end_layout
1428 1428
1429 1429 \end_inset
1430 1430
1431 1431 Initial configuration of your environment
1432 1432 \end_layout
1433 1433
1434 1434 \begin_layout Standard
1435 1435 This section will help you set various things in your environment for your
1436 1436 IPython sessions to be as efficient as possible.
1437 1437 All of IPython's configuration information, along with several example
1438 1438 files, is stored in a directory named by default
1439 1439 \family typewriter
1440 1440 $HOME/.ipython
1441 1441 \family default
1442 1442 .
1443 1443 You can change this by defining the environment variable
1444 1444 \family typewriter
1445 1445 IPYTHONDIR
1446 1446 \family default
1447 1447 , or at runtime with the command line option
1448 1448 \family typewriter
1449 1449 -ipythondir
1450 1450 \family default
1451 1451 .
1452 1452 \end_layout
1453 1453
1454 1454 \begin_layout Standard
1455 1455 If all goes well, the first time you run IPython it should automatically
1456 1456 create a user copy of the config directory for you, based on its builtin
1457 1457 defaults.
1458 1458 You can look at the files it creates to learn more about configuring the
1459 1459 system.
1460 1460 The main file you will modify to configure IPython's behavior is called
1461 1461
1462 1462 \family typewriter
1463 1463 ipythonrc
1464 1464 \family default
1465 1465 (with a
1466 1466 \family typewriter
1467 1467 .ini
1468 1468 \family default
1469 1469 extension under Windows), included for reference in Sec.
1470 1470
1471 1471 \begin_inset LatexCommand \ref{sec:ipytonrc-sample}
1472 1472
1473 1473 \end_inset
1474 1474
1475 1475 .
1476 1476 This file is very commented and has many variables you can change to suit
1477 1477 your taste, you can find more details in Sec.
1478 1478
1479 1479 \begin_inset LatexCommand \ref{sec:customization}
1480 1480
1481 1481 \end_inset
1482 1482
1483 1483 .
1484 1484 Here we discuss the basic things you will want to make sure things are
1485 1485 working properly from the beginning.
1486 1486 \end_layout
1487 1487
1488 1488 \begin_layout Subsection
1489 1489 \begin_inset LatexCommand \label{sec:help-access}
1490 1490
1491 1491 \end_inset
1492 1492
1493 1493 Access to the Python help system
1494 1494 \end_layout
1495 1495
1496 1496 \begin_layout Standard
1497 1497 This is true for Python in general (not just for IPython): you should have
1498 1498 an environment variable called
1499 1499 \family typewriter
1500 1500 PYTHONDOCS
1501 1501 \family default
1502 1502 pointing to the directory where your HTML Python documentation lives.
1503 1503 In my system it's
1504 1504 \family typewriter
1505 1505 /usr/share/doc/python-docs-2.3.4/html
1506 1506 \family default
1507 1507 , check your local details or ask your systems administrator.
1508 1508
1509 1509 \end_layout
1510 1510
1511 1511 \begin_layout Standard
1512 1512 This is the directory which holds the HTML version of the Python manuals.
1513 1513 Unfortunately it seems that different Linux distributions package these
1514 1514 files differently, so you may have to look around a bit.
1515 1515 Below I show the contents of this directory on my system for reference:
1516 1516 \end_layout
1517 1517
1518 1518 \begin_layout Standard
1519 1519
1520 1520 \family typewriter
1521 1521 [html]> ls
1522 1522 \newline
1523 1523 about.dat acks.html dist/ ext/ index.html lib/ modindex.html stdabout.dat
1524 1524 tut/ about.html api/ doc/ icons/ inst/ mac/ ref/ style.css
1525 1525 \end_layout
1526 1526
1527 1527 \begin_layout Standard
1528 1528 You should really make sure this variable is correctly set so that Python's
1529 1529 pydoc-based help system works.
1530 1530 It is a powerful and convenient system with full access to the Python manuals
1531 1531 and all modules accessible to you.
1532 1532 \end_layout
1533 1533
1534 1534 \begin_layout Standard
1535 1535 Under Windows it seems that pydoc finds the documentation automatically,
1536 1536 so no extra setup appears necessary.
1537 1537 \end_layout
1538 1538
1539 1539 \begin_layout Subsection
1540 1540 Editor
1541 1541 \end_layout
1542 1542
1543 1543 \begin_layout Standard
1544 1544 The
1545 1545 \family typewriter
1546 1546 %edit
1547 1547 \family default
1548 1548 command (and its alias
1549 1549 \family typewriter
1550 1550 %ed
1551 1551 \family default
1552 1552 ) will invoke the editor set in your environment as
1553 1553 \family typewriter
1554 1554 EDITOR
1555 1555 \family default
1556 1556 .
1557 1557 If this variable is not set, it will default to
1558 1558 \family typewriter
1559 1559 vi
1560 1560 \family default
1561 1561 under Linux/Unix and to
1562 1562 \family typewriter
1563 1563 notepad
1564 1564 \family default
1565 1565 under Windows.
1566 1566 You may want to set this variable properly and to a lightweight editor
1567 1567 which doesn't take too long to start (that is, something other than a new
1568 1568 instance of
1569 1569 \family typewriter
1570 1570 Emacs
1571 1571 \family default
1572 1572 ).
1573 1573 This way you can edit multi-line code quickly and with the power of a real
1574 1574 editor right inside IPython.
1575 1575
1576 1576 \end_layout
1577 1577
1578 1578 \begin_layout Standard
1579 1579 If you are a dedicated
1580 1580 \family typewriter
1581 1581 Emacs
1582 1582 \family default
1583 1583 user, you should set up the
1584 1584 \family typewriter
1585 1585 Emacs
1586 1586 \family default
1587 1587 server so that new requests are handled by the original process.
1588 1588 This means that almost no time is spent in handling the request (assuming
1589 1589 an
1590 1590 \family typewriter
1591 1591 Emacs
1592 1592 \family default
1593 1593 process is already running).
1594 1594 For this to work, you need to set your
1595 1595 \family typewriter
1596 1596 EDITOR
1597 1597 \family default
1598 1598 environment variable to
1599 1599 \family typewriter
1600 1600 'emacsclient'
1601 1601 \family default
1602 1602 .
1603 1603
1604 1604 \family typewriter
1605 1605
1606 1606 \family default
1607 1607 The code below, supplied by Francois Pinard, can then be used in your
1608 1608 \family typewriter
1609 1609 .emacs
1610 1610 \family default
1611 1611 file to enable the server:
1612 1612 \end_layout
1613 1613
1614 1614 \begin_layout Standard
1615 1615
1616 1616 \family typewriter
1617 1617 (defvar server-buffer-clients)
1618 1618 \newline
1619 1619 (when (and (fboundp 'server-start) (string-equal
1620 1620 (getenv "TERM") 'xterm))
1621 1621 \newline
1622 1622
1623 1623 \begin_inset ERT
1624 1624 status collapsed
1625 1625
1626 1626 \begin_layout Standard
1627 1627
1628 1628
1629 1629 \backslash
1630 1630 hspace*{0mm}
1631 1631 \end_layout
1632 1632
1633 1633 \end_inset
1634 1634
1635 1635 \InsetSpace ~
1636 1636 \InsetSpace ~
1637 1637 (server-start)
1638 1638 \newline
1639 1639
1640 1640 \begin_inset ERT
1641 1641 status collapsed
1642 1642
1643 1643 \begin_layout Standard
1644 1644
1645 1645
1646 1646 \backslash
1647 1647 hspace*{0mm}
1648 1648 \end_layout
1649 1649
1650 1650 \end_inset
1651 1651
1652 1652 \InsetSpace ~
1653 1653 \InsetSpace ~
1654 1654 (defun fp-kill-server-with-buffer-routine ()
1655 1655 \newline
1656 1656
1657 1657 \begin_inset ERT
1658 1658 status collapsed
1659 1659
1660 1660 \begin_layout Standard
1661 1661
1662 1662
1663 1663 \backslash
1664 1664 hspace*{0mm}
1665 1665 \end_layout
1666 1666
1667 1667 \end_inset
1668 1668
1669 1669 \InsetSpace ~
1670 1670 \InsetSpace ~
1671 1671 \InsetSpace ~
1672 1672 \InsetSpace ~
1673 1673 (and server-buffer-clients (server-done)))
1674 1674 \newline
1675 1675
1676 1676 \begin_inset ERT
1677 1677 status collapsed
1678 1678
1679 1679 \begin_layout Standard
1680 1680
1681 1681
1682 1682 \backslash
1683 1683 hspace*{0mm}
1684 1684 \end_layout
1685 1685
1686 1686 \end_inset
1687 1687
1688 1688 \InsetSpace ~
1689 1689 \InsetSpace ~
1690 1690 (add-hook 'kill-buffer-hook 'fp-kill-server-with-buffer-routine))
1691 1691 \end_layout
1692 1692
1693 1693 \begin_layout Standard
1694 1694 You can also set the value of this editor via the commmand-line option '-
1695 1695 \family typewriter
1696 1696 editor'
1697 1697 \family default
1698 1698 or in your
1699 1699 \family typewriter
1700 1700 ipythonrc
1701 1701 \family default
1702 1702 file.
1703 1703 This is useful if you wish to use specifically for IPython an editor different
1704 1704 from your typical default (and for Windows users who tend to use fewer
1705 1705 environment variables).
1706 1706 \end_layout
1707 1707
1708 1708 \begin_layout Subsection
1709 1709 Color
1710 1710 \end_layout
1711 1711
1712 1712 \begin_layout Standard
1713 1713 The default IPython configuration has most bells and whistles turned on
1714 1714 (they're pretty safe).
1715 1715 But there's one that
1716 1716 \emph on
1717 1717 may
1718 1718 \emph default
1719 1719 cause problems on some systems: the use of color on screen for displaying
1720 1720 information.
1721 1721 This is very useful, since IPython can show prompts and exception tracebacks
1722 1722 with various colors, display syntax-highlighted source code, and in general
1723 1723 make it easier to visually parse information.
1724 1724 \end_layout
1725 1725
1726 1726 \begin_layout Standard
1727 1727 The following terminals seem to handle the color sequences fine:
1728 1728 \end_layout
1729 1729
1730 1730 \begin_layout Itemize
1731 1731 Linux main text console, KDE Konsole, Gnome Terminal, E-term, rxvt, xterm.
1732 1732 \end_layout
1733 1733
1734 1734 \begin_layout Itemize
1735 1735 CDE terminal (tested under Solaris).
1736 1736 This one boldfaces light colors.
1737 1737 \end_layout
1738 1738
1739 1739 \begin_layout Itemize
1740 1740 (X)Emacs buffers.
1741 1741 See sec.
1742 1742 \begin_inset LatexCommand \ref{sec:emacs}
1743 1743
1744 1744 \end_inset
1745 1745
1746 1746 for more details on using IPython with (X)Emacs.
1747 1747 \end_layout
1748 1748
1749 1749 \begin_layout Itemize
1750 1750 A Windows (XP/2k) command prompt
1751 1751 \emph on
1752 1752 with Gary Bishop's support extensions
1753 1753 \emph default
1754 1754 .
1755 1755 Gary's extensions are discussed in Sec.\InsetSpace ~
1756 1756
1757 1757 \begin_inset LatexCommand \ref{sub:Under-Windows}
1758 1758
1759 1759 \end_inset
1760 1760
1761 1761 .
1762 1762 \end_layout
1763 1763
1764 1764 \begin_layout Itemize
1765 1765 A Windows (XP/2k) CygWin shell.
1766 1766 Although some users have reported problems; it is not clear whether there
1767 1767 is an issue for everyone or only under specific configurations.
1768 1768 If you have full color support under cygwin, please post to the IPython
1769 1769 mailing list so this issue can be resolved for all users.
1770 1770 \end_layout
1771 1771
1772 1772 \begin_layout Standard
1773 1773 These have shown problems:
1774 1774 \end_layout
1775 1775
1776 1776 \begin_layout Itemize
1777 1777 Windows command prompt in WinXP/2k logged into a Linux machine via telnet
1778 1778 or ssh.
1779 1779 \end_layout
1780 1780
1781 1781 \begin_layout Itemize
1782 1782 Windows native command prompt in WinXP/2k,
1783 1783 \emph on
1784 1784 without
1785 1785 \emph default
1786 1786 Gary Bishop's extensions.
1787 1787 Once Gary's readline library is installed, the normal WinXP/2k command
1788 1788 prompt works perfectly.
1789 1789 \end_layout
1790 1790
1791 1791 \begin_layout Standard
1792 1792 Currently the following color schemes are available:
1793 1793 \end_layout
1794 1794
1795 1795 \begin_layout Itemize
1796 1796
1797 1797 \family typewriter
1798 1798 NoColor
1799 1799 \family default
1800 1800 : uses no color escapes at all (all escapes are empty
1801 1801 \begin_inset Quotes eld
1802 1802 \end_inset
1803 1803
1804 1804
1805 1805 \begin_inset Quotes eld
1806 1806 \end_inset
1807 1807
1808 1808 strings).
1809 1809 This 'scheme' is thus fully safe to use in any terminal.
1810 1810 \end_layout
1811 1811
1812 1812 \begin_layout Itemize
1813 1813
1814 1814 \family typewriter
1815 1815 Linux
1816 1816 \family default
1817 1817 : works well in Linux console type environments: dark background with light
1818 1818 fonts.
1819 1819 It uses bright colors for information, so it is difficult to read if you
1820 1820 have a light colored background.
1821 1821 \end_layout
1822 1822
1823 1823 \begin_layout Itemize
1824 1824
1825 1825 \family typewriter
1826 1826 LightBG
1827 1827 \family default
1828 1828 : the basic colors are similar to those in the
1829 1829 \family typewriter
1830 1830 Linux
1831 1831 \family default
1832 1832 scheme but darker.
1833 1833 It is easy to read in terminals with light backgrounds.
1834 1834 \end_layout
1835 1835
1836 1836 \begin_layout Standard
1837 1837 IPython uses colors for two main groups of things: prompts and tracebacks
1838 1838 which are directly printed to the terminal, and the object introspection
1839 1839 system which passes large sets of data through a pager.
1840 1840 \end_layout
1841 1841
1842 1842 \begin_layout Subsubsection
1843 1843 Input/Output prompts and exception tracebacks
1844 1844 \end_layout
1845 1845
1846 1846 \begin_layout Standard
1847 1847 You can test whether the colored prompts and tracebacks work on your system
1848 1848 interactively by typing
1849 1849 \family typewriter
1850 1850 '%colors Linux'
1851 1851 \family default
1852 1852 at the prompt (use '
1853 1853 \family typewriter
1854 1854 %colors LightBG'
1855 1855 \family default
1856 1856 if your terminal has a light background).
1857 1857 If the input prompt shows garbage like:
1858 1858 \newline
1859 1859
1860 1860 \family typewriter
1861 1861 [0;32mIn [[1;32m1[0;32m]: [0;00m
1862 1862 \family default
1863 1863
1864 1864 \newline
1865 1865 instead of (in color) something like:
1866 1866 \newline
1867 1867
1868 1868 \family typewriter
1869 1869 In [1]:
1870 1870 \family default
1871 1871
1872 1872 \newline
1873 1873 this means that your terminal doesn't properly handle color escape sequences.
1874 1874 You can go to a 'no color' mode by typing '
1875 1875 \family typewriter
1876 1876 %colors NoColor
1877 1877 \family default
1878 1878 '.
1879 1879
1880 1880 \end_layout
1881 1881
1882 1882 \begin_layout Standard
1883 1883 You can try using a different terminal emulator program (Emacs users, see
1884 1884 below).
1885 1885 To permanently set your color preferences, edit the file
1886 1886 \family typewriter
1887 1887 $HOME/.ipython/ipythonrc
1888 1888 \family default
1889 1889 and set the
1890 1890 \family typewriter
1891 1891 colors
1892 1892 \family default
1893 1893 option to the desired value.
1894 1894 \end_layout
1895 1895
1896 1896 \begin_layout Subsubsection
1897 1897 Object details (types, docstrings, source code, etc.)
1898 1898 \end_layout
1899 1899
1900 1900 \begin_layout Standard
1901 1901 IPython has a set of special functions for studying the objects you are
1902 1902 working with, discussed in detail in Sec.
1903 1903
1904 1904 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1905 1905
1906 1906 \end_inset
1907 1907
1908 1908 .
1909 1909 But this system relies on passing information which is longer than your
1910 1910 screen through a data pager, such as the common Unix
1911 1911 \family typewriter
1912 1912 less
1913 1913 \family default
1914 1914 and
1915 1915 \family typewriter
1916 1916 more
1917 1917 \family default
1918 1918 programs.
1919 1919 In order to be able to see this information in color, your pager needs
1920 1920 to be properly configured.
1921 1921 I strongly recommend using
1922 1922 \family typewriter
1923 1923 less
1924 1924 \family default
1925 1925 instead of
1926 1926 \family typewriter
1927 1927 more
1928 1928 \family default
1929 1929 , as it seems that
1930 1930 \family typewriter
1931 1931 more
1932 1932 \family default
1933 1933 simply can not understand colored text correctly.
1934 1934 \end_layout
1935 1935
1936 1936 \begin_layout Standard
1937 1937 In order to configure
1938 1938 \family typewriter
1939 1939 less
1940 1940 \family default
1941 1941 as your default pager, do the following:
1942 1942 \end_layout
1943 1943
1944 1944 \begin_layout Enumerate
1945 1945 Set the environment
1946 1946 \family typewriter
1947 1947 PAGER
1948 1948 \family default
1949 1949 variable to
1950 1950 \family typewriter
1951 1951 less
1952 1952 \family default
1953 1953 .
1954 1954 \end_layout
1955 1955
1956 1956 \begin_layout Enumerate
1957 1957 Set the environment
1958 1958 \family typewriter
1959 1959 LESS
1960 1960 \family default
1961 1961 variable to
1962 1962 \family typewriter
1963 1963 -r
1964 1964 \family default
1965 1965 (plus any other options you always want to pass to
1966 1966 \family typewriter
1967 1967 less
1968 1968 \family default
1969 1969 by default).
1970 1970 This tells
1971 1971 \family typewriter
1972 1972 less
1973 1973 \family default
1974 1974 to properly interpret control sequences, which is how color information
1975 1975 is given to your terminal.
1976 1976 \end_layout
1977 1977
1978 1978 \begin_layout Standard
1979 1979 For the
1980 1980 \family typewriter
1981 1981 csh
1982 1982 \family default
1983 1983 or
1984 1984 \family typewriter
1985 1985 tcsh
1986 1986 \family default
1987 1987 shells, add to your
1988 1988 \family typewriter
1989 1989 ~/.cshrc
1990 1990 \family default
1991 1991 file the lines:
1992 1992 \end_layout
1993 1993
1994 1994 \begin_layout Standard
1995 1995
1996 1996 \family typewriter
1997 1997 setenv PAGER less
1998 1998 \newline
1999 1999 setenv LESS -r
2000 2000 \end_layout
2001 2001
2002 2002 \begin_layout Standard
2003 2003 There is similar syntax for other Unix shells, look at your system documentation
2004 2004 for details.
2005 2005 \end_layout
2006 2006
2007 2007 \begin_layout Standard
2008 2008 If you are on a system which lacks proper data pagers (such as Windows),
2009 2009 IPython will use a very limited builtin pager.
2010 2010 \end_layout
2011 2011
2012 2012 \begin_layout Subsection
2013 2013 \begin_inset LatexCommand \label{sec:emacs}
2014 2014
2015 2015 \end_inset
2016 2016
2017 2017 (X)Emacs configuration
2018 2018 \end_layout
2019 2019
2020 2020 \begin_layout Standard
2021 2021 Thanks to the work of Alexander Schmolck and Prabhu Ramachandran, currently
2022 2022 (X)Emacs and IPython get along very well.
2023 2023
2024 2024 \end_layout
2025 2025
2026 2026 \begin_layout Standard
2027 2027
2028 2028 \series bold
2029 2029 Important note:
2030 2030 \series default
2031 2031 You will need to use a recent enough version of
2032 2032 \family typewriter
2033 2033 python-mode.el
2034 2034 \family default
2035 2035 , along with the file
2036 2036 \family typewriter
2037 2037 ipython.el
2038 2038 \family default
2039 2039 .
2040 2040 You can check that the version you have of
2041 2041 \family typewriter
2042 2042 python-mode.el
2043 2043 \family default
2044 2044 is new enough by either looking at the revision number in the file itself,
2045 2045 or asking for it in (X)Emacs via
2046 2046 \family typewriter
2047 2047 M-x py-version
2048 2048 \family default
2049 2049 .
2050 2050 Versions 4.68 and newer contain the necessary fixes for proper IPython support.
2051 2051 \end_layout
2052 2052
2053 2053 \begin_layout Standard
2054 2054 The file
2055 2055 \family typewriter
2056 2056 ipython.el
2057 2057 \family default
2058 2058 is included with the IPython distribution, in the documentation directory
2059 2059 (where this manual resides in PDF and HTML formats).
2060 2060 \end_layout
2061 2061
2062 2062 \begin_layout Standard
2063 2063 Once you put these files in your Emacs path, all you need in your
2064 2064 \family typewriter
2065 2065 .emacs
2066 2066 \family default
2067 2067 file is:
2068 2068 \end_layout
2069 2069
2070 2070 \begin_layout LyX-Code
2071 2071 (require 'ipython)
2072 2072 \end_layout
2073 2073
2074 2074 \begin_layout Standard
2075 2075 This should give you full support for executing code snippets via IPython,
2076 2076 opening IPython as your Python shell via
2077 2077 \family typewriter
2078 2078 C-c\InsetSpace ~
2079 2079 !
2080 2080 \family default
2081 2081 , etc.
2082 2082
2083 2083 \end_layout
2084 2084
2085 2085 \begin_layout Standard
2086 2086 If you happen to get garbage instead of colored prompts as described in
2087 2087 the previous section, you may need to set also in your
2088 2088 \family typewriter
2089 2089 .emacs
2090 2090 \family default
2091 2091 file:
2092 2092 \end_layout
2093 2093
2094 2094 \begin_layout LyX-Code
2095 2095 (setq ansi-color-for-comint-mode t)
2096 2096 \end_layout
2097 2097
2098 2098 \begin_layout Subsubsection*
2099 2099 Notes
2100 2100 \end_layout
2101 2101
2102 2102 \begin_layout Itemize
2103 2103 There is one caveat you should be aware of: you must start the IPython shell
2104 2104
2105 2105 \emph on
2106 2106 before
2107 2107 \emph default
2108 2108 attempting to execute any code regions via
2109 2109 \family typewriter
2110 2110 C-c\InsetSpace ~
2111 2111 |
2112 2112 \family default
2113 2113 .
2114 2114 Simply type
2115 2115 \family typewriter
2116 2116 C-c\InsetSpace ~
2117 2117 !
2118 2118 \family default
2119 2119 to start IPython before passing any code regions to the interpreter, and
2120 2120 you shouldn't experience any problems.
2121 2121 \newline
2122 2122 This is due to a bug in Python itself,
2123 2123 which has been fixed for Python 2.3, but exists as of Python 2.2.2 (reported
2124 2124 as SF bug [ 737947 ]).
2125 2125 \end_layout
2126 2126
2127 2127 \begin_layout Itemize
2128 2128 The (X)Emacs support is maintained by Alexander Schmolck, so all comments/reques
2129 2129 ts should be directed to him through the IPython mailing lists.
2130 2130
2131 2131 \end_layout
2132 2132
2133 2133 \begin_layout Itemize
2134 2134 This code is still somewhat experimental so it's a bit rough around the
2135 2135 edges (although in practice, it works quite well).
2136 2136 \end_layout
2137 2137
2138 2138 \begin_layout Itemize
2139 2139 Be aware that if you customize
2140 2140 \family typewriter
2141 2141 py-python-command
2142 2142 \family default
2143 2143 previously, this value will override what
2144 2144 \family typewriter
2145 2145 ipython.el
2146 2146 \family default
2147 2147 does (because loading the customization variables comes later).
2148 2148 \end_layout
2149 2149
2150 2150 \begin_layout Section
2151 2151 \begin_inset LatexCommand \label{sec:quick_tips}
2152 2152
2153 2153 \end_inset
2154 2154
2155 2155 Quick tips
2156 2156 \end_layout
2157 2157
2158 2158 \begin_layout Standard
2159 2159 IPython can be used as an improved replacement for the Python prompt, and
2160 2160 for that you don't really need to read any more of this manual.
2161 2161 But in this section we'll try to summarize a few tips on how to make the
2162 2162 most effective use of it for everyday Python development, highlighting
2163 2163 things you might miss in the rest of the manual (which is getting long).
2164 2164 We'll give references to parts in the manual which provide more detail
2165 2165 when appropriate.
2166 2166 \end_layout
2167 2167
2168 2168 \begin_layout Standard
2169 2169 The following article by Jeremy Jones provides an introductory tutorial
2170 2170 about IPython:
2171 2171 \newline
2172 2172
2173 2173 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html}
2174 2174
2175 2175 \end_inset
2176 2176
2177 2177
2178 2178 \end_layout
2179 2179
2180 2180 \begin_layout Itemize
2181 2181 The TAB key.
2182 2182 TAB-completion, especially for attributes, is a convenient way to explore
2183 2183 the structure of any object you're dealing with.
2184 2184 Simply type
2185 2185 \family typewriter
2186 2186 object_name.<TAB>
2187 2187 \family default
2188 2188 and a list of the object's attributes will be printed (see sec.
2189 2189
2190 2190 \begin_inset LatexCommand \ref{sec:readline}
2191 2191
2192 2192 \end_inset
2193 2193
2194 2194 for more).
2195 2195 Tab completion also works on file and directory names, which combined with
2196 2196 IPython's alias system allows you to do from within IPython many of the
2197 2197 things you normally would need the system shell for.
2198 2198
2199 2199 \end_layout
2200 2200
2201 2201 \begin_layout Itemize
2202 2202 Explore your objects.
2203 2203 Typing
2204 2204 \family typewriter
2205 2205 object_name?
2206 2206 \family default
2207 2207 will print all sorts of details about any object, including docstrings,
2208 2208 function definition lines (for call arguments) and constructor details
2209 2209 for classes.
2210 2210 The magic commands
2211 2211 \family typewriter
2212 2212 %pdoc
2213 2213 \family default
2214 2214 ,
2215 2215 \family typewriter
2216 2216 %pdef
2217 2217 \family default
2218 2218 ,
2219 2219 \family typewriter
2220 2220 %psource
2221 2221 \family default
2222 2222 and
2223 2223 \family typewriter
2224 2224 %pfile
2225 2225 \family default
2226 2226 will respectively print the docstring, function definition line, full source
2227 2227 code and the complete file for any object (when they can be found).
2228 2228 If automagic is on (it is by default), you don't need to type the '
2229 2229 \family typewriter
2230 2230 %
2231 2231 \family default
2232 2232 ' explicitly.
2233 2233 See sec.
2234 2234
2235 2235 \begin_inset LatexCommand \ref{sec:dyn-object-info}
2236 2236
2237 2237 \end_inset
2238 2238
2239 2239 for more.
2240 2240 \end_layout
2241 2241
2242 2242 \begin_layout Itemize
2243 2243 The
2244 2244 \family typewriter
2245 2245 %run
2246 2246 \family default
2247 2247 magic command allows you to run any python script and load all of its data
2248 2248 directly into the interactive namespace.
2249 2249 Since the file is re-read from disk each time, changes you make to it are
2250 2250 reflected immediately (in contrast to the behavior of
2251 2251 \family typewriter
2252 2252 import
2253 2253 \family default
2254 2254 ).
2255 2255 I rarely use
2256 2256 \family typewriter
2257 2257 import
2258 2258 \family default
2259 2259 for code I am testing, relying on
2260 2260 \family typewriter
2261 2261 %run
2262 2262 \family default
2263 2263 instead.
2264 2264 See sec.
2265 2265
2266 2266 \begin_inset LatexCommand \ref{sec:magic}
2267 2267
2268 2268 \end_inset
2269 2269
2270 2270 for more on this and other magic commands, or type the name of any magic
2271 2271 command and ? to get details on it.
2272 2272 See also sec.
2273 2273
2274 2274 \begin_inset LatexCommand \ref{sec:dreload}
2275 2275
2276 2276 \end_inset
2277 2277
2278 2278 for a recursive reload command.
2279 2279 \newline
2280 2280
2281 2281 \family typewriter
2282 2282 %run
2283 2283 \family default
2284 2284 also has special flags for timing the execution of your scripts (
2285 2285 \family typewriter
2286 2286 -t
2287 2287 \family default
2288 2288 ) and for executing them under the control of either Python's
2289 2289 \family typewriter
2290 2290 pdb
2291 2291 \family default
2292 2292 debugger (
2293 2293 \family typewriter
2294 2294 -d
2295 2295 \family default
2296 2296 ) or profiler (
2297 2297 \family typewriter
2298 2298 -p
2299 2299 \family default
2300 2300 ).
2301 2301 With all of these,
2302 2302 \family typewriter
2303 2303 %run
2304 2304 \family default
2305 2305 can be used as the main tool for efficient interactive development of code
2306 2306 which you write in your editor of choice.
2307 2307 \end_layout
2308 2308
2309 2309 \begin_layout Itemize
2310 2310 Use the Python debugger,
2311 2311 \family typewriter
2312 2312 pdb
2313 2313 \family default
2314 2314
2315 2315 \begin_inset Foot
2316 2316 status collapsed
2317 2317
2318 2318 \begin_layout Standard
2319 2319 Thanks to Christian Hart and Matthew Arnison for the suggestions leading
2320 2320 to IPython's improved debugger and profiler support.
2321 2321 \end_layout
2322 2322
2323 2323 \end_inset
2324 2324
2325 2325 .
2326 2326 The
2327 2327 \family typewriter
2328 2328 %pdb
2329 2329 \family default
2330 2330 command allows you to toggle on and off the automatic invocation of an
2331 2331 IPython-enhanced
2332 2332 \family typewriter
2333 2333 pdb
2334 2334 \family default
2335 2335 debugger (with coloring, tab completion and more) at any uncaught exception.
2336 2336 The advantage of this is that
2337 2337 \family typewriter
2338 2338 pdb
2339 2339 \family default
2340 2340 starts
2341 2341 \emph on
2342 2342 inside
2343 2343 \emph default
2344 2344 the function where the exception occurred, with all data still available.
2345 2345 You can print variables, see code, execute statements and even walk up
2346 2346 and down the call stack to track down the true source of the problem (which
2347 2347 often is many layers in the stack above where the exception gets triggered).
2348 2348 \newline
2349 2349 Runn
2350 2350 ing programs with
2351 2351 \family typewriter
2352 2352 %run
2353 2353 \family default
2354 2354 and pdb active can be an efficient to develop and debug code, in many cases
2355 2355 eliminating the need for
2356 2356 \family typewriter
2357 2357 print
2358 2358 \family default
2359 2359 statements or external debugging tools.
2360 2360 I often simply put a
2361 2361 \family typewriter
2362 2362 1/0
2363 2363 \family default
2364 2364 in a place where I want to take a look so that pdb gets called, quickly
2365 2365 view whatever variables I need to or test various pieces of code and then
2366 2366 remove the
2367 2367 \family typewriter
2368 2368 1/0
2369 2369 \family default
2370 2370 .
2371 2371 \newline
2372 2372 Note also that `
2373 2373 \family typewriter
2374 2374 %run -d
2375 2375 \family default
2376 2376 ' activates
2377 2377 \family typewriter
2378 2378 pdb
2379 2379 \family default
2380 2380 and automatically sets initial breakpoints for you to step through your
2381 2381 code, watch variables, etc.
2382 2382 See Sec.\InsetSpace ~
2383 2383
2384 2384 \begin_inset LatexCommand \ref{sec:cache_output}
2385 2385
2386 2386 \end_inset
2387 2387
2388 2388 for details.
2389 2389 \end_layout
2390 2390
2391 2391 \begin_layout Itemize
2392 2392 Use the output cache.
2393 2393 All output results are automatically stored in a global dictionary named
2394 2394
2395 2395 \family typewriter
2396 2396 Out
2397 2397 \family default
2398 2398 and variables named
2399 2399 \family typewriter
2400 2400 _1
2401 2401 \family default
2402 2402 ,
2403 2403 \family typewriter
2404 2404 _2
2405 2405 \family default
2406 2406 , etc.
2407 2407 alias them.
2408 2408 For example, the result of input line 4 is available either as
2409 2409 \family typewriter
2410 2410 Out[4]
2411 2411 \family default
2412 2412 or as
2413 2413 \family typewriter
2414 2414 _4
2415 2415 \family default
2416 2416 .
2417 2417 Additionally, three variables named
2418 2418 \family typewriter
2419 2419 _
2420 2420 \family default
2421 2421 ,
2422 2422 \family typewriter
2423 2423 __
2424 2424 \family default
2425 2425 and
2426 2426 \family typewriter
2427 2427 ___
2428 2428 \family default
2429 2429 are always kept updated with the for the last three results.
2430 2430 This allows you to recall any previous result and further use it for new
2431 2431 calculations.
2432 2432 See Sec.\InsetSpace ~
2433 2433
2434 2434 \begin_inset LatexCommand \ref{sec:cache_output}
2435 2435
2436 2436 \end_inset
2437 2437
2438 2438 for more.
2439 2439 \end_layout
2440 2440
2441 2441 \begin_layout Itemize
2442 2442 Put a '
2443 2443 \family typewriter
2444 2444 ;
2445 2445 \family default
2446 2446 ' at the end of a line to supress the printing of output.
2447 2447 This is useful when doing calculations which generate long output you are
2448 2448 not interested in seeing.
2449 2449 The
2450 2450 \family typewriter
2451 2451 _*
2452 2452 \family default
2453 2453 variables and the
2454 2454 \family typewriter
2455 2455 Out[]
2456 2456 \family default
2457 2457 list do get updated with the contents of the output, even if it is not
2458 2458 printed.
2459 2459 You can thus still access the generated results this way for further processing.
2460 2460 \end_layout
2461 2461
2462 2462 \begin_layout Itemize
2463 2463 A similar system exists for caching input.
2464 2464 All input is stored in a global list called
2465 2465 \family typewriter
2466 2466 In
2467 2467 \family default
2468 2468 , so you can re-execute lines 22 through 28 plus line 34 by typing
2469 2469 \family typewriter
2470 2470 'exec In[22:29]+In[34]'
2471 2471 \family default
2472 2472 (using Python slicing notation).
2473 2473 If you need to execute the same set of lines often, you can assign them
2474 2474 to a macro with the
2475 2475 \family typewriter
2476 2476 %macro
2477 2477 \family default
2478 2478
2479 2479 \family typewriter
2480 2480 function.
2481 2481
2482 2482 \family default
2483 2483 See sec.
2484 2484
2485 2485 \begin_inset LatexCommand \ref{sec:cache_input}
2486 2486
2487 2487 \end_inset
2488 2488
2489 2489 for more.
2490 2490 \end_layout
2491 2491
2492 2492 \begin_layout Itemize
2493 2493 Use your input history.
2494 2494 The
2495 2495 \family typewriter
2496 2496 %hist
2497 2497 \family default
2498 2498 command can show you all previous input, without line numbers if desired
2499 2499 (option
2500 2500 \family typewriter
2501 2501 -n
2502 2502 \family default
2503 2503 ) so you can directly copy and paste code either back in IPython or in a
2504 2504 text editor.
2505 2505 You can also save all your history by turning on logging via
2506 2506 \family typewriter
2507 2507 %logstart
2508 2508 \family default
2509 2509 ; these logs can later be either reloaded as IPython sessions or used as
2510 2510 code for your programs.
2511 2511 \end_layout
2512 2512
2513 2513 \begin_layout Itemize
2514 2514 Define your own system aliases.
2515 2515 Even though IPython gives you access to your system shell via the
2516 2516 \family typewriter
2517 2517 !
2518 2518 \family default
2519 2519 prefix, it is convenient to have aliases to the system commands you use
2520 2520 most often.
2521 2521 This allows you to work seamlessly from inside IPython with the same commands
2522 2522 you are used to in your system shell.
2523 2523 \newline
2524 2524 IPython comes with some pre-defined
2525 2525 aliases and a complete system for changing directories, both via a stack
2526 2526 (see
2527 2527 \family typewriter
2528 2528 %pushd
2529 2529 \family default
2530 2530 ,
2531 2531 \family typewriter
2532 2532 %popd
2533 2533 \family default
2534 2534 and
2535 2535 \family typewriter
2536 2536 %dhist
2537 2537 \family default
2538 2538 ) and via direct
2539 2539 \family typewriter
2540 2540 %cd
2541 2541 \family default
2542 2542 .
2543 2543 The latter keeps a history of visited directories and allows you to go
2544 2544 to any previously visited one.
2545 2545 \end_layout
2546 2546
2547 2547 \begin_layout Itemize
2548 2548 Use Python to manipulate the results of system commands.
2549 2549 The `
2550 2550 \family typewriter
2551 2551 !!
2552 2552 \family default
2553 2553 ' special syntax, and the
2554 2554 \family typewriter
2555 2555 %sc
2556 2556 \family default
2557 2557 and
2558 2558 \family typewriter
2559 2559 %sx
2560 2560 \family default
2561 2561 magic commands allow you to capture system output into Python variables.
2562 2562 \end_layout
2563 2563
2564 2564 \begin_layout Itemize
2565 2565 Expand python variables when calling the shell (either via
2566 2566 \family typewriter
2567 2567 `!'
2568 2568 \family default
2569 2569 and
2570 2570 \family typewriter
2571 2571 `!!'
2572 2572 \family default
2573 2573 or via aliases) by prepending a
2574 2574 \family typewriter
2575 2575 $
2576 2576 \family default
2577 2577 in front of them.
2578 2578 You can also expand complete python expressions.
2579 2579 See sec.\InsetSpace ~
2580 2580
2581 2581 \begin_inset LatexCommand \ref{sub:System-shell-access}
2582 2582
2583 2583 \end_inset
2584 2584
2585 2585 for more.
2586 2586 \end_layout
2587 2587
2588 2588 \begin_layout Itemize
2589 2589 Use profiles to maintain different configurations (modules to load, function
2590 2590 definitions, option settings) for particular tasks.
2591 2591 You can then have customized versions of IPython for specific purposes.
2592 2592 See sec.\InsetSpace ~
2593 2593
2594 2594 \begin_inset LatexCommand \ref{sec:profiles}
2595 2595
2596 2596 \end_inset
2597 2597
2598 2598 for more.
2599 2599 \end_layout
2600 2600
2601 2601 \begin_layout Itemize
2602 2602 Embed IPython in your programs.
2603 2603 A few lines of code are enough to load a complete IPython inside your own
2604 2604 programs, giving you the ability to work with your data interactively after
2605 2605 automatic processing has been completed.
2606 2606 See sec.\InsetSpace ~
2607 2607
2608 2608 \begin_inset LatexCommand \ref{sec:embed}
2609 2609
2610 2610 \end_inset
2611 2611
2612 2612 for more.
2613 2613 \end_layout
2614 2614
2615 2615 \begin_layout Itemize
2616 2616 Use the Python profiler.
2617 2617 When dealing with performance issues, the
2618 2618 \family typewriter
2619 2619 %run
2620 2620 \family default
2621 2621 command with a
2622 2622 \family typewriter
2623 2623 -p
2624 2624 \family default
2625 2625 option allows you to run complete programs under the control of the Python
2626 2626 profiler.
2627 2627 The
2628 2628 \family typewriter
2629 2629 %prun
2630 2630 \family default
2631 2631 command does a similar job for single Python expressions (like function
2632 2632 calls).
2633 2633 \end_layout
2634 2634
2635 2635 \begin_layout Itemize
2636 2636 Use the IPython.demo.Demo class to load any Python script as an interactive
2637 2637 demo.
2638 2638 With a minimal amount of simple markup, you can control the execution of
2639 2639 the script, stopping as needed.
2640 2640 See sec.\InsetSpace ~
2641 2641
2642 2642 \begin_inset LatexCommand \ref{sec:interactive-demos}
2643 2643
2644 2644 \end_inset
2645 2645
2646 2646 for more.
2647 2647 \end_layout
2648 2648
2649 2649 \begin_layout Subsection
2650 2650 Source code handling tips
2651 2651 \end_layout
2652 2652
2653 2653 \begin_layout Standard
2654 2654 IPython is a line-oriented program, without full control of the terminal.
2655 2655 Therefore, it doesn't support true multiline editing.
2656 2656 However, it has a number of useful tools to help you in dealing effectively
2657 2657 with more complex editing.
2658 2658 \end_layout
2659 2659
2660 2660 \begin_layout Standard
2661 2661 The
2662 2662 \family typewriter
2663 2663 %edit
2664 2664 \family default
2665 2665 command gives a reasonable approximation of multiline editing, by invoking
2666 2666 your favorite editor on the spot.
2667 2667 IPython will execute the code you type in there as if it were typed interactive
2668 2668 ly.
2669 2669 Type
2670 2670 \family typewriter
2671 2671 %edit?
2672 2672 \family default
2673 2673 for the full details on the edit command.
2674 2674 \end_layout
2675 2675
2676 2676 \begin_layout Standard
2677 2677 If you have typed various commands during a session, which you'd like to
2678 2678 reuse, IPython provides you with a number of tools.
2679 2679 Start by using
2680 2680 \family typewriter
2681 2681 %hist
2682 2682 \family default
2683 2683 to see your input history, so you can see the line numbers of all input.
2684 2684 Let us say that you'd like to reuse lines 10 through 20, plus lines 24
2685 2685 and 28.
2686 2686 All the commands below can operate on these with the syntax
2687 2687 \end_layout
2688 2688
2689 2689 \begin_layout LyX-Code
2690 2690 %command 10-20 24 28
2691 2691 \end_layout
2692 2692
2693 2693 \begin_layout Standard
2694 2694 where the command given can be:
2695 2695 \end_layout
2696 2696
2697 2697 \begin_layout Itemize
2698 2698
2699 2699 \family typewriter
2700 2700 %macro <macroname>
2701 2701 \family default
2702 2702 : this stores the lines into a variable which, when called at the prompt,
2703 2703 re-executes the input.
2704 2704 Macros can be edited later using
2705 2705 \family typewriter
2706 2706 `%edit macroname
2707 2707 \family default
2708 2708 ', and they can be stored persistently across sessions with `
2709 2709 \family typewriter
2710 2710 %store macroname
2711 2711 \family default
2712 2712 ' (the storage system is per-profile).
2713 2713 The combination of quick macros, persistent storage and editing, allows
2714 2714 you to easily refine quick-and-dirty interactive input into permanent utilities
2715 2715 , always available both in IPython and as files for general reuse.
2716 2716 \end_layout
2717 2717
2718 2718 \begin_layout Itemize
2719 2719
2720 2720 \family typewriter
2721 2721 %edit
2722 2722 \family default
2723 2723 : this will open a text editor with those lines pre-loaded for further modificat
2724 2724 ion.
2725 2725 It will then execute the resulting file's contents as if you had typed
2726 2726 it at the prompt.
2727 2727 \end_layout
2728 2728
2729 2729 \begin_layout Itemize
2730 2730
2731 2731 \family typewriter
2732 2732 %save <filename>
2733 2733 \family default
2734 2734 : this saves the lines directly to a named file on disk.
2735 2735 \end_layout
2736 2736
2737 2737 \begin_layout Standard
2738 2738 While
2739 2739 \family typewriter
2740 2740 %macro
2741 2741 \family default
2742 2742 saves input lines into memory for interactive re-execution, sometimes you'd
2743 2743 like to save your input directly to a file.
2744 2744 The
2745 2745 \family typewriter
2746 2746 %save
2747 2747 \family default
2748 2748 magic does this: its input sytnax is the same as
2749 2749 \family typewriter
2750 2750 %macro
2751 2751 \family default
2752 2752 , but it saves your input directly to a Python file.
2753 2753 Note that the
2754 2754 \family typewriter
2755 2755 %logstart
2756 2756 \family default
2757 2757 command also saves input, but it logs
2758 2758 \emph on
2759 2759 all
2760 2760 \emph default
2761 2761 input to disk (though you can temporarily suspend it and reactivate it
2762 2762 with
2763 2763 \family typewriter
2764 2764 %logoff/%logon
2765 2765 \family default
2766 2766 );
2767 2767 \family typewriter
2768 2768 %save
2769 2769 \family default
2770 2770 allows you to select which lines of input you need to save.
2771 2771 \end_layout
2772 2772
2773 2773 \begin_layout Subsubsection*
2774 2774 Lightweight 'version control'
2775 2775 \end_layout
2776 2776
2777 2777 \begin_layout Standard
2778 2778 When you call
2779 2779 \family typewriter
2780 2780 %edit
2781 2781 \family default
2782 2782 with no arguments, IPython opens an empty editor with a temporary file,
2783 2783 and it returns the contents of your editing session as a string variable.
2784 2784 Thanks to IPython's output caching mechanism, this is automatically stored:
2785 2785 \end_layout
2786 2786
2787 2787 \begin_layout LyX-Code
2788 2788 In [1]: %edit
2789 2789 \end_layout
2790 2790
2791 2791 \begin_layout LyX-Code
2792 2792 IPython will make a temporary file named: /tmp/ipython_edit_yR-HCN.py
2793 2793 \end_layout
2794 2794
2795 2795 \begin_layout LyX-Code
2796 2796 Editing...
2797 2797 done.
2798 2798 Executing edited code...
2799 2799 \end_layout
2800 2800
2801 2801 \begin_layout LyX-Code
2802 2802 hello - this is a temporary file
2803 2803 \end_layout
2804 2804
2805 2805 \begin_layout LyX-Code
2806 2806 Out[1]: "print 'hello - this is a temporary file'
2807 2807 \backslash
2808 2808 n"
2809 2809 \end_layout
2810 2810
2811 2811 \begin_layout Standard
2812 2812 Now, if you call
2813 2813 \family typewriter
2814 2814 `%edit -p'
2815 2815 \family default
2816 2816 , IPython tries to open an editor with the same data as the last time you
2817 2817 used
2818 2818 \family typewriter
2819 2819 %edit
2820 2820 \family default
2821 2821 .
2822 2822 So if you haven't used
2823 2823 \family typewriter
2824 2824 %edit
2825 2825 \family default
2826 2826 in the meantime, this same contents will reopen; however, it will be done
2827 2827 in a
2828 2828 \emph on
2829 2829 new file
2830 2830 \emph default
2831 2831 .
2832 2832 This means that if you make changes and you later want to find an old version,
2833 2833 you can always retrieve it by using its output number, via
2834 2834 \family typewriter
2835 2835 `%edit _NN'
2836 2836 \family default
2837 2837 , where
2838 2838 \family typewriter
2839 2839 NN
2840 2840 \family default
2841 2841 is the number of the output prompt.
2842 2842 \end_layout
2843 2843
2844 2844 \begin_layout Standard
2845 2845 Continuing with the example above, this should illustrate this idea:
2846 2846 \end_layout
2847 2847
2848 2848 \begin_layout LyX-Code
2849 2849 In [2]: edit -p
2850 2850 \end_layout
2851 2851
2852 2852 \begin_layout LyX-Code
2853 2853 IPython will make a temporary file named: /tmp/ipython_edit_nA09Qk.py
2854 2854 \end_layout
2855 2855
2856 2856 \begin_layout LyX-Code
2857 2857 Editing...
2858 2858 done.
2859 2859 Executing edited code...
2860 2860 \end_layout
2861 2861
2862 2862 \begin_layout LyX-Code
2863 2863 hello - now I made some changes
2864 2864 \end_layout
2865 2865
2866 2866 \begin_layout LyX-Code
2867 2867 Out[2]: "print 'hello - now I made some changes'
2868 2868 \backslash
2869 2869 n"
2870 2870 \end_layout
2871 2871
2872 2872 \begin_layout LyX-Code
2873 2873 In [3]: edit _1
2874 2874 \end_layout
2875 2875
2876 2876 \begin_layout LyX-Code
2877 2877 IPython will make a temporary file named: /tmp/ipython_edit_gy6-zD.py
2878 2878 \end_layout
2879 2879
2880 2880 \begin_layout LyX-Code
2881 2881 Editing...
2882 2882 done.
2883 2883 Executing edited code...
2884 2884 \end_layout
2885 2885
2886 2886 \begin_layout LyX-Code
2887 2887 hello - this is a temporary file
2888 2888 \end_layout
2889 2889
2890 2890 \begin_layout LyX-Code
2891 2891 IPython version control at work :)
2892 2892 \end_layout
2893 2893
2894 2894 \begin_layout LyX-Code
2895 2895 Out[3]: "print 'hello - this is a temporary file'
2896 2896 \backslash
2897 2897 nprint 'IPython version control at work :)'
2898 2898 \backslash
2899 2899 n"
2900 2900 \end_layout
2901 2901
2902 2902 \begin_layout Standard
2903 2903 This section was written after a contribution by Alexander Belchenko on
2904 2904 the IPython user list.
2905 2905 \end_layout
2906 2906
2907 2907 \begin_layout LyX-Code
2908 2908
2909 2909 \end_layout
2910 2910
2911 2911 \begin_layout Subsection
2912 2912 Effective logging
2913 2913 \end_layout
2914 2914
2915 2915 \begin_layout Standard
2916 2916 A very useful suggestion sent in by Robert Kern follows:
2917 2917 \end_layout
2918 2918
2919 2919 \begin_layout Standard
2920 2920 I recently happened on a nifty way to keep tidy per-project log files.
2921 2921 I made a profile for my project (which is called "parkfield").
2922 2922 \end_layout
2923 2923
2924 2924 \begin_layout LyX-Code
2925 2925 include ipythonrc
2926 2926 \end_layout
2927 2927
2928 2928 \begin_layout LyX-Code
2929 2929 # cancel earlier logfile invocation:
2930 2930 \end_layout
2931 2931
2932 2932 \begin_layout LyX-Code
2933 2933 logfile ''
2934 2934 \end_layout
2935 2935
2936 2936 \begin_layout LyX-Code
2937 2937 execute import time
2938 2938 \end_layout
2939 2939
2940 2940 \begin_layout LyX-Code
2941 2941 execute __cmd = '/Users/kern/research/logfiles/parkfield-%s.log rotate'
2942 2942 \end_layout
2943 2943
2944 2944 \begin_layout LyX-Code
2945 2945 execute __IP.magic_logstart(__cmd % time.strftime('%Y-%m-%d'))
2946 2946 \end_layout
2947 2947
2948 2948 \begin_layout Standard
2949 2949 I also added a shell alias for convenience:
2950 2950 \end_layout
2951 2951
2952 2952 \begin_layout LyX-Code
2953 2953 alias parkfield="ipython -pylab -profile parkfield"
2954 2954 \end_layout
2955 2955
2956 2956 \begin_layout Standard
2957 2957 Now I have a nice little directory with everything I ever type in, organized
2958 2958 by project and date.
2959 2959 \end_layout
2960 2960
2961 2961 \begin_layout Standard
2962 2962
2963 2963 \series bold
2964 2964 Contribute your own:
2965 2965 \series default
2966 2966 If you have your own favorite tip on using IPython efficiently for a certain
2967 2967 task (especially things which can't be done in the normal Python interpreter),
2968 2968 don't hesitate to send it!
2969 2969 \end_layout
2970 2970
2971 2971 \begin_layout Section
2972 2972 Command-line use
2973 2973 \end_layout
2974 2974
2975 2975 \begin_layout Standard
2976 2976 You start IPython with the command:
2977 2977 \end_layout
2978 2978
2979 2979 \begin_layout Standard
2980 2980
2981 2981 \family typewriter
2982 2982 $ ipython [options] files
2983 2983 \end_layout
2984 2984
2985 2985 \begin_layout Standard
2986 2986 If invoked with no options, it executes all the files listed in sequence
2987 2987 and drops you into the interpreter while still acknowledging any options
2988 2988 you may have set in your ipythonrc file.
2989 2989 This behavior is different from standard Python, which when called as
2990 2990 \family typewriter
2991 2991 python -i
2992 2992 \family default
2993 2993 will only execute one file and ignore your configuration setup.
2994 2994 \end_layout
2995 2995
2996 2996 \begin_layout Standard
2997 2997 Please note that some of the configuration options are not available at
2998 2998 the command line, simply because they are not practical here.
2999 2999 Look into your ipythonrc configuration file for details on those.
3000 3000 This file typically installed in the
3001 3001 \family typewriter
3002 3002 $HOME/.ipython
3003 3003 \family default
3004 3004 directory.
3005 3005 For Windows users,
3006 3006 \family typewriter
3007 3007 $HOME
3008 3008 \family default
3009 3009 resolves to
3010 3010 \family typewriter
3011 3011 C:
3012 3012 \backslash
3013 3013
3014 3014 \backslash
3015 3015 Documents and Settings
3016 3016 \backslash
3017 3017
3018 3018 \backslash
3019 3019 YourUserName
3020 3020 \family default
3021 3021 in most instances.
3022 3022 In the rest of this text, we will refer to this directory as
3023 3023 \family typewriter
3024 3024 IPYTHONDIR
3025 3025 \family default
3026 3026 .
3027 3027 \end_layout
3028 3028
3029 3029 \begin_layout Subsection
3030 3030 \begin_inset LatexCommand \label{sec:threading-opts}
3031 3031
3032 3032 \end_inset
3033 3033
3034 3034 Special Threading Options
3035 3035 \end_layout
3036 3036
3037 3037 \begin_layout Standard
3038 3038 The following special options are ONLY valid at the beginning of the command
3039 3039 line, and not later.
3040 3040 This is because they control the initial- ization of ipython itself, before
3041 3041 the normal option-handling mechanism is active.
3042 3042 \end_layout
3043 3043
3044 3044 \begin_layout List
3045 3045 \labelwidthstring 00.00.0000
3046 3046
3047 3047 \family typewriter
3048 3048 \series bold
3049 3049 -gthread,\InsetSpace ~
3050 3050 -qthread,\InsetSpace ~
3051 3051 -q4thread,\InsetSpace ~
3052 3052 -wthread,\InsetSpace ~
3053 3053 -pylab:
3054 3054 \family default
3055 3055 \series default
3056 3056 Only
3057 3057 \emph on
3058 3058 one
3059 3059 \emph default
3060 3060 of these can be given, and it can only be given as the first option passed
3061 3061 to IPython (it will have no effect in any other position).
3062 3062 They provide threading support for the GTK, Qt (versions 3 and 4) and WXPython
3063 3063 toolkits, and for the matplotlib library.
3064 3064 \end_layout
3065 3065
3066 3066 \begin_layout List
3067 3067 \labelwidthstring 00.00.0000
3068 3068 \InsetSpace ~
3069 3069 With any of the first four options, IPython starts running a separate thread
3070 3070 for the graphical toolkit's operation, so that you can open and control
3071 3071 graphical elements from within an IPython command line, without blocking.
3072 3072 All four provide essentially the same functionality, respectively for GTK,
3073 3073 Qt3, Qt4 and WXWidgets (via their Python interfaces).
3074 3074 \end_layout
3075 3075
3076 3076 \begin_layout List
3077 3077 \labelwidthstring 00.00.0000
3078 3078 \InsetSpace ~
3079 3079 Note that with
3080 3080 \family typewriter
3081 3081 -wthread
3082 3082 \family default
3083 3083 , you can additionally use the -wxversion option to request a specific version
3084 3084 of wx to be used.
3085 3085 This requires that you have the
3086 3086 \family typewriter
3087 3087 wxversion
3088 3088 \family default
3089 3089 Python module installed, which is part of recent wxPython distributions.
3090 3090 \end_layout
3091 3091
3092 3092 \begin_layout List
3093 3093 \labelwidthstring 00.00.0000
3094 3094 \InsetSpace ~
3095 3095 If
3096 3096 \family typewriter
3097 3097 -pylab
3098 3098 \family default
3099 3099 is given, IPython loads special support for the mat plotlib library (
3100 3100 \begin_inset LatexCommand \htmlurl{http://matplotlib.sourceforge.net}
3101 3101
3102 3102 \end_inset
3103 3103
3104 3104 ), allowing interactive usage of any of its backends as defined in the user's
3105 3105
3106 3106 \family typewriter
3107 3107 ~/.matplotlib/matplotlibrc
3108 3108 \family default
3109 3109 file.
3110 3110 It automatically activates GTK, Qt or WX threading for IPyhton if the choice
3111 3111 of matplotlib backend requires it.
3112 3112 It also modifies the
3113 3113 \family typewriter
3114 3114 %run
3115 3115 \family default
3116 3116 command to correctly execute (without blocking) any matplotlib-based script
3117 3117 which calls
3118 3118 \family typewriter
3119 3119 show()
3120 3120 \family default
3121 3121 at the end.
3122 3122
3123 3123 \end_layout
3124 3124
3125 3125 \begin_layout List
3126 3126 \labelwidthstring 00.00.0000
3127 3127
3128 3128 \family typewriter
3129 3129 \series bold
3130 3130 -tk
3131 3131 \family default
3132 3132 \series default
3133 3133 The
3134 3134 \family typewriter
3135 3135 -g/q/q4/wthread
3136 3136 \family default
3137 3137 options, and
3138 3138 \family typewriter
3139 3139 -pylab
3140 3140 \family default
3141 3141 (if matplotlib is configured to use GTK, Qt3, Qt4 or WX), will normally
3142 3142 block Tk graphical interfaces.
3143 3143 This means that when either GTK, Qt or WX threading is active, any attempt
3144 3144 to open a Tk GUI will result in a dead window, and possibly cause the Python
3145 3145 interpreter to crash.
3146 3146 An extra option,
3147 3147 \family typewriter
3148 3148 -tk
3149 3149 \family default
3150 3150 , is available to address this issue.
3151 3151 It can
3152 3152 \emph on
3153 3153 only
3154 3154 \emph default
3155 3155 be given as a
3156 3156 \emph on
3157 3157 second
3158 3158 \emph default
3159 3159 option after any of the above (
3160 3160 \family typewriter
3161 3161 -gthread
3162 3162 \family default
3163 3163 ,
3164 3164 \family typewriter
3165 3165 -wthread
3166 3166 \family default
3167 3167 or
3168 3168 \family typewriter
3169 3169 -pylab
3170 3170 \family default
3171 3171 ).
3172 3172 \end_layout
3173 3173
3174 3174 \begin_layout List
3175 3175 \labelwidthstring 00.00.0000
3176 3176 \InsetSpace ~
3177 3177 If
3178 3178 \family typewriter
3179 3179 -tk
3180 3180 \family default
3181 3181 is given, IPython will try to coordinate Tk threading with GTK, Qt or WX.
3182 3182 This is however potentially unreliable, and you will have to test on your
3183 3183 platform and Python configuration to determine whether it works for you.
3184 3184 Debian users have reported success, apparently due to the fact that Debian
3185 3185 builds all of Tcl, Tk, Tkinter and Python with pthreads support.
3186 3186 Under other Linux environments (such as Fedora Core 2/3), this option has
3187 3187 caused random crashes and lockups of the Python interpreter.
3188 3188 Under other operating systems (Mac OSX and Windows), you'll need to try
3189 3189 it to find out, since currently no user reports are available.
3190 3190 \end_layout
3191 3191
3192 3192 \begin_layout List
3193 3193 \labelwidthstring 00.00.0000
3194 3194 \InsetSpace ~
3195 3195 There is unfortunately no way for IPython to determine at run time whether
3196 3196
3197 3197 \family typewriter
3198 3198 -tk
3199 3199 \family default
3200 3200 will work reliably or not, so you will need to do some experiments before
3201 3201 relying on it for regular work.
3202 3202
3203 3203 \end_layout
3204 3204
3205 3205 \begin_layout Subsection
3206 3206 \begin_inset LatexCommand \label{sec:cmd-line-opts}
3207 3207
3208 3208 \end_inset
3209 3209
3210 3210 Regular Options
3211 3211 \end_layout
3212 3212
3213 3213 \begin_layout Standard
3214 3214 After the above threading options have been given, regular options can follow
3215 3215 in any order.
3216 3216 All options can be abbreviated to their shortest non-ambiguous form and
3217 3217 are case-sensitive.
3218 3218 One or two dashes can be used.
3219 3219 Some options have an alternate short form, indicated after a
3220 3220 \family typewriter
3221 3221 |
3222 3222 \family default
3223 3223 .
3224 3224 \end_layout
3225 3225
3226 3226 \begin_layout Standard
3227 3227 Most options can also be set from your ipythonrc configuration file.
3228 3228 See the provided example for more details on what the options do.
3229 3229 Options given at the command line override the values set in the ipythonrc
3230 3230 file.
3231 3231 \end_layout
3232 3232
3233 3233 \begin_layout Standard
3234 3234 All options with a
3235 3235 \family typewriter
3236 3236 [no]
3237 3237 \family default
3238 3238 prepended can be specified in negated form (
3239 3239 \family typewriter
3240 3240 -nooption
3241 3241 \family default
3242 3242 instead of
3243 3243 \family typewriter
3244 3244 -option
3245 3245 \family default
3246 3246 ) to turn the feature off.
3247 3247 \end_layout
3248 3248
3249 3249 \begin_layout List
3250 3250 \labelwidthstring 00.00.0000
3251 3251
3252 3252 \family typewriter
3253 3253 \series bold
3254 3254 -help
3255 3255 \family default
3256 3256 \series default
3257 3257 : print a help message and exit.
3258 3258 \end_layout
3259 3259
3260 3260 \begin_layout List
3261 3261 \labelwidthstring 00.00.0000
3262 3262
3263 3263 \family typewriter
3264 3264 \series bold
3265 3265 -pylab:
3266 3266 \family default
3267 3267 \series default
3268 3268 this can
3269 3269 \emph on
3270 3270 only
3271 3271 \emph default
3272 3272 be given as the
3273 3273 \emph on
3274 3274 first
3275 3275 \emph default
3276 3276 option passed to IPython (it will have no effect in any other position).
3277 3277 It adds special support for the matplotlib library (
3278 3278 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
3279 3279
3280 3280 \end_inset
3281 3281
3282 3282 ), allowing interactive usage of any of its backends as defined in the user's
3283 3283
3284 3284 \family typewriter
3285 3285 .matplotlibrc
3286 3286 \family default
3287 3287 file.
3288 3288 It automatically activates GTK or WX threading for IPyhton if the choice
3289 3289 of matplotlib backend requires it.
3290 3290 It also modifies the
3291 3291 \family typewriter
3292 3292 %run
3293 3293 \family default
3294 3294 command to correctly execute (without blocking) any matplotlib-based script
3295 3295 which calls
3296 3296 \family typewriter
3297 3297 show()
3298 3298 \family default
3299 3299 at the end.
3300 3300 See Sec.\InsetSpace ~
3301 3301
3302 3302 \begin_inset LatexCommand \ref{sec:matplotlib-support}
3303 3303
3304 3304 \end_inset
3305 3305
3306 3306 for more details.
3307 3307 \end_layout
3308 3308
3309 3309 \begin_layout List
3310 3310 \labelwidthstring 00.00.0000
3311 3311
3312 3312 \family typewriter
3313 3313 \series bold
3314 3314 -autocall <val>:
3315 3315 \family default
3316 3316 \series default
3317 3317 Make IPython automatically call any callable object even if you didn't
3318 3318 type explicit parentheses.
3319 3319 For example, `str 43' becomes `str(43)' automatically.
3320 3320 The value can be `0' to disable the feature, `1' for
3321 3321 \emph on
3322 3322 smart
3323 3323 \emph default
3324 3324 autocall, where it is not applied if there are no more arguments on the
3325 3325 line, and `2' for
3326 3326 \emph on
3327 3327 full
3328 3328 \emph default
3329 3329 autocall, where all callable objects are automatically called (even if
3330 3330 no arguments are present).
3331 3331 The default is `1'.
3332 3332 \end_layout
3333 3333
3334 3334 \begin_layout List
3335 3335 \labelwidthstring 00.00.0000
3336 3336
3337 3337 \family typewriter
3338 3338 \series bold
3339 3339 -[no]autoindent:
3340 3340 \family default
3341 3341 \series default
3342 3342 Turn automatic indentation on/off.
3343 3343 \end_layout
3344 3344
3345 3345 \begin_layout List
3346 3346 \labelwidthstring 00.00.0000
3347 3347
3348 3348 \family typewriter
3349 3349 \series bold
3350 3350 -[no]automagic
3351 3351 \series default
3352 3352 :
3353 3353 \family default
3354 3354 make magic commands automatic (without needing their first character to
3355 3355 be
3356 3356 \family typewriter
3357 3357 %
3358 3358 \family default
3359 3359 ).
3360 3360 Type
3361 3361 \family typewriter
3362 3362 %magic
3363 3363 \family default
3364 3364 at the IPython prompt for more information.
3365 3365 \end_layout
3366 3366
3367 3367 \begin_layout List
3368 3368 \labelwidthstring 00.00.0000
3369 3369
3370 3370 \family typewriter
3371 3371 \series bold
3372 3372 -[no]autoedit_syntax:
3373 3373 \family default
3374 3374 \series default
3375 3375 When a syntax error occurs after editing a file, automatically open the
3376 3376 file to the trouble causing line for convenient fixing.
3377 3377
3378 3378 \end_layout
3379 3379
3380 3380 \begin_layout List
3381 3381 \labelwidthstring 00.00.0000
3382 3382
3383 3383 \family typewriter
3384 3384 \series bold
3385 3385 -[no]banner
3386 3386 \series default
3387 3387 :
3388 3388 \family default
3389 3389 Print the initial information banner (default on).
3390 3390 \end_layout
3391 3391
3392 3392 \begin_layout List
3393 3393 \labelwidthstring 00.00.0000
3394 3394
3395 3395 \family typewriter
3396 3396 \series bold
3397 3397 -c\InsetSpace ~
3398 3398 <command>:
3399 3399 \family default
3400 3400 \series default
3401 3401 execute the given command string, and set sys.argv to
3402 3402 \family typewriter
3403 3403 ['c']
3404 3404 \family default
3405 3405 .
3406 3406 This is similar to the
3407 3407 \family typewriter
3408 3408 -c
3409 3409 \family default
3410 3410 option in the normal Python interpreter.
3411 3411
3412 3412 \end_layout
3413 3413
3414 3414 \begin_layout List
3415 3415 \labelwidthstring 00.00.0000
3416 3416
3417 3417 \family typewriter
3418 3418 \series bold
3419 3419 -cache_size|cs\InsetSpace ~
3420 3420 <n>
3421 3421 \series default
3422 3422 :
3423 3423 \family default
3424 3424 size of the output cache (maximum number of entries to hold in memory).
3425 3425 The default is 1000, you can change it permanently in your config file.
3426 3426 Setting it to 0 completely disables the caching system, and the minimum
3427 3427 value accepted is 20 (if you provide a value less than 20, it is reset
3428 3428 to 0 and a warning is issued) This limit is defined because otherwise you'll
3429 3429 spend more time re-flushing a too small cache than working.
3430 3430 \end_layout
3431 3431
3432 3432 \begin_layout List
3433 3433 \labelwidthstring 00.00.0000
3434 3434
3435 3435 \family typewriter
3436 3436 \series bold
3437 3437 -classic|cl
3438 3438 \series default
3439 3439 :
3440 3440 \family default
3441 3441 Gives IPython a similar feel to the classic Python prompt.
3442 3442 \end_layout
3443 3443
3444 3444 \begin_layout List
3445 3445 \labelwidthstring 00.00.0000
3446 3446
3447 3447 \family typewriter
3448 3448 \series bold
3449 3449 -colors\InsetSpace ~
3450 3450 <scheme>:
3451 3451 \family default
3452 3452 \series default
3453 3453 Color scheme for prompts and exception reporting.
3454 3454 Currently implemented: NoColor, Linux and LightBG.
3455 3455 \end_layout
3456 3456
3457 3457 \begin_layout List
3458 3458 \labelwidthstring 00.00.0000
3459 3459
3460 3460 \family typewriter
3461 3461 \series bold
3462 3462 -[no]color_info:
3463 3463 \family default
3464 3464 \series default
3465 3465 IPython can display information about objects via a set of functions, and
3466 3466 optionally can use colors for this, syntax highlighting source code and
3467 3467 various other elements.
3468 3468 However, because this information is passed through a pager (like 'less')
3469 3469 and many pagers get confused with color codes, this option is off by default.
3470 3470 You can test it and turn it on permanently in your ipythonrc file if it
3471 3471 works for you.
3472 3472 As a reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
3473 3473 that in RedHat 7.2 doesn't.
3474 3474 \end_layout
3475 3475
3476 3476 \begin_layout List
3477 3477 \labelwidthstring 00.00.0000
3478 3478 \InsetSpace ~
3479 3479 Test it and turn it on permanently if it works with your system.
3480 3480 The magic function
3481 3481 \family typewriter
3482 3482 %color_info
3483 3483 \family default
3484 3484 allows you to toggle this interactively for testing.
3485 3485 \end_layout
3486 3486
3487 3487 \begin_layout List
3488 3488 \labelwidthstring 00.00.0000
3489 3489
3490 3490 \family typewriter
3491 3491 \series bold
3492 3492 -[no]debug
3493 3493 \family default
3494 3494 \series default
3495 3495 : Show information about the loading process.
3496 3496 Very useful to pin down problems with your configuration files or to get
3497 3497 details about session restores.
3498 3498 \end_layout
3499 3499
3500 3500 \begin_layout List
3501 3501 \labelwidthstring 00.00.0000
3502 3502
3503 3503 \family typewriter
3504 3504 \series bold
3505 3505 -[no]deep_reload
3506 3506 \series default
3507 3507 :
3508 3508 \family default
3509 3509 IPython can use the
3510 3510 \family typewriter
3511 3511 deep_reload
3512 3512 \family default
3513 3513 module which reloads changes in modules recursively (it replaces the
3514 3514 \family typewriter
3515 3515 reload()
3516 3516 \family default
3517 3517 function, so you don't need to change anything to use it).
3518 3518
3519 3519 \family typewriter
3520 3520 deep_reload()
3521 3521 \family default
3522 3522 forces a full reload of modules whose code may have changed, which the
3523 3523 default
3524 3524 \family typewriter
3525 3525 reload()
3526 3526 \family default
3527 3527 function does not.
3528 3528 \end_layout
3529 3529
3530 3530 \begin_layout List
3531 3531 \labelwidthstring 00.00.0000
3532 3532 \InsetSpace ~
3533 3533 When deep_reload is off, IPython will use the normal
3534 3534 \family typewriter
3535 3535 reload()
3536 3536 \family default
3537 3537 , but deep_reload will still be available as
3538 3538 \family typewriter
3539 3539 dreload()
3540 3540 \family default
3541 3541 .
3542 3542 This feature is off by default [which means that you have both normal
3543 3543 \family typewriter
3544 3544 reload()
3545 3545 \family default
3546 3546 and
3547 3547 \family typewriter
3548 3548 dreload()
3549 3549 \family default
3550 3550 ].
3551 3551 \end_layout
3552 3552
3553 3553 \begin_layout List
3554 3554 \labelwidthstring 00.00.0000
3555 3555
3556 3556 \family typewriter
3557 3557 \series bold
3558 3558 -editor\InsetSpace ~
3559 3559 <name>
3560 3560 \family default
3561 3561 \series default
3562 3562 : Which editor to use with the
3563 3563 \family typewriter
3564 3564 %edit
3565 3565 \family default
3566 3566 command.
3567 3567 By default, IPython will honor your
3568 3568 \family typewriter
3569 3569 EDITOR
3570 3570 \family default
3571 3571 environment variable (if not set, vi is the Unix default and notepad the
3572 3572 Windows one).
3573 3573 Since this editor is invoked on the fly by IPython and is meant for editing
3574 3574 small code snippets, you may want to use a small, lightweight editor here
3575 3575 (in case your default
3576 3576 \family typewriter
3577 3577 EDITOR
3578 3578 \family default
3579 3579 is something like Emacs).
3580 3580 \end_layout
3581 3581
3582 3582 \begin_layout List
3583 3583 \labelwidthstring 00.00.0000
3584 3584
3585 3585 \family typewriter
3586 3586 \series bold
3587 3587 -ipythondir\InsetSpace ~
3588 3588 <name>
3589 3589 \series default
3590 3590 :
3591 3591 \family default
3592 3592 name of your IPython configuration directory
3593 3593 \family typewriter
3594 3594 IPYTHONDIR
3595 3595 \family default
3596 3596 .
3597 3597 This can also be specified through the environment variable
3598 3598 \family typewriter
3599 3599 IPYTHONDIR
3600 3600 \family default
3601 3601 .
3602 3602 \end_layout
3603 3603
3604 3604 \begin_layout List
3605 3605 \labelwidthstring 00.00.0000
3606 3606
3607 3607 \family typewriter
3608 3608 \series bold
3609 3609 -log|l
3610 3610 \family default
3611 3611 \series default
3612 3612 : generate a log file of all input.
3613 3613 The file is named
3614 3614 \family typewriter
3615 3615 ipython_log.py
3616 3616 \family default
3617 3617 in your current directory (which prevents logs from multiple IPython sessions
3618 3618 from trampling each other).
3619 3619 You can use this to later restore a session by loading your logfile as
3620 3620 a file to be executed with option
3621 3621 \family typewriter
3622 3622 -logplay
3623 3623 \family default
3624 3624 (see below).
3625 3625 \end_layout
3626 3626
3627 3627 \begin_layout List
3628 3628 \labelwidthstring 00.00.0000
3629 3629
3630 3630 \family typewriter
3631 3631 \series bold
3632 3632 -logfile|lf\InsetSpace ~
3633 3633 <name>
3634 3634 \series default
3635 3635 :
3636 3636 \family default
3637 3637 specify the name of your logfile.
3638 3638 \end_layout
3639 3639
3640 3640 \begin_layout List
3641 3641 \labelwidthstring 00.00.0000
3642 3642
3643 3643 \family typewriter
3644 3644 \series bold
3645 3645 -logplay|lp\InsetSpace ~
3646 3646 <name>
3647 3647 \series default
3648 3648 :
3649 3649 \family default
3650 3650 you can replay a previous log.
3651 3651 For restoring a session as close as possible to the state you left it in,
3652 3652 use this option (don't just run the logfile).
3653 3653 With
3654 3654 \family typewriter
3655 3655 -logplay
3656 3656 \family default
3657 3657 , IPython will try to reconstruct the previous working environment in full,
3658 3658 not just execute the commands in the logfile.
3659 3659 \end_layout
3660 3660
3661 3661 \begin_layout List
3662 3662 \labelwidthstring 00.00.0000
3663 3663 \InsetSpace ~
3664 3664 When a session is restored, logging is automatically turned on again with
3665 3665 the name of the logfile it was invoked with (it is read from the log header).
3666 3666 So once you've turned logging on for a session, you can quit IPython and
3667 3667 reload it as many times as you want and it will continue to log its history
3668 3668 and restore from the beginning every time.
3669 3669 \end_layout
3670 3670
3671 3671 \begin_layout List
3672 3672 \labelwidthstring 00.00.0000
3673 3673 \InsetSpace ~
3674 3674 Caveats: there are limitations in this option.
3675 3675 The history variables
3676 3676 \family typewriter
3677 3677 _i*
3678 3678 \family default
3679 3679 ,
3680 3680 \family typewriter
3681 3681 _*
3682 3682 \family default
3683 3683 and
3684 3684 \family typewriter
3685 3685 _dh
3686 3686 \family default
3687 3687 don't get restored properly.
3688 3688 In the future we will try to implement full session saving by writing and
3689 3689 retrieving a 'snapshot' of the memory state of IPython.
3690 3690 But our first attempts failed because of inherent limitations of Python's
3691 3691 Pickle module, so this may have to wait.
3692 3692 \end_layout
3693 3693
3694 3694 \begin_layout List
3695 3695 \labelwidthstring 00.00.0000
3696 3696
3697 3697 \family typewriter
3698 3698 \series bold
3699 3699 -[no]messages
3700 3700 \series default
3701 3701 :
3702 3702 \family default
3703 3703 Print messages which IPython collects about its startup process (default
3704 3704 on).
3705 3705 \end_layout
3706 3706
3707 3707 \begin_layout List
3708 3708 \labelwidthstring 00.00.0000
3709 3709
3710 3710 \family typewriter
3711 3711 \series bold
3712 3712 -[no]pdb
3713 3713 \family default
3714 3714 \series default
3715 3715 : Automatically call the pdb debugger after every uncaught exception.
3716 3716 If you are used to debugging using pdb, this puts you automatically inside
3717 3717 of it after any call (either in IPython or in code called by it) which
3718 3718 triggers an exception which goes uncaught.
3719 3719 \end_layout
3720 3720
3721 3721 \begin_layout List
3722 3722 \labelwidthstring 00.00.0000
3723 3723
3724 3724 \family typewriter
3725 3725 \series bold
3726 3726 -[no]pprint
3727 3727 \series default
3728 3728 :
3729 3729 \family default
3730 3730 ipython can optionally use the pprint (pretty printer) module for displaying
3731 3731 results.
3732 3732 pprint tends to give a nicer display of nested data structures.
3733 3733 If you like it, you can turn it on permanently in your config file (default
3734 3734 off).
3735 3735 \end_layout
3736 3736
3737 3737 \begin_layout List
3738 3738 \labelwidthstring 00.00.0000
3739 3739
3740 3740 \family typewriter
3741 3741 \series bold
3742 3742 -profile|p <name>
3743 3743 \series default
3744 3744 :
3745 3745 \family default
3746 3746 assume that your config file is
3747 3747 \family typewriter
3748 3748 ipythonrc-<name>
3749 3749 \family default
3750 3750 (looks in current dir first, then in
3751 3751 \family typewriter
3752 3752 IPYTHONDIR
3753 3753 \family default
3754 3754 ).
3755 3755 This is a quick way to keep and load multiple config files for different
3756 3756 tasks, especially if you use the include option of config files.
3757 3757 You can keep a basic
3758 3758 \family typewriter
3759 3759 IPYTHONDIR/ipythonrc
3760 3760 \family default
3761 3761 file and then have other 'profiles' which include this one and load extra
3762 3762 things for particular tasks.
3763 3763 For example:
3764 3764 \end_layout
3765 3765
3766 3766 \begin_layout List
3767 3767 \labelwidthstring 00.00.0000
3768 3768
3769 3769 \family typewriter
3770 3770 \InsetSpace ~
3771 3771
3772 3772 \family default
3773 3773 1.
3774 3774
3775 3775 \family typewriter
3776 3776 $HOME/.ipython/ipythonrc
3777 3777 \family default
3778 3778 : load basic things you always want.
3779 3779 \end_layout
3780 3780
3781 3781 \begin_layout List
3782 3782 \labelwidthstring 00.00.0000
3783 3783
3784 3784 \family typewriter
3785 3785 \InsetSpace ~
3786 3786
3787 3787 \family default
3788 3788 2.
3789 3789
3790 3790 \family typewriter
3791 3791 $HOME/.ipython/ipythonrc-math
3792 3792 \family default
3793 3793 : load (1) and basic math-related modules.
3794 3794
3795 3795 \end_layout
3796 3796
3797 3797 \begin_layout List
3798 3798 \labelwidthstring 00.00.0000
3799 3799
3800 3800 \family typewriter
3801 3801 \InsetSpace ~
3802 3802
3803 3803 \family default
3804 3804 3.
3805 3805
3806 3806 \family typewriter
3807 3807 $HOME/.ipython/ipythonrc-numeric
3808 3808 \family default
3809 3809 : load (1) and Numeric and plotting modules.
3810 3810 \end_layout
3811 3811
3812 3812 \begin_layout List
3813 3813 \labelwidthstring 00.00.0000
3814 3814 \InsetSpace ~
3815 3815 Since it is possible to create an endless loop by having circular file
3816 3816 inclusions, IPython will stop if it reaches 15 recursive inclusions.
3817 3817 \end_layout
3818 3818
3819 3819 \begin_layout List
3820 3820 \labelwidthstring 00.00.0000
3821 3821
3822 3822 \family typewriter
3823 3823 \series bold
3824 3824 -prompt_in1|pi1\InsetSpace ~
3825 3825 <string>:
3826 3826 \family default
3827 3827 \series default
3828 3828 Specify the string used for input prompts.
3829 3829 Note that if you are using numbered prompts, the number is represented
3830 3830 with a '
3831 3831 \backslash
3832 3832 #' in the string.
3833 3833 Don't forget to quote strings with spaces embedded in them.
3834 3834 Default: '
3835 3835 \family typewriter
3836 3836 In\InsetSpace ~
3837 3837 [
3838 3838 \backslash
3839 3839 #]:
3840 3840 \family default
3841 3841 '.
3842 3842 Sec.\InsetSpace ~
3843 3843
3844 3844 \begin_inset LatexCommand \ref{sec:prompts}
3845 3845
3846 3846 \end_inset
3847 3847
3848 3848 discusses in detail all the available escapes to customize your prompts.
3849 3849 \end_layout
3850 3850
3851 3851 \begin_layout List
3852 3852 \labelwidthstring 00.00.0000
3853 3853
3854 3854 \family typewriter
3855 3855 \series bold
3856 3856 -prompt_in2|pi2\InsetSpace ~
3857 3857 <string>:
3858 3858 \family default
3859 3859 \series default
3860 3860 Similar to the previous option, but used for the continuation prompts.
3861 3861 The special sequence '
3862 3862 \family typewriter
3863 3863
3864 3864 \backslash
3865 3865 D
3866 3866 \family default
3867 3867 ' is similar to '
3868 3868 \family typewriter
3869 3869
3870 3870 \backslash
3871 3871 #
3872 3872 \family default
3873 3873 ', but with all digits replaced dots (so you can have your continuation
3874 3874 prompt aligned with your input prompt).
3875 3875 Default: '
3876 3876 \family typewriter
3877 3877 \InsetSpace ~
3878 3878 \InsetSpace ~
3879 3879 \InsetSpace ~
3880 3880 .
3881 3881 \backslash
3882 3882 D.:
3883 3883 \family default
3884 3884 ' (note three spaces at the start for alignment with '
3885 3885 \family typewriter
3886 3886 In\InsetSpace ~
3887 3887 [
3888 3888 \backslash
3889 3889 #]
3890 3890 \family default
3891 3891 ').
3892 3892 \end_layout
3893 3893
3894 3894 \begin_layout List
3895 3895 \labelwidthstring 00.00.0000
3896 3896
3897 3897 \family typewriter
3898 3898 \series bold
3899 3899 -prompt_out|po\InsetSpace ~
3900 3900 <string>:
3901 3901 \family default
3902 3902 \series default
3903 3903 String used for output prompts, also uses numbers like
3904 3904 \family typewriter
3905 3905 prompt_in1
3906 3906 \family default
3907 3907 .
3908 3908 Default: '
3909 3909 \family typewriter
3910 3910 Out[
3911 3911 \backslash
3912 3912 #]:
3913 3913 \family default
3914 3914 '
3915 3915 \end_layout
3916 3916
3917 3917 \begin_layout List
3918 3918 \labelwidthstring 00.00.0000
3919 3919
3920 3920 \family typewriter
3921 3921 \series bold
3922 3922 -quick
3923 3923 \family default
3924 3924 \series default
3925 3925 : start in bare bones mode (no config file loaded).
3926 3926 \end_layout
3927 3927
3928 3928 \begin_layout List
3929 3929 \labelwidthstring 00.00.0000
3930 3930
3931 3931 \family typewriter
3932 3932 \series bold
3933 3933 -rcfile\InsetSpace ~
3934 3934 <name>
3935 3935 \series default
3936 3936 :
3937 3937 \family default
3938 3938 name of your IPython resource configuration file.
3939 3939 Normally IPython loads ipythonrc (from current directory) or
3940 3940 \family typewriter
3941 3941 IPYTHONDIR/ipythonrc
3942 3942 \family default
3943 3943 .
3944 3944 \end_layout
3945 3945
3946 3946 \begin_layout List
3947 3947 \labelwidthstring 00.00.0000
3948 3948 \InsetSpace ~
3949 3949 If the loading of your config file fails, IPython starts with a bare bones
3950 3950 configuration (no modules loaded at all).
3951 3951 \end_layout
3952 3952
3953 3953 \begin_layout List
3954 3954 \labelwidthstring 00.00.0000
3955 3955
3956 3956 \family typewriter
3957 3957 \series bold
3958 3958 -[no]readline
3959 3959 \family default
3960 3960 \series default
3961 3961 : use the readline library, which is needed to support name completion and
3962 3962 command history, among other things.
3963 3963 It is enabled by default, but may cause problems for users of X/Emacs in
3964 3964 Python comint or shell buffers.
3965 3965 \end_layout
3966 3966
3967 3967 \begin_layout List
3968 3968 \labelwidthstring 00.00.0000
3969 3969 \InsetSpace ~
3970 3970 Note that X/Emacs 'eterm' buffers (opened with
3971 3971 \family typewriter
3972 3972 M-x\InsetSpace ~
3973 3973 term
3974 3974 \family default
3975 3975 ) support IPython's readline and syntax coloring fine, only 'emacs' (
3976 3976 \family typewriter
3977 3977 M-x\InsetSpace ~
3978 3978 shell
3979 3979 \family default
3980 3980 and
3981 3981 \family typewriter
3982 3982 C-c\InsetSpace ~
3983 3983 !
3984 3984 \family default
3985 3985 ) buffers do not.
3986 3986 \end_layout
3987 3987
3988 3988 \begin_layout List
3989 3989 \labelwidthstring 00.00.0000
3990 3990
3991 3991 \family typewriter
3992 3992 \series bold
3993 3993 -screen_length|sl\InsetSpace ~
3994 3994 <n>
3995 3995 \series default
3996 3996 :
3997 3997 \family default
3998 3998 number of lines of your screen.
3999 3999 This is used to control printing of very long strings.
4000 4000 Strings longer than this number of lines will be sent through a pager instead
4001 4001 of directly printed.
4002 4002 \end_layout
4003 4003
4004 4004 \begin_layout List
4005 4005 \labelwidthstring 00.00.0000
4006 4006 \InsetSpace ~
4007 4007 The default value for this is 0, which means IPython will auto-detect your
4008 4008 screen size every time it needs to print certain potentially long strings
4009 4009 (this doesn't change the behavior of the 'print' keyword, it's only triggered
4010 4010 internally).
4011 4011 If for some reason this isn't working well (it needs curses support), specify
4012 4012 it yourself.
4013 4013 Otherwise don't change the default.
4014 4014 \end_layout
4015 4015
4016 4016 \begin_layout List
4017 4017 \labelwidthstring 00.00.0000
4018 4018
4019 4019 \family typewriter
4020 4020 \series bold
4021 4021 -separate_in|si\InsetSpace ~
4022 4022 <string>
4023 4023 \series default
4024 4024 :
4025 4025 \family default
4026 4026 separator before input prompts.
4027 4027 Default: '
4028 4028 \family typewriter
4029 4029
4030 4030 \backslash
4031 4031 n
4032 4032 \family default
4033 4033 '
4034 4034 \end_layout
4035 4035
4036 4036 \begin_layout List
4037 4037 \labelwidthstring 00.00.0000
4038 4038
4039 4039 \family typewriter
4040 4040 \series bold
4041 4041 -separate_out|so\InsetSpace ~
4042 4042 <string>
4043 4043 \family default
4044 4044 \series default
4045 4045 : separator before output prompts.
4046 4046 Default: nothing.
4047 4047 \end_layout
4048 4048
4049 4049 \begin_layout List
4050 4050 \labelwidthstring 00.00.0000
4051 4051
4052 4052 \family typewriter
4053 4053 \series bold
4054 4054 -separate_out2|so2\InsetSpace ~
4055 4055 <string>
4056 4056 \series default
4057 4057 :
4058 4058 \family default
4059 4059 separator after output prompts.
4060 4060 Default: nothing.
4061 4061 \end_layout
4062 4062
4063 4063 \begin_layout List
4064 4064 \labelwidthstring 00.00.0000
4065 4065 \InsetSpace ~
4066 4066 For these three options, use the value 0 to specify no separator.
4067 4067 \end_layout
4068 4068
4069 4069 \begin_layout List
4070 4070 \labelwidthstring 00.00.0000
4071 4071
4072 4072 \family typewriter
4073 4073 \series bold
4074 4074 -nosep
4075 4075 \series default
4076 4076 :
4077 4077 \family default
4078 4078 shorthand for
4079 4079 \family typewriter
4080 4080 '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'
4081 4081 \family default
4082 4082 .
4083 4083 Simply removes all input/output separators.
4084 4084 \end_layout
4085 4085
4086 4086 \begin_layout List
4087 4087 \labelwidthstring 00.00.0000
4088 4088
4089 4089 \family typewriter
4090 4090 \series bold
4091 4091 -upgrade
4092 4092 \family default
4093 4093 \series default
4094 4094 : allows you to upgrade your
4095 4095 \family typewriter
4096 4096 IPYTHONDIR
4097 4097 \family default
4098 4098 configuration when you install a new version of IPython.
4099 4099 Since new versions may include new command line options or example files,
4100 4100 this copies updated ipythonrc-type files.
4101 4101 However, it backs up (with a
4102 4102 \family typewriter
4103 4103 .old
4104 4104 \family default
4105 4105 extension) all files which it overwrites so that you can merge back any
4106 4106 customizations you might have in your personal files.
4107 4107 \end_layout
4108 4108
4109 4109 \begin_layout List
4110 4110 \labelwidthstring 00.00.0000
4111 4111
4112 4112 \family typewriter
4113 4113 \series bold
4114 4114 -Version
4115 4115 \series default
4116 4116 :
4117 4117 \family default
4118 4118 print version information and exit.
4119 4119 \end_layout
4120 4120
4121 4121 \begin_layout List
4122 4122 \labelwidthstring 00.00.0000
4123 4123
4124 4124 \family typewriter
4125 4125 \series bold
4126 4126 -wxversion\InsetSpace ~
4127 4127 <string>:
4128 4128 \family default
4129 4129 \series default
4130 4130 Select a specific version of wxPython (used in conjunction with
4131 4131 \family typewriter
4132 4132 -wthread
4133 4133 \family default
4134 4134 ).
4135 4135 Requires the wxversion module, part of recent wxPython distributions
4136 4136 \end_layout
4137 4137
4138 4138 \begin_layout List
4139 4139 \labelwidthstring 00.00.0000
4140 4140
4141 4141 \family typewriter
4142 4142 \series bold
4143 4143 -xmode\InsetSpace ~
4144 4144 <modename>
4145 4145 \series default
4146 4146 :
4147 4147 \family default
4148 4148 Mode for exception reporting.
4149 4149 \end_layout
4150 4150
4151 4151 \begin_layout List
4152 4152 \labelwidthstring 00.00.0000
4153 4153 \InsetSpace ~
4154 4154 Valid modes: Plain, Context and Verbose.
4155 4155 \end_layout
4156 4156
4157 4157 \begin_layout List
4158 4158 \labelwidthstring 00.00.0000
4159 4159 \InsetSpace ~
4160 4160 Plain: similar to python's normal traceback printing.
4161 4161 \end_layout
4162 4162
4163 4163 \begin_layout List
4164 4164 \labelwidthstring 00.00.0000
4165 4165 \InsetSpace ~
4166 4166 Context: prints 5 lines of context source code around each line in the
4167 4167 traceback.
4168 4168 \end_layout
4169 4169
4170 4170 \begin_layout List
4171 4171 \labelwidthstring 00.00.0000
4172 4172 \InsetSpace ~
4173 4173 Verbose: similar to Context, but additionally prints the variables currently
4174 4174 visible where the exception happened (shortening their strings if too long).
4175 4175 This can potentially be very slow, if you happen to have a huge data structure
4176 4176 whose string representation is complex to compute.
4177 4177 Your computer may appear to freeze for a while with cpu usage at 100%.
4178 4178 If this occurs, you can cancel the traceback with Ctrl-C (maybe hitting
4179 4179 it more than once).
4180 4180 \end_layout
4181 4181
4182 4182 \begin_layout Section
4183 4183 Interactive use
4184 4184 \end_layout
4185 4185
4186 4186 \begin_layout Standard
4187 4187
4188 4188 \series bold
4189 4189 Warning
4190 4190 \series default
4191 4191 : IPython relies on the existence of a global variable called
4192 4192 \family typewriter
4193 4193 __IP
4194 4194 \family default
4195 4195 which controls the shell itself.
4196 4196 If you redefine
4197 4197 \family typewriter
4198 4198 __IP
4199 4199 \family default
4200 4200 to anything, bizarre behavior will quickly occur.
4201 4201 \end_layout
4202 4202
4203 4203 \begin_layout Standard
4204 4204 Other than the above warning, IPython is meant to work as a drop-in replacement
4205 4205 for the standard interactive interpreter.
4206 4206 As such, any code which is valid python should execute normally under IPython
4207 4207 (cases where this is not true should be reported as bugs).
4208 4208 It does, however, offer many features which are not available at a standard
4209 4209 python prompt.
4210 4210 What follows is a list of these.
4211 4211 \end_layout
4212 4212
4213 4213 \begin_layout Subsection
4214 4214 Caution for Windows users
4215 4215 \end_layout
4216 4216
4217 4217 \begin_layout Standard
4218 4218 Windows, unfortunately, uses the `
4219 4219 \family typewriter
4220 4220
4221 4221 \backslash
4222 4222
4223 4223 \family default
4224 4224 ' character as a path separator.
4225 4225 This is a terrible choice, because `
4226 4226 \family typewriter
4227 4227
4228 4228 \backslash
4229 4229
4230 4230 \family default
4231 4231 ' also represents the escape character in most modern programming languages,
4232 4232 including Python.
4233 4233 For this reason, issuing many of the commands discussed below (especially
4234 4234 magics which affect the filesystem) with `
4235 4235 \family typewriter
4236 4236
4237 4237 \backslash
4238 4238
4239 4239 \family default
4240 4240 ' in them will cause strange errors.
4241 4241 \end_layout
4242 4242
4243 4243 \begin_layout Standard
4244 4244 A partial solution is to use instead the `
4245 4245 \family typewriter
4246 4246 /
4247 4247 \family default
4248 4248 ' character as a path separator, which Windows recognizes in
4249 4249 \emph on
4250 4250 most
4251 4251 \emph default
4252 4252 situations.
4253 4253 However, in Windows commands `
4254 4254 \family typewriter
4255 4255 /
4256 4256 \family default
4257 4257 ' flags options, so you can not use it for the root directory.
4258 4258 This means that paths beginning at the root must be typed in a contrived
4259 4259 manner like:
4260 4260 \newline
4261 4261
4262 4262 \family typewriter
4263 4263 %copy
4264 4264 \backslash
4265 4265 opt/foo/bar.txt
4266 4266 \backslash
4267 4267 tmp
4268 4268 \end_layout
4269 4269
4270 4270 \begin_layout Standard
4271 4271 There is no sensible thing IPython can do to truly work around this flaw
4272 4272 in Windows
4273 4273 \begin_inset Foot
4274 4274 status collapsed
4275 4275
4276 4276 \begin_layout Standard
4277 4277 If anyone comes up with a
4278 4278 \emph on
4279 4279 clean
4280 4280 \emph default
4281 4281 solution which works consistently and does not negatively impact other
4282 4282 platforms at all, I'll gladly accept a patch.
4283 4283 \end_layout
4284 4284
4285 4285 \end_inset
4286 4286
4287 4287 .
4288 4288 \end_layout
4289 4289
4290 4290 \begin_layout Subsection
4291 4291 \begin_inset LatexCommand \label{sec:magic}
4292 4292
4293 4293 \end_inset
4294 4294
4295 4295 Magic command system
4296 4296 \end_layout
4297 4297
4298 4298 \begin_layout Standard
4299 4299 IPython will treat any line whose first character is a
4300 4300 \family typewriter
4301 4301 %
4302 4302 \family default
4303 4303 as a special call to a 'magic' function.
4304 4304 These allow you to control the behavior of IPython itself, plus a lot of
4305 4305 system-type features.
4306 4306 They are all prefixed with a
4307 4307 \family typewriter
4308 4308 %
4309 4309 \family default
4310 4310 character, but parameters are given without parentheses or quotes.
4311 4311 \end_layout
4312 4312
4313 4313 \begin_layout Standard
4314 4314 Example: typing
4315 4315 \family typewriter
4316 4316 '%cd mydir'
4317 4317 \family default
4318 4318 (without the quotes) changes you working directory to
4319 4319 \family typewriter
4320 4320 'mydir'
4321 4321 \family default
4322 4322 , if it exists.
4323 4323 \end_layout
4324 4324
4325 4325 \begin_layout Standard
4326 4326 If you have 'automagic' enabled (in your
4327 4327 \family typewriter
4328 4328 ipythonrc
4329 4329 \family default
4330 4330 file, via the command line option
4331 4331 \family typewriter
4332 4332 -automagic
4333 4333 \family default
4334 4334 or with the
4335 4335 \family typewriter
4336 4336 %automagic
4337 4337 \family default
4338 4338 function), you don't need to type in the
4339 4339 \family typewriter
4340 4340 %
4341 4341 \family default
4342 4342 explicitly.
4343 4343 IPython will scan its internal list of magic functions and call one if
4344 4344 it exists.
4345 4345 With automagic on you can then just type '
4346 4346 \family typewriter
4347 4347 cd mydir
4348 4348 \family default
4349 4349 ' to go to directory '
4350 4350 \family typewriter
4351 4351 mydir
4352 4352 \family default
4353 4353 '.
4354 4354 The automagic system has the lowest possible precedence in name searches,
4355 4355 so defining an identifier with the same name as an existing magic function
4356 4356 will shadow it for automagic use.
4357 4357 You can still access the shadowed magic function by explicitly using the
4358 4358
4359 4359 \family typewriter
4360 4360 %
4361 4361 \family default
4362 4362 character at the beginning of the line.
4363 4363 \end_layout
4364 4364
4365 4365 \begin_layout Standard
4366 4366 An example (with automagic on) should clarify all this:
4367 4367 \end_layout
4368 4368
4369 4369 \begin_layout LyX-Code
4370 4370 In [1]: cd ipython # %cd is called by automagic
4371 4371 \end_layout
4372 4372
4373 4373 \begin_layout LyX-Code
4374 4374 /home/fperez/ipython
4375 4375 \end_layout
4376 4376
4377 4377 \begin_layout LyX-Code
4378 4378 In [2]: cd=1 # now cd is just a variable
4379 4379 \end_layout
4380 4380
4381 4381 \begin_layout LyX-Code
4382 4382 In [3]: cd ..
4383 4383 # and doesn't work as a function anymore
4384 4384 \end_layout
4385 4385
4386 4386 \begin_layout LyX-Code
4387 4387 ------------------------------------------------------------
4388 4388 \end_layout
4389 4389
4390 4390 \begin_layout LyX-Code
4391 4391 File "<console>", line 1
4392 4392 \end_layout
4393 4393
4394 4394 \begin_layout LyX-Code
4395 4395 cd ..
4396 4396 \end_layout
4397 4397
4398 4398 \begin_layout LyX-Code
4399 4399 ^
4400 4400 \end_layout
4401 4401
4402 4402 \begin_layout LyX-Code
4403 4403 SyntaxError: invalid syntax
4404 4404 \end_layout
4405 4405
4406 4406 \begin_layout LyX-Code
4407 4407
4408 4408 \end_layout
4409 4409
4410 4410 \begin_layout LyX-Code
4411 4411 In [4]: %cd ..
4412 4412 # but %cd always works
4413 4413 \end_layout
4414 4414
4415 4415 \begin_layout LyX-Code
4416 4416 /home/fperez
4417 4417 \end_layout
4418 4418
4419 4419 \begin_layout LyX-Code
4420 4420 In [5]: del cd # if you remove the cd variable
4421 4421 \end_layout
4422 4422
4423 4423 \begin_layout LyX-Code
4424 4424 In [6]: cd ipython # automagic can work again
4425 4425 \end_layout
4426 4426
4427 4427 \begin_layout LyX-Code
4428 4428 /home/fperez/ipython
4429 4429 \end_layout
4430 4430
4431 4431 \begin_layout Standard
4432 4432 You can define your own magic functions to extend the system.
4433 4433 The following example defines a new magic command,
4434 4434 \family typewriter
4435 4435 %impall
4436 4436 \family default
4437 4437 :
4438 4438 \end_layout
4439 4439
4440 4440 \begin_layout LyX-Code
4441 4441 import IPython.ipapi
4442 4442 \end_layout
4443 4443
4444 4444 \begin_layout LyX-Code
4445 4445 ip = IPython.ipapi.get()
4446 4446 \end_layout
4447 4447
4448 4448 \begin_layout LyX-Code
4449 4449
4450 4450 \end_layout
4451 4451
4452 4452 \begin_layout LyX-Code
4453 4453 def doimp(self, arg):
4454 4454 \end_layout
4455 4455
4456 4456 \begin_layout LyX-Code
4457 4457 ip = self.api
4458 4458 \end_layout
4459 4459
4460 4460 \begin_layout LyX-Code
4461 4461 ip.ex("import %s; reload(%s); from %s import *" % (
4462 4462 \end_layout
4463 4463
4464 4464 \begin_layout LyX-Code
4465 4465 arg,arg,arg)
4466 4466 \end_layout
4467 4467
4468 4468 \begin_layout LyX-Code
4469 4469 )
4470 4470 \end_layout
4471 4471
4472 4472 \begin_layout LyX-Code
4473 4473 ip.expose_magic('impall', doimp)
4474 4474 \end_layout
4475 4475
4476 4476 \begin_layout Standard
4477 4477 You can also define your own aliased names for magic functions.
4478 4478 In your
4479 4479 \family typewriter
4480 4480 ipythonrc
4481 4481 \family default
4482 4482 file, placing a line like:
4483 4483 \end_layout
4484 4484
4485 4485 \begin_layout Standard
4486 4486
4487 4487 \family typewriter
4488 4488 execute __IP.magic_cl = __IP.magic_clear
4489 4489 \end_layout
4490 4490
4491 4491 \begin_layout Standard
4492 4492 will define
4493 4493 \family typewriter
4494 4494 %cl
4495 4495 \family default
4496 4496 as a new name for
4497 4497 \family typewriter
4498 4498 %clear
4499 4499 \family default
4500 4500 .
4501 4501 \end_layout
4502 4502
4503 4503 \begin_layout Standard
4504 4504 Type
4505 4505 \family typewriter
4506 4506 %magic
4507 4507 \family default
4508 4508 for more information, including a list of all available magic functions
4509 4509 at any time and their docstrings.
4510 4510 You can also type
4511 4511 \family typewriter
4512 4512 %magic_function_name?
4513 4513 \family default
4514 4514 (see sec.
4515 4515
4516 4516 \begin_inset LatexCommand \ref{sec:dyn-object-info}
4517 4517
4518 4518 \end_inset
4519 4519
4520 4520 for information on the
4521 4521 \family typewriter
4522 4522 '?'
4523 4523 \family default
4524 4524 system) to get information about any particular magic function you are
4525 4525 interested in.
4526 4526 \end_layout
4527 4527
4528 4528 \begin_layout Subsubsection
4529 4529 Magic commands
4530 4530 \end_layout
4531 4531
4532 4532 \begin_layout Standard
4533 4533 The rest of this section is automatically generated for each release from
4534 4534 the docstrings in the IPython code.
4535 4535 Therefore the formatting is somewhat minimal, but this method has the advantage
4536 4536 of having information always in sync with the code.
4537 4537 \end_layout
4538 4538
4539 4539 \begin_layout Standard
4540 4540 A list of all the magic commands available in IPython's
4541 4541 \emph on
4542 4542 default
4543 4543 \emph default
4544 4544 installation follows.
4545 4545 This is similar to what you'll see by simply typing
4546 4546 \family typewriter
4547 4547 %magic
4548 4548 \family default
4549 4549 at the prompt, but that will also give you information about magic commands
4550 4550 you may have added as part of your personal customizations.
4551 4551 \end_layout
4552 4552
4553 4553 \begin_layout Standard
4554 4554 \begin_inset Include \input{magic.tex}
4555 4555 preview false
4556 4556
4557 4557 \end_inset
4558 4558
4559 4559
4560 4560 \end_layout
4561 4561
4562 4562 \begin_layout Subsection
4563 4563 Access to the standard Python help
4564 4564 \end_layout
4565 4565
4566 4566 \begin_layout Standard
4567 4567 As of Python 2.1, a help system is available with access to object docstrings
4568 4568 and the Python manuals.
4569 4569 Simply type
4570 4570 \family typewriter
4571 4571 'help'
4572 4572 \family default
4573 4573 (no quotes) to access it.
4574 4574 You can also type
4575 4575 \family typewriter
4576 4576 help(object)
4577 4577 \family default
4578 4578 to obtain information about a given object, and
4579 4579 \family typewriter
4580 4580 help('keyword')
4581 4581 \family default
4582 4582 for information on a keyword.
4583 4583 As noted in sec.
4584 4584
4585 4585 \begin_inset LatexCommand \ref{sec:help-access}
4586 4586
4587 4587 \end_inset
4588 4588
4589 4589 , you need to properly configure your environment variable
4590 4590 \family typewriter
4591 4591 PYTHONDOCS
4592 4592 \family default
4593 4593 for this feature to work correctly.
4594 4594 \end_layout
4595 4595
4596 4596 \begin_layout Subsection
4597 4597 \begin_inset LatexCommand \label{sec:dyn-object-info}
4598 4598
4599 4599 \end_inset
4600 4600
4601 4601 Dynamic object information
4602 4602 \end_layout
4603 4603
4604 4604 \begin_layout Standard
4605 4605 Typing
4606 4606 \family typewriter
4607 4607 ?word
4608 4608 \family default
4609 4609 or
4610 4610 \family typewriter
4611 4611 word?
4612 4612 \family default
4613 4613 prints detailed information about an object.
4614 4614 If certain strings in the object are too long (docstrings, code, etc.) they
4615 4615 get snipped in the center for brevity.
4616 4616 This system gives access variable types and values, full source code for
4617 4617 any object (if available), function prototypes and other useful information.
4618 4618 \end_layout
4619 4619
4620 4620 \begin_layout Standard
4621 4621 Typing
4622 4622 \family typewriter
4623 4623 ??word
4624 4624 \family default
4625 4625 or
4626 4626 \family typewriter
4627 4627 word??
4628 4628 \family default
4629 4629 gives access to the full information without snipping long strings.
4630 4630 Long strings are sent to the screen through the
4631 4631 \family typewriter
4632 4632 less
4633 4633 \family default
4634 4634 pager if longer than the screen and printed otherwise.
4635 4635 On systems lacking the
4636 4636 \family typewriter
4637 4637 less
4638 4638 \family default
4639 4639 command, IPython uses a very basic internal pager.
4640 4640 \end_layout
4641 4641
4642 4642 \begin_layout Standard
4643 4643 The following magic functions are particularly useful for gathering information
4644 4644 about your working environment.
4645 4645 You can get more details by typing
4646 4646 \family typewriter
4647 4647 %magic
4648 4648 \family default
4649 4649 or querying them individually (use
4650 4650 \family typewriter
4651 4651 %function_name?
4652 4652 \family default
4653 4653 with or without the
4654 4654 \family typewriter
4655 4655 %
4656 4656 \family default
4657 4657 ), this is just a summary:
4658 4658 \end_layout
4659 4659
4660 4660 \begin_layout List
4661 4661 \labelwidthstring 00.00.0000
4662 4662
4663 4663 \family typewriter
4664 4664 \series bold
4665 4665 %pdoc\InsetSpace ~
4666 4666 <object>
4667 4667 \family default
4668 4668 \series default
4669 4669 : Print (or run through a pager if too long) the docstring for an object.
4670 4670 If the given object is a class, it will print both the class and the constructo
4671 4671 r docstrings.
4672 4672 \end_layout
4673 4673
4674 4674 \begin_layout List
4675 4675 \labelwidthstring 00.00.0000
4676 4676
4677 4677 \family typewriter
4678 4678 \series bold
4679 4679 %pdef\InsetSpace ~
4680 4680 <object>
4681 4681 \family default
4682 4682 \series default
4683 4683 : Print the definition header for any callable object.
4684 4684 If the object is a class, print the constructor information.
4685 4685 \end_layout
4686 4686
4687 4687 \begin_layout List
4688 4688 \labelwidthstring 00.00.0000
4689 4689
4690 4690 \family typewriter
4691 4691 \series bold
4692 4692 %psource\InsetSpace ~
4693 4693 <object>
4694 4694 \family default
4695 4695 \series default
4696 4696 : Print (or run through a pager if too long) the source code for an object.
4697 4697 \end_layout
4698 4698
4699 4699 \begin_layout List
4700 4700 \labelwidthstring 00.00.0000
4701 4701
4702 4702 \family typewriter
4703 4703 \series bold
4704 4704 %pfile\InsetSpace ~
4705 4705 <object>
4706 4706 \family default
4707 4707 \series default
4708 4708 : Show the entire source file where an object was defined via a pager, opening
4709 4709 it at the line where the object definition begins.
4710 4710 \end_layout
4711 4711
4712 4712 \begin_layout List
4713 4713 \labelwidthstring 00.00.0000
4714 4714
4715 4715 \family typewriter
4716 4716 \series bold
4717 4717 %who/%whos
4718 4718 \family default
4719 4719 \series default
4720 4720 : These functions give information about identifiers you have defined interactiv
4721 4721 ely (not things you loaded or defined in your configuration files).
4722 4722
4723 4723 \family typewriter
4724 4724 %who
4725 4725 \family default
4726 4726 just prints a list of identifiers and
4727 4727 \family typewriter
4728 4728 %whos
4729 4729 \family default
4730 4730 prints a table with some basic details about each identifier.
4731 4731 \end_layout
4732 4732
4733 4733 \begin_layout Standard
4734 4734 Note that the dynamic object information functions (
4735 4735 \family typewriter
4736 4736 ?/??, %pdoc, %pfile, %pdef, %psource
4737 4737 \family default
4738 4738 ) give you access to documentation even on things which are not really defined
4739 4739 as separate identifiers.
4740 4740 Try for example typing
4741 4741 \family typewriter
4742 4742 {}.get?
4743 4743 \family default
4744 4744 or after doing
4745 4745 \family typewriter
4746 4746 import os
4747 4747 \family default
4748 4748 , type
4749 4749 \family typewriter
4750 4750 os.path.abspath??
4751 4751 \family default
4752 4752 .
4753 4753 \end_layout
4754 4754
4755 4755 \begin_layout Subsection
4756 4756 \begin_inset LatexCommand \label{sec:readline}
4757 4757
4758 4758 \end_inset
4759 4759
4760 4760 Readline-based features
4761 4761 \end_layout
4762 4762
4763 4763 \begin_layout Standard
4764 4764 These features require the GNU readline library, so they won't work if your
4765 4765 Python installation lacks readline support.
4766 4766 We will first describe the default behavior IPython uses, and then how
4767 4767 to change it to suit your preferences.
4768 4768 \end_layout
4769 4769
4770 4770 \begin_layout Subsubsection
4771 4771 Command line completion
4772 4772 \end_layout
4773 4773
4774 4774 \begin_layout Standard
4775 4775 At any time, hitting TAB will complete any available python commands or
4776 4776 variable names, and show you a list of the possible completions if there's
4777 4777 no unambiguous one.
4778 4778 It will also complete filenames in the current directory if no python names
4779 4779 match what you've typed so far.
4780 4780 \end_layout
4781 4781
4782 4782 \begin_layout Subsubsection
4783 4783 Search command history
4784 4784 \end_layout
4785 4785
4786 4786 \begin_layout Standard
4787 4787 IPython provides two ways for searching through previous input and thus
4788 4788 reduce the need for repetitive typing:
4789 4789 \end_layout
4790 4790
4791 4791 \begin_layout Enumerate
4792 4792 Start typing, and then use
4793 4793 \family typewriter
4794 4794 Ctrl-p
4795 4795 \family default
4796 4796 (previous,up) and
4797 4797 \family typewriter
4798 4798 Ctrl-n
4799 4799 \family default
4800 4800 (next,down) to search through only the history items that match what you've
4801 4801 typed so far.
4802 4802 If you use
4803 4803 \family typewriter
4804 4804 Ctrl-p/Ctrl-n
4805 4805 \family default
4806 4806 at a blank prompt, they just behave like normal arrow keys.
4807 4807 \end_layout
4808 4808
4809 4809 \begin_layout Enumerate
4810 4810 Hit
4811 4811 \family typewriter
4812 4812 Ctrl-r
4813 4813 \family default
4814 4814 : opens a search prompt.
4815 4815 Begin typing and the system searches your history for lines that contain
4816 4816 what you've typed so far, completing as much as it can.
4817 4817 \end_layout
4818 4818
4819 4819 \begin_layout Subsubsection
4820 4820 Persistent command history across sessions
4821 4821 \end_layout
4822 4822
4823 4823 \begin_layout Standard
4824 4824 IPython will save your input history when it leaves and reload it next time
4825 4825 you restart it.
4826 4826 By default, the history file is named
4827 4827 \family typewriter
4828 4828 $IPYTHONDIR/history
4829 4829 \family default
4830 4830 , but if you've loaded a named profile, '
4831 4831 \family typewriter
4832 4832 -PROFILE_NAME
4833 4833 \family default
4834 4834 ' is appended to the name.
4835 4835 This allows you to keep separate histories related to various tasks: commands
4836 4836 related to numerical work will not be clobbered by a system shell history,
4837 4837 for example.
4838 4838 \end_layout
4839 4839
4840 4840 \begin_layout Subsubsection
4841 4841 Autoindent
4842 4842 \end_layout
4843 4843
4844 4844 \begin_layout Standard
4845 4845 IPython can recognize lines ending in ':' and indent the next line, while
4846 4846 also un-indenting automatically after 'raise' or 'return'.
4847 4847
4848 4848 \end_layout
4849 4849
4850 4850 \begin_layout Standard
4851 4851 This feature uses the readline library, so it will honor your
4852 4852 \family typewriter
4853 4853 ~/.inputrc
4854 4854 \family default
4855 4855 configuration (or whatever file your
4856 4856 \family typewriter
4857 4857 INPUTRC
4858 4858 \family default
4859 4859 variable points to).
4860 4860 Adding the following lines to your
4861 4861 \family typewriter
4862 4862 .inputrc
4863 4863 \family default
4864 4864 file can make indenting/unindenting more convenient (
4865 4865 \family typewriter
4866 4866 M-i
4867 4867 \family default
4868 4868 indents,
4869 4869 \family typewriter
4870 4870 M-u
4871 4871 \family default
4872 4872 unindents):
4873 4873 \end_layout
4874 4874
4875 4875 \begin_layout Standard
4876 4876
4877 4877 \family typewriter
4878 4878 $if Python
4879 4879 \newline
4880 4880 "
4881 4881 \backslash
4882 4882 M-i": "\InsetSpace ~
4883 4883 \InsetSpace ~
4884 4884 \InsetSpace ~
4885 4885 \InsetSpace ~
4886 4886 "
4887 4887 \newline
4888 4888 "
4889 4889 \backslash
4890 4890 M-u": "
4891 4891 \backslash
4892 4892 d
4893 4893 \backslash
4894 4894 d
4895 4895 \backslash
4896 4896 d
4897 4897 \backslash
4898 4898 d"
4899 4899 \newline
4900 4900 $endif
4901 4901 \end_layout
4902 4902
4903 4903 \begin_layout Standard
4904 4904 Note that there are 4 spaces between the quote marks after
4905 4905 \family typewriter
4906 4906 "M-i"
4907 4907 \family default
4908 4908 above.
4909 4909 \end_layout
4910 4910
4911 4911 \begin_layout Standard
4912 4912
4913 4913 \series bold
4914 4914 Warning:
4915 4915 \series default
4916 4916 this feature is ON by default, but it can cause problems with the pasting
4917 4917 of multi-line indented code (the pasted code gets re-indented on each line).
4918 4918 A magic function
4919 4919 \family typewriter
4920 4920 %autoindent
4921 4921 \family default
4922 4922 allows you to toggle it on/off at runtime.
4923 4923 You can also disable it permanently on in your
4924 4924 \family typewriter
4925 4925 ipythonrc
4926 4926 \family default
4927 4927 file (set
4928 4928 \family typewriter
4929 4929 autoindent 0
4930 4930 \family default
4931 4931 ).
4932 4932 \end_layout
4933 4933
4934 4934 \begin_layout Subsubsection
4935 4935 Customizing readline behavior
4936 4936 \end_layout
4937 4937
4938 4938 \begin_layout Standard
4939 4939 All these features are based on the GNU readline library, which has an extremely
4940 4940 customizable interface.
4941 4941 Normally, readline is configured via a file which defines the behavior
4942 4942 of the library; the details of the syntax for this can be found in the
4943 4943 readline documentation available with your system or on the Internet.
4944 4944 IPython doesn't read this file (if it exists) directly, but it does support
4945 4945 passing to readline valid options via a simple interface.
4946 4946 In brief, you can customize readline by setting the following options in
4947 4947 your
4948 4948 \family typewriter
4949 4949 ipythonrc
4950 4950 \family default
4951 4951 configuration file (note that these options can
4952 4952 \emph on
4953 4953 not
4954 4954 \emph default
4955 4955 be specified at the command line):
4956 4956 \end_layout
4957 4957
4958 4958 \begin_layout List
4959 4959 \labelwidthstring 00.00.0000
4960 4960
4961 4961 \family typewriter
4962 4962 \series bold
4963 4963 readline_parse_and_bind:
4964 4964 \family default
4965 4965 \series default
4966 4966 this option can appear as many times as you want, each time defining a
4967 4967 string to be executed via a
4968 4968 \family typewriter
4969 4969 readline.parse_and_bind()
4970 4970 \family default
4971 4971 command.
4972 4972 The syntax for valid commands of this kind can be found by reading the
4973 4973 documentation for the GNU readline library, as these commands are of the
4974 4974 kind which readline accepts in its configuration file.
4975 4975 \end_layout
4976 4976
4977 4977 \begin_layout List
4978 4978 \labelwidthstring 00.00.0000
4979 4979
4980 4980 \family typewriter
4981 4981 \series bold
4982 4982 readline_remove_delims:
4983 4983 \family default
4984 4984 \series default
4985 4985 a string of characters to be removed from the default word-delimiters list
4986 4986 used by readline, so that completions may be performed on strings which
4987 4987 contain them.
4988 4988 Do not change the default value unless you know what you're doing.
4989 4989 \end_layout
4990 4990
4991 4991 \begin_layout List
4992 4992 \labelwidthstring 00.00.0000
4993 4993
4994 4994 \family typewriter
4995 4995 \series bold
4996 4996 readline_omit__names
4997 4997 \family default
4998 4998 \series default
4999 4999 : when tab-completion is enabled, hitting
5000 5000 \family typewriter
5001 5001 <tab>
5002 5002 \family default
5003 5003 after a '
5004 5004 \family typewriter
5005 5005 .
5006 5006 \family default
5007 5007 ' in a name will complete all attributes of an object, including all the
5008 5008 special methods whose names include double underscores (like
5009 5009 \family typewriter
5010 5010 __getitem__
5011 5011 \family default
5012 5012 or
5013 5013 \family typewriter
5014 5014 __class__
5015 5015 \family default
5016 5016 ).
5017 5017 If you'd rather not see these names by default, you can set this option
5018 5018 to 1.
5019 5019 Note that even when this option is set, you can still see those names by
5020 5020 explicitly typing a
5021 5021 \family typewriter
5022 5022 _
5023 5023 \family default
5024 5024 after the period and hitting
5025 5025 \family typewriter
5026 5026 <tab>
5027 5027 \family default
5028 5028 : '
5029 5029 \family typewriter
5030 5030 name._<tab>
5031 5031 \family default
5032 5032 ' will always complete attribute names starting with '
5033 5033 \family typewriter
5034 5034 _
5035 5035 \family default
5036 5036 '.
5037 5037 \end_layout
5038 5038
5039 5039 \begin_layout List
5040 5040 \labelwidthstring 00.00.0000
5041 5041 \InsetSpace ~
5042 5042 This option is off by default so that new users see all attributes of any
5043 5043 objects they are dealing with.
5044 5044 \end_layout
5045 5045
5046 5046 \begin_layout Standard
5047 5047 You will find the default values along with a corresponding detailed explanation
5048 5048 in your
5049 5049 \family typewriter
5050 5050 ipythonrc
5051 5051 \family default
5052 5052 file.
5053 5053 \end_layout
5054 5054
5055 5055 \begin_layout Subsection
5056 5056 Session logging and restoring
5057 5057 \end_layout
5058 5058
5059 5059 \begin_layout Standard
5060 5060 You can log all input from a session either by starting IPython with the
5061 5061 command line switches
5062 5062 \family typewriter
5063 5063 -log
5064 5064 \family default
5065 5065 or
5066 5066 \family typewriter
5067 5067 -logfile
5068 5068 \family default
5069 5069 (see sec.
5070 5070
5071 5071 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5072 5072
5073 5073 \end_inset
5074 5074
5075 5075 )or by activating the logging at any moment with the magic function
5076 5076 \family typewriter
5077 5077 %logstart
5078 5078 \family default
5079 5079 .
5080 5080
5081 5081 \end_layout
5082 5082
5083 5083 \begin_layout Standard
5084 5084 Log files can later be reloaded with the
5085 5085 \family typewriter
5086 5086 -logplay
5087 5087 \family default
5088 5088 option and IPython will attempt to 'replay' the log by executing all the
5089 5089 lines in it, thus restoring the state of a previous session.
5090 5090 This feature is not quite perfect, but can still be useful in many cases.
5091 5091 \end_layout
5092 5092
5093 5093 \begin_layout Standard
5094 5094 The log files can also be used as a way to have a permanent record of any
5095 5095 code you wrote while experimenting.
5096 5096 Log files are regular text files which you can later open in your favorite
5097 5097 text editor to extract code or to 'clean them up' before using them to
5098 5098 replay a session.
5099 5099 \end_layout
5100 5100
5101 5101 \begin_layout Standard
5102 5102 The
5103 5103 \family typewriter
5104 5104 %logstart
5105 5105 \family default
5106 5106 function for activating logging in mid-session is used as follows:
5107 5107 \end_layout
5108 5108
5109 5109 \begin_layout Standard
5110 5110
5111 5111 \family typewriter
5112 5112 %logstart [log_name [log_mode]]
5113 5113 \end_layout
5114 5114
5115 5115 \begin_layout Standard
5116 5116 If no name is given, it defaults to a file named
5117 5117 \family typewriter
5118 5118 'log'
5119 5119 \family default
5120 5120 in your IPYTHONDIR directory, in
5121 5121 \family typewriter
5122 5122 'rotate'
5123 5123 \family default
5124 5124 mode (see below).
5125 5125 \end_layout
5126 5126
5127 5127 \begin_layout Standard
5128 5128 '
5129 5129 \family typewriter
5130 5130 %logstart name
5131 5131 \family default
5132 5132 ' saves to file
5133 5133 \family typewriter
5134 5134 'name'
5135 5135 \family default
5136 5136 in
5137 5137 \family typewriter
5138 5138 'backup'
5139 5139 \family default
5140 5140 mode.
5141 5141 It saves your history up to that point and then continues logging.
5142 5142 \end_layout
5143 5143
5144 5144 \begin_layout Standard
5145 5145
5146 5146 \family typewriter
5147 5147 %logstart
5148 5148 \family default
5149 5149 takes a second optional parameter: logging mode.
5150 5150 This can be one of (note that the modes are given unquoted):
5151 5151 \end_layout
5152 5152
5153 5153 \begin_layout List
5154 5154 \labelwidthstring 00.00.0000
5155 5155
5156 5156 \family typewriter
5157 5157 over
5158 5158 \family default
5159 5159 : overwrite existing
5160 5160 \family typewriter
5161 5161 log_name
5162 5162 \family default
5163 5163 .
5164 5164 \end_layout
5165 5165
5166 5166 \begin_layout List
5167 5167 \labelwidthstring 00.00.0000
5168 5168
5169 5169 \family typewriter
5170 5170 backup
5171 5171 \family default
5172 5172 : rename (if exists) to
5173 5173 \family typewriter
5174 5174 log_name~
5175 5175 \family default
5176 5176 and start
5177 5177 \family typewriter
5178 5178 log_name
5179 5179 \family default
5180 5180 .
5181 5181 \end_layout
5182 5182
5183 5183 \begin_layout List
5184 5184 \labelwidthstring 00.00.0000
5185 5185
5186 5186 \family typewriter
5187 5187 append
5188 5188 \family default
5189 5189 : well, that says it.
5190 5190 \end_layout
5191 5191
5192 5192 \begin_layout List
5193 5193 \labelwidthstring 00.00.0000
5194 5194
5195 5195 \family typewriter
5196 5196 rotate
5197 5197 \family default
5198 5198 : create rotating logs
5199 5199 \family typewriter
5200 5200 log_name
5201 5201 \family default
5202 5202 .
5203 5203 \family typewriter
5204 5204 1~
5205 5205 \family default
5206 5206 ,
5207 5207 \family typewriter
5208 5208 log_name.2~
5209 5209 \family default
5210 5210 , etc.
5211 5211 \end_layout
5212 5212
5213 5213 \begin_layout Standard
5214 5214 The
5215 5215 \family typewriter
5216 5216 %logoff
5217 5217 \family default
5218 5218 and
5219 5219 \family typewriter
5220 5220 %logon
5221 5221 \family default
5222 5222 functions allow you to temporarily stop and resume logging to a file which
5223 5223 had previously been started with
5224 5224 \family typewriter
5225 5225 %logstart
5226 5226 \family default
5227 5227 .
5228 5228 They will fail (with an explanation) if you try to use them before logging
5229 5229 has been started.
5230 5230 \end_layout
5231 5231
5232 5232 \begin_layout Subsection
5233 5233 \begin_inset LatexCommand \label{sub:System-shell-access}
5234 5234
5235 5235 \end_inset
5236 5236
5237 5237 System shell access
5238 5238 \end_layout
5239 5239
5240 5240 \begin_layout Standard
5241 5241 Any input line beginning with a
5242 5242 \family typewriter
5243 5243 !
5244 5244 \family default
5245 5245 character is passed verbatim (minus the
5246 5246 \family typewriter
5247 5247 !
5248 5248 \family default
5249 5249 , of course) to the underlying operating system.
5250 5250 For example, typing
5251 5251 \family typewriter
5252 5252 !ls
5253 5253 \family default
5254 5254 will run
5255 5255 \family typewriter
5256 5256 'ls'
5257 5257 \family default
5258 5258 in the current directory.
5259 5259 \end_layout
5260 5260
5261 5261 \begin_layout Subsubsection
5262 5262 Manual capture of command output
5263 5263 \end_layout
5264 5264
5265 5265 \begin_layout Standard
5266 5266 If the input line begins with
5267 5267 \emph on
5268 5268 two
5269 5269 \emph default
5270 5270 exclamation marks,
5271 5271 \family typewriter
5272 5272 !!
5273 5273 \family default
5274 5274 , the command is executed but its output is captured and returned as a python
5275 5275 list, split on newlines.
5276 5276 Any output sent by the subprocess to standard error is printed separately,
5277 5277 so that the resulting list only captures standard output.
5278 5278 The
5279 5279 \family typewriter
5280 5280 !!
5281 5281 \family default
5282 5282 syntax is a shorthand for the
5283 5283 \family typewriter
5284 5284 %sx
5285 5285 \family default
5286 5286 magic command.
5287 5287 \end_layout
5288 5288
5289 5289 \begin_layout Standard
5290 5290 Finally, the
5291 5291 \family typewriter
5292 5292 %sc
5293 5293 \family default
5294 5294 magic (short for `shell capture') is similar to
5295 5295 \family typewriter
5296 5296 %sx
5297 5297 \family default
5298 5298 , but allowing more fine-grained control of the capture details, and storing
5299 5299 the result directly into a named variable.
5300 5300 \end_layout
5301 5301
5302 5302 \begin_layout Standard
5303 5303 See Sec.\InsetSpace ~
5304 5304
5305 5305 \begin_inset LatexCommand \ref{sec:magic}
5306 5306
5307 5307 \end_inset
5308 5308
5309 5309 for details on the magics
5310 5310 \family typewriter
5311 5311 %sc
5312 5312 \family default
5313 5313 and
5314 5314 \family typewriter
5315 5315 %sx
5316 5316 \family default
5317 5317 , or use IPython's own help (
5318 5318 \family typewriter
5319 5319 sc?
5320 5320 \family default
5321 5321 and
5322 5322 \family typewriter
5323 5323 sx?
5324 5324 \family default
5325 5325 ) for further details.
5326 5326 \end_layout
5327 5327
5328 5328 \begin_layout Standard
5329 5329 IPython also allows you to expand the value of python variables when making
5330 5330 system calls.
5331 5331 Any python variable or expression which you prepend with
5332 5332 \family typewriter
5333 5333 $
5334 5334 \family default
5335 5335 will get expanded before the system call is made.
5336 5336
5337 5337 \end_layout
5338 5338
5339 5339 \begin_layout Standard
5340 5340
5341 5341 \family typewriter
5342 5342 In [1]: pyvar='Hello world'
5343 5343 \newline
5344 5344 In [2]: !echo "A python variable: $pyvar"
5345 5345 \newline
5346 5346 A python
5347 5347 variable: Hello world
5348 5348 \end_layout
5349 5349
5350 5350 \begin_layout Standard
5351 5351 If you want the shell to actually see a literal
5352 5352 \family typewriter
5353 5353 $
5354 5354 \family default
5355 5355 , you need to type it twice:
5356 5356 \end_layout
5357 5357
5358 5358 \begin_layout Standard
5359 5359
5360 5360 \family typewriter
5361 5361 In [3]: !echo "A system variable: $$HOME"
5362 5362 \newline
5363 5363 A system variable: /home/fperez
5364 5364 \end_layout
5365 5365
5366 5366 \begin_layout Standard
5367 5367 You can pass arbitrary expressions, though you'll need to delimit them with
5368 5368
5369 5369 \family typewriter
5370 5370 {}
5371 5371 \family default
5372 5372 if there is ambiguity as to the extent of the expression:
5373 5373 \end_layout
5374 5374
5375 5375 \begin_layout Standard
5376 5376
5377 5377 \family typewriter
5378 5378 In [5]: x=10
5379 5379 \newline
5380 5380 In [6]: y=20
5381 5381 \newline
5382 5382 In [13]: !echo $x+y
5383 5383 \newline
5384 5384 10+y
5385 5385 \newline
5386 5386 In [7]: !echo ${x+y}
5387 5387 \newline
5388 5388 30
5389 5389
5390 5390 \end_layout
5391 5391
5392 5392 \begin_layout Standard
5393 5393 Even object attributes can be expanded:
5394 5394 \end_layout
5395 5395
5396 5396 \begin_layout Standard
5397 5397
5398 5398 \family typewriter
5399 5399 In [12]: !echo $sys.argv
5400 5400 \newline
5401 5401 [/home/fperez/usr/bin/ipython]
5402 5402 \end_layout
5403 5403
5404 5404 \begin_layout Subsection
5405 5405 System command aliases
5406 5406 \end_layout
5407 5407
5408 5408 \begin_layout Standard
5409 5409 The
5410 5410 \family typewriter
5411 5411 %alias
5412 5412 \family default
5413 5413 magic function and the
5414 5414 \family typewriter
5415 5415 alias
5416 5416 \family default
5417 5417 option in the
5418 5418 \family typewriter
5419 5419 ipythonrc
5420 5420 \family default
5421 5421 configuration file allow you to define magic functions which are in fact
5422 5422 system shell commands.
5423 5423 These aliases can have parameters.
5424 5424
5425 5425 \end_layout
5426 5426
5427 5427 \begin_layout Standard
5428 5428 '
5429 5429 \family typewriter
5430 5430 %alias alias_name cmd
5431 5431 \family default
5432 5432 ' defines '
5433 5433 \family typewriter
5434 5434 alias_name
5435 5435 \family default
5436 5436 ' as an alias for '
5437 5437 \family typewriter
5438 5438 cmd
5439 5439 \family default
5440 5440 '
5441 5441 \end_layout
5442 5442
5443 5443 \begin_layout Standard
5444 5444 Then, typing '
5445 5445 \family typewriter
5446 5446 %alias_name params
5447 5447 \family default
5448 5448 ' will execute the system command '
5449 5449 \family typewriter
5450 5450 cmd params
5451 5451 \family default
5452 5452 ' (from your underlying operating system).
5453 5453
5454 5454 \end_layout
5455 5455
5456 5456 \begin_layout Standard
5457 5457 You can also define aliases with parameters using
5458 5458 \family typewriter
5459 5459 %s
5460 5460 \family default
5461 5461 specifiers (one per parameter).
5462 5462 The following example defines the
5463 5463 \family typewriter
5464 5464 %parts
5465 5465 \family default
5466 5466 function as an alias to the command '
5467 5467 \family typewriter
5468 5468 echo first %s second %s
5469 5469 \family default
5470 5470 ' where each
5471 5471 \family typewriter
5472 5472 %s
5473 5473 \family default
5474 5474 will be replaced by a positional parameter to the call to
5475 5475 \family typewriter
5476 5476 %parts:
5477 5477 \end_layout
5478 5478
5479 5479 \begin_layout Standard
5480 5480
5481 5481 \family typewriter
5482 5482 In [1]: alias parts echo first %s second %s
5483 5483 \newline
5484 5484 In [2]: %parts A B
5485 5485 \newline
5486 5486 first A second
5487 5487 B
5488 5488 \newline
5489 5489 In [3]: %parts A
5490 5490 \newline
5491 5491 Incorrect number of arguments: 2 expected.
5492 5492
5493 5493 \newline
5494 5494 parts is an alias to: 'echo first %s second %s'
5495 5495 \end_layout
5496 5496
5497 5497 \begin_layout Standard
5498 5498 If called with no parameters,
5499 5499 \family typewriter
5500 5500 %alias
5501 5501 \family default
5502 5502 prints the table of currently defined aliases.
5503 5503 \end_layout
5504 5504
5505 5505 \begin_layout Standard
5506 5506 The
5507 5507 \family typewriter
5508 5508 %rehash/rehashx
5509 5509 \family default
5510 5510 magics allow you to load your entire
5511 5511 \family typewriter
5512 5512 $PATH
5513 5513 \family default
5514 5514 as ipython aliases.
5515 5515 See their respective docstrings (or sec.\InsetSpace ~
5516 5516
5517 5517 \begin_inset LatexCommand \ref{sec:magic}
5518 5518
5519 5519 \end_inset
5520 5520
5521 5521 for further details).
5522 5522 \end_layout
5523 5523
5524 5524 \begin_layout Subsection
5525 5525 \begin_inset LatexCommand \label{sec:dreload}
5526 5526
5527 5527 \end_inset
5528 5528
5529 5529 Recursive reload
5530 5530 \end_layout
5531 5531
5532 5532 \begin_layout Standard
5533 5533 The
5534 5534 \family typewriter
5535 5535 dreload
5536 5536 \family default
5537 5537 function does a recursive reload of a module: changes made to the module
5538 5538 since you imported will actually be available without having to exit.
5539 5539 \end_layout
5540 5540
5541 5541 \begin_layout Subsection
5542 5542 Verbose and colored exception traceback printouts
5543 5543 \end_layout
5544 5544
5545 5545 \begin_layout Standard
5546 5546 IPython provides the option to see very detailed exception tracebacks, which
5547 5547 can be especially useful when debugging large programs.
5548 5548 You can run any Python file with the
5549 5549 \family typewriter
5550 5550 %run
5551 5551 \family default
5552 5552 function to benefit from these detailed tracebacks.
5553 5553 Furthermore, both normal and verbose tracebacks can be colored (if your
5554 5554 terminal supports it) which makes them much easier to parse visually.
5555 5555 \end_layout
5556 5556
5557 5557 \begin_layout Standard
5558 5558 See the magic
5559 5559 \family typewriter
5560 5560 xmode
5561 5561 \family default
5562 5562 and
5563 5563 \family typewriter
5564 5564 colors
5565 5565 \family default
5566 5566 functions for details (just type
5567 5567 \family typewriter
5568 5568 %magic
5569 5569 \family default
5570 5570 ).
5571 5571 \end_layout
5572 5572
5573 5573 \begin_layout Standard
5574 5574 These features are basically a terminal version of Ka-Ping Yee's
5575 5575 \family typewriter
5576 5576 cgitb
5577 5577 \family default
5578 5578 module, now part of the standard Python library.
5579 5579 \end_layout
5580 5580
5581 5581 \begin_layout Subsection
5582 5582 \begin_inset LatexCommand \label{sec:cache_input}
5583 5583
5584 5584 \end_inset
5585 5585
5586 5586 Input caching system
5587 5587 \end_layout
5588 5588
5589 5589 \begin_layout Standard
5590 5590 IPython offers numbered prompts (In/Out) with input and output caching.
5591 5591 All input is saved and can be retrieved as variables (besides the usual
5592 5592 arrow key recall).
5593 5593 \end_layout
5594 5594
5595 5595 \begin_layout Standard
5596 5596 The following GLOBAL variables always exist (so don't overwrite them!):
5597 5597
5598 5598 \family typewriter
5599 5599 _i
5600 5600 \family default
5601 5601 : stores previous input.
5602 5602
5603 5603 \family typewriter
5604 5604 _ii
5605 5605 \family default
5606 5606 : next previous.
5607 5607
5608 5608 \family typewriter
5609 5609 _iii
5610 5610 \family default
5611 5611 : next-next previous.
5612 5612
5613 5613 \family typewriter
5614 5614 _ih
5615 5615 \family default
5616 5616 : a list of all input
5617 5617 \family typewriter
5618 5618 _ih[n]
5619 5619 \family default
5620 5620 is the input from line
5621 5621 \family typewriter
5622 5622 n
5623 5623 \family default
5624 5624 and this list is aliased to the global variable
5625 5625 \family typewriter
5626 5626 In
5627 5627 \family default
5628 5628 .
5629 5629 If you overwrite
5630 5630 \family typewriter
5631 5631 In
5632 5632 \family default
5633 5633 with a variable of your own, you can remake the assignment to the internal
5634 5634 list with a simple
5635 5635 \family typewriter
5636 5636 'In=_ih'
5637 5637 \family default
5638 5638 .
5639 5639 \end_layout
5640 5640
5641 5641 \begin_layout Standard
5642 5642 Additionally, global variables named
5643 5643 \family typewriter
5644 5644 _i<n>
5645 5645 \family default
5646 5646 are dynamically created (
5647 5647 \family typewriter
5648 5648 <n>
5649 5649 \family default
5650 5650 being the prompt counter), such that
5651 5651 \newline
5652 5652
5653 5653 \family typewriter
5654 5654 _i<n> == _ih[<n>] == In[<n>].
5655 5655 \end_layout
5656 5656
5657 5657 \begin_layout Standard
5658 5658 For example, what you typed at prompt 14 is available as
5659 5659 \family typewriter
5660 5660 _i14,
5661 5661 \family default
5662 5662
5663 5663 \family typewriter
5664 5664 _ih[14]
5665 5665 \family default
5666 5666 and
5667 5667 \family typewriter
5668 5668 In[14]
5669 5669 \family default
5670 5670 .
5671 5671 \end_layout
5672 5672
5673 5673 \begin_layout Standard
5674 5674 This allows you to easily cut and paste multi line interactive prompts by
5675 5675 printing them out: they print like a clean string, without prompt characters.
5676 5676 You can also manipulate them like regular variables (they are strings),
5677 5677 modify or exec them (typing
5678 5678 \family typewriter
5679 5679 'exec _i9'
5680 5680 \family default
5681 5681 will re-execute the contents of input prompt 9, '
5682 5682 \family typewriter
5683 5683 exec In[9:14]+In[18]
5684 5684 \family default
5685 5685 ' will re-execute lines 9 through 13 and line 18).
5686 5686 \end_layout
5687 5687
5688 5688 \begin_layout Standard
5689 5689 You can also re-execute multiple lines of input easily by using the magic
5690 5690
5691 5691 \family typewriter
5692 5692 %macro
5693 5693 \family default
5694 5694 function (which automates the process and allows re-execution without having
5695 5695 to type '
5696 5696 \family typewriter
5697 5697 exec
5698 5698 \family default
5699 5699 ' every time).
5700 5700 The macro system also allows you to re-execute previous lines which include
5701 5701 magic function calls (which require special processing).
5702 5702 Type
5703 5703 \family typewriter
5704 5704 %macro?
5705 5705 \family default
5706 5706 or see sec.
5707 5707
5708 5708 \begin_inset LatexCommand \ref{sec:magic}
5709 5709
5710 5710 \end_inset
5711 5711
5712 5712 for more details on the macro system.
5713 5713 \end_layout
5714 5714
5715 5715 \begin_layout Standard
5716 5716 A history function
5717 5717 \family typewriter
5718 5718 %hist
5719 5719 \family default
5720 5720 allows you to see any part of your input history by printing a range of
5721 5721 the
5722 5722 \family typewriter
5723 5723 _i
5724 5724 \family default
5725 5725 variables.
5726 5726 \end_layout
5727 5727
5728 5728 \begin_layout Subsection
5729 5729 \begin_inset LatexCommand \label{sec:cache_output}
5730 5730
5731 5731 \end_inset
5732 5732
5733 5733 Output caching system
5734 5734 \end_layout
5735 5735
5736 5736 \begin_layout Standard
5737 5737 For output that is returned from actions, a system similar to the input
5738 5738 cache exists but using
5739 5739 \family typewriter
5740 5740 _
5741 5741 \family default
5742 5742 instead of
5743 5743 \family typewriter
5744 5744 _i
5745 5745 \family default
5746 5746 .
5747 5747 Only actions that produce a result (NOT assignments, for example) are cached.
5748 5748 If you are familiar with Mathematica, IPython's
5749 5749 \family typewriter
5750 5750 _
5751 5751 \family default
5752 5752 variables behave exactly like Mathematica's
5753 5753 \family typewriter
5754 5754 %
5755 5755 \family default
5756 5756 variables.
5757 5757 \end_layout
5758 5758
5759 5759 \begin_layout Standard
5760 5760 The following GLOBAL variables always exist (so don't overwrite them!):
5761 5761
5762 5762 \end_layout
5763 5763
5764 5764 \begin_layout List
5765 5765 \labelwidthstring 00.00.0000
5766 5766
5767 5767 \family typewriter
5768 5768 \series bold
5769 5769 _
5770 5770 \family default
5771 5771 \series default
5772 5772 (a
5773 5773 \emph on
5774 5774 single
5775 5775 \emph default
5776 5776 underscore) : stores previous output, like Python's default interpreter.
5777 5777 \end_layout
5778 5778
5779 5779 \begin_layout List
5780 5780 \labelwidthstring 00.00.0000
5781 5781
5782 5782 \family typewriter
5783 5783 \series bold
5784 5784 __
5785 5785 \family default
5786 5786 \series default
5787 5787 (two underscores): next previous.
5788 5788 \end_layout
5789 5789
5790 5790 \begin_layout List
5791 5791 \labelwidthstring 00.00.0000
5792 5792
5793 5793 \family typewriter
5794 5794 \series bold
5795 5795 ___
5796 5796 \family default
5797 5797 \series default
5798 5798 (three underscores): next-next previous.
5799 5799 \end_layout
5800 5800
5801 5801 \begin_layout Standard
5802 5802 Additionally, global variables named
5803 5803 \family typewriter
5804 5804 _<n>
5805 5805 \family default
5806 5806 are dynamically created (
5807 5807 \family typewriter
5808 5808 <n>
5809 5809 \family default
5810 5810 being the prompt counter), such that the result of output
5811 5811 \family typewriter
5812 5812 <n>
5813 5813 \family default
5814 5814 is always available as
5815 5815 \family typewriter
5816 5816 _<n>
5817 5817 \family default
5818 5818 (don't use the angle brackets, just the number, e.g.
5819 5819
5820 5820 \family typewriter
5821 5821 _21
5822 5822 \family default
5823 5823 ).
5824 5824 \end_layout
5825 5825
5826 5826 \begin_layout Standard
5827 5827 These global variables are all stored in a global dictionary (not a list,
5828 5828 since it only has entries for lines which returned a result) available
5829 5829 under the names
5830 5830 \family typewriter
5831 5831 _oh
5832 5832 \family default
5833 5833 and
5834 5834 \family typewriter
5835 5835 Out
5836 5836 \family default
5837 5837 (similar to
5838 5838 \family typewriter
5839 5839 _ih
5840 5840 \family default
5841 5841 and
5842 5842 \family typewriter
5843 5843 In
5844 5844 \family default
5845 5845 ).
5846 5846 So the output from line 12 can be obtained as
5847 5847 \family typewriter
5848 5848 _12
5849 5849 \family default
5850 5850 ,
5851 5851 \family typewriter
5852 5852 Out[12]
5853 5853 \family default
5854 5854 or
5855 5855 \family typewriter
5856 5856 _oh[12]
5857 5857 \family default
5858 5858 .
5859 5859 If you accidentally overwrite the
5860 5860 \family typewriter
5861 5861 Out
5862 5862 \family default
5863 5863 variable you can recover it by typing
5864 5864 \family typewriter
5865 5865 'Out=_oh
5866 5866 \family default
5867 5867 ' at the prompt.
5868 5868 \end_layout
5869 5869
5870 5870 \begin_layout Standard
5871 5871 This system obviously can potentially put heavy memory demands on your system,
5872 5872 since it prevents Python's garbage collector from removing any previously
5873 5873 computed results.
5874 5874 You can control how many results are kept in memory with the option (at
5875 5875 the command line or in your
5876 5876 \family typewriter
5877 5877 ipythonrc
5878 5878 \family default
5879 5879 file)
5880 5880 \family typewriter
5881 5881 cache_size
5882 5882 \family default
5883 5883 .
5884 5884 If you set it to 0, the whole system is completely disabled and the prompts
5885 5885 revert to the classic
5886 5886 \family typewriter
5887 5887 '>>>'
5888 5888 \family default
5889 5889 of normal Python.
5890 5890 \end_layout
5891 5891
5892 5892 \begin_layout Subsection
5893 5893 Directory history
5894 5894 \end_layout
5895 5895
5896 5896 \begin_layout Standard
5897 5897 Your history of visited directories is kept in the global list
5898 5898 \family typewriter
5899 5899 _dh
5900 5900 \family default
5901 5901 , and the magic
5902 5902 \family typewriter
5903 5903 %cd
5904 5904 \family default
5905 5905 command can be used to go to any entry in that list.
5906 5906 The
5907 5907 \family typewriter
5908 5908 %dhist
5909 5909 \family default
5910 5910 command allows you to view this history.
5911 5911 \end_layout
5912 5912
5913 5913 \begin_layout Subsection
5914 5914 Automatic parentheses and quotes
5915 5915 \end_layout
5916 5916
5917 5917 \begin_layout Standard
5918 5918 These features were adapted from Nathan Gray's LazyPython.
5919 5919 They are meant to allow less typing for common situations.
5920 5920 \end_layout
5921 5921
5922 5922 \begin_layout Subsubsection
5923 5923 Automatic parentheses
5924 5924 \end_layout
5925 5925
5926 5926 \begin_layout Standard
5927 5927 Callable objects (i.e.
5928 5928 functions, methods, etc) can be invoked like this (notice the commas between
5929 5929 the arguments):
5930 5930 \end_layout
5931 5931
5932 5932 \begin_layout Standard
5933 5933
5934 5934 \family typewriter
5935 5935 >>> callable_ob arg1, arg2, arg3
5936 5936 \end_layout
5937 5937
5938 5938 \begin_layout Standard
5939 5939 and the input will be translated to this:
5940 5940 \end_layout
5941 5941
5942 5942 \begin_layout Standard
5943 5943
5944 5944 \family typewriter
5945 5945 --> callable_ob(arg1, arg2, arg3)
5946 5946 \end_layout
5947 5947
5948 5948 \begin_layout Standard
5949 5949 You can force automatic parentheses by using '/' as the first character
5950 5950 of a line.
5951 5951 For example:
5952 5952 \end_layout
5953 5953
5954 5954 \begin_layout Standard
5955 5955
5956 5956 \family typewriter
5957 5957 >>> /globals # becomes 'globals()'
5958 5958 \end_layout
5959 5959
5960 5960 \begin_layout Standard
5961 5961 Note that the '/' MUST be the first character on the line! This won't work:
5962 5962
5963 5963 \end_layout
5964 5964
5965 5965 \begin_layout Standard
5966 5966
5967 5967 \family typewriter
5968 5968 >>> print /globals # syntax error
5969 5969 \end_layout
5970 5970
5971 5971 \begin_layout Standard
5972 5972 In most cases the automatic algorithm should work, so you should rarely
5973 5973 need to explicitly invoke /.
5974 5974 One notable exception is if you are trying to call a function with a list
5975 5975 of tuples as arguments (the parenthesis will confuse IPython):
5976 5976 \end_layout
5977 5977
5978 5978 \begin_layout Standard
5979 5979
5980 5980 \family typewriter
5981 5981 In [1]: zip (1,2,3),(4,5,6) # won't work
5982 5982 \end_layout
5983 5983
5984 5984 \begin_layout Standard
5985 5985 but this will work:
5986 5986 \end_layout
5987 5987
5988 5988 \begin_layout Standard
5989 5989
5990 5990 \family typewriter
5991 5991 In [2]: /zip (1,2,3),(4,5,6)
5992 5992 \newline
5993 5993 ------> zip ((1,2,3),(4,5,6))
5994 5994 \newline
5995 5995 Out[2]= [(1, 4),
5996 5996 (2, 5), (3, 6)]
5997 5997 \end_layout
5998 5998
5999 5999 \begin_layout Standard
6000 6000 IPython tells you that it has altered your command line by displaying the
6001 6001 new command line preceded by
6002 6002 \family typewriter
6003 6003 -->
6004 6004 \family default
6005 6005 .
6006 6006 e.g.:
6007 6007 \end_layout
6008 6008
6009 6009 \begin_layout Standard
6010 6010
6011 6011 \family typewriter
6012 6012 In [18]: callable list
6013 6013 \newline
6014 6014 -------> callable (list)
6015 6015 \end_layout
6016 6016
6017 6017 \begin_layout Subsubsection
6018 6018 Automatic quoting
6019 6019 \end_layout
6020 6020
6021 6021 \begin_layout Standard
6022 6022 You can force automatic quoting of a function's arguments by using
6023 6023 \family typewriter
6024 6024 `,'
6025 6025 \family default
6026 6026 or
6027 6027 \family typewriter
6028 6028 `;'
6029 6029 \family default
6030 6030 as the first character of a line.
6031 6031 For example:
6032 6032 \end_layout
6033 6033
6034 6034 \begin_layout Standard
6035 6035
6036 6036 \family typewriter
6037 6037 >>> ,my_function /home/me # becomes my_function("/home/me")
6038 6038 \end_layout
6039 6039
6040 6040 \begin_layout Standard
6041 6041 If you use
6042 6042 \family typewriter
6043 6043 `;'
6044 6044 \family default
6045 6045 instead, the whole argument is quoted as a single string (while
6046 6046 \family typewriter
6047 6047 `,'
6048 6048 \family default
6049 6049 splits on whitespace):
6050 6050 \end_layout
6051 6051
6052 6052 \begin_layout Standard
6053 6053
6054 6054 \family typewriter
6055 6055 >>> ,my_function a b c # becomes my_function("a","b","c")
6056 6056 \end_layout
6057 6057
6058 6058 \begin_layout Standard
6059 6059
6060 6060 \family typewriter
6061 6061 >>> ;my_function a b c # becomes my_function("a b c")
6062 6062 \end_layout
6063 6063
6064 6064 \begin_layout Standard
6065 6065 Note that the `
6066 6066 \family typewriter
6067 6067 ,
6068 6068 \family default
6069 6069 ' or `
6070 6070 \family typewriter
6071 6071 ;
6072 6072 \family default
6073 6073 ' MUST be the first character on the line! This won't work:
6074 6074 \end_layout
6075 6075
6076 6076 \begin_layout Standard
6077 6077
6078 6078 \family typewriter
6079 6079 >>> x = ,my_function /home/me # syntax error
6080 6080 \end_layout
6081 6081
6082 6082 \begin_layout Section
6083 6083 \begin_inset LatexCommand \label{sec:customization}
6084 6084
6085 6085 \end_inset
6086 6086
6087 6087 Customization
6088 6088 \end_layout
6089 6089
6090 6090 \begin_layout Standard
6091 6091 As we've already mentioned, IPython reads a configuration file which can
6092 6092 be specified at the command line (
6093 6093 \family typewriter
6094 6094 -rcfile
6095 6095 \family default
6096 6096 ) or which by default is assumed to be called
6097 6097 \family typewriter
6098 6098 ipythonrc
6099 6099 \family default
6100 6100 .
6101 6101 Such a file is looked for in the current directory where IPython is started
6102 6102 and then in your
6103 6103 \family typewriter
6104 6104 IPYTHONDIR
6105 6105 \family default
6106 6106 , which allows you to have local configuration files for specific projects.
6107 6107 In this section we will call these types of configuration files simply
6108 6108 rcfiles (short for resource configuration file).
6109 6109 \end_layout
6110 6110
6111 6111 \begin_layout Standard
6112 6112 The syntax of an rcfile is one of key-value pairs separated by whitespace,
6113 6113 one per line.
6114 6114 Lines beginning with a
6115 6115 \family typewriter
6116 6116 #
6117 6117 \family default
6118 6118 are ignored as comments, but comments can
6119 6119 \series bold
6120 6120 not
6121 6121 \series default
6122 6122 be put on lines with data (the parser is fairly primitive).
6123 6123 Note that these are not python files, and this is deliberate, because it
6124 6124 allows us to do some things which would be quite tricky to implement if
6125 6125 they were normal python files.
6126 6126 \end_layout
6127 6127
6128 6128 \begin_layout Standard
6129 6129 First, an rcfile can contain permanent default values for almost all command
6130 6130 line options (except things like
6131 6131 \family typewriter
6132 6132 -help
6133 6133 \family default
6134 6134 or
6135 6135 \family typewriter
6136 6136 -Version
6137 6137 \family default
6138 6138 ).
6139 6139 Sec\InsetSpace ~
6140 6140
6141 6141 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
6142 6142
6143 6143 \end_inset
6144 6144
6145 6145 contains a description of all command-line options.
6146 6146 However, values you explicitly specify at the command line override the
6147 6147 values defined in the rcfile.
6148 6148 \end_layout
6149 6149
6150 6150 \begin_layout Standard
6151 6151 Besides command line option values, the rcfile can specify values for certain
6152 6152 extra special options which are not available at the command line.
6153 6153 These options are briefly described below.
6154 6154
6155 6155 \end_layout
6156 6156
6157 6157 \begin_layout Standard
6158 6158 Each of these options may appear as many times as you need it in the file.
6159 6159 \end_layout
6160 6160
6161 6161 \begin_layout List
6162 6162 \labelwidthstring 00.00.0000
6163 6163
6164 6164 \family typewriter
6165 6165 \series bold
6166 6166 include\InsetSpace ~
6167 6167 <file1>\InsetSpace ~
6168 6168 <file2>\InsetSpace ~
6169 6169 ...
6170 6170 \family default
6171 6171 \series default
6172 6172 : you can name
6173 6173 \emph on
6174 6174 other
6175 6175 \emph default
6176 6176 rcfiles you want to recursively load up to 15 levels (don't use the
6177 6177 \family typewriter
6178 6178 <>
6179 6179 \family default
6180 6180 brackets in your names!).
6181 6181 This feature allows you to define a 'base' rcfile with general options
6182 6182 and special-purpose files which can be loaded only when needed with particular
6183 6183 configuration options.
6184 6184 To make this more convenient, IPython accepts the
6185 6185 \family typewriter
6186 6186 -profile <name>
6187 6187 \family default
6188 6188 option (abbreviates to
6189 6189 \family typewriter
6190 6190 -p <name
6191 6191 \family default
6192 6192 >)
6193 6193 \family typewriter
6194 6194 which
6195 6195 \family default
6196 6196 tells it to look for an rcfile named
6197 6197 \family typewriter
6198 6198 ipythonrc-<name>
6199 6199 \family default
6200 6200 .
6201 6201
6202 6202 \end_layout
6203 6203
6204 6204 \begin_layout List
6205 6205 \labelwidthstring 00.00.0000
6206 6206
6207 6207 \family typewriter
6208 6208 \series bold
6209 6209 import_mod\InsetSpace ~
6210 6210 <mod1>\InsetSpace ~
6211 6211 <mod2>\InsetSpace ~
6212 6212 ...
6213 6213 \family default
6214 6214 \series default
6215 6215 : import modules with '
6216 6216 \family typewriter
6217 6217 import
6218 6218 \family default
6219 6219
6220 6220 \family typewriter
6221 6221 <mod1>,<mod2>,...
6222 6222 \family default
6223 6223 '
6224 6224 \end_layout
6225 6225
6226 6226 \begin_layout List
6227 6227 \labelwidthstring 00.00.0000
6228 6228
6229 6229 \family typewriter
6230 6230 \series bold
6231 6231 import_some\InsetSpace ~
6232 6232 <mod>\InsetSpace ~
6233 6233 <f1>\InsetSpace ~
6234 6234 <f2>\InsetSpace ~
6235 6235 ...
6236 6236 \family default
6237 6237 \series default
6238 6238 : import functions with '
6239 6239 \family typewriter
6240 6240 from <mod> import
6241 6241 \family default
6242 6242
6243 6243 \family typewriter
6244 6244 <f1>,<f2>,...
6245 6245 \family default
6246 6246 '
6247 6247 \end_layout
6248 6248
6249 6249 \begin_layout List
6250 6250 \labelwidthstring 00.00.0000
6251 6251
6252 6252 \family typewriter
6253 6253 \series bold
6254 6254 import_all\InsetSpace ~
6255 6255 <mod1>\InsetSpace ~
6256 6256 <mod2>\InsetSpace ~
6257 6257 ...
6258 6258 \family default
6259 6259 \series default
6260 6260 : for each module listed import functions with '
6261 6261 \family typewriter
6262 6262 from <mod> import *
6263 6263 \family default
6264 6264 '
6265 6265 \end_layout
6266 6266
6267 6267 \begin_layout List
6268 6268 \labelwidthstring 00.00.0000
6269 6269
6270 6270 \family typewriter
6271 6271 \series bold
6272 6272 execute\InsetSpace ~
6273 6273 <python\InsetSpace ~
6274 6274 code>
6275 6275 \family default
6276 6276 \series default
6277 6277 : give any single-line python code to be executed.
6278 6278 \end_layout
6279 6279
6280 6280 \begin_layout List
6281 6281 \labelwidthstring 00.00.0000
6282 6282
6283 6283 \family typewriter
6284 6284 \series bold
6285 6285 execfile\InsetSpace ~
6286 6286 <filename>
6287 6287 \family default
6288 6288 \series default
6289 6289 : execute the python file given with an '
6290 6290 \family typewriter
6291 6291 execfile(filename)
6292 6292 \family default
6293 6293 ' command.
6294 6294 Username expansion is performed on the given names.
6295 6295 So if you need any amount of extra fancy customization that won't fit in
6296 6296 any of the above 'canned' options, you can just put it in a separate python
6297 6297 file and execute it.
6298 6298 \end_layout
6299 6299
6300 6300 \begin_layout List
6301 6301 \labelwidthstring 00.00.0000
6302 6302
6303 6303 \family typewriter
6304 6304 \series bold
6305 6305 alias\InsetSpace ~
6306 6306 <alias_def>
6307 6307 \family default
6308 6308 \series default
6309 6309 : this is equivalent to calling '
6310 6310 \family typewriter
6311 6311 %alias\InsetSpace ~
6312 6312 <alias_def>
6313 6313 \family default
6314 6314 ' at the IPython command line.
6315 6315 This way, from within IPython you can do common system tasks without having
6316 6316 to exit it or use the
6317 6317 \family typewriter
6318 6318 !
6319 6319 \family default
6320 6320 escape.
6321 6321 IPython isn't meant to be a shell replacement, but it is often very useful
6322 6322 to be able to do things with files while testing code.
6323 6323 This gives you the flexibility to have within IPython any aliases you may
6324 6324 be used to under your normal system shell.
6325 6325 \end_layout
6326 6326
6327 6327 \begin_layout Subsection
6328 6328 \begin_inset LatexCommand \label{sec:ipytonrc-sample}
6329 6329
6330 6330 \end_inset
6331 6331
6332 6332 Sample
6333 6333 \family typewriter
6334 6334 ipythonrc
6335 6335 \family default
6336 6336 file
6337 6337 \end_layout
6338 6338
6339 6339 \begin_layout Standard
6340 6340 The default rcfile, called
6341 6341 \family typewriter
6342 6342 ipythonrc
6343 6343 \family default
6344 6344 and supplied in your
6345 6345 \family typewriter
6346 6346 IPYTHONDIR
6347 6347 \family default
6348 6348 directory contains lots of comments on all of these options.
6349 6349 We reproduce it here for reference:
6350 6350 \end_layout
6351 6351
6352 6352 \begin_layout Standard
6353 6353 \begin_inset ERT
6354 6354 status open
6355 6355
6356 6356 \begin_layout Standard
6357 6357
6358 6358
6359 6359 \backslash
6360 6360 codelist{../IPython/UserConfig/ipythonrc}
6361 6361 \end_layout
6362 6362
6363 6363 \end_inset
6364 6364
6365 6365
6366 6366 \end_layout
6367 6367
6368 6368 \begin_layout Subsection
6369 6369 \begin_inset LatexCommand \label{sec:prompts}
6370 6370
6371 6371 \end_inset
6372 6372
6373 6373 Fine-tuning your prompt
6374 6374 \end_layout
6375 6375
6376 6376 \begin_layout Standard
6377 6377 IPython's prompts can be customized using a syntax similar to that of the
6378 6378
6379 6379 \family typewriter
6380 6380 bash
6381 6381 \family default
6382 6382 shell.
6383 6383 Many of
6384 6384 \family typewriter
6385 6385 bash
6386 6386 \family default
6387 6387 's escapes are supported, as well as a few additional ones.
6388 6388 We list them below:
6389 6389 \end_layout
6390 6390
6391 6391 \begin_layout Description
6392 6392
6393 6393 \backslash
6394 6394 # the prompt/history count number.
6395 6395 This escape is automatically wrapped in the coloring codes for the currently
6396 6396 active color scheme.
6397 6397 \end_layout
6398 6398
6399 6399 \begin_layout Description
6400 6400
6401 6401 \backslash
6402 6402 N the 'naked' prompt/history count number: this is just the number itself,
6403 6403 without any coloring applied to it.
6404 6404 This lets you produce numbered prompts with your own colors.
6405 6405 \end_layout
6406 6406
6407 6407 \begin_layout Description
6408 6408
6409 6409 \backslash
6410 6410 D the prompt/history count, with the actual digits replaced by dots.
6411 6411 Used mainly in continuation prompts (prompt_in2)
6412 6412 \end_layout
6413 6413
6414 6414 \begin_layout Description
6415 6415
6416 6416 \backslash
6417 6417 w the current working directory
6418 6418 \end_layout
6419 6419
6420 6420 \begin_layout Description
6421 6421
6422 6422 \backslash
6423 6423 W the basename of current working directory
6424 6424 \end_layout
6425 6425
6426 6426 \begin_layout Description
6427 6427
6428 6428 \backslash
6429 6429 X
6430 6430 \emph on
6431 6431 n
6432 6432 \emph default
6433 6433 where
6434 6434 \begin_inset Formula $n=0\ldots5.$
6435 6435 \end_inset
6436 6436
6437 6437 The current working directory, with
6438 6438 \family typewriter
6439 6439 $HOME
6440 6440 \family default
6441 6441 replaced by
6442 6442 \family typewriter
6443 6443 ~
6444 6444 \family default
6445 6445 , and filtered out to contain only
6446 6446 \begin_inset Formula $n$
6447 6447 \end_inset
6448 6448
6449 6449 path elements
6450 6450 \end_layout
6451 6451
6452 6452 \begin_layout Description
6453 6453
6454 6454 \backslash
6455 6455 Y
6456 6456 \emph on
6457 6457 n
6458 6458 \emph default
6459 6459 Similar to
6460 6460 \backslash
6461 6461 X
6462 6462 \emph on
6463 6463 n
6464 6464 \emph default
6465 6465 , but with the
6466 6466 \begin_inset Formula $n+1$
6467 6467 \end_inset
6468 6468
6469 6469 element included if it is
6470 6470 \family typewriter
6471 6471 ~
6472 6472 \family default
6473 6473 (this is similar to the behavior of the %c
6474 6474 \emph on
6475 6475 n
6476 6476 \emph default
6477 6477 escapes in
6478 6478 \family typewriter
6479 6479 tcsh
6480 6480 \family default
6481 6481 )
6482 6482 \end_layout
6483 6483
6484 6484 \begin_layout Description
6485 6485
6486 6486 \backslash
6487 6487 u the username of the current user
6488 6488 \end_layout
6489 6489
6490 6490 \begin_layout Description
6491 6491
6492 6492 \backslash
6493 6493 $ if the effective UID is 0, a #, otherwise a $
6494 6494 \end_layout
6495 6495
6496 6496 \begin_layout Description
6497 6497
6498 6498 \backslash
6499 6499 h the hostname up to the first `.'
6500 6500 \end_layout
6501 6501
6502 6502 \begin_layout Description
6503 6503
6504 6504 \backslash
6505 6505 H the hostname
6506 6506 \end_layout
6507 6507
6508 6508 \begin_layout Description
6509 6509
6510 6510 \backslash
6511 6511 n a newline
6512 6512 \end_layout
6513 6513
6514 6514 \begin_layout Description
6515 6515
6516 6516 \backslash
6517 6517 r a carriage return
6518 6518 \end_layout
6519 6519
6520 6520 \begin_layout Description
6521 6521
6522 6522 \backslash
6523 6523 v IPython version string
6524 6524 \end_layout
6525 6525
6526 6526 \begin_layout Standard
6527 6527 In addition to these, ANSI color escapes can be insterted into the prompts,
6528 6528 as
6529 6529 \family typewriter
6530 6530
6531 6531 \backslash
6532 6532 C_
6533 6533 \emph on
6534 6534 ColorName
6535 6535 \family default
6536 6536 \emph default
6537 6537 .
6538 6538 The list of valid color names is: Black, Blue, Brown, Cyan, DarkGray, Green,
6539 6539 LightBlue, LightCyan, LightGray, LightGreen, LightPurple, LightRed, NoColor,
6540 6540 Normal, Purple, Red, White, Yellow.
6541 6541 \end_layout
6542 6542
6543 6543 \begin_layout Standard
6544 6544 Finally, IPython supports the evaluation of arbitrary expressions in your
6545 6545 prompt string.
6546 6546 The prompt strings are evaluated through the syntax of PEP 215, but basically
6547 6547 you can use
6548 6548 \family typewriter
6549 6549 $x.y
6550 6550 \family default
6551 6551 to expand the value of
6552 6552 \family typewriter
6553 6553 x.y
6554 6554 \family default
6555 6555 , and for more complicated expressions you can use braces:
6556 6556 \family typewriter
6557 6557 ${foo()+x}
6558 6558 \family default
6559 6559 will call function
6560 6560 \family typewriter
6561 6561 foo
6562 6562 \family default
6563 6563 and add to it the value of
6564 6564 \family typewriter
6565 6565 x
6566 6566 \family default
6567 6567 , before putting the result into your prompt.
6568 6568 For example, using
6569 6569 \newline
6570 6570
6571 6571 \family typewriter
6572 6572 prompt_in1 '${commands.getoutput("uptime")}
6573 6573 \backslash
6574 6574 nIn [
6575 6575 \backslash
6576 6576 #]: '
6577 6577 \newline
6578 6578
6579 6579 \family default
6580 6580 will print the result of the uptime command on each prompt (assuming the
6581 6581
6582 6582 \family typewriter
6583 6583 commands
6584 6584 \family default
6585 6585 module has been imported in your
6586 6586 \family typewriter
6587 6587 ipythonrc
6588 6588 \family default
6589 6589 file).
6590 6590 \end_layout
6591 6591
6592 6592 \begin_layout Subsubsection
6593 6593 Prompt examples
6594 6594 \end_layout
6595 6595
6596 6596 \begin_layout Standard
6597 6597 The following options in an ipythonrc file will give you IPython's default
6598 6598 prompts:
6599 6599 \end_layout
6600 6600
6601 6601 \begin_layout Standard
6602 6602
6603 6603 \family typewriter
6604 6604 prompt_in1 'In [
6605 6605 \backslash
6606 6606 #]:'
6607 6607 \newline
6608 6608 prompt_in2 '\InsetSpace ~
6609 6609 \InsetSpace ~
6610 6610 \InsetSpace ~
6611 6611 .
6612 6612 \backslash
6613 6613 D.:'
6614 6614 \newline
6615 6615 prompt_out 'Out[
6616 6616 \backslash
6617 6617 #]:'
6618 6618 \end_layout
6619 6619
6620 6620 \begin_layout Standard
6621 6621 which look like this:
6622 6622 \end_layout
6623 6623
6624 6624 \begin_layout Standard
6625 6625
6626 6626 \family typewriter
6627 6627 In [1]: 1+2
6628 6628 \newline
6629 6629 Out[1]: 3
6630 6630 \end_layout
6631 6631
6632 6632 \begin_layout Standard
6633 6633
6634 6634 \family typewriter
6635 6635 In [2]: for i in (1,2,3):
6636 6636 \newline
6637 6637
6638 6638 \begin_inset ERT
6639 6639 status collapsed
6640 6640
6641 6641 \begin_layout Standard
6642 6642
6643 6643
6644 6644 \backslash
6645 6645 hspace*{0mm}
6646 6646 \end_layout
6647 6647
6648 6648 \end_inset
6649 6649
6650 6650 \InsetSpace ~
6651 6651 \InsetSpace ~
6652 6652 \InsetSpace ~
6653 6653 ...: \InsetSpace ~
6654 6654 \InsetSpace ~
6655 6655 \InsetSpace ~
6656 6656 \InsetSpace ~
6657 6657 print i,
6658 6658 \newline
6659 6659
6660 6660 \begin_inset ERT
6661 6661 status collapsed
6662 6662
6663 6663 \begin_layout Standard
6664 6664
6665 6665
6666 6666 \backslash
6667 6667 hspace*{0mm}
6668 6668 \end_layout
6669 6669
6670 6670 \end_inset
6671 6671
6672 6672 \InsetSpace ~
6673 6673 \InsetSpace ~
6674 6674 \InsetSpace ~
6675 6675 ...:
6676 6676 \newline
6677 6677 1 2 3
6678 6678 \end_layout
6679 6679
6680 6680 \begin_layout Standard
6681 6681 These will give you a very colorful prompt with path information:
6682 6682 \end_layout
6683 6683
6684 6684 \begin_layout Standard
6685 6685
6686 6686 \family typewriter
6687 6687 #prompt_in1 '
6688 6688 \backslash
6689 6689 C_Red
6690 6690 \backslash
6691 6691 u
6692 6692 \backslash
6693 6693 C_Blue[
6694 6694 \backslash
6695 6695 C_Cyan
6696 6696 \backslash
6697 6697 Y1
6698 6698 \backslash
6699 6699 C_Blue]
6700 6700 \backslash
6701 6701 C_LightGreen
6702 6702 \backslash
6703 6703 #>'
6704 6704 \newline
6705 6705 prompt_in2 ' ..
6706 6706 \backslash
6707 6707 D>'
6708 6708 \newline
6709 6709 prompt_out '<
6710 6710 \backslash
6711 6711 #>'
6712 6712 \end_layout
6713 6713
6714 6714 \begin_layout Standard
6715 6715 which look like this:
6716 6716 \end_layout
6717 6717
6718 6718 \begin_layout Standard
6719 6719
6720 6720 \family typewriter
6721 6721 \color red
6722 6722 fperez
6723 6723 \color blue
6724 6724 [
6725 6725 \color cyan
6726 6726 ~/ipython
6727 6727 \color blue
6728 6728 ]
6729 6729 \color green
6730 6730 1>
6731 6731 \color none
6732 6732 1+2
6733 6733 \newline
6734 6734
6735 6735 \begin_inset ERT
6736 6736 status collapsed
6737 6737
6738 6738 \begin_layout Standard
6739 6739
6740 6740
6741 6741 \backslash
6742 6742 hspace*{0mm}
6743 6743 \end_layout
6744 6744
6745 6745 \end_inset
6746 6746
6747 6747 \InsetSpace ~
6748 6748 \InsetSpace ~
6749 6749 \InsetSpace ~
6750 6750 \InsetSpace ~
6751 6751 \InsetSpace ~
6752 6752 \InsetSpace ~
6753 6753 \InsetSpace ~
6754 6754 \InsetSpace ~
6755 6755 \InsetSpace ~
6756 6756 \InsetSpace ~
6757 6757 \InsetSpace ~
6758 6758 \InsetSpace ~
6759 6759 \InsetSpace ~
6760 6760 \InsetSpace ~
6761 6761 \InsetSpace ~
6762 6762 \InsetSpace ~
6763 6763
6764 6764 \color red
6765 6765 <1>
6766 6766 \color none
6767 6767 3
6768 6768 \newline
6769 6769
6770 6770 \color red
6771 6771 fperez
6772 6772 \color blue
6773 6773 [
6774 6774 \color cyan
6775 6775 ~/ipython
6776 6776 \color blue
6777 6777 ]
6778 6778 \color green
6779 6779 2>
6780 6780 \color none
6781 6781 for i in (1,2,3):
6782 6782 \newline
6783 6783
6784 6784 \begin_inset ERT
6785 6785 status collapsed
6786 6786
6787 6787 \begin_layout Standard
6788 6788
6789 6789
6790 6790 \backslash
6791 6791 hspace*{0mm}
6792 6792 \end_layout
6793 6793
6794 6794 \end_inset
6795 6795
6796 6796 \InsetSpace ~
6797 6797 \InsetSpace ~
6798 6798 \InsetSpace ~
6799 6799 \InsetSpace ~
6800 6800 \InsetSpace ~
6801 6801 \InsetSpace ~
6802 6802 \InsetSpace ~
6803 6803 \InsetSpace ~
6804 6804 \InsetSpace ~
6805 6805 \InsetSpace ~
6806 6806 \InsetSpace ~
6807 6807 \InsetSpace ~
6808 6808 \InsetSpace ~
6809 6809 \InsetSpace ~
6810 6810 \InsetSpace ~
6811 6811
6812 6812 \color green
6813 6813 ...>
6814 6814 \color none
6815 6815 \InsetSpace ~
6816 6816 \InsetSpace ~
6817 6817 \InsetSpace ~
6818 6818 \InsetSpace ~
6819 6819 print i,
6820 6820 \newline
6821 6821
6822 6822 \begin_inset ERT
6823 6823 status collapsed
6824 6824
6825 6825 \begin_layout Standard
6826 6826
6827 6827
6828 6828 \backslash
6829 6829 hspace*{0mm}
6830 6830 \end_layout
6831 6831
6832 6832 \end_inset
6833 6833
6834 6834 \InsetSpace ~
6835 6835 \InsetSpace ~
6836 6836 \InsetSpace ~
6837 6837 \InsetSpace ~
6838 6838 \InsetSpace ~
6839 6839 \InsetSpace ~
6840 6840 \InsetSpace ~
6841 6841 \InsetSpace ~
6842 6842 \InsetSpace ~
6843 6843 \InsetSpace ~
6844 6844 \InsetSpace ~
6845 6845 \InsetSpace ~
6846 6846 \InsetSpace ~
6847 6847 \InsetSpace ~
6848 6848 \InsetSpace ~
6849 6849
6850 6850 \color green
6851 6851 ...>
6852 6852 \color none
6853 6853
6854 6854 \newline
6855 6855 1 2 3
6856 6856 \end_layout
6857 6857
6858 6858 \begin_layout Standard
6859 6859 The following shows the usage of dynamic expression evaluation:
6860 6860 \end_layout
6861 6861
6862 6862 \begin_layout Subsection
6863 6863 \begin_inset LatexCommand \label{sec:profiles}
6864 6864
6865 6865 \end_inset
6866 6866
6867 6867 IPython profiles
6868 6868 \end_layout
6869 6869
6870 6870 \begin_layout Standard
6871 6871 As we already mentioned, IPython supports the
6872 6872 \family typewriter
6873 6873 -profile
6874 6874 \family default
6875 6875 command-line option (see sec.
6876 6876
6877 6877 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
6878 6878
6879 6879 \end_inset
6880 6880
6881 6881 ).
6882 6882 A profile is nothing more than a particular configuration file like your
6883 6883 basic
6884 6884 \family typewriter
6885 6885 ipythonrc
6886 6886 \family default
6887 6887 one, but with particular customizations for a specific purpose.
6888 6888 When you start IPython with '
6889 6889 \family typewriter
6890 6890 ipython -profile <name>
6891 6891 \family default
6892 6892 ', it assumes that in your
6893 6893 \family typewriter
6894 6894 IPYTHONDIR
6895 6895 \family default
6896 6896 there is a file called
6897 6897 \family typewriter
6898 6898 ipythonrc-<name>
6899 6899 \family default
6900 6900 , and loads it instead of the normal
6901 6901 \family typewriter
6902 6902 ipythonrc
6903 6903 \family default
6904 6904 .
6905 6905 \end_layout
6906 6906
6907 6907 \begin_layout Standard
6908 6908 This system allows you to maintain multiple configurations which load modules,
6909 6909 set options, define functions, etc.
6910 6910 suitable for different tasks and activate them in a very simple manner.
6911 6911 In order to avoid having to repeat all of your basic options (common things
6912 6912 that don't change such as your color preferences, for example), any profile
6913 6913 can include another configuration file.
6914 6914 The most common way to use profiles is then to have each one include your
6915 6915 basic
6916 6916 \family typewriter
6917 6917 ipythonrc
6918 6918 \family default
6919 6919 file as a starting point, and then add further customizations.
6920 6920 \end_layout
6921 6921
6922 6922 \begin_layout Standard
6923 6923 In sections
6924 6924 \begin_inset LatexCommand \ref{sec:syntax-extensions}
6925 6925
6926 6926 \end_inset
6927 6927
6928 6928 and
6929 6929 \begin_inset LatexCommand \ref{sec:Gnuplot}
6930 6930
6931 6931 \end_inset
6932 6932
6933 6933 we discuss some particular profiles which come as part of the standard
6934 6934 IPython distribution.
6935 6935 You may also look in your
6936 6936 \family typewriter
6937 6937 IPYTHONDIR
6938 6938 \family default
6939 6939 directory, any file whose name begins with
6940 6940 \family typewriter
6941 6941 ipythonrc-
6942 6942 \family default
6943 6943 is a profile.
6944 6944 You can use those as examples for further customizations to suit your own
6945 6945 needs.
6946 6946 \end_layout
6947 6947
6948 6948 \begin_layout Section
6949 6949 \begin_inset OptArg
6950 6950 status open
6951 6951
6952 6952 \begin_layout Standard
6953 6953 IPython as default...
6954 6954 \end_layout
6955 6955
6956 6956 \end_inset
6957 6957
6958 6958 IPython as your default Python environment
6959 6959 \end_layout
6960 6960
6961 6961 \begin_layout Standard
6962 6962 Python honors the environment variable
6963 6963 \family typewriter
6964 6964 PYTHONSTARTUP
6965 6965 \family default
6966 6966 and will execute at startup the file referenced by this variable.
6967 6967 If you put at the end of this file the following two lines of code:
6968 6968 \end_layout
6969 6969
6970 6970 \begin_layout Standard
6971 6971
6972 6972 \family typewriter
6973 6973 import IPython
6974 6974 \newline
6975 6975 IPython.Shell.IPShell().mainloop(sys_exit=1)
6976 6976 \end_layout
6977 6977
6978 6978 \begin_layout Standard
6979 6979 then IPython will be your working environment anytime you start Python.
6980 6980 The
6981 6981 \family typewriter
6982 6982 sys_exit=1
6983 6983 \family default
6984 6984 is needed to have IPython issue a call to
6985 6985 \family typewriter
6986 6986 sys.exit()
6987 6987 \family default
6988 6988 when it finishes, otherwise you'll be back at the normal Python '
6989 6989 \family typewriter
6990 6990 >>>
6991 6991 \family default
6992 6992 ' prompt
6993 6993 \begin_inset Foot
6994 6994 status collapsed
6995 6995
6996 6996 \begin_layout Standard
6997 6997 Based on an idea by Holger Krekel.
6998 6998 \end_layout
6999 6999
7000 7000 \end_inset
7001 7001
7002 7002 .
7003 7003 \end_layout
7004 7004
7005 7005 \begin_layout Standard
7006 7006 This is probably useful to developers who manage multiple Python versions
7007 7007 and don't want to have correspondingly multiple IPython versions.
7008 7008 Note that in this mode, there is no way to pass IPython any command-line
7009 7009 options, as those are trapped first by Python itself.
7010 7010 \end_layout
7011 7011
7012 7012 \begin_layout Section
7013 7013 \begin_inset LatexCommand \label{sec:embed}
7014 7014
7015 7015 \end_inset
7016 7016
7017 7017 Embedding IPython
7018 7018 \end_layout
7019 7019
7020 7020 \begin_layout Standard
7021 7021 It is possible to start an IPython instance
7022 7022 \emph on
7023 7023 inside
7024 7024 \emph default
7025 7025 your own Python programs.
7026 7026 This allows you to evaluate dynamically the state of your code, operate
7027 7027 with your variables, analyze them, etc.
7028 7028 Note however that any changes you make to values while in the shell do
7029 7029
7030 7030 \emph on
7031 7031 not
7032 7032 \emph default
7033 7033 propagate back to the running code, so it is safe to modify your values
7034 7034 because you won't break your code in bizarre ways by doing so.
7035 7035 \end_layout
7036 7036
7037 7037 \begin_layout Standard
7038 7038 This feature allows you to easily have a fully functional python environment
7039 7039 for doing object introspection anywhere in your code with a simple function
7040 7040 call.
7041 7041 In some cases a simple print statement is enough, but if you need to do
7042 7042 more detailed analysis of a code fragment this feature can be very valuable.
7043 7043 \end_layout
7044 7044
7045 7045 \begin_layout Standard
7046 7046 It can also be useful in scientific computing situations where it is common
7047 7047 to need to do some automatic, computationally intensive part and then stop
7048 7048 to look at data, plots, etc
7049 7049 \begin_inset Foot
7050 7050 status collapsed
7051 7051
7052 7052 \begin_layout Standard
7053 7053 This functionality was inspired by IDL's combination of the
7054 7054 \family typewriter
7055 7055 stop
7056 7056 \family default
7057 7057 keyword and the
7058 7058 \family typewriter
7059 7059 .continue
7060 7060 \family default
7061 7061 executive command, which I have found very useful in the past, and by a
7062 7062 posting on comp.lang.python by cmkl <cmkleffner-AT-gmx.de> on Dec.
7063 7063 06/01 concerning similar uses of pyrepl.
7064 7064 \end_layout
7065 7065
7066 7066 \end_inset
7067 7067
7068 7068 .
7069 7069 Opening an IPython instance will give you full access to your data and
7070 7070 functions, and you can resume program execution once you are done with
7071 7071 the interactive part (perhaps to stop again later, as many times as needed).
7072 7072 \end_layout
7073 7073
7074 7074 \begin_layout Standard
7075 7075 The following code snippet is the bare minimum you need to include in your
7076 7076 Python programs for this to work (detailed examples follow later):
7077 7077 \end_layout
7078 7078
7079 7079 \begin_layout LyX-Code
7080 7080 from IPython.Shell import IPShellEmbed
7081 7081 \end_layout
7082 7082
7083 7083 \begin_layout LyX-Code
7084 7084 ipshell = IPShellEmbed()
7085 7085 \end_layout
7086 7086
7087 7087 \begin_layout LyX-Code
7088 7088 ipshell() # this call anywhere in your program will start IPython
7089 7089 \end_layout
7090 7090
7091 7091 \begin_layout Standard
7092 7092 You can run embedded instances even in code which is itself being run at
7093 7093 the IPython interactive prompt with '
7094 7094 \family typewriter
7095 7095 %run\InsetSpace ~
7096 7096 <filename>
7097 7097 \family default
7098 7098 '.
7099 7099 Since it's easy to get lost as to where you are (in your top-level IPython
7100 7100 or in your embedded one), it's a good idea in such cases to set the in/out
7101 7101 prompts to something different for the embedded instances.
7102 7102 The code examples below illustrate this.
7103 7103 \end_layout
7104 7104
7105 7105 \begin_layout Standard
7106 7106 You can also have multiple IPython instances in your program and open them
7107 7107 separately, for example with different options for data presentation.
7108 7108 If you close and open the same instance multiple times, its prompt counters
7109 7109 simply continue from each execution to the next.
7110 7110 \end_layout
7111 7111
7112 7112 \begin_layout Standard
7113 7113 Please look at the docstrings in the
7114 7114 \family typewriter
7115 7115 Shell.py
7116 7116 \family default
7117 7117 module for more details on the use of this system.
7118 7118 \end_layout
7119 7119
7120 7120 \begin_layout Standard
7121 7121 The following sample file illustrating how to use the embedding functionality
7122 7122 is provided in the examples directory as
7123 7123 \family typewriter
7124 7124 example-embed.py
7125 7125 \family default
7126 7126 .
7127 7127 It should be fairly self-explanatory:
7128 7128 \end_layout
7129 7129
7130 7130 \begin_layout Standard
7131 7131 \begin_inset ERT
7132 7132 status open
7133 7133
7134 7134 \begin_layout Standard
7135 7135
7136 7136
7137 7137 \backslash
7138 7138 codelist{examples/example-embed.py}
7139 7139 \end_layout
7140 7140
7141 7141 \end_inset
7142 7142
7143 7143
7144 7144 \end_layout
7145 7145
7146 7146 \begin_layout Standard
7147 7147 Once you understand how the system functions, you can use the following
7148 7148 code fragments in your programs which are ready for cut and paste:
7149 7149 \end_layout
7150 7150
7151 7151 \begin_layout Standard
7152 7152 \begin_inset ERT
7153 7153 status open
7154 7154
7155 7155 \begin_layout Standard
7156 7156
7157 7157
7158 7158 \backslash
7159 7159 codelist{examples/example-embed-short.py}
7160 7160 \end_layout
7161 7161
7162 7162 \end_inset
7163 7163
7164 7164
7165 7165 \end_layout
7166 7166
7167 7167 \begin_layout Section
7168 7168 \begin_inset LatexCommand \label{sec:using-pdb}
7169 7169
7170 7170 \end_inset
7171 7171
7172 7172 Using the Python debugger (
7173 7173 \family typewriter
7174 7174 pdb
7175 7175 \family default
7176 7176 )
7177 7177 \end_layout
7178 7178
7179 7179 \begin_layout Subsection
7180 7180 Running entire programs via
7181 7181 \family typewriter
7182 7182 pdb
7183 7183 \end_layout
7184 7184
7185 7185 \begin_layout Standard
7186 7186
7187 7187 \family typewriter
7188 7188 pdb
7189 7189 \family default
7190 7190 , the Python debugger, is a powerful interactive debugger which allows you
7191 7191 to step through code, set breakpoints, watch variables, etc.
7192 7192 IPython makes it very easy to start any script under the control of
7193 7193 \family typewriter
7194 7194 pdb
7195 7195 \family default
7196 7196 , regardless of whether you have wrapped it into a
7197 7197 \family typewriter
7198 7198 `main()'
7199 7199 \family default
7200 7200 function or not.
7201 7201 For this, simply type
7202 7202 \family typewriter
7203 7203 `%run -d myscript'
7204 7204 \family default
7205 7205 at an IPython prompt.
7206 7206 See the
7207 7207 \family typewriter
7208 7208 %run
7209 7209 \family default
7210 7210 command's documentation (via
7211 7211 \family typewriter
7212 7212 `%run?'
7213 7213 \family default
7214 7214 or in Sec.\InsetSpace ~
7215 7215
7216 7216 \begin_inset LatexCommand \ref{sec:magic}
7217 7217
7218 7218 \end_inset
7219 7219
7220 7220 ) for more details, including how to control where
7221 7221 \family typewriter
7222 7222 pdb
7223 7223 \family default
7224 7224 will stop execution first.
7225 7225 \end_layout
7226 7226
7227 7227 \begin_layout Standard
7228 7228 For more information on the use of the
7229 7229 \family typewriter
7230 7230 pdb
7231 7231 \family default
7232 7232 debugger, read the included
7233 7233 \family typewriter
7234 7234 pdb.doc
7235 7235 \family default
7236 7236 file (part of the standard Python distribution).
7237 7237 On a stock Linux system it is located at
7238 7238 \family typewriter
7239 7239 /usr/lib/python2.3/pdb.doc
7240 7240 \family default
7241 7241 , but the easiest way to read it is by using the
7242 7242 \family typewriter
7243 7243 help()
7244 7244 \family default
7245 7245 function of the
7246 7246 \family typewriter
7247 7247 pdb
7248 7248 \family default
7249 7249 module as follows (in an IPython prompt):
7250 7250 \end_layout
7251 7251
7252 7252 \begin_layout Standard
7253 7253
7254 7254 \family typewriter
7255 7255 In [1]: import pdb
7256 7256 \newline
7257 7257 In [2]: pdb.help()
7258 7258 \end_layout
7259 7259
7260 7260 \begin_layout Standard
7261 7261 This will load the
7262 7262 \family typewriter
7263 7263 pdb.doc
7264 7264 \family default
7265 7265 document in a file viewer for you automatically.
7266 7266 \end_layout
7267 7267
7268 7268 \begin_layout Subsection
7269 7269 Automatic invocation of
7270 7270 \family typewriter
7271 7271 pdb
7272 7272 \family default
7273 7273 on exceptions
7274 7274 \end_layout
7275 7275
7276 7276 \begin_layout Standard
7277 7277 IPython, if started with the
7278 7278 \family typewriter
7279 7279 -pdb
7280 7280 \family default
7281 7281 option (or if the option is set in your rc file) can call the Python
7282 7282 \family typewriter
7283 7283 pdb
7284 7284 \family default
7285 7285 debugger every time your code triggers an uncaught exception
7286 7286 \begin_inset Foot
7287 7287 status collapsed
7288 7288
7289 7289 \begin_layout Standard
7290 7290 Many thanks to Christopher Hart for the request which prompted adding this
7291 7291 feature to IPython.
7292 7292 \end_layout
7293 7293
7294 7294 \end_inset
7295 7295
7296 7296 .
7297 7297 This feature can also be toggled at any time with the
7298 7298 \family typewriter
7299 7299 %pdb
7300 7300 \family default
7301 7301 magic command.
7302 7302 This can be extremely useful in order to find the origin of subtle bugs,
7303 7303 because
7304 7304 \family typewriter
7305 7305 pdb
7306 7306 \family default
7307 7307 opens up at the point in your code which triggered the exception, and while
7308 7308 your program is at this point `dead', all the data is still available and
7309 7309 you can walk up and down the stack frame and understand the origin of the
7310 7310 problem.
7311 7311 \end_layout
7312 7312
7313 7313 \begin_layout Standard
7314 7314 Furthermore, you can use these debugging facilities both with the embedded
7315 7315 IPython mode and without IPython at all.
7316 7316 For an embedded shell (see sec.
7317 7317
7318 7318 \begin_inset LatexCommand \ref{sec:embed}
7319 7319
7320 7320 \end_inset
7321 7321
7322 7322 ), simply call the constructor with
7323 7323 \family typewriter
7324 7324 `-pdb'
7325 7325 \family default
7326 7326 in the argument string and automatically
7327 7327 \family typewriter
7328 7328 pdb
7329 7329 \family default
7330 7330 will be called if an uncaught exception is triggered by your code.
7331 7331
7332 7332 \end_layout
7333 7333
7334 7334 \begin_layout Standard
7335 7335 For stand-alone use of the feature in your programs which do not use IPython
7336 7336 at all, put the following lines toward the top of your `main' routine:
7337 7337 \end_layout
7338 7338
7339 7339 \begin_layout Standard
7340 7340 \align left
7341 7341
7342 7342 \family typewriter
7343 7343 import sys,IPython.ultraTB
7344 7344 \newline
7345 7345 sys.excepthook = IPython.ultraTB.FormattedTB(mode=`Verbos
7346 7346 e', color_scheme=`Linux', call_pdb=1)
7347 7347 \end_layout
7348 7348
7349 7349 \begin_layout Standard
7350 7350 The
7351 7351 \family typewriter
7352 7352 mode
7353 7353 \family default
7354 7354 keyword can be either
7355 7355 \family typewriter
7356 7356 `Verbose'
7357 7357 \family default
7358 7358 or
7359 7359 \family typewriter
7360 7360 `Plain'
7361 7361 \family default
7362 7362 , giving either very detailed or normal tracebacks respectively.
7363 7363 The
7364 7364 \family typewriter
7365 7365 color_scheme
7366 7366 \family default
7367 7367 keyword can be one of
7368 7368 \family typewriter
7369 7369 `NoColor'
7370 7370 \family default
7371 7371 ,
7372 7372 \family typewriter
7373 7373 `Linux'
7374 7374 \family default
7375 7375 (default) or
7376 7376 \family typewriter
7377 7377 `LightBG'
7378 7378 \family default
7379 7379 .
7380 7380 These are the same options which can be set in IPython with
7381 7381 \family typewriter
7382 7382 -colors
7383 7383 \family default
7384 7384 and
7385 7385 \family typewriter
7386 7386 -xmode
7387 7387 \family default
7388 7388 .
7389 7389 \end_layout
7390 7390
7391 7391 \begin_layout Standard
7392 7392 This will give any of your programs detailed, colored tracebacks with automatic
7393 7393 invocation of
7394 7394 \family typewriter
7395 7395 pdb
7396 7396 \family default
7397 7397 .
7398 7398 \end_layout
7399 7399
7400 7400 \begin_layout Section
7401 7401 \begin_inset LatexCommand \label{sec:syntax-extensions}
7402 7402
7403 7403 \end_inset
7404 7404
7405 7405 Extensions for syntax processing
7406 7406 \end_layout
7407 7407
7408 7408 \begin_layout Standard
7409 7409 This isn't for the faint of heart, because the potential for breaking things
7410 7410 is quite high.
7411 7411 But it can be a very powerful and useful feature.
7412 7412 In a nutshell, you can redefine the way IPython processes the user input
7413 7413 line to accept new, special extensions to the syntax without needing to
7414 7414 change any of IPython's own code.
7415 7415 \end_layout
7416 7416
7417 7417 \begin_layout Standard
7418 7418 In the
7419 7419 \family typewriter
7420 7420 IPython/Extensions
7421 7421 \family default
7422 7422 directory you will find some examples supplied, which we will briefly describe
7423 7423 now.
7424 7424 These can be used `as is' (and both provide very useful functionality),
7425 7425 or you can use them as a starting point for writing your own extensions.
7426 7426 \end_layout
7427 7427
7428 7428 \begin_layout Subsection
7429 7429 Pasting of code starting with
7430 7430 \family typewriter
7431 7431 `>>>
7432 7432 \family default
7433 7433 ' or
7434 7434 \family typewriter
7435 7435 `...
7436 7436
7437 7437 \family default
7438 7438 '
7439 7439 \end_layout
7440 7440
7441 7441 \begin_layout Standard
7442 7442 In the python tutorial it is common to find code examples which have been
7443 7443 taken from real python sessions.
7444 7444 The problem with those is that all the lines begin with either
7445 7445 \family typewriter
7446 7446 `>>>
7447 7447 \family default
7448 7448 ' or
7449 7449 \family typewriter
7450 7450 `...
7451 7451
7452 7452 \family default
7453 7453 ', which makes it impossible to paste them all at once.
7454 7454 One must instead do a line by line manual copying, carefully removing the
7455 7455 leading extraneous characters.
7456 7456 \end_layout
7457 7457
7458 7458 \begin_layout Standard
7459 7459 This extension identifies those starting characters and removes them from
7460 7460 the input automatically, so that one can paste multi-line examples directly
7461 7461 into IPython, saving a lot of time.
7462 7462 Please look at the file
7463 7463 \family typewriter
7464 7464 InterpreterPasteInput.py
7465 7465 \family default
7466 7466 in the
7467 7467 \family typewriter
7468 7468 IPython/Extensions
7469 7469 \family default
7470 7470 directory for details on how this is done.
7471 7471 \end_layout
7472 7472
7473 7473 \begin_layout Standard
7474 7474 IPython comes with a special profile enabling this feature, called
7475 7475 \family typewriter
7476 7476 tutorial
7477 7477 \family default
7478 7478 \emph on
7479 7479 .
7480 7480
7481 7481 \emph default
7482 7482 Simply start IPython via
7483 7483 \family typewriter
7484 7484 `ipython\InsetSpace ~
7485 7485 -p\InsetSpace ~
7486 7486 tutorial'
7487 7487 \family default
7488 7488 and the feature will be available.
7489 7489 In a normal IPython session you can activate the feature by importing the
7490 7490 corresponding module with:
7491 7491 \newline
7492 7492
7493 7493 \family typewriter
7494 7494 In [1]: import IPython.Extensions.InterpreterPasteInput
7495 7495 \end_layout
7496 7496
7497 7497 \begin_layout Standard
7498 7498 The following is a 'screenshot' of how things work when this extension is
7499 7499 on, copying an example from the standard tutorial:
7500 7500 \end_layout
7501 7501
7502 7502 \begin_layout Standard
7503 7503
7504 7504 \family typewriter
7505 7505 IPython profile: tutorial
7506 7506 \newline
7507 7507 \InsetSpace ~
7508 7508
7509 7509 \newline
7510 7510 *** Pasting of code with ">>>" or "..." has been enabled.
7511 7511 \newline
7512 7512 \InsetSpace ~
7513 7513
7514 7514 \newline
7515 7515 In
7516 7516 [1]: >>> def fib2(n): # return Fibonacci series up to n
7517 7517 \newline
7518 7518
7519 7519 \begin_inset ERT
7520 7520 status collapsed
7521 7521
7522 7522 \begin_layout Standard
7523 7523
7524 7524
7525 7525 \backslash
7526 7526 hspace*{0mm}
7527 7527 \end_layout
7528 7528
7529 7529 \end_inset
7530 7530
7531 7531 \InsetSpace ~
7532 7532 \InsetSpace ~
7533 7533 ...: ...\InsetSpace ~
7534 7534 \InsetSpace ~
7535 7535 \InsetSpace ~
7536 7536 \InsetSpace ~
7537 7537 """Return a list containing the Fibonacci series up to n."""
7538 7538 \newline
7539 7539
7540 7540 \begin_inset ERT
7541 7541 status collapsed
7542 7542
7543 7543 \begin_layout Standard
7544 7544
7545 7545
7546 7546 \backslash
7547 7547 hspace*{0mm}
7548 7548 \end_layout
7549 7549
7550 7550 \end_inset
7551 7551
7552 7552 \InsetSpace ~
7553 7553 \InsetSpace ~
7554 7554 ...: ...\InsetSpace ~
7555 7555 \InsetSpace ~
7556 7556 \InsetSpace ~
7557 7557 \InsetSpace ~
7558 7558 result = []
7559 7559 \newline
7560 7560
7561 7561 \begin_inset ERT
7562 7562 status collapsed
7563 7563
7564 7564 \begin_layout Standard
7565 7565
7566 7566
7567 7567 \backslash
7568 7568 hspace*{0mm}
7569 7569 \end_layout
7570 7570
7571 7571 \end_inset
7572 7572
7573 7573 \InsetSpace ~
7574 7574 \InsetSpace ~
7575 7575 ...: ...\InsetSpace ~
7576 7576 \InsetSpace ~
7577 7577 \InsetSpace ~
7578 7578 \InsetSpace ~
7579 7579 a, b = 0, 1
7580 7580 \newline
7581 7581
7582 7582 \begin_inset ERT
7583 7583 status collapsed
7584 7584
7585 7585 \begin_layout Standard
7586 7586
7587 7587
7588 7588 \backslash
7589 7589 hspace*{0mm}
7590 7590 \end_layout
7591 7591
7592 7592 \end_inset
7593 7593
7594 7594 \InsetSpace ~
7595 7595 \InsetSpace ~
7596 7596 ...: ...\InsetSpace ~
7597 7597 \InsetSpace ~
7598 7598 \InsetSpace ~
7599 7599 \InsetSpace ~
7600 7600 while b < n:
7601 7601 \newline
7602 7602
7603 7603 \begin_inset ERT
7604 7604 status collapsed
7605 7605
7606 7606 \begin_layout Standard
7607 7607
7608 7608
7609 7609 \backslash
7610 7610 hspace*{0mm}
7611 7611 \end_layout
7612 7612
7613 7613 \end_inset
7614 7614
7615 7615 \InsetSpace ~
7616 7616 \InsetSpace ~
7617 7617 ...: ...\InsetSpace ~
7618 7618 \InsetSpace ~
7619 7619 \InsetSpace ~
7620 7620 \InsetSpace ~
7621 7621 \InsetSpace ~
7622 7622 \InsetSpace ~
7623 7623 \InsetSpace ~
7624 7624 \InsetSpace ~
7625 7625 result.append(b)\InsetSpace ~
7626 7626 \InsetSpace ~
7627 7627 \InsetSpace ~
7628 7628 # see below
7629 7629 \newline
7630 7630
7631 7631 \begin_inset ERT
7632 7632 status collapsed
7633 7633
7634 7634 \begin_layout Standard
7635 7635
7636 7636
7637 7637 \backslash
7638 7638 hspace*{0mm}
7639 7639 \end_layout
7640 7640
7641 7641 \end_inset
7642 7642
7643 7643 \InsetSpace ~
7644 7644 \InsetSpace ~
7645 7645 ...: ...\InsetSpace ~
7646 7646 \InsetSpace ~
7647 7647 \InsetSpace ~
7648 7648 \InsetSpace ~
7649 7649 \InsetSpace ~
7650 7650 \InsetSpace ~
7651 7651 \InsetSpace ~
7652 7652 \InsetSpace ~
7653 7653 a, b = b, a+b
7654 7654 \newline
7655 7655
7656 7656 \begin_inset ERT
7657 7657 status collapsed
7658 7658
7659 7659 \begin_layout Standard
7660 7660
7661 7661
7662 7662 \backslash
7663 7663 hspace*{0mm}
7664 7664 \end_layout
7665 7665
7666 7666 \end_inset
7667 7667
7668 7668 \InsetSpace ~
7669 7669 \InsetSpace ~
7670 7670 ...: ...\InsetSpace ~
7671 7671 \InsetSpace ~
7672 7672 \InsetSpace ~
7673 7673 \InsetSpace ~
7674 7674 return result
7675 7675 \newline
7676 7676
7677 7677 \begin_inset ERT
7678 7678 status collapsed
7679 7679
7680 7680 \begin_layout Standard
7681 7681
7682 7682
7683 7683 \backslash
7684 7684 hspace*{0mm}
7685 7685 \end_layout
7686 7686
7687 7687 \end_inset
7688 7688
7689 7689 \InsetSpace ~
7690 7690 \InsetSpace ~
7691 7691 ...:
7692 7692 \newline
7693 7693 \InsetSpace ~
7694 7694
7695 7695 \newline
7696 7696 In [2]: fib2(10)
7697 7697 \newline
7698 7698 Out[2]: [1, 1, 2, 3, 5, 8]
7699 7699 \end_layout
7700 7700
7701 7701 \begin_layout Standard
7702 7702 Note that as currently written, this extension does
7703 7703 \emph on
7704 7704 not
7705 7705 \emph default
7706 7706 recognize IPython's prompts for pasting.
7707 7707 Those are more complicated, since the user can change them very easily,
7708 7708 they involve numbers and can vary in length.
7709 7709 One could however extract all the relevant information from the IPython
7710 7710 instance and build an appropriate regular expression.
7711 7711 This is left as an exercise for the reader.
7712 7712 \end_layout
7713 7713
7714 7714 \begin_layout Subsection
7715 7715 Input of physical quantities with units
7716 7716 \end_layout
7717 7717
7718 7718 \begin_layout Standard
7719 7719 The module
7720 7720 \family typewriter
7721 7721 PhysicalQInput
7722 7722 \family default
7723 7723 allows a simplified form of input for physical quantities with units.
7724 7724 This file is meant to be used in conjunction with the
7725 7725 \family typewriter
7726 7726 PhysicalQInteractive
7727 7727 \family default
7728 7728 module (in the same directory) and
7729 7729 \family typewriter
7730 7730 Physics.PhysicalQuantities
7731 7731 \family default
7732 7732 from Konrad Hinsen's ScientificPython (
7733 7733 \begin_inset LatexCommand \htmlurl{http://dirac.cnrs-orleans.fr/ScientificPython/}
7734 7734
7735 7735 \end_inset
7736 7736
7737 7737 ).
7738 7738 \end_layout
7739 7739
7740 7740 \begin_layout Standard
7741 7741 The
7742 7742 \family typewriter
7743 7743 Physics.PhysicalQuantities
7744 7744 \family default
7745 7745 module defines
7746 7746 \family typewriter
7747 7747 PhysicalQuantity
7748 7748 \family default
7749 7749 objects, but these must be declared as instances of a class.
7750 7750 For example, to define
7751 7751 \family typewriter
7752 7752 v
7753 7753 \family default
7754 7754 as a velocity of 3\InsetSpace ~
7755 7755 m/s, normally you would write:
7756 7756 \family typewriter
7757 7757
7758 7758 \newline
7759 7759 In [1]: v = PhysicalQuantity(3,'m/s')
7760 7760 \end_layout
7761 7761
7762 7762 \begin_layout Standard
7763 7763 Using the
7764 7764 \family typewriter
7765 7765 PhysicalQ_Input
7766 7766 \family default
7767 7767 extension this can be input instead as:
7768 7768 \family typewriter
7769 7769
7770 7770 \newline
7771 7771 In [1]: v = 3 m/s
7772 7772 \family default
7773 7773
7774 7774 \newline
7775 7775 which is much more convenient for interactive use (even though it is blatantly
7776 7776 invalid Python syntax).
7777 7777 \end_layout
7778 7778
7779 7779 \begin_layout Standard
7780 7780 The
7781 7781 \family typewriter
7782 7782 physics
7783 7783 \family default
7784 7784 profile supplied with IPython (enabled via
7785 7785 \family typewriter
7786 7786 'ipython -p physics'
7787 7787 \family default
7788 7788 ) uses these extensions, which you can also activate with:
7789 7789 \end_layout
7790 7790
7791 7791 \begin_layout Standard
7792 7792
7793 7793 \family typewriter
7794 7794 from math import * # math MUST be imported BEFORE PhysicalQInteractive
7795 7795 \newline
7796 7796 from
7797 7797 IPython.Extensions.PhysicalQInteractive import *
7798 7798 \newline
7799 7799 import IPython.Extensions.PhysicalQ
7800 7800 Input
7801 7801 \end_layout
7802 7802
7803 7803 \begin_layout Section
7804 7804 \begin_inset LatexCommand \label{sec:IPython-as-shell}
7805 7805
7806 7806 \end_inset
7807 7807
7808 7808 IPython as a system shell
7809 7809 \end_layout
7810 7810
7811 7811 \begin_layout Standard
7812 7812 IPython ships with a special profile called
7813 7813 \family typewriter
7814 7814 pysh
7815 7815 \family default
7816 7816 , which you can activate at the command line as
7817 7817 \family typewriter
7818 7818 `ipython -p pysh'
7819 7819 \family default
7820 7820 .
7821 7821 This loads
7822 7822 \family typewriter
7823 7823 InterpreterExec
7824 7824 \family default
7825 7825 , along with some additional facilities and a prompt customized for filesystem
7826 7826 navigation.
7827 7827 \end_layout
7828 7828
7829 7829 \begin_layout Standard
7830 7830 Note that this does
7831 7831 \emph on
7832 7832 not
7833 7833 \emph default
7834 7834 make IPython a full-fledged system shell.
7835 7835 In particular, it has no job control, so if you type Ctrl-Z (under Unix),
7836 7836 you'll suspend pysh itself, not the process you just started.
7837 7837
7838 7838 \end_layout
7839 7839
7840 7840 \begin_layout Standard
7841 7841 What the shell profile allows you to do is to use the convenient and powerful
7842 7842 syntax of Python to do quick scripting at the command line.
7843 7843 Below we describe some of its features.
7844 7844 \end_layout
7845 7845
7846 7846 \begin_layout Subsection
7847 7847 Aliases
7848 7848 \end_layout
7849 7849
7850 7850 \begin_layout Standard
7851 7851 All of your
7852 7852 \family typewriter
7853 7853 $PATH
7854 7854 \family default
7855 7855 has been loaded as IPython aliases, so you should be able to type any normal
7856 7856 system command and have it executed.
7857 7857 See
7858 7858 \family typewriter
7859 7859 %alias?
7860 7860 \family default
7861 7861 and
7862 7862 \family typewriter
7863 7863 %unalias?
7864 7864 \family default
7865 7865 for details on the alias facilities.
7866 7866 See also
7867 7867 \family typewriter
7868 7868 %rehash?
7869 7869 \family default
7870 7870 and
7871 7871 \family typewriter
7872 7872 %rehashx?
7873 7873 \family default
7874 7874 for details on the mechanism used to load
7875 7875 \family typewriter
7876 7876 $PATH
7877 7877 \family default
7878 7878 .
7879 7879 \end_layout
7880 7880
7881 7881 \begin_layout Subsection
7882 7882 Special syntax
7883 7883 \end_layout
7884 7884
7885 7885 \begin_layout Standard
7886 7886 Any lines which begin with
7887 7887 \family typewriter
7888 7888 `~'
7889 7889 \family default
7890 7890 ,
7891 7891 \family typewriter
7892 7892 `/'
7893 7893 \family default
7894 7894 and
7895 7895 \family typewriter
7896 7896 `.'
7897 7897 \family default
7898 7898 will be executed as shell commands instead of as Python code.
7899 7899 The special escapes below are also recognized.
7900 7900
7901 7901 \family typewriter
7902 7902 !cmd
7903 7903 \family default
7904 7904 is valid in single or multi-line input, all others are only valid in single-lin
7905 7905 e input:
7906 7906 \end_layout
7907 7907
7908 7908 \begin_layout Description
7909 7909
7910 7910 \family typewriter
7911 7911 !cmd
7912 7912 \family default
7913 7913 pass `cmd' directly to the shell
7914 7914 \end_layout
7915 7915
7916 7916 \begin_layout Description
7917 7917
7918 7918 \family typewriter
7919 7919 !!cmd
7920 7920 \family default
7921 7921 execute `cmd' and return output as a list (split on `
7922 7922 \backslash
7923 7923 n')
7924 7924 \end_layout
7925 7925
7926 7926 \begin_layout Description
7927 7927
7928 7928 \family typewriter
7929 7929 $var=cmd
7930 7930 \family default
7931 7931 capture output of cmd into var, as a string
7932 7932 \end_layout
7933 7933
7934 7934 \begin_layout Description
7935 7935
7936 7936 \family typewriter
7937 7937 $$var=cmd
7938 7938 \family default
7939 7939 capture output of cmd into var, as a list (split on `
7940 7940 \backslash
7941 7941 n')
7942 7942 \end_layout
7943 7943
7944 7944 \begin_layout Standard
7945 7945 The
7946 7946 \family typewriter
7947 7947 $
7948 7948 \family default
7949 7949 /
7950 7950 \family typewriter
7951 7951 $$
7952 7952 \family default
7953 7953 syntaxes make Python variables from system output, which you can later
7954 7954 use for further scripting.
7955 7955 The converse is also possible: when executing an alias or calling to the
7956 7956 system via
7957 7957 \family typewriter
7958 7958 !
7959 7959 \family default
7960 7960 /
7961 7961 \family typewriter
7962 7962 !!
7963 7963 \family default
7964 7964 , you can expand any python variable or expression by prepending it with
7965 7965
7966 7966 \family typewriter
7967 7967 $
7968 7968 \family default
7969 7969 .
7970 7970 Full details of the allowed syntax can be found in Python's PEP 215.
7971 7971 \end_layout
7972 7972
7973 7973 \begin_layout Standard
7974 7974 A few brief examples will illustrate these (note that the indentation below
7975 7975 may be incorrectly displayed):
7976 7976 \end_layout
7977 7977
7978 7978 \begin_layout Standard
7979 7979
7980 7980 \family typewriter
7981 7981 fperez[~/test]|3> !ls *s.py
7982 7982 \newline
7983 7983 scopes.py strings.py
7984 7984 \end_layout
7985 7985
7986 7986 \begin_layout Standard
7987 7987 ls is an internal alias, so there's no need to use
7988 7988 \family typewriter
7989 7989 !
7990 7990 \family default
7991 7991 :
7992 7992 \end_layout
7993 7993
7994 7994 \begin_layout Standard
7995 7995
7996 7996 \family typewriter
7997 7997 fperez[~/test]|4> ls *s.py
7998 7998 \newline
7999 7999 scopes.py* strings.py
8000 8000 \end_layout
8001 8001
8002 8002 \begin_layout Standard
8003 8003 !!ls will return the output into a Python variable:
8004 8004 \end_layout
8005 8005
8006 8006 \begin_layout Standard
8007 8007
8008 8008 \family typewriter
8009 8009 fperez[~/test]|5> !!ls *s.py
8010 8010 \newline
8011 8011
8012 8012 \begin_inset ERT
8013 8013 status collapsed
8014 8014
8015 8015 \begin_layout Standard
8016 8016
8017 8017
8018 8018 \backslash
8019 8019 hspace*{0mm}
8020 8020 \end_layout
8021 8021
8022 8022 \end_inset
8023 8023
8024 8024 \InsetSpace ~
8025 8025 \InsetSpace ~
8026 8026 \InsetSpace ~
8027 8027 \InsetSpace ~
8028 8028 \InsetSpace ~
8029 8029 \InsetSpace ~
8030 8030 \InsetSpace ~
8031 8031 \InsetSpace ~
8032 8032 \InsetSpace ~
8033 8033 \InsetSpace ~
8034 8034 \InsetSpace ~
8035 8035 \InsetSpace ~
8036 8036 \InsetSpace ~
8037 8037 \InsetSpace ~
8038 8038 <5> ['scopes.py', 'strings.py']
8039 8039 \newline
8040 8040 fperez[~/test]|6> print _5
8041 8041 \newline
8042 8042 ['scopes.py', 'strings.py
8043 8043 ']
8044 8044 \end_layout
8045 8045
8046 8046 \begin_layout Standard
8047 8047
8048 8048 \family typewriter
8049 8049 $
8050 8050 \family default
8051 8051 and
8052 8052 \family typewriter
8053 8053 $$
8054 8054 \family default
8055 8055 allow direct capture to named variables:
8056 8056 \end_layout
8057 8057
8058 8058 \begin_layout Standard
8059 8059
8060 8060 \family typewriter
8061 8061 fperez[~/test]|7> $astr = ls *s.py
8062 8062 \newline
8063 8063 fperez[~/test]|8> astr
8064 8064 \newline
8065 8065
8066 8066 \begin_inset ERT
8067 8067 status collapsed
8068 8068
8069 8069 \begin_layout Standard
8070 8070
8071 8071
8072 8072 \backslash
8073 8073 hspace*{0mm}
8074 8074 \end_layout
8075 8075
8076 8076 \end_inset
8077 8077
8078 8078 \InsetSpace ~
8079 8079 \InsetSpace ~
8080 8080 \InsetSpace ~
8081 8081 \InsetSpace ~
8082 8082 \InsetSpace ~
8083 8083 \InsetSpace ~
8084 8084 \InsetSpace ~
8085 8085 \InsetSpace ~
8086 8086 \InsetSpace ~
8087 8087 \InsetSpace ~
8088 8088 \InsetSpace ~
8089 8089 \InsetSpace ~
8090 8090 \InsetSpace ~
8091 8091 \InsetSpace ~
8092 8092 <8> 'scopes.py
8093 8093 \backslash
8094 8094 nstrings.py'
8095 8095 \end_layout
8096 8096
8097 8097 \begin_layout Standard
8098 8098
8099 8099 \family typewriter
8100 8100 fperez[~/test]|9> $$alist = ls *s.py
8101 8101 \newline
8102 8102 fperez[~/test]|10> alist
8103 8103 \newline
8104 8104
8105 8105 \begin_inset ERT
8106 8106 status collapsed
8107 8107
8108 8108 \begin_layout Standard
8109 8109
8110 8110
8111 8111 \backslash
8112 8112 hspace*{0mm}
8113 8113 \end_layout
8114 8114
8115 8115 \end_inset
8116 8116
8117 8117 \InsetSpace ~
8118 8118 \InsetSpace ~
8119 8119 \InsetSpace ~
8120 8120 \InsetSpace ~
8121 8121 \InsetSpace ~
8122 8122 \InsetSpace ~
8123 8123 \InsetSpace ~
8124 8124 \InsetSpace ~
8125 8125 \InsetSpace ~
8126 8126 \InsetSpace ~
8127 8127 \InsetSpace ~
8128 8128 \InsetSpace ~
8129 8129 \InsetSpace ~
8130 8130 \InsetSpace ~
8131 8131 <10> ['scopes.py', 'strings.py']
8132 8132 \end_layout
8133 8133
8134 8134 \begin_layout Standard
8135 8135 alist is now a normal python list you can loop over.
8136 8136 Using
8137 8137 \family typewriter
8138 8138 $
8139 8139 \family default
8140 8140 will expand back the python values when alias calls are made:
8141 8141 \end_layout
8142 8142
8143 8143 \begin_layout Standard
8144 8144
8145 8145 \family typewriter
8146 8146 fperez[~/test]|11> for f in alist:
8147 8147 \newline
8148 8148
8149 8149 \begin_inset ERT
8150 8150 status collapsed
8151 8151
8152 8152 \begin_layout Standard
8153 8153
8154 8154
8155 8155 \backslash
8156 8156 hspace*{0mm}
8157 8157 \end_layout
8158 8158
8159 8159 \end_inset
8160 8160
8161 8161 \InsetSpace ~
8162 8162 \InsetSpace ~
8163 8163 \InsetSpace ~
8164 8164 \InsetSpace ~
8165 8165 \InsetSpace ~
8166 8166 \InsetSpace ~
8167 8167 \InsetSpace ~
8168 8168 \InsetSpace ~
8169 8169 \InsetSpace ~
8170 8170 \InsetSpace ~
8171 8171 \InsetSpace ~
8172 8172 \InsetSpace ~
8173 8173 \InsetSpace ~
8174 8174 \InsetSpace ~
8175 8175 |..> \InsetSpace ~
8176 8176 \InsetSpace ~
8177 8177 \InsetSpace ~
8178 8178 \InsetSpace ~
8179 8179 print 'file',f,
8180 8180 \newline
8181 8181
8182 8182 \begin_inset ERT
8183 8183 status collapsed
8184 8184
8185 8185 \begin_layout Standard
8186 8186
8187 8187
8188 8188 \backslash
8189 8189 hspace*{0mm}
8190 8190 \end_layout
8191 8191
8192 8192 \end_inset
8193 8193
8194 8194 \InsetSpace ~
8195 8195 \InsetSpace ~
8196 8196 \InsetSpace ~
8197 8197 \InsetSpace ~
8198 8198 \InsetSpace ~
8199 8199 \InsetSpace ~
8200 8200 \InsetSpace ~
8201 8201 \InsetSpace ~
8202 8202 \InsetSpace ~
8203 8203 \InsetSpace ~
8204 8204 \InsetSpace ~
8205 8205 \InsetSpace ~
8206 8206 \InsetSpace ~
8207 8207 \InsetSpace ~
8208 8208 |..> \InsetSpace ~
8209 8209 \InsetSpace ~
8210 8210 \InsetSpace ~
8211 8211 \InsetSpace ~
8212 8212 wc -l $f
8213 8213 \newline
8214 8214
8215 8215 \begin_inset ERT
8216 8216 status collapsed
8217 8217
8218 8218 \begin_layout Standard
8219 8219
8220 8220
8221 8221 \backslash
8222 8222 hspace*{0mm}
8223 8223 \end_layout
8224 8224
8225 8225 \end_inset
8226 8226
8227 8227 \InsetSpace ~
8228 8228 \InsetSpace ~
8229 8229 \InsetSpace ~
8230 8230 \InsetSpace ~
8231 8231 \InsetSpace ~
8232 8232 \InsetSpace ~
8233 8233 \InsetSpace ~
8234 8234 \InsetSpace ~
8235 8235 \InsetSpace ~
8236 8236 \InsetSpace ~
8237 8237 \InsetSpace ~
8238 8238 \InsetSpace ~
8239 8239 \InsetSpace ~
8240 8240 \InsetSpace ~
8241 8241 |..>
8242 8242 \newline
8243 8243 file scopes.py 13 scopes.py
8244 8244 \newline
8245 8245 file strings.py 4 strings.py
8246 8246 \end_layout
8247 8247
8248 8248 \begin_layout Standard
8249 8249 Note that you may need to protect your variables with braces if you want
8250 8250 to append strings to their names.
8251 8251 To copy all files in alist to
8252 8252 \family typewriter
8253 8253 .bak
8254 8254 \family default
8255 8255 extensions, you must use:
8256 8256 \end_layout
8257 8257
8258 8258 \begin_layout Standard
8259 8259
8260 8260 \family typewriter
8261 8261 fperez[~/test]|12> for f in alist:
8262 8262 \newline
8263 8263
8264 8264 \begin_inset ERT
8265 8265 status collapsed
8266 8266
8267 8267 \begin_layout Standard
8268 8268
8269 8269
8270 8270 \backslash
8271 8271 hspace*{0mm}
8272 8272 \end_layout
8273 8273
8274 8274 \end_inset
8275 8275
8276 8276 \InsetSpace ~
8277 8277 \InsetSpace ~
8278 8278 \InsetSpace ~
8279 8279 \InsetSpace ~
8280 8280 \InsetSpace ~
8281 8281 \InsetSpace ~
8282 8282 \InsetSpace ~
8283 8283 \InsetSpace ~
8284 8284 \InsetSpace ~
8285 8285 \InsetSpace ~
8286 8286 \InsetSpace ~
8287 8287 \InsetSpace ~
8288 8288 \InsetSpace ~
8289 8289 \InsetSpace ~
8290 8290 |..> \InsetSpace ~
8291 8291 \InsetSpace ~
8292 8292 \InsetSpace ~
8293 8293 \InsetSpace ~
8294 8294 cp $f ${f}.bak
8295 8295 \end_layout
8296 8296
8297 8297 \begin_layout Standard
8298 8298 If you try using
8299 8299 \family typewriter
8300 8300 $f.bak
8301 8301 \family default
8302 8302 , you'll get an AttributeError exception saying that your string object
8303 8303 doesn't have a
8304 8304 \family typewriter
8305 8305 .bak
8306 8306 \family default
8307 8307 attribute.
8308 8308 This is because the
8309 8309 \family typewriter
8310 8310 $
8311 8311 \family default
8312 8312 expansion mechanism allows you to expand full Python expressions:
8313 8313 \end_layout
8314 8314
8315 8315 \begin_layout Standard
8316 8316
8317 8317 \family typewriter
8318 8318 fperez[~/test]|13> echo "sys.platform is: $sys.platform"
8319 8319 \newline
8320 8320 sys.platform is: linux2
8321 8321 \end_layout
8322 8322
8323 8323 \begin_layout Standard
8324 8324 IPython's input history handling is still active, which allows you to rerun
8325 8325 a single block of multi-line input by simply using exec:
8326 8326 \newline
8327 8327
8328 8328 \family typewriter
8329 8329 fperez[~/test]|14> $$alist = ls *.eps
8330 8330 \newline
8331 8331 fperez[~/test]|15> exec _i11
8332 8332 \newline
8333 8333 file image2.eps
8334 8334 921 image2.eps
8335 8335 \newline
8336 8336 file image.eps 921 image.eps
8337 8337 \end_layout
8338 8338
8339 8339 \begin_layout Standard
8340 8340 While these are new special-case syntaxes, they are designed to allow very
8341 8341 efficient use of the shell with minimal typing.
8342 8342 At an interactive shell prompt, conciseness of expression wins over readability.
8343 8343 \end_layout
8344 8344
8345 8345 \begin_layout Subsection
8346 8346 Useful functions and modules
8347 8347 \end_layout
8348 8348
8349 8349 \begin_layout Standard
8350 8350 The os, sys and shutil modules from the Python standard library are automaticall
8351 8351 y loaded.
8352 8352 Some additional functions, useful for shell usage, are listed below.
8353 8353 You can request more help about them with `
8354 8354 \family typewriter
8355 8355 ?
8356 8356 \family default
8357 8357 '.
8358 8358 \end_layout
8359 8359
8360 8360 \begin_layout Description
8361 8361
8362 8362 \family typewriter
8363 8363 shell
8364 8364 \family default
8365 8365 - execute a command in the underlying system shell
8366 8366 \end_layout
8367 8367
8368 8368 \begin_layout Description
8369 8369
8370 8370 \family typewriter
8371 8371 system
8372 8372 \family default
8373 8373 - like
8374 8374 \family typewriter
8375 8375 shell()
8376 8376 \family default
8377 8377 , but return the exit status of the command
8378 8378 \end_layout
8379 8379
8380 8380 \begin_layout Description
8381 8381
8382 8382 \family typewriter
8383 8383 sout
8384 8384 \family default
8385 8385 - capture the output of a command as a string
8386 8386 \end_layout
8387 8387
8388 8388 \begin_layout Description
8389 8389
8390 8390 \family typewriter
8391 8391 lout
8392 8392 \family default
8393 8393 - capture the output of a command as a list (split on `
8394 8394 \backslash
8395 8395 n')
8396 8396 \end_layout
8397 8397
8398 8398 \begin_layout Description
8399 8399
8400 8400 \family typewriter
8401 8401 getoutputerror
8402 8402 \family default
8403 8403 - capture (output,error) of a shell commandss
8404 8404 \end_layout
8405 8405
8406 8406 \begin_layout Standard
8407 8407
8408 8408 \family typewriter
8409 8409 sout
8410 8410 \family default
8411 8411 /
8412 8412 \family typewriter
8413 8413 lout
8414 8414 \family default
8415 8415 are the functional equivalents of
8416 8416 \family typewriter
8417 8417 $
8418 8418 \family default
8419 8419 /
8420 8420 \family typewriter
8421 8421 $$
8422 8422 \family default
8423 8423 .
8424 8424 They are provided to allow you to capture system output in the middle of
8425 8425 true python code, function definitions, etc (where
8426 8426 \family typewriter
8427 8427 $
8428 8428 \family default
8429 8429 and
8430 8430 \family typewriter
8431 8431 $$
8432 8432 \family default
8433 8433 are invalid).
8434 8434 \end_layout
8435 8435
8436 8436 \begin_layout Subsection
8437 8437 Directory management
8438 8438 \end_layout
8439 8439
8440 8440 \begin_layout Standard
8441 8441 Since each command passed by pysh to the underlying system is executed in
8442 8442 a subshell which exits immediately, you can NOT use !cd to navigate the
8443 8443 filesystem.
8444 8444 \end_layout
8445 8445
8446 8446 \begin_layout Standard
8447 8447 Pysh provides its own builtin
8448 8448 \family typewriter
8449 8449 `%cd
8450 8450 \family default
8451 8451 ' magic command to move in the filesystem (the
8452 8452 \family typewriter
8453 8453 %
8454 8454 \family default
8455 8455 is not required with automagic on).
8456 8456 It also maintains a list of visited directories (use
8457 8457 \family typewriter
8458 8458 %dhist
8459 8459 \family default
8460 8460 to see it) and allows direct switching to any of them.
8461 8461 Type
8462 8462 \family typewriter
8463 8463 `cd?
8464 8464 \family default
8465 8465 ' for more details.
8466 8466 \end_layout
8467 8467
8468 8468 \begin_layout Standard
8469 8469
8470 8470 \family typewriter
8471 8471 %pushd
8472 8472 \family default
8473 8473 ,
8474 8474 \family typewriter
8475 8475 %popd
8476 8476 \family default
8477 8477 and
8478 8478 \family typewriter
8479 8479 %dirs
8480 8480 \family default
8481 8481 are provided for directory stack handling.
8482 8482 \end_layout
8483 8483
8484 8484 \begin_layout Subsection
8485 8485 Prompt customization
8486 8486 \end_layout
8487 8487
8488 8488 \begin_layout Standard
8489 8489 The supplied
8490 8490 \family typewriter
8491 8491 ipythonrc-pysh
8492 8492 \family default
8493 8493 profile comes with an example of a very colored and detailed prompt, mainly
8494 8494 to serve as an illustration.
8495 8495 The valid escape sequences, besides color names, are:
8496 8496 \end_layout
8497 8497
8498 8498 \begin_layout Description
8499 8499
8500 8500 \backslash
8501 8501 # - Prompt number, wrapped in the color escapes for the input prompt (determined
8502 8502 by the current color scheme).
8503 8503 \end_layout
8504 8504
8505 8505 \begin_layout Description
8506 8506
8507 8507 \backslash
8508 8508 N - Just the prompt counter number,
8509 8509 \emph on
8510 8510 without
8511 8511 \emph default
8512 8512 any coloring wrappers.
8513 8513 You can thus customize the actual prompt colors manually.
8514 8514 \end_layout
8515 8515
8516 8516 \begin_layout Description
8517 8517
8518 8518 \backslash
8519 8519 D - Dots, as many as there are digits in
8520 8520 \backslash
8521 8521 # (so they align).
8522 8522 \end_layout
8523 8523
8524 8524 \begin_layout Description
8525 8525
8526 8526 \backslash
8527 8527 w - Current working directory (cwd).
8528 8528 \end_layout
8529 8529
8530 8530 \begin_layout Description
8531 8531
8532 8532 \backslash
8533 8533 W - Basename of current working directory.
8534 8534 \end_layout
8535 8535
8536 8536 \begin_layout Description
8537 8537
8538 8538 \backslash
8539 8539 X
8540 8540 \emph on
8541 8541 N
8542 8542 \emph default
8543 8543 - Where
8544 8544 \emph on
8545 8545 N
8546 8546 \emph default
8547 8547 =0..5.
8548 8548 N terms of the cwd, with $HOME written as ~.
8549 8549 \end_layout
8550 8550
8551 8551 \begin_layout Description
8552 8552
8553 8553 \backslash
8554 8554 Y
8555 8555 \emph on
8556 8556 N
8557 8557 \emph default
8558 8558 - Where
8559 8559 \emph on
8560 8560 N
8561 8561 \emph default
8562 8562 =0..5.
8563 8563 Like X
8564 8564 \emph on
8565 8565 N
8566 8566 \emph default
8567 8567 , but if ~ is term
8568 8568 \emph on
8569 8569 N
8570 8570 \emph default
8571 8571 +1 it's also shown.
8572 8572 \end_layout
8573 8573
8574 8574 \begin_layout Description
8575 8575
8576 8576 \backslash
8577 8577 u - Username.
8578 8578 \end_layout
8579 8579
8580 8580 \begin_layout Description
8581 8581
8582 8582 \backslash
8583 8583 H - Full hostname.
8584 8584 \end_layout
8585 8585
8586 8586 \begin_layout Description
8587 8587
8588 8588 \backslash
8589 8589 h - Hostname up to first '.'
8590 8590 \end_layout
8591 8591
8592 8592 \begin_layout Description
8593 8593
8594 8594 \backslash
8595 8595 $ - Root symbol ($ or #).
8596 8596
8597 8597 \end_layout
8598 8598
8599 8599 \begin_layout Description
8600 8600
8601 8601 \backslash
8602 8602 t - Current time, in H:M:S format.
8603 8603 \end_layout
8604 8604
8605 8605 \begin_layout Description
8606 8606
8607 8607 \backslash
8608 8608 v - IPython release version.
8609 8609
8610 8610 \end_layout
8611 8611
8612 8612 \begin_layout Description
8613 8613
8614 8614 \backslash
8615 8615 n - Newline.
8616 8616
8617 8617 \end_layout
8618 8618
8619 8619 \begin_layout Description
8620 8620
8621 8621 \backslash
8622 8622 r - Carriage return.
8623 8623
8624 8624 \end_layout
8625 8625
8626 8626 \begin_layout Description
8627 8627
8628 8628 \backslash
8629 8629
8630 8630 \backslash
8631 8631 - An explicitly escaped '
8632 8632 \backslash
8633 8633 '.
8634 8634 \end_layout
8635 8635
8636 8636 \begin_layout Standard
8637 8637 You can configure your prompt colors using any ANSI color escape.
8638 8638 Each color escape sets the color for any subsequent text, until another
8639 8639 escape comes in and changes things.
8640 8640 The valid color escapes are:
8641 8641 \end_layout
8642 8642
8643 8643 \begin_layout Description
8644 8644
8645 8645 \backslash
8646 8646 C_Black
8647 8647 \end_layout
8648 8648
8649 8649 \begin_layout Description
8650 8650
8651 8651 \backslash
8652 8652 C_Blue
8653 8653 \end_layout
8654 8654
8655 8655 \begin_layout Description
8656 8656
8657 8657 \backslash
8658 8658 C_Brown
8659 8659 \end_layout
8660 8660
8661 8661 \begin_layout Description
8662 8662
8663 8663 \backslash
8664 8664 C_Cyan
8665 8665 \end_layout
8666 8666
8667 8667 \begin_layout Description
8668 8668
8669 8669 \backslash
8670 8670 C_DarkGray
8671 8671 \end_layout
8672 8672
8673 8673 \begin_layout Description
8674 8674
8675 8675 \backslash
8676 8676 C_Green
8677 8677 \end_layout
8678 8678
8679 8679 \begin_layout Description
8680 8680
8681 8681 \backslash
8682 8682 C_LightBlue
8683 8683 \end_layout
8684 8684
8685 8685 \begin_layout Description
8686 8686
8687 8687 \backslash
8688 8688 C_LightCyan
8689 8689 \end_layout
8690 8690
8691 8691 \begin_layout Description
8692 8692
8693 8693 \backslash
8694 8694 C_LightGray
8695 8695 \end_layout
8696 8696
8697 8697 \begin_layout Description
8698 8698
8699 8699 \backslash
8700 8700 C_LightGreen
8701 8701 \end_layout
8702 8702
8703 8703 \begin_layout Description
8704 8704
8705 8705 \backslash
8706 8706 C_LightPurple
8707 8707 \end_layout
8708 8708
8709 8709 \begin_layout Description
8710 8710
8711 8711 \backslash
8712 8712 C_LightRed
8713 8713 \end_layout
8714 8714
8715 8715 \begin_layout Description
8716 8716
8717 8717 \backslash
8718 8718 C_Purple
8719 8719 \end_layout
8720 8720
8721 8721 \begin_layout Description
8722 8722
8723 8723 \backslash
8724 8724 C_Red
8725 8725 \end_layout
8726 8726
8727 8727 \begin_layout Description
8728 8728
8729 8729 \backslash
8730 8730 C_White
8731 8731 \end_layout
8732 8732
8733 8733 \begin_layout Description
8734 8734
8735 8735 \backslash
8736 8736 C_Yellow
8737 8737 \end_layout
8738 8738
8739 8739 \begin_layout Description
8740 8740
8741 8741 \backslash
8742 8742 C_Normal Stop coloring, defaults to your terminal settings.
8743 8743 \end_layout
8744 8744
8745 8745 \begin_layout Section
8746 8746 \begin_inset LatexCommand \label{sec:Threading-support}
8747 8747
8748 8748 \end_inset
8749 8749
8750 8750 Threading support
8751 8751 \end_layout
8752 8752
8753 8753 \begin_layout Standard
8754 8754
8755 8755 \series bold
8756 8756 WARNING:
8757 8757 \series default
8758 8758 The threading support is still somewhat experimental, and it has only seen
8759 8759 reasonable testing under Linux.
8760 8760 Threaded code is particularly tricky to debug, and it tends to show extremely
8761 8761 platform-dependent behavior.
8762 8762 Since I only have access to Linux machines, I will have to rely on user's
8763 8763 experiences and assistance for this area of IPython to improve under other
8764 8764 platforms.
8765 8765 \end_layout
8766 8766
8767 8767 \begin_layout Standard
8768 8768 IPython, via the
8769 8769 \family typewriter
8770 8770 -gthread
8771 8771 \family default
8772 8772 ,
8773 8773 \family typewriter
8774 8774 -qthread
8775 8775 \family default
8776 ,
8777 \family typewriter
8778 -q4thread
8779 \family default
8776 8780 and
8777 8781 \family typewriter
8778 8782 -wthread
8779 8783 \family default
8780 8784 options (described in Sec.\InsetSpace ~
8781 8785
8782 8786 \begin_inset LatexCommand \ref{sec:threading-opts}
8783 8787
8784 8788 \end_inset
8785 8789
8786 ), can run in multithreaded mode to support pyGTK, Qt and WXPython applications
8787 respectively.
8790 ), can run in multithreaded mode to support pyGTK, Qt3, Qt4 and WXPython
8791 applications respectively.
8788 8792 These GUI toolkits need to control the python main loop of execution, so
8789 under a normal Python interpreter, starting a pyGTK, Qt or WXPython application
8790 will immediately freeze the shell.
8793 under a normal Python interpreter, starting a pyGTK, Qt3, Qt4 or WXPython
8794 application will immediately freeze the shell.
8791 8795
8792 8796 \end_layout
8793 8797
8794 8798 \begin_layout Standard
8795 8799 IPython, with one of these options (you can only use one at a time), separates
8796 8800 the graphical loop and IPython's code execution run into different threads.
8797 8801 This allows you to test interactively (with
8798 8802 \family typewriter
8799 8803 %run
8800 8804 \family default
8801 8805 , for example) your GUI code without blocking.
8802 8806 \end_layout
8803 8807
8804 8808 \begin_layout Standard
8805 8809 A nice mini-tutorial on using IPython along with the Qt Designer application
8806 8810 is available at the SciPy wiki:
8807 8811 \begin_inset LatexCommand \htmlurl{http://www.scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer}
8808 8812
8809 8813 \end_inset
8810 8814
8811 8815 .
8812 8816 \end_layout
8813 8817
8814 8818 \begin_layout Subsection
8815 8819 Tk issues
8816 8820 \end_layout
8817 8821
8818 8822 \begin_layout Standard
8819 8823 As indicated in Sec.\InsetSpace ~
8820 8824
8821 8825 \begin_inset LatexCommand \ref{sec:threading-opts}
8822 8826
8823 8827 \end_inset
8824 8828
8825 8829 , a special
8826 8830 \family typewriter
8827 8831 -tk
8828 8832 \family default
8829 8833 option is provided to try and allow Tk graphical applications to coexist
8830 8834 interactively with WX, Qt or GTK ones.
8831 8835 Whether this works at all, however, is very platform and configuration
8832 8836 dependent.
8833 8837 Please experiment with simple test cases before committing to using this
8834 8838 combination of Tk and GTK/Qt/WX threading in a production environment.
8835 8839 \end_layout
8836 8840
8837 8841 \begin_layout Subsection
8838 Signals and Threads
8839 \end_layout
8840
8841 \begin_layout Standard
8842 When any of the thread systems (GTK, Qt or WX) are active, either directly
8843 or via
8844 \family typewriter
8845 -pylab
8846 \family default
8847 with a threaded backend, it is impossible to interrupt long-running Python
8848 code via
8849 \family typewriter
8850 Ctrl-C
8851 \family default
8852 .
8853 IPython can not pass the KeyboardInterrupt exception (or the underlying
8854
8855 \family typewriter
8856 SIGINT
8857 \family default
8858 ) across threads, so any long-running process started from IPython will
8859 run to completion, or will have to be killed via an external (OS-based)
8860 mechanism.
8861 \end_layout
8862
8863 \begin_layout Standard
8864 To the best of my knowledge, this limitation is imposed by the Python interprete
8865 r itself, and it comes from the difficulty of writing portable signal/threaded
8866 code.
8867 If any user is an expert on this topic and can suggest a better solution,
8868 I would love to hear about it.
8869 In the IPython sources, look at the
8870 \family typewriter
8871 Shell.py
8872 \family default
8873 module, and in particular at the
8874 \family typewriter
8875 runcode()
8876 \family default
8877 method.
8878
8879 \end_layout
8880
8881 \begin_layout Subsection
8882 8842 I/O pitfalls
8883 8843 \end_layout
8884 8844
8885 8845 \begin_layout Standard
8886 8846 Be mindful that the Python interpreter switches between threads every
8887 8847 \begin_inset Formula $N$
8888 8848 \end_inset
8889 8849
8890 8850 bytecodes, where the default value as of Python\InsetSpace ~
8891 8851 2.3 is
8892 8852 \begin_inset Formula $N=100.$
8893 8853 \end_inset
8894 8854
8895 8855 This value can be read by using the
8896 8856 \family typewriter
8897 8857 sys.getcheckinterval()
8898 8858 \family default
8899 8859 function, and it can be reset via
8900 8860 \family typewriter
8901 8861 sys.setcheckinterval(
8902 8862 \emph on
8903 8863 N
8904 8864 \emph default
8905 8865 )
8906 8866 \family default
8907 8867 .
8908 8868 This switching of threads can cause subtly confusing effects if one of
8909 8869 your threads is doing file I/O.
8910 8870 In text mode, most systems only flush file buffers when they encounter
8911 8871 a
8912 8872 \family typewriter
8913 8873 `
8914 8874 \backslash
8915 8875 n'
8916 8876 \family default
8917 8877 .
8918 8878 An instruction as simple as
8919 8879 \family typewriter
8920 8880
8921 8881 \newline
8922 8882 \InsetSpace ~
8923 8883 \InsetSpace ~
8924 8884 print >> filehandle,
8925 8885 \begin_inset Quotes eld
8926 8886 \end_inset
8927 8887
8928 8888 hello world
8929 8889 \begin_inset Quotes erd
8930 8890 \end_inset
8931 8891
8932 8892
8933 8893 \family default
8934 8894
8935 8895 \newline
8936 8896 actually consists of several bytecodes, so it is possible that the newline
8937 8897 does not reach your file before the next thread switch.
8938 8898 Similarly, if you are writing to a file in binary mode, the file won't
8939 8899 be flushed until the buffer fills, and your other thread may see apparently
8940 8900 truncated files.
8941 8901
8942 8902 \end_layout
8943 8903
8944 8904 \begin_layout Standard
8945 8905 For this reason, if you are using IPython's thread support and have (for
8946 8906 example) a GUI application which will read data generated by files written
8947 8907 to from the IPython thread, the safest approach is to open all of your
8948 8908 files in unbuffered mode (the third argument to the
8949 8909 \family typewriter
8950 8910 file/open
8951 8911 \family default
8952 8912 function is the buffering value):
8953 8913 \newline
8954 8914
8955 8915 \family typewriter
8956 8916 \InsetSpace ~
8957 8917 \InsetSpace ~
8958 8918 filehandle = open(filename,mode,0)
8959 8919 \end_layout
8960 8920
8961 8921 \begin_layout Standard
8962 8922 This is obviously a brute force way of avoiding race conditions with the
8963 8923 file buffering.
8964 8924 If you want to do it cleanly, and you have a resource which is being shared
8965 8925 by the interactive IPython loop and your GUI thread, you should really
8966 8926 handle it with thread locking and syncrhonization properties.
8967 8927 The Python documentation discusses these.
8968 8928 \end_layout
8969 8929
8970 8930 \begin_layout Section
8971 8931 \begin_inset LatexCommand \label{sec:interactive-demos}
8972 8932
8973 8933 \end_inset
8974 8934
8975 8935 Interactive demos with IPython
8976 8936 \end_layout
8977 8937
8978 8938 \begin_layout Standard
8979 8939 IPython ships with a basic system for running scripts interactively in sections,
8980 8940 useful when presenting code to audiences.
8981 8941 A few tags embedded in comments (so that the script remains valid Python
8982 8942 code) divide a file into separate blocks, and the demo can be run one block
8983 8943 at a time, with IPython printing (with syntax highlighting) the block before
8984 8944 executing it, and returning to the interactive prompt after each block.
8985 8945 The interactive namespace is updated after each block is run with the contents
8986 8946 of the demo's namespace.
8987 8947 \end_layout
8988 8948
8989 8949 \begin_layout Standard
8990 8950 This allows you to show a piece of code, run it and then execute interactively
8991 8951 commands based on the variables just created.
8992 8952 Once you want to continue, you simply execute the next block of the demo.
8993 8953 The following listing shows the markup necessary for dividing a script
8994 8954 into sections for execution as a demo.
8995 8955 \end_layout
8996 8956
8997 8957 \begin_layout Standard
8998 8958 \begin_inset ERT
8999 8959 status open
9000 8960
9001 8961 \begin_layout Standard
9002 8962
9003 8963
9004 8964 \backslash
9005 8965 codelist{examples/example-demo.py}
9006 8966 \end_layout
9007 8967
9008 8968 \end_inset
9009 8969
9010 8970
9011 8971 \end_layout
9012 8972
9013 8973 \begin_layout Standard
9014 8974 In order to run a file as a demo, you must first make a
9015 8975 \family typewriter
9016 8976 Demo
9017 8977 \family default
9018 8978 object out of it.
9019 8979 If the file is named
9020 8980 \family typewriter
9021 8981 myscript.py
9022 8982 \family default
9023 8983 , the following code will make a demo:
9024 8984 \end_layout
9025 8985
9026 8986 \begin_layout LyX-Code
9027 8987 from IPython.demo import Demo
9028 8988 \end_layout
9029 8989
9030 8990 \begin_layout LyX-Code
9031 8991 mydemo = Demo('myscript.py')
9032 8992 \end_layout
9033 8993
9034 8994 \begin_layout Standard
9035 8995 This creates the
9036 8996 \family typewriter
9037 8997 mydemo
9038 8998 \family default
9039 8999 object, whose blocks you run one at a time by simply calling the object
9040 9000 with no arguments.
9041 9001 If you have autocall active in IPython (the default), all you need to do
9042 9002 is type
9043 9003 \end_layout
9044 9004
9045 9005 \begin_layout LyX-Code
9046 9006 mydemo
9047 9007 \end_layout
9048 9008
9049 9009 \begin_layout Standard
9050 9010 and IPython will call it, executing each block.
9051 9011 Demo objects can be restarted, you can move forward or back skipping blocks,
9052 9012 re-execute the last block, etc.
9053 9013 Simply use the Tab key on a demo object to see its methods, and call
9054 9014 \family typewriter
9055 9015 `?'
9056 9016 \family default
9057 9017 on them to see their docstrings for more usage details.
9058 9018 In addition, the
9059 9019 \family typewriter
9060 9020 demo
9061 9021 \family default
9062 9022 module itself contains a comprehensive docstring, which you can access
9063 9023 via
9064 9024 \end_layout
9065 9025
9066 9026 \begin_layout LyX-Code
9067 9027 from IPython import demo
9068 9028 \end_layout
9069 9029
9070 9030 \begin_layout LyX-Code
9071 9031 demo?
9072 9032 \end_layout
9073 9033
9074 9034 \begin_layout Standard
9075 9035
9076 9036 \series bold
9077 9037 Limitations:
9078 9038 \series default
9079 9039 It is important to note that these demos are limited to fairly simple uses.
9080 9040 In particular, you can
9081 9041 \emph on
9082 9042 not
9083 9043 \emph default
9084 9044 put division marks in indented code (loops, if statements, function definitions
9085 9045 , etc.) Supporting something like this would basically require tracking the
9086 9046 internal execution state of the Python interpreter, so only top-level divisions
9087 9047 are allowed.
9088 9048 If you want to be able to open an IPython instance at an arbitrary point
9089 9049 in a program, you can use IPython's embedding facilities, described in
9090 9050 detail in Sec\SpecialChar \@.
9091 9051 \InsetSpace ~
9092 9052
9093 9053 \begin_inset LatexCommand \ref{sec:embed}
9094 9054
9095 9055 \end_inset
9096 9056
9097 9057 .
9098 9058 \end_layout
9099 9059
9100 9060 \begin_layout Section
9101 9061 \begin_inset LatexCommand \label{sec:matplotlib-support}
9102 9062
9103 9063 \end_inset
9104 9064
9105 9065 Plotting with
9106 9066 \family typewriter
9107 9067 matplotlib
9108 9068 \family default
9109 9069
9110 9070 \end_layout
9111 9071
9112 9072 \begin_layout Standard
9113 9073 The matplotlib library (
9114 9074 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
9115 9075
9116 9076 \end_inset
9117 9077
9118 9078 ) provides high quality 2D plotting for Python.
9119 9079 Matplotlib can produce plots on screen using a variety of GUI toolkits,
9120 9080 including Tk, GTK and WXPython.
9121 9081 It also provides a number of commands useful for scientific computing,
9122 9082 all with a syntax compatible with that of the popular Matlab program.
9123 9083 \end_layout
9124 9084
9125 9085 \begin_layout Standard
9126 9086 IPython accepts the special option
9127 9087 \family typewriter
9128 9088 -pylab
9129 9089 \family default
9130 9090 (Sec.\InsetSpace ~
9131 9091
9132 9092 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
9133 9093
9134 9094 \end_inset
9135 9095
9136 9096 ).
9137 9097 This configures it to support matplotlib, honoring the settings in the
9138 9098
9139 9099 \family typewriter
9140 9100 .matplotlibrc
9141 9101 \family default
9142 9102 file.
9143 9103 IPython will detect the user's choice of matplotlib GUI backend, and automatica
9144 9104 lly select the proper threading model to prevent blocking.
9145 9105 It also sets matplotlib in interactive mode and modifies
9146 9106 \family typewriter
9147 9107 %run
9148 9108 \family default
9149 9109 slightly, so that any matplotlib-based script can be executed using
9150 9110 \family typewriter
9151 9111 %run
9152 9112 \family default
9153 9113 and the final
9154 9114 \family typewriter
9155 9115 show()
9156 9116 \family default
9157 9117 command does not block the interactive shell.
9158 9118 \end_layout
9159 9119
9160 9120 \begin_layout Standard
9161 9121 The
9162 9122 \family typewriter
9163 9123 -pylab
9164 9124 \family default
9165 9125 option must be given first in order for IPython to configure its threading
9166 9126 mode.
9167 9127 However, you can still issue other options afterwards.
9168 9128 This allows you to have a matplotlib-based environment customized with
9169 9129 additional modules using the standard IPython profile mechanism (Sec.\InsetSpace ~
9170 9130
9171 9131 \begin_inset LatexCommand \ref{sec:profiles}
9172 9132
9173 9133 \end_inset
9174 9134
9175 9135 ): ``
9176 9136 \family typewriter
9177 9137 ipython -pylab -p myprofile
9178 9138 \family default
9179 9139 '' will load the profile defined in
9180 9140 \family typewriter
9181 9141 ipythonrc-myprofile
9182 9142 \family default
9183 9143 after configuring matplotlib.
9184 9144 \end_layout
9185 9145
9186 9146 \begin_layout Section
9187 9147 \begin_inset LatexCommand \label{sec:Gnuplot}
9188 9148
9189 9149 \end_inset
9190 9150
9191 9151 Plotting with
9192 9152 \family typewriter
9193 9153 Gnuplot
9194 9154 \end_layout
9195 9155
9196 9156 \begin_layout Standard
9197 9157 Through the magic extension system described in sec.
9198 9158
9199 9159 \begin_inset LatexCommand \ref{sec:magic}
9200 9160
9201 9161 \end_inset
9202 9162
9203 9163 , IPython incorporates a mechanism for conveniently interfacing with the
9204 9164 Gnuplot system (
9205 9165 \begin_inset LatexCommand \htmlurl{http://www.gnuplot.info}
9206 9166
9207 9167 \end_inset
9208 9168
9209 9169 ).
9210 9170 Gnuplot is a very complete 2D and 3D plotting package available for many
9211 9171 operating systems and commonly included in modern Linux distributions.
9212 9172
9213 9173 \end_layout
9214 9174
9215 9175 \begin_layout Standard
9216 9176 Besides having Gnuplot installed, this functionality requires the
9217 9177 \family typewriter
9218 9178 Gnuplot.py
9219 9179 \family default
9220 9180 module for interfacing python with Gnuplot.
9221 9181 It can be downloaded from:
9222 9182 \begin_inset LatexCommand \htmlurl{http://gnuplot-py.sourceforge.net}
9223 9183
9224 9184 \end_inset
9225 9185
9226 9186 .
9227 9187 \end_layout
9228 9188
9229 9189 \begin_layout Subsection
9230 9190 Proper Gnuplot configuration
9231 9191 \end_layout
9232 9192
9233 9193 \begin_layout Standard
9234 9194 As of version 4.0, Gnuplot has excellent mouse and interactive keyboard support.
9235 9195 However, as of
9236 9196 \family typewriter
9237 9197 Gnuplot.py
9238 9198 \family default
9239 9199 version 1.7, a new option was added to communicate between Python and Gnuplot
9240 9200 via FIFOs (pipes).
9241 9201 This mechanism, while fast, also breaks the mouse system.
9242 9202 You must therefore set the variable
9243 9203 \family typewriter
9244 9204 prefer_fifo_data
9245 9205 \family default
9246 9206 to
9247 9207 \family typewriter
9248 9208 0
9249 9209 \family default
9250 9210 in file
9251 9211 \family typewriter
9252 9212 gp_unix.py
9253 9213 \family default
9254 9214 if you wish to keep the interactive mouse and keyboard features working
9255 9215 properly (
9256 9216 \family typewriter
9257 9217 prefer_inline_data
9258 9218 \family default
9259 9219 also must be
9260 9220 \family typewriter
9261 9221 0
9262 9222 \family default
9263 9223 , but this is the default so unless you've changed it manually you should
9264 9224 be fine).
9265 9225 \end_layout
9266 9226
9267 9227 \begin_layout Standard
9268 9228 'Out of the box', Gnuplot is configured with a rather poor set of size,
9269 9229 color and linewidth choices which make the graphs fairly hard to read on
9270 9230 modern high-resolution displays (although they work fine on old 640x480
9271 9231 ones).
9272 9232 Below is a section of my
9273 9233 \family typewriter
9274 9234 .Xdefaults
9275 9235 \family default
9276 9236 file which I use for having a more convenient Gnuplot setup.
9277 9237 Remember to load it by running
9278 9238 \family typewriter
9279 9239 `xrdb .Xdefaults`
9280 9240 \family default
9281 9241 :
9282 9242 \end_layout
9283 9243
9284 9244 \begin_layout Standard
9285 9245
9286 9246 \family typewriter
9287 9247 !******************************************************************
9288 9248 \newline
9289 9249 ! gnuplot
9290 9250 options
9291 9251 \newline
9292 9252 ! modify this for a convenient window size
9293 9253 \newline
9294 9254 gnuplot*geometry: 780x580
9295 9255 \end_layout
9296 9256
9297 9257 \begin_layout Standard
9298 9258
9299 9259 \family typewriter
9300 9260 ! on-screen font (not for PostScript)
9301 9261 \newline
9302 9262 gnuplot*font: -misc-fixed-bold-r-normal--15
9303 9263 -120-100-100-c-90-iso8859-1
9304 9264 \end_layout
9305 9265
9306 9266 \begin_layout Standard
9307 9267
9308 9268 \family typewriter
9309 9269 ! color options
9310 9270 \newline
9311 9271 gnuplot*background: black
9312 9272 \newline
9313 9273 gnuplot*textColor: white
9314 9274 \newline
9315 9275 gnuplot*borderCo
9316 9276 lor: white
9317 9277 \newline
9318 9278 gnuplot*axisColor: white
9319 9279 \newline
9320 9280 gnuplot*line1Color: red
9321 9281 \newline
9322 9282 gnuplot*line2Color:
9323 9283 green
9324 9284 \newline
9325 9285 gnuplot*line3Color: blue
9326 9286 \newline
9327 9287 gnuplot*line4Color: magenta
9328 9288 \newline
9329 9289 gnuplot*line5Color:
9330 9290 cyan
9331 9291 \newline
9332 9292 gnuplot*line6Color: sienna
9333 9293 \newline
9334 9294 gnuplot*line7Color: orange
9335 9295 \newline
9336 9296 gnuplot*line8Color:
9337 9297 coral
9338 9298 \end_layout
9339 9299
9340 9300 \begin_layout Standard
9341 9301
9342 9302 \family typewriter
9343 9303 ! multiplicative factor for point styles
9344 9304 \newline
9345 9305 gnuplot*pointsize: 2
9346 9306 \end_layout
9347 9307
9348 9308 \begin_layout Standard
9349 9309
9350 9310 \family typewriter
9351 9311 ! line width options (in pixels)
9352 9312 \newline
9353 9313 gnuplot*borderWidth: 2
9354 9314 \newline
9355 9315 gnuplot*axisWidth:
9356 9316 2
9357 9317 \newline
9358 9318 gnuplot*line1Width: 2
9359 9319 \newline
9360 9320 gnuplot*line2Width: 2
9361 9321 \newline
9362 9322 gnuplot*line3Width: 2
9363 9323 \newline
9364 9324 gnuplot*line4Wi
9365 9325 dth: 2
9366 9326 \newline
9367 9327 gnuplot*line5Width: 2
9368 9328 \newline
9369 9329 gnuplot*line6Width: 2
9370 9330 \newline
9371 9331 gnuplot*line7Width: 2
9372 9332 \newline
9373 9333 gnuplot*lin
9374 9334 e8Width: 2
9375 9335 \end_layout
9376 9336
9377 9337 \begin_layout Subsection
9378 9338 The
9379 9339 \family typewriter
9380 9340 IPython.GnuplotRuntime
9381 9341 \family default
9382 9342 module
9383 9343 \end_layout
9384 9344
9385 9345 \begin_layout Standard
9386 9346 IPython includes a module called
9387 9347 \family typewriter
9388 9348 Gnuplot2.py
9389 9349 \family default
9390 9350 which extends and improves the default
9391 9351 \family typewriter
9392 9352 Gnuplot
9393 9353 \family default
9394 9354 .
9395 9355 \family typewriter
9396 9356 py
9397 9357 \family default
9398 9358 (which it still relies upon).
9399 9359 For example, the new
9400 9360 \family typewriter
9401 9361 plot
9402 9362 \family default
9403 9363 function adds several improvements to the original making it more convenient
9404 9364 for interactive use, and
9405 9365 \family typewriter
9406 9366 hardcopy
9407 9367 \family default
9408 9368 fixes a bug in the original which under some circumstances blocks the creation
9409 9369 of PostScript output.
9410 9370 \end_layout
9411 9371
9412 9372 \begin_layout Standard
9413 9373 For scripting use,
9414 9374 \family typewriter
9415 9375 GnuplotRuntime.py
9416 9376 \family default
9417 9377 is provided, which wraps
9418 9378 \family typewriter
9419 9379 Gnuplot2.py
9420 9380 \family default
9421 9381 and creates a series of global aliases.
9422 9382 These make it easy to control Gnuplot plotting jobs through the Python
9423 9383 language.
9424 9384 \end_layout
9425 9385
9426 9386 \begin_layout Standard
9427 9387 Below is some example code which illustrates how to configure Gnuplot inside
9428 9388 your own programs but have it available for further interactive use through
9429 9389 an embedded IPython instance.
9430 9390 Simply run this file at a system prompt.
9431 9391 This file is provided as
9432 9392 \family typewriter
9433 9393 example-gnuplot.py
9434 9394 \family default
9435 9395 in the examples directory:
9436 9396 \end_layout
9437 9397
9438 9398 \begin_layout Standard
9439 9399 \begin_inset ERT
9440 9400 status open
9441 9401
9442 9402 \begin_layout Standard
9443 9403
9444 9404
9445 9405 \backslash
9446 9406 codelist{examples/example-gnuplot.py}
9447 9407 \end_layout
9448 9408
9449 9409 \end_inset
9450 9410
9451 9411
9452 9412 \end_layout
9453 9413
9454 9414 \begin_layout Subsection
9455 9415 The
9456 9416 \family typewriter
9457 9417 numeric
9458 9418 \family default
9459 9419 profile: a scientific computing environment
9460 9420 \end_layout
9461 9421
9462 9422 \begin_layout Standard
9463 9423 The
9464 9424 \family typewriter
9465 9425 numeric
9466 9426 \family default
9467 9427 IPython profile, which you can activate with
9468 9428 \family typewriter
9469 9429 `ipython -p numeric
9470 9430 \family default
9471 9431 ' will automatically load the IPython Gnuplot extensions (plus Numeric and
9472 9432 other useful things for numerical computing), contained in the
9473 9433 \family typewriter
9474 9434 IPython.GnuplotInteractive
9475 9435 \family default
9476 9436 module.
9477 9437 This will create the globals
9478 9438 \family typewriter
9479 9439 Gnuplot
9480 9440 \family default
9481 9441 (an alias to the improved Gnuplot2 module),
9482 9442 \family typewriter
9483 9443 gp
9484 9444 \family default
9485 9445 (a Gnuplot active instance), the new magic commands
9486 9446 \family typewriter
9487 9447 %gpc
9488 9448 \family default
9489 9449 and
9490 9450 \family typewriter
9491 9451 %gp_set_instance
9492 9452 \family default
9493 9453 and several other convenient globals.
9494 9454 Type
9495 9455 \family typewriter
9496 9456 gphelp()
9497 9457 \family default
9498 9458 for further details.
9499 9459 \end_layout
9500 9460
9501 9461 \begin_layout Standard
9502 9462 This should turn IPython into a convenient environment for numerical computing,
9503 9463 with all the functions in the NumPy library and the Gnuplot facilities
9504 9464 for plotting.
9505 9465 Further improvements can be obtained by loading the SciPy libraries for
9506 9466 scientific computing, available at
9507 9467 \begin_inset LatexCommand \htmlurl{http://scipy.org}
9508 9468
9509 9469 \end_inset
9510 9470
9511 9471 .
9512 9472 \end_layout
9513 9473
9514 9474 \begin_layout Standard
9515 9475 If you are in the middle of a working session with numerical objects and
9516 9476 need to plot them but you didn't start the
9517 9477 \family typewriter
9518 9478 numeric
9519 9479 \family default
9520 9480 profile, you can load these extensions at any time by typing
9521 9481 \newline
9522 9482
9523 9483 \family typewriter
9524 9484 from IPython.GnuplotInteractive import *
9525 9485 \newline
9526 9486
9527 9487 \family default
9528 9488 at the IPython prompt.
9529 9489 This will allow you to keep your objects intact and start using Gnuplot
9530 9490 to view them.
9531 9491 \end_layout
9532 9492
9533 9493 \begin_layout Section
9534 9494 Reporting bugs
9535 9495 \end_layout
9536 9496
9537 9497 \begin_layout Subsection*
9538 9498 Automatic crash reports
9539 9499 \end_layout
9540 9500
9541 9501 \begin_layout Standard
9542 9502 Ideally, IPython itself shouldn't crash.
9543 9503 It will catch exceptions produced by you, but bugs in its internals will
9544 9504 still crash it.
9545 9505 \end_layout
9546 9506
9547 9507 \begin_layout Standard
9548 9508 In such a situation, IPython will leave a file named
9549 9509 \family typewriter
9550 9510 IPython_crash_report.txt
9551 9511 \family default
9552 9512 in your IPYTHONDIR directory (that way if crashes happen several times
9553 9513 it won't litter many directories, the post-mortem file is always located
9554 9514 in the same place and new occurrences just overwrite the previous one).
9555 9515 If you can mail this file to the developers (see sec.
9556 9516
9557 9517 \begin_inset LatexCommand \ref{sec:credits}
9558 9518
9559 9519 \end_inset
9560 9520
9561 9521 for names and addresses), it will help us
9562 9522 \emph on
9563 9523 a lot
9564 9524 \emph default
9565 9525 in understanding the cause of the problem and fixing it sooner.
9566 9526 \end_layout
9567 9527
9568 9528 \begin_layout Subsection*
9569 9529 The bug tracker
9570 9530 \end_layout
9571 9531
9572 9532 \begin_layout Standard
9573 9533 IPython also has an online bug-tracker, located at
9574 9534 \begin_inset LatexCommand \htmlurl{http://projects.scipy.org/ipython/ipython/report/1}
9575 9535
9576 9536 \end_inset
9577 9537
9578 9538 .
9579 9539 In addition to mailing the developers, it would be a good idea to file
9580 9540 a bug report here.
9581 9541 This will ensure that the issue is properly followed to conclusion.
9582 9542 To report new bugs you will have to register first.
9583 9543 \end_layout
9584 9544
9585 9545 \begin_layout Standard
9586 9546 You can also use this bug tracker to file feature requests.
9587 9547 \end_layout
9588 9548
9589 9549 \begin_layout Section
9590 9550 Brief history
9591 9551 \end_layout
9592 9552
9593 9553 \begin_layout Subsection
9594 9554 Origins
9595 9555 \end_layout
9596 9556
9597 9557 \begin_layout Standard
9598 9558 The current IPython system grew out of the following three projects:
9599 9559 \end_layout
9600 9560
9601 9561 \begin_layout List
9602 9562 \labelwidthstring 00.00.0000
9603 9563 ipython by Fernando P
9604 9564 \begin_inset ERT
9605 9565 status collapsed
9606 9566
9607 9567 \begin_layout Standard
9608 9568
9609 9569
9610 9570 \backslash
9611 9571 '{e}
9612 9572 \end_layout
9613 9573
9614 9574 \end_inset
9615 9575
9616 9576 rez.
9617 9577 I was working on adding Mathematica-type prompts and a flexible configuration
9618 9578 system (something better than
9619 9579 \family typewriter
9620 9580 $PYTHONSTARTUP
9621 9581 \family default
9622 9582 ) to the standard Python interactive interpreter.
9623 9583 \end_layout
9624 9584
9625 9585 \begin_layout List
9626 9586 \labelwidthstring 00.00.0000
9627 9587 IPP by Janko Hauser.
9628 9588 Very well organized, great usability.
9629 9589 Had an old help system.
9630 9590 IPP was used as the `container' code into which I added the functionality
9631 9591 from ipython and LazyPython.
9632 9592 \end_layout
9633 9593
9634 9594 \begin_layout List
9635 9595 \labelwidthstring 00.00.0000
9636 9596 LazyPython by Nathan Gray.
9637 9597 Simple but
9638 9598 \emph on
9639 9599 very
9640 9600 \emph default
9641 9601 powerful.
9642 9602 The quick syntax (auto parens, auto quotes) and verbose/colored tracebacks
9643 9603 were all taken from here.
9644 9604 \end_layout
9645 9605
9646 9606 \begin_layout Standard
9647 9607 When I found out (see sec.
9648 9608
9649 9609 \begin_inset LatexCommand \ref{figgins}
9650 9610
9651 9611 \end_inset
9652 9612
9653 9613 ) about IPP and LazyPython I tried to join all three into a unified system.
9654 9614 I thought this could provide a very nice working environment, both for
9655 9615 regular programming and scientific computing: shell-like features, IDL/Matlab
9656 9616 numerics, Mathematica-type prompt history and great object introspection
9657 9617 and help facilities.
9658 9618 I think it worked reasonably well, though it was a lot more work than I
9659 9619 had initially planned.
9660 9620 \end_layout
9661 9621
9662 9622 \begin_layout Subsection
9663 9623 Current status
9664 9624 \end_layout
9665 9625
9666 9626 \begin_layout Standard
9667 9627 The above listed features work, and quite well for the most part.
9668 9628 But until a major internal restructuring is done (see below), only bug
9669 9629 fixing will be done, no other features will be added (unless very minor
9670 9630 and well localized in the cleaner parts of the code).
9671 9631 \end_layout
9672 9632
9673 9633 \begin_layout Standard
9674 9634 IPython consists of some 18000 lines of pure python code, of which roughly
9675 9635 two thirds is reasonably clean.
9676 9636 The rest is, messy code which needs a massive restructuring before any
9677 9637 further major work is done.
9678 9638 Even the messy code is fairly well documented though, and most of the problems
9679 9639 in the (non-existent) class design are well pointed to by a PyChecker run.
9680 9640 So the rewriting work isn't that bad, it will just be time-consuming.
9681 9641 \end_layout
9682 9642
9683 9643 \begin_layout Subsection
9684 9644 Future
9685 9645 \end_layout
9686 9646
9687 9647 \begin_layout Standard
9688 9648 See the separate
9689 9649 \family typewriter
9690 9650 new_design
9691 9651 \family default
9692 9652 document for details.
9693 9653 Ultimately, I would like to see IPython become part of the standard Python
9694 9654 distribution as a `big brother with batteries' to the standard Python interacti
9695 9655 ve interpreter.
9696 9656 But that will never happen with the current state of the code, so all contribut
9697 9657 ions are welcome.
9698 9658 \end_layout
9699 9659
9700 9660 \begin_layout Section
9701 9661 License
9702 9662 \end_layout
9703 9663
9704 9664 \begin_layout Standard
9705 9665 IPython is released under the terms of the BSD license, whose general form
9706 9666 can be found at:
9707 9667 \begin_inset LatexCommand \htmlurl{http://www.opensource.org/licenses/bsd-license.php}
9708 9668
9709 9669 \end_inset
9710 9670
9711 9671 .
9712 9672 The full text of the IPython license is reproduced below:
9713 9673 \end_layout
9714 9674
9715 9675 \begin_layout Quote
9716 9676
9717 9677 \family typewriter
9718 9678 \size small
9719 9679 IPython is released under a BSD-type license.
9720 9680 \end_layout
9721 9681
9722 9682 \begin_layout Quote
9723 9683
9724 9684 \family typewriter
9725 9685 \size small
9726 9686 Copyright (c) 2001, 2002, 2003, 2004 Fernando Perez <fperez@colorado.edu>.
9727 9687 \end_layout
9728 9688
9729 9689 \begin_layout Quote
9730 9690
9731 9691 \family typewriter
9732 9692 \size small
9733 9693 Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and
9734 9694 \newline
9735 9695 Nathaniel Gray <n8gray@ca
9736 9696 ltech.edu>.
9737 9697 \end_layout
9738 9698
9739 9699 \begin_layout Quote
9740 9700
9741 9701 \family typewriter
9742 9702 \size small
9743 9703 All rights reserved.
9744 9704 \end_layout
9745 9705
9746 9706 \begin_layout Quote
9747 9707
9748 9708 \family typewriter
9749 9709 \size small
9750 9710 Redistribution and use in source and binary forms, with or without modification,
9751 9711 are permitted provided that the following conditions are met:
9752 9712 \end_layout
9753 9713
9754 9714 \begin_layout Quote
9755 9715
9756 9716 \family typewriter
9757 9717 \size small
9758 9718 a.
9759 9719 Redistributions of source code must retain the above copyright notice,
9760 9720 this list of conditions and the following disclaimer.
9761 9721 \end_layout
9762 9722
9763 9723 \begin_layout Quote
9764 9724
9765 9725 \family typewriter
9766 9726 \size small
9767 9727 b.
9768 9728 Redistributions in binary form must reproduce the above copyright notice,
9769 9729 this list of conditions and the following disclaimer in the documentation
9770 9730 and/or other materials provided with the distribution.
9771 9731 \end_layout
9772 9732
9773 9733 \begin_layout Quote
9774 9734
9775 9735 \family typewriter
9776 9736 \size small
9777 9737 c.
9778 9738 Neither the name of the copyright holders nor the names of any contributors
9779 9739 to this software may be used to endorse or promote products derived from
9780 9740 this software without specific prior written permission.
9781 9741 \end_layout
9782 9742
9783 9743 \begin_layout Quote
9784 9744
9785 9745 \family typewriter
9786 9746 \size small
9787 9747 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
9788 9748 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
9789 9749 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
9790 9750 PURPOSE ARE DISCLAIMED.
9791 9751 IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
9792 9752 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
9793 9753 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
9794 9754 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
9795 9755 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
9796 9756 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
9797 9757 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9798 9758
9799 9759 \end_layout
9800 9760
9801 9761 \begin_layout Standard
9802 9762 Individual authors are the holders of the copyright for their code and are
9803 9763 listed in each file.
9804 9764 \end_layout
9805 9765
9806 9766 \begin_layout Standard
9807 9767 Some files (
9808 9768 \family typewriter
9809 9769 DPyGetOpt.py
9810 9770 \family default
9811 9771 , for example) may be licensed under different conditions.
9812 9772 Ultimately each file indicates clearly the conditions under which its author/au
9813 9773 thors have decided to publish the code.
9814 9774 \end_layout
9815 9775
9816 9776 \begin_layout Standard
9817 9777 Versions of IPython up to and including 0.6.3 were released under the GNU
9818 9778 Lesser General Public License (LGPL), available at
9819 9779 \begin_inset LatexCommand \htmlurl{http://www.gnu.org/copyleft/lesser.html}
9820 9780
9821 9781 \end_inset
9822 9782
9823 9783 .
9824 9784 \end_layout
9825 9785
9826 9786 \begin_layout Section
9827 9787 \begin_inset LatexCommand \label{sec:credits}
9828 9788
9829 9789 \end_inset
9830 9790
9831 9791 Credits
9832 9792 \end_layout
9833 9793
9834 9794 \begin_layout Standard
9835 9795 IPython is mainly developed by Fernando P
9836 9796 \begin_inset ERT
9837 9797 status collapsed
9838 9798
9839 9799 \begin_layout Standard
9840 9800
9841 9801
9842 9802 \backslash
9843 9803 '{e}
9844 9804 \end_layout
9845 9805
9846 9806 \end_inset
9847 9807
9848 9808 rez
9849 9809 \family typewriter
9850 9810 <Fernando.Perez@colorado.edu>
9851 9811 \family default
9852 9812 , but the project was born from mixing in Fernando's code with the IPP project
9853 9813 by Janko Hauser
9854 9814 \family typewriter
9855 9815 <jhauser-AT-zscout.de>
9856 9816 \family default
9857 9817 and LazyPython by Nathan Gray
9858 9818 \family typewriter
9859 9819 <n8gray-AT-caltech.edu>
9860 9820 \family default
9861 9821 .
9862 9822 For all IPython-related requests, please contact Fernando.
9863 9823
9864 9824 \end_layout
9865 9825
9866 9826 \begin_layout Standard
9867 9827 As of early 2006, the following developers have joined the core team:
9868 9828 \end_layout
9869 9829
9870 9830 \begin_layout List
9871 9831 \labelwidthstring 00.00.0000
9872 9832 Robert\InsetSpace ~
9873 9833 Kern
9874 9834 \family typewriter
9875 9835 <rkern-AT-enthought.com>
9876 9836 \family default
9877 9837 : co-mentored the 2005 Google Summer of Code project to develop python interacti
9878 9838 ve notebooks (XML documents) and graphical interface.
9879 9839 This project was awarded to the students Tzanko Matev
9880 9840 \family typewriter
9881 9841 <tsanko-AT-gmail.com>
9882 9842 \family default
9883 9843 and Toni Alatalo
9884 9844 \family typewriter
9885 9845 <antont-AT-an.org>
9886 9846 \end_layout
9887 9847
9888 9848 \begin_layout List
9889 9849 \labelwidthstring 00.00.0000
9890 9850 Brian\InsetSpace ~
9891 9851 Granger
9892 9852 \family typewriter
9893 9853 <bgranger-AT-scu.edu>
9894 9854 \family default
9895 9855 : extending IPython to allow support for interactive parallel computing.
9896 9856 \end_layout
9897 9857
9898 9858 \begin_layout List
9899 9859 \labelwidthstring 00.00.0000
9900 9860 Ville\InsetSpace ~
9901 9861 Vainio
9902 9862 \family typewriter
9903 9863 <vivainio-AT-gmail.com>
9904 9864 \family default
9905 9865 : Ville is the new maintainer for the main trunk of IPython after version
9906 9866 0.7.1.
9907 9867 \end_layout
9908 9868
9909 9869 \begin_layout Standard
9910 9870 User or development help should be requested via the IPython mailing lists:
9911 9871 \end_layout
9912 9872
9913 9873 \begin_layout Description
9914 9874 User\InsetSpace ~
9915 9875 list:
9916 9876 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-user}
9917 9877
9918 9878 \end_inset
9919 9879
9920 9880
9921 9881 \end_layout
9922 9882
9923 9883 \begin_layout Description
9924 9884 Developer's\InsetSpace ~
9925 9885 list:
9926 9886 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-dev}
9927 9887
9928 9888 \end_inset
9929 9889
9930 9890
9931 9891 \end_layout
9932 9892
9933 9893 \begin_layout Standard
9934 9894 The IPython project is also very grateful to
9935 9895 \begin_inset Foot
9936 9896 status collapsed
9937 9897
9938 9898 \begin_layout Standard
9939 9899 I've mangled email addresses to reduce spam, since the IPython manuals can
9940 9900 be accessed online.
9941 9901 \end_layout
9942 9902
9943 9903 \end_inset
9944 9904
9945 9905 :
9946 9906 \end_layout
9947 9907
9948 9908 \begin_layout Standard
9949 9909 Bill Bumgarner
9950 9910 \family typewriter
9951 9911 <bbum-AT-friday.com>
9952 9912 \family default
9953 9913 : for providing the DPyGetOpt module which gives very powerful and convenient
9954 9914 handling of command-line options (light years ahead of what Python 2.1.1's
9955 9915 getopt module does).
9956 9916 \end_layout
9957 9917
9958 9918 \begin_layout Standard
9959 9919 Ka-Ping Yee
9960 9920 \family typewriter
9961 9921 <ping-AT-lfw.org>
9962 9922 \family default
9963 9923 : for providing the Itpl module for convenient and powerful string interpolation
9964 9924 with a much nicer syntax than formatting through the '%' operator.
9965 9925 \end_layout
9966 9926
9967 9927 \begin_layout Standard
9968 9928 Arnd Baecker
9969 9929 \family typewriter
9970 9930 <baecker-AT-physik.tu-dresden.de>
9971 9931 \family default
9972 9932 : for his many very useful suggestions and comments, and lots of help with
9973 9933 testing and documentation checking.
9974 9934 Many of IPython's newer features are a result of discussions with him (bugs
9975 9935 are still my fault, not his).
9976 9936 \end_layout
9977 9937
9978 9938 \begin_layout Standard
9979 9939 Obviously Guido van\InsetSpace ~
9980 9940 Rossum and the whole Python development team, that goes
9981 9941 without saying.
9982 9942 \end_layout
9983 9943
9984 9944 \begin_layout Standard
9985 9945 IPython's website is generously hosted at
9986 9946 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
9987 9947
9988 9948 \end_inset
9989 9949
9990 9950 by Enthought (
9991 9951 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
9992 9952
9993 9953 \end_inset
9994 9954
9995 9955 ).
9996 9956 I am very grateful to them and all of the SciPy team for their contribution.
9997 9957 \end_layout
9998 9958
9999 9959 \begin_layout Standard
10000 9960 \begin_inset LatexCommand \label{figgins}
10001 9961
10002 9962 \end_inset
10003 9963
10004 9964 Fernando would also like to thank Stephen Figgins
10005 9965 \family typewriter
10006 9966 <fig-AT-monitor.net>
10007 9967 \family default
10008 9968 , an O'Reilly Python editor.
10009 9969 His Oct/11/2001 article about IPP and LazyPython, was what got this project
10010 9970 started.
10011 9971 You can read it at:
10012 9972 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html}
10013 9973
10014 9974 \end_inset
10015 9975
10016 9976 .
10017 9977 \end_layout
10018 9978
10019 9979 \begin_layout Standard
10020 9980 And last but not least, all the kind IPython users who have emailed new
10021 9981 code, bug reports, fixes, comments and ideas.
10022 9982 A brief list follows, please let me know if I have ommitted your name by
10023 9983 accident:
10024 9984 \end_layout
10025 9985
10026 9986 \begin_layout List
10027 9987 \labelwidthstring 00.00.0000
10028 9988 Jack\InsetSpace ~
10029 9989 Moffit
10030 9990 \family typewriter
10031 9991 <jack-AT-xiph.org>
10032 9992 \family default
10033 9993 Bug fixes, including the infamous color problem.
10034 9994 This bug alone caused many lost hours and frustration, many thanks to him
10035 9995 for the fix.
10036 9996 I've always been a fan of Ogg & friends, now I have one more reason to
10037 9997 like these folks.
10038 9998 \newline
10039 9999 Jack is also contributing with Debian packaging and many
10040 10000 other things.
10041 10001 \end_layout
10042 10002
10043 10003 \begin_layout List
10044 10004 \labelwidthstring 00.00.0000
10045 10005 Alexander\InsetSpace ~
10046 10006 Schmolck
10047 10007 \family typewriter
10048 10008 <a.schmolck-AT-gmx.net>
10049 10009 \family default
10050 10010 Emacs work, bug reports, bug fixes, ideas, lots more.
10051 10011 The ipython.el mode for (X)Emacs is Alex's code, providing full support
10052 10012 for IPython under (X)Emacs.
10053 10013 \end_layout
10054 10014
10055 10015 \begin_layout List
10056 10016 \labelwidthstring 00.00.0000
10057 10017 Andrea\InsetSpace ~
10058 10018 Riciputi
10059 10019 \family typewriter
10060 10020 <andrea.riciputi-AT-libero.it>
10061 10021 \family default
10062 10022 Mac OSX information, Fink package management.
10063 10023 \end_layout
10064 10024
10065 10025 \begin_layout List
10066 10026 \labelwidthstring 00.00.0000
10067 10027 Gary\InsetSpace ~
10068 10028 Bishop
10069 10029 \family typewriter
10070 10030 <gb-AT-cs.unc.edu>
10071 10031 \family default
10072 10032 Bug reports, and patches to work around the exception handling idiosyncracies
10073 10033 of WxPython.
10074 10034 Readline and color support for Windows.
10075 10035 \end_layout
10076 10036
10077 10037 \begin_layout List
10078 10038 \labelwidthstring 00.00.0000
10079 10039 Jeffrey\InsetSpace ~
10080 10040 Collins
10081 10041 \family typewriter
10082 10042 <Jeff.Collins-AT-vexcel.com>
10083 10043 \family default
10084 10044 Bug reports.
10085 10045 Much improved readline support, including fixes for Python 2.3.
10086 10046 \end_layout
10087 10047
10088 10048 \begin_layout List
10089 10049 \labelwidthstring 00.00.0000
10090 10050 Dryice\InsetSpace ~
10091 10051 Liu
10092 10052 \family typewriter
10093 10053 <dryice-AT-liu.com.cn>
10094 10054 \family default
10095 10055 FreeBSD port.
10096 10056 \end_layout
10097 10057
10098 10058 \begin_layout List
10099 10059 \labelwidthstring 00.00.0000
10100 10060 Mike\InsetSpace ~
10101 10061 Heeter
10102 10062 \family typewriter
10103 10063 <korora-AT-SDF.LONESTAR.ORG>
10104 10064 \end_layout
10105 10065
10106 10066 \begin_layout List
10107 10067 \labelwidthstring 00.00.0000
10108 10068 Christopher\InsetSpace ~
10109 10069 Hart
10110 10070 \family typewriter
10111 10071 <hart-AT-caltech.edu>
10112 10072 \family default
10113 10073 PDB integration.
10114 10074 \end_layout
10115 10075
10116 10076 \begin_layout List
10117 10077 \labelwidthstring 00.00.0000
10118 10078 Milan\InsetSpace ~
10119 10079 Zamazal
10120 10080 \family typewriter
10121 10081 <pdm-AT-zamazal.org>
10122 10082 \family default
10123 10083 Emacs info.
10124 10084 \end_layout
10125 10085
10126 10086 \begin_layout List
10127 10087 \labelwidthstring 00.00.0000
10128 10088 Philip\InsetSpace ~
10129 10089 Hisley
10130 10090 \family typewriter
10131 10091 <compsys-AT-starpower.net>
10132 10092 \end_layout
10133 10093
10134 10094 \begin_layout List
10135 10095 \labelwidthstring 00.00.0000
10136 10096 Holger\InsetSpace ~
10137 10097 Krekel
10138 10098 \family typewriter
10139 10099 <pyth-AT-devel.trillke.net>
10140 10100 \family default
10141 10101 Tab completion, lots more.
10142 10102 \end_layout
10143 10103
10144 10104 \begin_layout List
10145 10105 \labelwidthstring 00.00.0000
10146 10106 Robin\InsetSpace ~
10147 10107 Siebler
10148 10108 \family typewriter
10149 10109 <robinsiebler-AT-starband.net>
10150 10110 \end_layout
10151 10111
10152 10112 \begin_layout List
10153 10113 \labelwidthstring 00.00.0000
10154 10114 Ralf\InsetSpace ~
10155 10115 Ahlbrink
10156 10116 \family typewriter
10157 10117 <ralf_ahlbrink-AT-web.de>
10158 10118 \end_layout
10159 10119
10160 10120 \begin_layout List
10161 10121 \labelwidthstring 00.00.0000
10162 10122 Thorsten\InsetSpace ~
10163 10123 Kampe
10164 10124 \family typewriter
10165 10125 <thorsten-AT-thorstenkampe.de>
10166 10126 \end_layout
10167 10127
10168 10128 \begin_layout List
10169 10129 \labelwidthstring 00.00.0000
10170 10130 Fredrik\InsetSpace ~
10171 10131 Kant
10172 10132 \family typewriter
10173 10133 <fredrik.kant-AT-front.com>
10174 10134 \family default
10175 10135 Windows setup.
10176 10136 \end_layout
10177 10137
10178 10138 \begin_layout List
10179 10139 \labelwidthstring 00.00.0000
10180 10140 Syver\InsetSpace ~
10181 10141 Enstad
10182 10142 \family typewriter
10183 10143 <syver-en-AT-online.no>
10184 10144 \family default
10185 10145 Windows setup.
10186 10146 \end_layout
10187 10147
10188 10148 \begin_layout List
10189 10149 \labelwidthstring 00.00.0000
10190 10150 Richard
10191 10151 \family typewriter
10192 10152 <rxe-AT-renre-europe.com>
10193 10153 \family default
10194 10154 Global embedding.
10195 10155 \end_layout
10196 10156
10197 10157 \begin_layout List
10198 10158 \labelwidthstring 00.00.0000
10199 10159 Hayden\InsetSpace ~
10200 10160 Callow
10201 10161 \family typewriter
10202 10162 <h.callow-AT-elec.canterbury.ac.nz>
10203 10163 \family default
10204 10164 Gnuplot.py 1.6 compatibility.
10205 10165 \end_layout
10206 10166
10207 10167 \begin_layout List
10208 10168 \labelwidthstring 00.00.0000
10209 10169 Leonardo\InsetSpace ~
10210 10170 Santagada
10211 10171 \family typewriter
10212 10172 <retype-AT-terra.com.br>
10213 10173 \family default
10214 10174 Fixes for Windows installation.
10215 10175 \end_layout
10216 10176
10217 10177 \begin_layout List
10218 10178 \labelwidthstring 00.00.0000
10219 10179 Christopher\InsetSpace ~
10220 10180 Armstrong
10221 10181 \family typewriter
10222 10182 <radix-AT-twistedmatrix.com>
10223 10183 \family default
10224 10184 Bugfixes.
10225 10185 \end_layout
10226 10186
10227 10187 \begin_layout List
10228 10188 \labelwidthstring 00.00.0000
10229 10189 Francois\InsetSpace ~
10230 10190 Pinard
10231 10191 \family typewriter
10232 10192 <pinard-AT-iro.umontreal.ca>
10233 10193 \family default
10234 10194 Code and documentation fixes.
10235 10195 \end_layout
10236 10196
10237 10197 \begin_layout List
10238 10198 \labelwidthstring 00.00.0000
10239 10199 Cory\InsetSpace ~
10240 10200 Dodt
10241 10201 \family typewriter
10242 10202 <cdodt-AT-fcoe.k12.ca.us>
10243 10203 \family default
10244 10204 Bug reports and Windows ideas.
10245 10205 Patches for Windows installer.
10246 10206 \end_layout
10247 10207
10248 10208 \begin_layout List
10249 10209 \labelwidthstring 00.00.0000
10250 10210 Olivier\InsetSpace ~
10251 10211 Aubert
10252 10212 \family typewriter
10253 10213 <oaubert-AT-bat710.univ-lyon1.fr>
10254 10214 \family default
10255 10215 New magics.
10256 10216 \end_layout
10257 10217
10258 10218 \begin_layout List
10259 10219 \labelwidthstring 00.00.0000
10260 10220 King\InsetSpace ~
10261 10221 C.\InsetSpace ~
10262 10222 Shu
10263 10223 \family typewriter
10264 10224 <kingshu-AT-myrealbox.com>
10265 10225 \family default
10266 10226 Autoindent patch.
10267 10227 \end_layout
10268 10228
10269 10229 \begin_layout List
10270 10230 \labelwidthstring 00.00.0000
10271 10231 Chris\InsetSpace ~
10272 10232 Drexler
10273 10233 \family typewriter
10274 10234 <chris-AT-ac-drexler.de>
10275 10235 \family default
10276 10236 Readline packages for Win32/CygWin.
10277 10237 \end_layout
10278 10238
10279 10239 \begin_layout List
10280 10240 \labelwidthstring 00.00.0000
10281 10241 Gustavo\InsetSpace ~
10282 10242 Cordova\InsetSpace ~
10283 10243 Avila
10284 10244 \family typewriter
10285 10245 <gcordova-AT-sismex.com>
10286 10246 \family default
10287 10247 EvalDict code for nice, lightweight string interpolation.
10288 10248 \end_layout
10289 10249
10290 10250 \begin_layout List
10291 10251 \labelwidthstring 00.00.0000
10292 10252 Kasper\InsetSpace ~
10293 10253 Souren
10294 10254 \family typewriter
10295 10255 <Kasper.Souren-AT-ircam.fr>
10296 10256 \family default
10297 10257 Bug reports, ideas.
10298 10258 \end_layout
10299 10259
10300 10260 \begin_layout List
10301 10261 \labelwidthstring 00.00.0000
10302 10262 Gever\InsetSpace ~
10303 10263 Tulley
10304 10264 \family typewriter
10305 10265 <gever-AT-helium.com>
10306 10266 \family default
10307 10267 Code contributions.
10308 10268 \end_layout
10309 10269
10310 10270 \begin_layout List
10311 10271 \labelwidthstring 00.00.0000
10312 10272 Ralf\InsetSpace ~
10313 10273 Schmitt
10314 10274 \family typewriter
10315 10275 <ralf-AT-brainbot.com>
10316 10276 \family default
10317 10277 Bug reports & fixes.
10318 10278 \end_layout
10319 10279
10320 10280 \begin_layout List
10321 10281 \labelwidthstring 00.00.0000
10322 10282 Oliver\InsetSpace ~
10323 10283 Sander
10324 10284 \family typewriter
10325 10285 <osander-AT-gmx.de>
10326 10286 \family default
10327 10287 Bug reports.
10328 10288 \end_layout
10329 10289
10330 10290 \begin_layout List
10331 10291 \labelwidthstring 00.00.0000
10332 10292 Rod\InsetSpace ~
10333 10293 Holland
10334 10294 \family typewriter
10335 10295 <rhh-AT-structurelabs.com>
10336 10296 \family default
10337 10297 Bug reports and fixes to logging module.
10338 10298 \end_layout
10339 10299
10340 10300 \begin_layout List
10341 10301 \labelwidthstring 00.00.0000
10342 10302 Daniel\InsetSpace ~
10343 10303 'Dang'\InsetSpace ~
10344 10304 Griffith
10345 10305 \family typewriter
10346 10306 <pythondev-dang-AT-lazytwinacres.net>
10347 10307 \family default
10348 10308 Fixes, enhancement suggestions for system shell use.
10349 10309 \end_layout
10350 10310
10351 10311 \begin_layout List
10352 10312 \labelwidthstring 00.00.0000
10353 10313 Viktor\InsetSpace ~
10354 10314 Ransmayr
10355 10315 \family typewriter
10356 10316 <viktor.ransmayr-AT-t-online.de>
10357 10317 \family default
10358 10318 Tests and reports on Windows installation issues.
10359 10319 Contributed a true Windows binary installer.
10360 10320 \end_layout
10361 10321
10362 10322 \begin_layout List
10363 10323 \labelwidthstring 00.00.0000
10364 10324 Mike\InsetSpace ~
10365 10325 Salib
10366 10326 \family typewriter
10367 10327 <msalib-AT-mit.edu>
10368 10328 \family default
10369 10329 Help fixing a subtle bug related to traceback printing.
10370 10330 \end_layout
10371 10331
10372 10332 \begin_layout List
10373 10333 \labelwidthstring 00.00.0000
10374 10334 W.J.\InsetSpace ~
10375 10335 van\InsetSpace ~
10376 10336 der\InsetSpace ~
10377 10337 Laan
10378 10338 \family typewriter
10379 10339 <gnufnork-AT-hetdigitalegat.nl>
10380 10340 \family default
10381 10341 Bash-like prompt specials.
10382 10342 \end_layout
10383 10343
10384 10344 \begin_layout List
10385 10345 \labelwidthstring 00.00.0000
10386 10346 Antoon\InsetSpace ~
10387 10347 Pardon
10388 10348 \family typewriter
10389 10349 <Antoon.Pardon-AT-rece.vub.ac.be>
10390 10350 \family default
10391 10351 Critical fix for the multithreaded IPython.
10392 10352 \end_layout
10393 10353
10394 10354 \begin_layout List
10395 10355 \labelwidthstring 00.00.0000
10396 10356 John\InsetSpace ~
10397 10357 Hunter
10398 10358 \family typewriter
10399 10359 <jdhunter-AT-nitace.bsd.uchicago.edu>
10400 10360 \family default
10401 10361 Matplotlib author, helped with all the development of support for matplotlib
10402 10362 in IPyhton, including making necessary changes to matplotlib itself.
10403 10363 \end_layout
10404 10364
10405 10365 \begin_layout List
10406 10366 \labelwidthstring 00.00.0000
10407 10367 Matthew\InsetSpace ~
10408 10368 Arnison
10409 10369 \family typewriter
10410 10370 <maffew-AT-cat.org.au>
10411 10371 \family default
10412 10372 Bug reports, `
10413 10373 \family typewriter
10414 10374 %run -d
10415 10375 \family default
10416 10376 ' idea.
10417 10377 \end_layout
10418 10378
10419 10379 \begin_layout List
10420 10380 \labelwidthstring 00.00.0000
10421 10381 Prabhu\InsetSpace ~
10422 10382 Ramachandran
10423 10383 \family typewriter
10424 10384 <prabhu_r-AT-users.sourceforge.net>
10425 10385 \family default
10426 10386 Help with (X)Emacs support, threading patches, ideas...
10427 10387 \end_layout
10428 10388
10429 10389 \begin_layout List
10430 10390 \labelwidthstring 00.00.0000
10431 10391 Norbert\InsetSpace ~
10432 10392 Tretkowski
10433 10393 \family typewriter
10434 10394 <tretkowski-AT-inittab.de>
10435 10395 \family default
10436 10396 help with Debian packaging and distribution.
10437 10397 \end_layout
10438 10398
10439 10399 \begin_layout List
10440 10400 \labelwidthstring 00.00.0000
10441 10401 George\InsetSpace ~
10442 10402 Sakkis <
10443 10403 \family typewriter
10444 10404 gsakkis-AT-eden.rutgers.edu>
10445 10405 \family default
10446 10406 New matcher for tab-completing named arguments of user-defined functions.
10447 10407 \end_layout
10448 10408
10449 10409 \begin_layout List
10450 10410 \labelwidthstring 00.00.0000
10451 10411 JοΏ½rgen\InsetSpace ~
10452 10412 Stenarson
10453 10413 \family typewriter
10454 10414 <jorgen.stenarson-AT-bostream.nu>
10455 10415 \family default
10456 10416 Wildcard support implementation for searching namespaces.
10457 10417 \end_layout
10458 10418
10459 10419 \begin_layout List
10460 10420 \labelwidthstring 00.00.0000
10461 10421 Vivian\InsetSpace ~
10462 10422 De\InsetSpace ~
10463 10423 Smedt
10464 10424 \family typewriter
10465 10425 <vivian-AT-vdesmedt.com>
10466 10426 \family default
10467 10427 Debugger enhancements, so that when pdb is activated from within IPython,
10468 10428 coloring, tab completion and other features continue to work seamlessly.
10469 10429 \end_layout
10470 10430
10471 10431 \begin_layout List
10472 10432 \labelwidthstring 00.00.0000
10473 10433 Scott\InsetSpace ~
10474 10434 Tsai
10475 10435 \family typewriter
10476 10436 <scottt958-AT-yahoo.com.tw>
10477 10437 \family default
10478 10438 Support for automatic editor invocation on syntax errors (see
10479 10439 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython/issue36}
10480 10440
10481 10441 \end_inset
10482 10442
10483 10443 ).
10484 10444 \end_layout
10485 10445
10486 10446 \begin_layout List
10487 10447 \labelwidthstring 00.00.0000
10488 10448 Alexander\InsetSpace ~
10489 10449 Belchenko
10490 10450 \family typewriter
10491 10451 <bialix-AT-ukr.net>
10492 10452 \family default
10493 10453 Improvements for win32 paging system.
10494 10454 \end_layout
10495 10455
10496 10456 \begin_layout List
10497 10457 \labelwidthstring 00.00.0000
10498 10458 Will\InsetSpace ~
10499 10459 Maier
10500 10460 \family typewriter
10501 10461 <willmaier-AT-ml1.net>
10502 10462 \family default
10503 10463 Official OpenBSD port.
10504 10464 \end_layout
10505 10465
10506 10466 \end_body
10507 10467 \end_document
General Comments 0
You need to be logged in to leave comments. Login now