##// END OF EJS Templates
Arnd's wxversion support.
fperez -
Show More
@@ -1,917 +1,933 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """IPython Shell classes.
2 """IPython Shell classes.
3
3
4 All the matplotlib support code was co-developed with John Hunter,
4 All the matplotlib support code was co-developed with John Hunter,
5 matplotlib's author.
5 matplotlib's author.
6
6
7 $Id: Shell.py 994 2006-01-08 08:29:44Z fperez $"""
7 $Id: Shell.py 998 2006-01-09 06:57:40Z fperez $"""
8
8
9 #*****************************************************************************
9 #*****************************************************************************
10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
11 #
11 #
12 # Distributed under the terms of the BSD License. The full license is in
12 # Distributed under the terms of the BSD License. The full license is in
13 # the file COPYING, distributed as part of this software.
13 # the file COPYING, distributed as part of this software.
14 #*****************************************************************************
14 #*****************************************************************************
15
15
16 from IPython import Release
16 from IPython import Release
17 __author__ = '%s <%s>' % Release.authors['Fernando']
17 __author__ = '%s <%s>' % Release.authors['Fernando']
18 __license__ = Release.license
18 __license__ = Release.license
19
19
20 # Code begins
20 # Code begins
21 import __main__
21 import __main__
22 import __builtin__
22 import __builtin__
23 import os
23 import os
24 import sys
24 import sys
25 import signal
25 import signal
26 import threading
26 import threading
27
27
28 import IPython
28 import IPython
29 from IPython import ultraTB
29 from IPython import ultraTB
30 from IPython.genutils import Term,warn,error,flag_calls
30 from IPython.genutils import Term,warn,error,flag_calls
31 from IPython.iplib import InteractiveShell
31 from IPython.iplib import InteractiveShell
32 from IPython.ipmaker import make_IPython
32 from IPython.ipmaker import make_IPython
33 from IPython.Magic import Magic
33 from IPython.Magic import Magic
34 from IPython.Struct import Struct
34 from IPython.Struct import Struct
35
35
36 # global flag to pass around information about Ctrl-C without exceptions
36 # global flag to pass around information about Ctrl-C without exceptions
37 KBINT = False
37 KBINT = False
38
38
39 # global flag to turn on/off Tk support.
39 # global flag to turn on/off Tk support.
40 USE_TK = False
40 USE_TK = False
41
41
42 #-----------------------------------------------------------------------------
42 #-----------------------------------------------------------------------------
43 # This class is trivial now, but I want to have it in to publish a clean
43 # This class is trivial now, but I want to have it in to publish a clean
44 # interface. Later when the internals are reorganized, code that uses this
44 # interface. Later when the internals are reorganized, code that uses this
45 # shouldn't have to change.
45 # shouldn't have to change.
46
46
47 class IPShell:
47 class IPShell:
48 """Create an IPython instance."""
48 """Create an IPython instance."""
49
49
50 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
50 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
51 debug=1,shell_class=InteractiveShell):
51 debug=1,shell_class=InteractiveShell):
52 self.IP = make_IPython(argv,user_ns=user_ns,user_global_ns=user_global_ns,
52 self.IP = make_IPython(argv,user_ns=user_ns,user_global_ns=user_global_ns,
53 debug=debug,shell_class=shell_class)
53 debug=debug,shell_class=shell_class)
54
54
55 def mainloop(self,sys_exit=0,banner=None):
55 def mainloop(self,sys_exit=0,banner=None):
56 self.IP.mainloop(banner)
56 self.IP.mainloop(banner)
57 if sys_exit:
57 if sys_exit:
58 sys.exit()
58 sys.exit()
59
59
60 #-----------------------------------------------------------------------------
60 #-----------------------------------------------------------------------------
61 class IPShellEmbed:
61 class IPShellEmbed:
62 """Allow embedding an IPython shell into a running program.
62 """Allow embedding an IPython shell into a running program.
63
63
64 Instances of this class are callable, with the __call__ method being an
64 Instances of this class are callable, with the __call__ method being an
65 alias to the embed() method of an InteractiveShell instance.
65 alias to the embed() method of an InteractiveShell instance.
66
66
67 Usage (see also the example-embed.py file for a running example):
67 Usage (see also the example-embed.py file for a running example):
68
68
69 ipshell = IPShellEmbed([argv,banner,exit_msg,rc_override])
69 ipshell = IPShellEmbed([argv,banner,exit_msg,rc_override])
70
70
71 - argv: list containing valid command-line options for IPython, as they
71 - argv: list containing valid command-line options for IPython, as they
72 would appear in sys.argv[1:].
72 would appear in sys.argv[1:].
73
73
74 For example, the following command-line options:
74 For example, the following command-line options:
75
75
76 $ ipython -prompt_in1 'Input <\\#>' -colors LightBG
76 $ ipython -prompt_in1 'Input <\\#>' -colors LightBG
77
77
78 would be passed in the argv list as:
78 would be passed in the argv list as:
79
79
80 ['-prompt_in1','Input <\\#>','-colors','LightBG']
80 ['-prompt_in1','Input <\\#>','-colors','LightBG']
81
81
82 - banner: string which gets printed every time the interpreter starts.
82 - banner: string which gets printed every time the interpreter starts.
83
83
84 - exit_msg: string which gets printed every time the interpreter exits.
84 - exit_msg: string which gets printed every time the interpreter exits.
85
85
86 - rc_override: a dict or Struct of configuration options such as those
86 - rc_override: a dict or Struct of configuration options such as those
87 used by IPython. These options are read from your ~/.ipython/ipythonrc
87 used by IPython. These options are read from your ~/.ipython/ipythonrc
88 file when the Shell object is created. Passing an explicit rc_override
88 file when the Shell object is created. Passing an explicit rc_override
89 dict with any options you want allows you to override those values at
89 dict with any options you want allows you to override those values at
90 creation time without having to modify the file. This way you can create
90 creation time without having to modify the file. This way you can create
91 embeddable instances configured in any way you want without editing any
91 embeddable instances configured in any way you want without editing any
92 global files (thus keeping your interactive IPython configuration
92 global files (thus keeping your interactive IPython configuration
93 unchanged).
93 unchanged).
94
94
95 Then the ipshell instance can be called anywhere inside your code:
95 Then the ipshell instance can be called anywhere inside your code:
96
96
97 ipshell(header='') -> Opens up an IPython shell.
97 ipshell(header='') -> Opens up an IPython shell.
98
98
99 - header: string printed by the IPython shell upon startup. This can let
99 - header: string printed by the IPython shell upon startup. This can let
100 you know where in your code you are when dropping into the shell. Note
100 you know where in your code you are when dropping into the shell. Note
101 that 'banner' gets prepended to all calls, so header is used for
101 that 'banner' gets prepended to all calls, so header is used for
102 location-specific information.
102 location-specific information.
103
103
104 For more details, see the __call__ method below.
104 For more details, see the __call__ method below.
105
105
106 When the IPython shell is exited with Ctrl-D, normal program execution
106 When the IPython shell is exited with Ctrl-D, normal program execution
107 resumes.
107 resumes.
108
108
109 This functionality was inspired by a posting on comp.lang.python by cmkl
109 This functionality was inspired by a posting on comp.lang.python by cmkl
110 <cmkleffner@gmx.de> on Dec. 06/01 concerning similar uses of pyrepl, and
110 <cmkleffner@gmx.de> on Dec. 06/01 concerning similar uses of pyrepl, and
111 by the IDL stop/continue commands."""
111 by the IDL stop/continue commands."""
112
112
113 def __init__(self,argv=None,banner='',exit_msg=None,rc_override=None):
113 def __init__(self,argv=None,banner='',exit_msg=None,rc_override=None):
114 """Note that argv here is a string, NOT a list."""
114 """Note that argv here is a string, NOT a list."""
115 self.set_banner(banner)
115 self.set_banner(banner)
116 self.set_exit_msg(exit_msg)
116 self.set_exit_msg(exit_msg)
117 self.set_dummy_mode(0)
117 self.set_dummy_mode(0)
118
118
119 # sys.displayhook is a global, we need to save the user's original
119 # sys.displayhook is a global, we need to save the user's original
120 # Don't rely on __displayhook__, as the user may have changed that.
120 # Don't rely on __displayhook__, as the user may have changed that.
121 self.sys_displayhook_ori = sys.displayhook
121 self.sys_displayhook_ori = sys.displayhook
122
122
123 # save readline completer status
123 # save readline completer status
124 try:
124 try:
125 #print 'Save completer',sys.ipcompleter # dbg
125 #print 'Save completer',sys.ipcompleter # dbg
126 self.sys_ipcompleter_ori = sys.ipcompleter
126 self.sys_ipcompleter_ori = sys.ipcompleter
127 except:
127 except:
128 pass # not nested with IPython
128 pass # not nested with IPython
129
129
130 # FIXME. Passing user_ns breaks namespace handling.
130 # FIXME. Passing user_ns breaks namespace handling.
131 #self.IP = make_IPython(argv,user_ns=__main__.__dict__)
131 #self.IP = make_IPython(argv,user_ns=__main__.__dict__)
132 self.IP = make_IPython(argv,rc_override=rc_override,embedded=True)
132 self.IP = make_IPython(argv,rc_override=rc_override,embedded=True)
133
133
134 # copy our own displayhook also
134 # copy our own displayhook also
135 self.sys_displayhook_embed = sys.displayhook
135 self.sys_displayhook_embed = sys.displayhook
136 # and leave the system's display hook clean
136 # and leave the system's display hook clean
137 sys.displayhook = self.sys_displayhook_ori
137 sys.displayhook = self.sys_displayhook_ori
138 # don't use the ipython crash handler so that user exceptions aren't
138 # don't use the ipython crash handler so that user exceptions aren't
139 # trapped
139 # trapped
140 sys.excepthook = ultraTB.FormattedTB(color_scheme = self.IP.rc.colors,
140 sys.excepthook = ultraTB.FormattedTB(color_scheme = self.IP.rc.colors,
141 mode = self.IP.rc.xmode,
141 mode = self.IP.rc.xmode,
142 call_pdb = self.IP.rc.pdb)
142 call_pdb = self.IP.rc.pdb)
143 self.restore_system_completer()
143 self.restore_system_completer()
144
144
145 def restore_system_completer(self):
145 def restore_system_completer(self):
146 """Restores the readline completer which was in place.
146 """Restores the readline completer which was in place.
147
147
148 This allows embedded IPython within IPython not to disrupt the
148 This allows embedded IPython within IPython not to disrupt the
149 parent's completion.
149 parent's completion.
150 """
150 """
151
151
152 try:
152 try:
153 self.IP.readline.set_completer(self.sys_ipcompleter_ori)
153 self.IP.readline.set_completer(self.sys_ipcompleter_ori)
154 sys.ipcompleter = self.sys_ipcompleter_ori
154 sys.ipcompleter = self.sys_ipcompleter_ori
155 except:
155 except:
156 pass
156 pass
157
157
158 def __call__(self,header='',local_ns=None,global_ns=None,dummy=None):
158 def __call__(self,header='',local_ns=None,global_ns=None,dummy=None):
159 """Activate the interactive interpreter.
159 """Activate the interactive interpreter.
160
160
161 __call__(self,header='',local_ns=None,global_ns,dummy=None) -> Start
161 __call__(self,header='',local_ns=None,global_ns,dummy=None) -> Start
162 the interpreter shell with the given local and global namespaces, and
162 the interpreter shell with the given local and global namespaces, and
163 optionally print a header string at startup.
163 optionally print a header string at startup.
164
164
165 The shell can be globally activated/deactivated using the
165 The shell can be globally activated/deactivated using the
166 set/get_dummy_mode methods. This allows you to turn off a shell used
166 set/get_dummy_mode methods. This allows you to turn off a shell used
167 for debugging globally.
167 for debugging globally.
168
168
169 However, *each* time you call the shell you can override the current
169 However, *each* time you call the shell you can override the current
170 state of dummy_mode with the optional keyword parameter 'dummy'. For
170 state of dummy_mode with the optional keyword parameter 'dummy'. For
171 example, if you set dummy mode on with IPShell.set_dummy_mode(1), you
171 example, if you set dummy mode on with IPShell.set_dummy_mode(1), you
172 can still have a specific call work by making it as IPShell(dummy=0).
172 can still have a specific call work by making it as IPShell(dummy=0).
173
173
174 The optional keyword parameter dummy controls whether the call
174 The optional keyword parameter dummy controls whether the call
175 actually does anything. """
175 actually does anything. """
176
176
177 # Allow the dummy parameter to override the global __dummy_mode
177 # Allow the dummy parameter to override the global __dummy_mode
178 if dummy or (dummy != 0 and self.__dummy_mode):
178 if dummy or (dummy != 0 and self.__dummy_mode):
179 return
179 return
180
180
181 # Set global subsystems (display,completions) to our values
181 # Set global subsystems (display,completions) to our values
182 sys.displayhook = self.sys_displayhook_embed
182 sys.displayhook = self.sys_displayhook_embed
183 if self.IP.has_readline:
183 if self.IP.has_readline:
184 self.IP.readline.set_completer(self.IP.Completer.complete)
184 self.IP.readline.set_completer(self.IP.Completer.complete)
185
185
186 if self.banner and header:
186 if self.banner and header:
187 format = '%s\n%s\n'
187 format = '%s\n%s\n'
188 else:
188 else:
189 format = '%s%s\n'
189 format = '%s%s\n'
190 banner = format % (self.banner,header)
190 banner = format % (self.banner,header)
191
191
192 # Call the embedding code with a stack depth of 1 so it can skip over
192 # Call the embedding code with a stack depth of 1 so it can skip over
193 # our call and get the original caller's namespaces.
193 # our call and get the original caller's namespaces.
194 self.IP.embed_mainloop(banner,local_ns,global_ns,stack_depth=1)
194 self.IP.embed_mainloop(banner,local_ns,global_ns,stack_depth=1)
195
195
196 if self.exit_msg:
196 if self.exit_msg:
197 print self.exit_msg
197 print self.exit_msg
198
198
199 # Restore global systems (display, completion)
199 # Restore global systems (display, completion)
200 sys.displayhook = self.sys_displayhook_ori
200 sys.displayhook = self.sys_displayhook_ori
201 self.restore_system_completer()
201 self.restore_system_completer()
202
202
203 def set_dummy_mode(self,dummy):
203 def set_dummy_mode(self,dummy):
204 """Sets the embeddable shell's dummy mode parameter.
204 """Sets the embeddable shell's dummy mode parameter.
205
205
206 set_dummy_mode(dummy): dummy = 0 or 1.
206 set_dummy_mode(dummy): dummy = 0 or 1.
207
207
208 This parameter is persistent and makes calls to the embeddable shell
208 This parameter is persistent and makes calls to the embeddable shell
209 silently return without performing any action. This allows you to
209 silently return without performing any action. This allows you to
210 globally activate or deactivate a shell you're using with a single call.
210 globally activate or deactivate a shell you're using with a single call.
211
211
212 If you need to manually"""
212 If you need to manually"""
213
213
214 if dummy not in [0,1,False,True]:
214 if dummy not in [0,1,False,True]:
215 raise ValueError,'dummy parameter must be boolean'
215 raise ValueError,'dummy parameter must be boolean'
216 self.__dummy_mode = dummy
216 self.__dummy_mode = dummy
217
217
218 def get_dummy_mode(self):
218 def get_dummy_mode(self):
219 """Return the current value of the dummy mode parameter.
219 """Return the current value of the dummy mode parameter.
220 """
220 """
221 return self.__dummy_mode
221 return self.__dummy_mode
222
222
223 def set_banner(self,banner):
223 def set_banner(self,banner):
224 """Sets the global banner.
224 """Sets the global banner.
225
225
226 This banner gets prepended to every header printed when the shell
226 This banner gets prepended to every header printed when the shell
227 instance is called."""
227 instance is called."""
228
228
229 self.banner = banner
229 self.banner = banner
230
230
231 def set_exit_msg(self,exit_msg):
231 def set_exit_msg(self,exit_msg):
232 """Sets the global exit_msg.
232 """Sets the global exit_msg.
233
233
234 This exit message gets printed upon exiting every time the embedded
234 This exit message gets printed upon exiting every time the embedded
235 shell is called. It is None by default. """
235 shell is called. It is None by default. """
236
236
237 self.exit_msg = exit_msg
237 self.exit_msg = exit_msg
238
238
239 #-----------------------------------------------------------------------------
239 #-----------------------------------------------------------------------------
240 def sigint_handler (signum,stack_frame):
240 def sigint_handler (signum,stack_frame):
241 """Sigint handler for threaded apps.
241 """Sigint handler for threaded apps.
242
242
243 This is a horrible hack to pass information about SIGINT _without_ using
243 This is a horrible hack to pass information about SIGINT _without_ using
244 exceptions, since I haven't been able to properly manage cross-thread
244 exceptions, since I haven't been able to properly manage cross-thread
245 exceptions in GTK/WX. In fact, I don't think it can be done (or at least
245 exceptions in GTK/WX. In fact, I don't think it can be done (or at least
246 that's my understanding from a c.l.py thread where this was discussed)."""
246 that's my understanding from a c.l.py thread where this was discussed)."""
247
247
248 global KBINT
248 global KBINT
249
249
250 print '\nKeyboardInterrupt - Press <Enter> to continue.',
250 print '\nKeyboardInterrupt - Press <Enter> to continue.',
251 Term.cout.flush()
251 Term.cout.flush()
252 # Set global flag so that runsource can know that Ctrl-C was hit
252 # Set global flag so that runsource can know that Ctrl-C was hit
253 KBINT = True
253 KBINT = True
254
254
255 class MTInteractiveShell(InteractiveShell):
255 class MTInteractiveShell(InteractiveShell):
256 """Simple multi-threaded shell."""
256 """Simple multi-threaded shell."""
257
257
258 # Threading strategy taken from:
258 # Threading strategy taken from:
259 # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by Brian
259 # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by Brian
260 # McErlean and John Finlay. Modified with corrections by Antoon Pardon,
260 # McErlean and John Finlay. Modified with corrections by Antoon Pardon,
261 # from the pygtk mailing list, to avoid lockups with system calls.
261 # from the pygtk mailing list, to avoid lockups with system calls.
262
262
263 # class attribute to indicate whether the class supports threads or not.
263 # class attribute to indicate whether the class supports threads or not.
264 # Subclasses with thread support should override this as needed.
264 # Subclasses with thread support should override this as needed.
265 isthreaded = True
265 isthreaded = True
266
266
267 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
267 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
268 user_ns=None,user_global_ns=None,banner2='',**kw):
268 user_ns=None,user_global_ns=None,banner2='',**kw):
269 """Similar to the normal InteractiveShell, but with threading control"""
269 """Similar to the normal InteractiveShell, but with threading control"""
270
270
271 InteractiveShell.__init__(self,name,usage,rc,user_ns,
271 InteractiveShell.__init__(self,name,usage,rc,user_ns,
272 user_global_ns,banner2)
272 user_global_ns,banner2)
273
273
274 # Locking control variable
274 # Locking control variable
275 self.thread_ready = threading.Condition()
275 self.thread_ready = threading.Condition()
276
276
277 # Stuff to do at closing time
277 # Stuff to do at closing time
278 self._kill = False
278 self._kill = False
279 on_kill = kw.get('on_kill')
279 on_kill = kw.get('on_kill')
280 if on_kill is None:
280 if on_kill is None:
281 on_kill = []
281 on_kill = []
282 # Check that all things to kill are callable:
282 # Check that all things to kill are callable:
283 for t in on_kill:
283 for t in on_kill:
284 if not callable(t):
284 if not callable(t):
285 raise TypeError,'on_kill must be a list of callables'
285 raise TypeError,'on_kill must be a list of callables'
286 self.on_kill = on_kill
286 self.on_kill = on_kill
287
287
288 def runsource(self, source, filename="<input>", symbol="single"):
288 def runsource(self, source, filename="<input>", symbol="single"):
289 """Compile and run some source in the interpreter.
289 """Compile and run some source in the interpreter.
290
290
291 Modified version of code.py's runsource(), to handle threading issues.
291 Modified version of code.py's runsource(), to handle threading issues.
292 See the original for full docstring details."""
292 See the original for full docstring details."""
293
293
294 global KBINT
294 global KBINT
295
295
296 # If Ctrl-C was typed, we reset the flag and return right away
296 # If Ctrl-C was typed, we reset the flag and return right away
297 if KBINT:
297 if KBINT:
298 KBINT = False
298 KBINT = False
299 return False
299 return False
300
300
301 try:
301 try:
302 code = self.compile(source, filename, symbol)
302 code = self.compile(source, filename, symbol)
303 except (OverflowError, SyntaxError, ValueError):
303 except (OverflowError, SyntaxError, ValueError):
304 # Case 1
304 # Case 1
305 self.showsyntaxerror(filename)
305 self.showsyntaxerror(filename)
306 return False
306 return False
307
307
308 if code is None:
308 if code is None:
309 # Case 2
309 # Case 2
310 return True
310 return True
311
311
312 # Case 3
312 # Case 3
313 # Store code in self, so the execution thread can handle it
313 # Store code in self, so the execution thread can handle it
314 self.thread_ready.acquire()
314 self.thread_ready.acquire()
315 self.code_to_run = code
315 self.code_to_run = code
316 self.thread_ready.wait() # Wait until processed in timeout interval
316 self.thread_ready.wait() # Wait until processed in timeout interval
317 self.thread_ready.release()
317 self.thread_ready.release()
318
318
319 return False
319 return False
320
320
321 def runcode(self):
321 def runcode(self):
322 """Execute a code object.
322 """Execute a code object.
323
323
324 Multithreaded wrapper around IPython's runcode()."""
324 Multithreaded wrapper around IPython's runcode()."""
325
325
326 # lock thread-protected stuff
326 # lock thread-protected stuff
327 self.thread_ready.acquire()
327 self.thread_ready.acquire()
328
328
329 # Install sigint handler
329 # Install sigint handler
330 try:
330 try:
331 signal.signal(signal.SIGINT, sigint_handler)
331 signal.signal(signal.SIGINT, sigint_handler)
332 except SystemError:
332 except SystemError:
333 # This happens under Windows, which seems to have all sorts
333 # This happens under Windows, which seems to have all sorts
334 # of problems with signal handling. Oh well...
334 # of problems with signal handling. Oh well...
335 pass
335 pass
336
336
337 if self._kill:
337 if self._kill:
338 print >>Term.cout, 'Closing threads...',
338 print >>Term.cout, 'Closing threads...',
339 Term.cout.flush()
339 Term.cout.flush()
340 for tokill in self.on_kill:
340 for tokill in self.on_kill:
341 tokill()
341 tokill()
342 print >>Term.cout, 'Done.'
342 print >>Term.cout, 'Done.'
343
343
344 # Run pending code by calling parent class
344 # Run pending code by calling parent class
345 if self.code_to_run is not None:
345 if self.code_to_run is not None:
346 self.thread_ready.notify()
346 self.thread_ready.notify()
347 InteractiveShell.runcode(self,self.code_to_run)
347 InteractiveShell.runcode(self,self.code_to_run)
348
348
349 # We're done with thread-protected variables
349 # We're done with thread-protected variables
350 self.thread_ready.release()
350 self.thread_ready.release()
351 # This MUST return true for gtk threading to work
351 # This MUST return true for gtk threading to work
352 return True
352 return True
353
353
354 def kill (self):
354 def kill (self):
355 """Kill the thread, returning when it has been shut down."""
355 """Kill the thread, returning when it has been shut down."""
356 self.thread_ready.acquire()
356 self.thread_ready.acquire()
357 self._kill = True
357 self._kill = True
358 self.thread_ready.release()
358 self.thread_ready.release()
359
359
360 class MatplotlibShellBase:
360 class MatplotlibShellBase:
361 """Mixin class to provide the necessary modifications to regular IPython
361 """Mixin class to provide the necessary modifications to regular IPython
362 shell classes for matplotlib support.
362 shell classes for matplotlib support.
363
363
364 Given Python's MRO, this should be used as the FIRST class in the
364 Given Python's MRO, this should be used as the FIRST class in the
365 inheritance hierarchy, so that it overrides the relevant methods."""
365 inheritance hierarchy, so that it overrides the relevant methods."""
366
366
367 def _matplotlib_config(self,name):
367 def _matplotlib_config(self,name):
368 """Return various items needed to setup the user's shell with matplotlib"""
368 """Return various items needed to setup the user's shell with matplotlib"""
369
369
370 # Initialize matplotlib to interactive mode always
370 # Initialize matplotlib to interactive mode always
371 import matplotlib
371 import matplotlib
372 from matplotlib import backends
372 from matplotlib import backends
373 matplotlib.interactive(True)
373 matplotlib.interactive(True)
374
374
375 def use(arg):
375 def use(arg):
376 """IPython wrapper for matplotlib's backend switcher.
376 """IPython wrapper for matplotlib's backend switcher.
377
377
378 In interactive use, we can not allow switching to a different
378 In interactive use, we can not allow switching to a different
379 interactive backend, since thread conflicts will most likely crash
379 interactive backend, since thread conflicts will most likely crash
380 the python interpreter. This routine does a safety check first,
380 the python interpreter. This routine does a safety check first,
381 and refuses to perform a dangerous switch. It still allows
381 and refuses to perform a dangerous switch. It still allows
382 switching to non-interactive backends."""
382 switching to non-interactive backends."""
383
383
384 if arg in backends.interactive_bk and arg != self.mpl_backend:
384 if arg in backends.interactive_bk and arg != self.mpl_backend:
385 m=('invalid matplotlib backend switch.\n'
385 m=('invalid matplotlib backend switch.\n'
386 'This script attempted to switch to the interactive '
386 'This script attempted to switch to the interactive '
387 'backend: `%s`\n'
387 'backend: `%s`\n'
388 'Your current choice of interactive backend is: `%s`\n\n'
388 'Your current choice of interactive backend is: `%s`\n\n'
389 'Switching interactive matplotlib backends at runtime\n'
389 'Switching interactive matplotlib backends at runtime\n'
390 'would crash the python interpreter, '
390 'would crash the python interpreter, '
391 'and IPython has blocked it.\n\n'
391 'and IPython has blocked it.\n\n'
392 'You need to either change your choice of matplotlib backend\n'
392 'You need to either change your choice of matplotlib backend\n'
393 'by editing your .matplotlibrc file, or run this script as a \n'
393 'by editing your .matplotlibrc file, or run this script as a \n'
394 'standalone file from the command line, not using IPython.\n' %
394 'standalone file from the command line, not using IPython.\n' %
395 (arg,self.mpl_backend) )
395 (arg,self.mpl_backend) )
396 raise RuntimeError, m
396 raise RuntimeError, m
397 else:
397 else:
398 self.mpl_use(arg)
398 self.mpl_use(arg)
399 self.mpl_use._called = True
399 self.mpl_use._called = True
400
400
401 self.matplotlib = matplotlib
401 self.matplotlib = matplotlib
402 self.mpl_backend = matplotlib.rcParams['backend']
402 self.mpl_backend = matplotlib.rcParams['backend']
403
403
404 # we also need to block switching of interactive backends by use()
404 # we also need to block switching of interactive backends by use()
405 self.mpl_use = matplotlib.use
405 self.mpl_use = matplotlib.use
406 self.mpl_use._called = False
406 self.mpl_use._called = False
407 # overwrite the original matplotlib.use with our wrapper
407 # overwrite the original matplotlib.use with our wrapper
408 matplotlib.use = use
408 matplotlib.use = use
409
409
410
410
411 # This must be imported last in the matplotlib series, after
411 # This must be imported last in the matplotlib series, after
412 # backend/interactivity choices have been made
412 # backend/interactivity choices have been made
413 try:
413 try:
414 import matplotlib.pylab as pylab
414 import matplotlib.pylab as pylab
415 self.pylab = pylab
415 self.pylab = pylab
416 self.pylab_name = 'pylab'
416 self.pylab_name = 'pylab'
417 except ImportError:
417 except ImportError:
418 import matplotlib.matlab as matlab
418 import matplotlib.matlab as matlab
419 self.pylab = matlab
419 self.pylab = matlab
420 self.pylab_name = 'matlab'
420 self.pylab_name = 'matlab'
421
421
422 self.pylab.show._needmain = False
422 self.pylab.show._needmain = False
423 # We need to detect at runtime whether show() is called by the user.
423 # We need to detect at runtime whether show() is called by the user.
424 # For this, we wrap it into a decorator which adds a 'called' flag.
424 # For this, we wrap it into a decorator which adds a 'called' flag.
425 self.pylab.draw_if_interactive = flag_calls(self.pylab.draw_if_interactive)
425 self.pylab.draw_if_interactive = flag_calls(self.pylab.draw_if_interactive)
426
426
427 # Build a user namespace initialized with matplotlib/matlab features.
427 # Build a user namespace initialized with matplotlib/matlab features.
428 user_ns = {'__name__':'__main__',
428 user_ns = {'__name__':'__main__',
429 '__builtins__' : __builtin__ }
429 '__builtins__' : __builtin__ }
430
430
431 # Be careful not to remove the final \n in the code string below, or
431 # Be careful not to remove the final \n in the code string below, or
432 # things will break badly with py22 (I think it's a python bug, 2.3 is
432 # things will break badly with py22 (I think it's a python bug, 2.3 is
433 # OK).
433 # OK).
434 pname = self.pylab_name # Python can't interpolate dotted var names
434 pname = self.pylab_name # Python can't interpolate dotted var names
435 exec ("import matplotlib\n"
435 exec ("import matplotlib\n"
436 "import matplotlib.%(pname)s as %(pname)s\n"
436 "import matplotlib.%(pname)s as %(pname)s\n"
437 "from matplotlib.%(pname)s import *\n" % locals()) in user_ns
437 "from matplotlib.%(pname)s import *\n" % locals()) in user_ns
438
438
439 # Build matplotlib info banner
439 # Build matplotlib info banner
440 b="""
440 b="""
441 Welcome to pylab, a matplotlib-based Python environment.
441 Welcome to pylab, a matplotlib-based Python environment.
442 For more information, type 'help(pylab)'.
442 For more information, type 'help(pylab)'.
443 """
443 """
444 return user_ns,b
444 return user_ns,b
445
445
446 def mplot_exec(self,fname,*where,**kw):
446 def mplot_exec(self,fname,*where,**kw):
447 """Execute a matplotlib script.
447 """Execute a matplotlib script.
448
448
449 This is a call to execfile(), but wrapped in safeties to properly
449 This is a call to execfile(), but wrapped in safeties to properly
450 handle interactive rendering and backend switching."""
450 handle interactive rendering and backend switching."""
451
451
452 #print '*** Matplotlib runner ***' # dbg
452 #print '*** Matplotlib runner ***' # dbg
453 # turn off rendering until end of script
453 # turn off rendering until end of script
454 isInteractive = self.matplotlib.rcParams['interactive']
454 isInteractive = self.matplotlib.rcParams['interactive']
455 self.matplotlib.interactive(False)
455 self.matplotlib.interactive(False)
456 self.safe_execfile(fname,*where,**kw)
456 self.safe_execfile(fname,*where,**kw)
457 self.matplotlib.interactive(isInteractive)
457 self.matplotlib.interactive(isInteractive)
458 # make rendering call now, if the user tried to do it
458 # make rendering call now, if the user tried to do it
459 if self.pylab.draw_if_interactive.called:
459 if self.pylab.draw_if_interactive.called:
460 self.pylab.draw()
460 self.pylab.draw()
461 self.pylab.draw_if_interactive.called = False
461 self.pylab.draw_if_interactive.called = False
462
462
463 # if a backend switch was performed, reverse it now
463 # if a backend switch was performed, reverse it now
464 if self.mpl_use._called:
464 if self.mpl_use._called:
465 self.matplotlib.rcParams['backend'] = self.mpl_backend
465 self.matplotlib.rcParams['backend'] = self.mpl_backend
466
466
467 def magic_run(self,parameter_s=''):
467 def magic_run(self,parameter_s=''):
468 Magic.magic_run(self,parameter_s,runner=self.mplot_exec)
468 Magic.magic_run(self,parameter_s,runner=self.mplot_exec)
469
469
470 # Fix the docstring so users see the original as well
470 # Fix the docstring so users see the original as well
471 magic_run.__doc__ = "%s\n%s" % (Magic.magic_run.__doc__,
471 magic_run.__doc__ = "%s\n%s" % (Magic.magic_run.__doc__,
472 "\n *** Modified %run for Matplotlib,"
472 "\n *** Modified %run for Matplotlib,"
473 " with proper interactive handling ***")
473 " with proper interactive handling ***")
474
474
475 # Now we provide 2 versions of a matplotlib-aware IPython base shells, single
475 # Now we provide 2 versions of a matplotlib-aware IPython base shells, single
476 # and multithreaded. Note that these are meant for internal use, the IPShell*
476 # and multithreaded. Note that these are meant for internal use, the IPShell*
477 # classes below are the ones meant for public consumption.
477 # classes below are the ones meant for public consumption.
478
478
479 class MatplotlibShell(MatplotlibShellBase,InteractiveShell):
479 class MatplotlibShell(MatplotlibShellBase,InteractiveShell):
480 """Single-threaded shell with matplotlib support."""
480 """Single-threaded shell with matplotlib support."""
481
481
482 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
482 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
483 user_ns=None,user_global_ns=None,**kw):
483 user_ns=None,user_global_ns=None,**kw):
484 user_ns,b2 = self._matplotlib_config(name)
484 user_ns,b2 = self._matplotlib_config(name)
485 InteractiveShell.__init__(self,name,usage,rc,user_ns,user_global_ns,
485 InteractiveShell.__init__(self,name,usage,rc,user_ns,user_global_ns,
486 banner2=b2,**kw)
486 banner2=b2,**kw)
487
487
488 class MatplotlibMTShell(MatplotlibShellBase,MTInteractiveShell):
488 class MatplotlibMTShell(MatplotlibShellBase,MTInteractiveShell):
489 """Multi-threaded shell with matplotlib support."""
489 """Multi-threaded shell with matplotlib support."""
490
490
491 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
491 def __init__(self,name,usage=None,rc=Struct(opts=None,args=None),
492 user_ns=None,user_global_ns=None, **kw):
492 user_ns=None,user_global_ns=None, **kw):
493 user_ns,b2 = self._matplotlib_config(name)
493 user_ns,b2 = self._matplotlib_config(name)
494 MTInteractiveShell.__init__(self,name,usage,rc,user_ns,user_global_ns,
494 MTInteractiveShell.__init__(self,name,usage,rc,user_ns,user_global_ns,
495 banner2=b2,**kw)
495 banner2=b2,**kw)
496
496
497 #-----------------------------------------------------------------------------
497 #-----------------------------------------------------------------------------
498 # Utility functions for the different GUI enabled IPShell* classes.
498 # Utility functions for the different GUI enabled IPShell* classes.
499
499
500 def get_tk():
500 def get_tk():
501 """Tries to import Tkinter and returns a withdrawn Tkinter root
501 """Tries to import Tkinter and returns a withdrawn Tkinter root
502 window. If Tkinter is already imported or not available, this
502 window. If Tkinter is already imported or not available, this
503 returns None. This function calls `hijack_tk` underneath.
503 returns None. This function calls `hijack_tk` underneath.
504 """
504 """
505 if not USE_TK or sys.modules.has_key('Tkinter'):
505 if not USE_TK or sys.modules.has_key('Tkinter'):
506 return None
506 return None
507 else:
507 else:
508 try:
508 try:
509 import Tkinter
509 import Tkinter
510 except ImportError:
510 except ImportError:
511 return None
511 return None
512 else:
512 else:
513 hijack_tk()
513 hijack_tk()
514 r = Tkinter.Tk()
514 r = Tkinter.Tk()
515 r.withdraw()
515 r.withdraw()
516 return r
516 return r
517
517
518 def hijack_tk():
518 def hijack_tk():
519 """Modifies Tkinter's mainloop with a dummy so when a module calls
519 """Modifies Tkinter's mainloop with a dummy so when a module calls
520 mainloop, it does not block.
520 mainloop, it does not block.
521
521
522 """
522 """
523 def misc_mainloop(self, n=0):
523 def misc_mainloop(self, n=0):
524 pass
524 pass
525 def tkinter_mainloop(n=0):
525 def tkinter_mainloop(n=0):
526 pass
526 pass
527
527
528 import Tkinter
528 import Tkinter
529 Tkinter.Misc.mainloop = misc_mainloop
529 Tkinter.Misc.mainloop = misc_mainloop
530 Tkinter.mainloop = tkinter_mainloop
530 Tkinter.mainloop = tkinter_mainloop
531
531
532 def update_tk(tk):
532 def update_tk(tk):
533 """Updates the Tkinter event loop. This is typically called from
533 """Updates the Tkinter event loop. This is typically called from
534 the respective WX or GTK mainloops.
534 the respective WX or GTK mainloops.
535 """
535 """
536 if tk:
536 if tk:
537 tk.update()
537 tk.update()
538
538
539 def hijack_wx():
539 def hijack_wx():
540 """Modifies wxPython's MainLoop with a dummy so user code does not
540 """Modifies wxPython's MainLoop with a dummy so user code does not
541 block IPython. The hijacked mainloop function is returned.
541 block IPython. The hijacked mainloop function is returned.
542 """
542 """
543 def dummy_mainloop(*args, **kw):
543 def dummy_mainloop(*args, **kw):
544 pass
544 pass
545 import wxPython
545 import wxPython
546 ver = wxPython.__version__
546 ver = wxPython.__version__
547 orig_mainloop = None
547 orig_mainloop = None
548 if ver[:3] >= '2.5':
548 if ver[:3] >= '2.5':
549 import wx
549 import wx
550 if hasattr(wx, '_core_'): core = getattr(wx, '_core_')
550 if hasattr(wx, '_core_'): core = getattr(wx, '_core_')
551 elif hasattr(wx, '_core'): core = getattr(wx, '_core')
551 elif hasattr(wx, '_core'): core = getattr(wx, '_core')
552 else: raise AttributeError('Could not find wx core module')
552 else: raise AttributeError('Could not find wx core module')
553 orig_mainloop = core.PyApp_MainLoop
553 orig_mainloop = core.PyApp_MainLoop
554 core.PyApp_MainLoop = dummy_mainloop
554 core.PyApp_MainLoop = dummy_mainloop
555 elif ver[:3] == '2.4':
555 elif ver[:3] == '2.4':
556 orig_mainloop = wxPython.wxc.wxPyApp_MainLoop
556 orig_mainloop = wxPython.wxc.wxPyApp_MainLoop
557 wxPython.wxc.wxPyApp_MainLoop = dummy_mainloop
557 wxPython.wxc.wxPyApp_MainLoop = dummy_mainloop
558 else:
558 else:
559 warn("Unable to find either wxPython version 2.4 or >= 2.5.")
559 warn("Unable to find either wxPython version 2.4 or >= 2.5.")
560 return orig_mainloop
560 return orig_mainloop
561
561
562 def hijack_gtk():
562 def hijack_gtk():
563 """Modifies pyGTK's mainloop with a dummy so user code does not
563 """Modifies pyGTK's mainloop with a dummy so user code does not
564 block IPython. This function returns the original `gtk.mainloop`
564 block IPython. This function returns the original `gtk.mainloop`
565 function that has been hijacked.
565 function that has been hijacked.
566 """
566 """
567 def dummy_mainloop(*args, **kw):
567 def dummy_mainloop(*args, **kw):
568 pass
568 pass
569 import gtk
569 import gtk
570 if gtk.pygtk_version >= (2,4,0): orig_mainloop = gtk.main
570 if gtk.pygtk_version >= (2,4,0): orig_mainloop = gtk.main
571 else: orig_mainloop = gtk.mainloop
571 else: orig_mainloop = gtk.mainloop
572 gtk.mainloop = dummy_mainloop
572 gtk.mainloop = dummy_mainloop
573 gtk.main = dummy_mainloop
573 gtk.main = dummy_mainloop
574 return orig_mainloop
574 return orig_mainloop
575
575
576 #-----------------------------------------------------------------------------
576 #-----------------------------------------------------------------------------
577 # The IPShell* classes below are the ones meant to be run by external code as
577 # The IPShell* classes below are the ones meant to be run by external code as
578 # IPython instances. Note that unless a specific threading strategy is
578 # IPython instances. Note that unless a specific threading strategy is
579 # desired, the factory function start() below should be used instead (it
579 # desired, the factory function start() below should be used instead (it
580 # selects the proper threaded class).
580 # selects the proper threaded class).
581
581
582 class IPShellGTK(threading.Thread):
582 class IPShellGTK(threading.Thread):
583 """Run a gtk mainloop() in a separate thread.
583 """Run a gtk mainloop() in a separate thread.
584
584
585 Python commands can be passed to the thread where they will be executed.
585 Python commands can be passed to the thread where they will be executed.
586 This is implemented by periodically checking for passed code using a
586 This is implemented by periodically checking for passed code using a
587 GTK timeout callback."""
587 GTK timeout callback."""
588
588
589 TIMEOUT = 100 # Millisecond interval between timeouts.
589 TIMEOUT = 100 # Millisecond interval between timeouts.
590
590
591 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
591 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
592 debug=1,shell_class=MTInteractiveShell):
592 debug=1,shell_class=MTInteractiveShell):
593
593
594 import gtk
594 import gtk
595
595
596 self.gtk = gtk
596 self.gtk = gtk
597 self.gtk_mainloop = hijack_gtk()
597 self.gtk_mainloop = hijack_gtk()
598
598
599 # Allows us to use both Tk and GTK.
599 # Allows us to use both Tk and GTK.
600 self.tk = get_tk()
600 self.tk = get_tk()
601
601
602 if gtk.pygtk_version >= (2,4,0): mainquit = self.gtk.main_quit
602 if gtk.pygtk_version >= (2,4,0): mainquit = self.gtk.main_quit
603 else: mainquit = self.gtk.mainquit
603 else: mainquit = self.gtk.mainquit
604
604
605 self.IP = make_IPython(argv,user_ns=user_ns,
605 self.IP = make_IPython(argv,user_ns=user_ns,
606 user_global_ns=user_global_ns,
606 user_global_ns=user_global_ns,
607 debug=debug,
607 debug=debug,
608 shell_class=shell_class,
608 shell_class=shell_class,
609 on_kill=[mainquit])
609 on_kill=[mainquit])
610
610
611 # HACK: slot for banner in self; it will be passed to the mainloop
611 # HACK: slot for banner in self; it will be passed to the mainloop
612 # method only and .run() needs it. The actual value will be set by
612 # method only and .run() needs it. The actual value will be set by
613 # .mainloop().
613 # .mainloop().
614 self._banner = None
614 self._banner = None
615
615
616 threading.Thread.__init__(self)
616 threading.Thread.__init__(self)
617
617
618 def run(self):
618 def run(self):
619 self.IP.mainloop(self._banner)
619 self.IP.mainloop(self._banner)
620 self.IP.kill()
620 self.IP.kill()
621
621
622 def mainloop(self,sys_exit=0,banner=None):
622 def mainloop(self,sys_exit=0,banner=None):
623
623
624 self._banner = banner
624 self._banner = banner
625
625
626 if self.gtk.pygtk_version >= (2,4,0):
626 if self.gtk.pygtk_version >= (2,4,0):
627 import gobject
627 import gobject
628 gobject.timeout_add(self.TIMEOUT, self.on_timer)
628 gobject.timeout_add(self.TIMEOUT, self.on_timer)
629 else:
629 else:
630 self.gtk.timeout_add(self.TIMEOUT, self.on_timer)
630 self.gtk.timeout_add(self.TIMEOUT, self.on_timer)
631
631
632 if sys.platform != 'win32':
632 if sys.platform != 'win32':
633 try:
633 try:
634 if self.gtk.gtk_version[0] >= 2:
634 if self.gtk.gtk_version[0] >= 2:
635 self.gtk.threads_init()
635 self.gtk.threads_init()
636 except AttributeError:
636 except AttributeError:
637 pass
637 pass
638 except RuntimeError:
638 except RuntimeError:
639 error('Your pyGTK likely has not been compiled with '
639 error('Your pyGTK likely has not been compiled with '
640 'threading support.\n'
640 'threading support.\n'
641 'The exception printout is below.\n'
641 'The exception printout is below.\n'
642 'You can either rebuild pyGTK with threads, or '
642 'You can either rebuild pyGTK with threads, or '
643 'try using \n'
643 'try using \n'
644 'matplotlib with a different backend (like Tk or WX).\n'
644 'matplotlib with a different backend (like Tk or WX).\n'
645 'Note that matplotlib will most likely not work in its '
645 'Note that matplotlib will most likely not work in its '
646 'current state!')
646 'current state!')
647 self.IP.InteractiveTB()
647 self.IP.InteractiveTB()
648 self.start()
648 self.start()
649 self.gtk.threads_enter()
649 self.gtk.threads_enter()
650 self.gtk_mainloop()
650 self.gtk_mainloop()
651 self.gtk.threads_leave()
651 self.gtk.threads_leave()
652 self.join()
652 self.join()
653
653
654 def on_timer(self):
654 def on_timer(self):
655 update_tk(self.tk)
655 update_tk(self.tk)
656 return self.IP.runcode()
656 return self.IP.runcode()
657
657
658
658
659 class IPShellWX(threading.Thread):
659 class IPShellWX(threading.Thread):
660 """Run a wx mainloop() in a separate thread.
660 """Run a wx mainloop() in a separate thread.
661
661
662 Python commands can be passed to the thread where they will be executed.
662 Python commands can be passed to the thread where they will be executed.
663 This is implemented by periodically checking for passed code using a
663 This is implemented by periodically checking for passed code using a
664 GTK timeout callback."""
664 GTK timeout callback."""
665
665
666 TIMEOUT = 100 # Millisecond interval between timeouts.
666 TIMEOUT = 100 # Millisecond interval between timeouts.
667
667
668 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
668 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
669 debug=1,shell_class=MTInteractiveShell):
669 debug=1,shell_class=MTInteractiveShell):
670
670
671 self.IP = make_IPython(argv,user_ns=user_ns,
672 user_global_ns=user_global_ns,
673 debug=debug,
674 shell_class=shell_class,
675 on_kill=[self.wxexit])
676
677 wantedwxversion=self.IP.rc.wxversion
678 if wantedwxversion!="0":
679 try:
680 import wxversion
681 except ImportError:
682 error('The wxversion module is needed for WX version selection')
683 else:
684 try:
685 wxversion.select(wantedwxversion)
686 except:
687 self.IP.InteractiveTB()
688 error('Requested wxPython version %s could not be loaded' %
689 wantedwxversion)
690
671 import wxPython.wx as wx
691 import wxPython.wx as wx
672
692
673 threading.Thread.__init__(self)
693 threading.Thread.__init__(self)
674 self.wx = wx
694 self.wx = wx
675 self.wx_mainloop = hijack_wx()
695 self.wx_mainloop = hijack_wx()
676
696
677 # Allows us to use both Tk and GTK.
697 # Allows us to use both Tk and GTK.
678 self.tk = get_tk()
698 self.tk = get_tk()
679
699
680 self.IP = make_IPython(argv,user_ns=user_ns,
700
681 user_global_ns=user_global_ns,
682 debug=debug,
683 shell_class=shell_class,
684 on_kill=[self.wxexit])
685 # HACK: slot for banner in self; it will be passed to the mainloop
701 # HACK: slot for banner in self; it will be passed to the mainloop
686 # method only and .run() needs it. The actual value will be set by
702 # method only and .run() needs it. The actual value will be set by
687 # .mainloop().
703 # .mainloop().
688 self._banner = None
704 self._banner = None
689
705
690 self.app = None
706 self.app = None
691
707
692 def wxexit(self, *args):
708 def wxexit(self, *args):
693 if self.app is not None:
709 if self.app is not None:
694 self.app.agent.timer.Stop()
710 self.app.agent.timer.Stop()
695 self.app.ExitMainLoop()
711 self.app.ExitMainLoop()
696
712
697 def run(self):
713 def run(self):
698 self.IP.mainloop(self._banner)
714 self.IP.mainloop(self._banner)
699 self.IP.kill()
715 self.IP.kill()
700
716
701 def mainloop(self,sys_exit=0,banner=None):
717 def mainloop(self,sys_exit=0,banner=None):
702
718
703 self._banner = banner
719 self._banner = banner
704
720
705 self.start()
721 self.start()
706
722
707 class TimerAgent(self.wx.wxMiniFrame):
723 class TimerAgent(self.wx.wxMiniFrame):
708 wx = self.wx
724 wx = self.wx
709 IP = self.IP
725 IP = self.IP
710 tk = self.tk
726 tk = self.tk
711 def __init__(self, parent, interval):
727 def __init__(self, parent, interval):
712 style = self.wx.wxDEFAULT_FRAME_STYLE | self.wx.wxTINY_CAPTION_HORIZ
728 style = self.wx.wxDEFAULT_FRAME_STYLE | self.wx.wxTINY_CAPTION_HORIZ
713 self.wx.wxMiniFrame.__init__(self, parent, -1, ' ', pos=(200, 200),
729 self.wx.wxMiniFrame.__init__(self, parent, -1, ' ', pos=(200, 200),
714 size=(100, 100),style=style)
730 size=(100, 100),style=style)
715 self.Show(False)
731 self.Show(False)
716 self.interval = interval
732 self.interval = interval
717 self.timerId = self.wx.wxNewId()
733 self.timerId = self.wx.wxNewId()
718
734
719 def StartWork(self):
735 def StartWork(self):
720 self.timer = self.wx.wxTimer(self, self.timerId)
736 self.timer = self.wx.wxTimer(self, self.timerId)
721 self.wx.EVT_TIMER(self, self.timerId, self.OnTimer)
737 self.wx.EVT_TIMER(self, self.timerId, self.OnTimer)
722 self.timer.Start(self.interval)
738 self.timer.Start(self.interval)
723
739
724 def OnTimer(self, event):
740 def OnTimer(self, event):
725 update_tk(self.tk)
741 update_tk(self.tk)
726 self.IP.runcode()
742 self.IP.runcode()
727
743
728 class App(self.wx.wxApp):
744 class App(self.wx.wxApp):
729 wx = self.wx
745 wx = self.wx
730 TIMEOUT = self.TIMEOUT
746 TIMEOUT = self.TIMEOUT
731 def OnInit(self):
747 def OnInit(self):
732 'Create the main window and insert the custom frame'
748 'Create the main window and insert the custom frame'
733 self.agent = TimerAgent(None, self.TIMEOUT)
749 self.agent = TimerAgent(None, self.TIMEOUT)
734 self.agent.Show(self.wx.false)
750 self.agent.Show(self.wx.false)
735 self.agent.StartWork()
751 self.agent.StartWork()
736 return self.wx.true
752 return self.wx.true
737
753
738 self.app = App(redirect=False)
754 self.app = App(redirect=False)
739 self.wx_mainloop(self.app)
755 self.wx_mainloop(self.app)
740 self.join()
756 self.join()
741
757
742
758
743 class IPShellQt(threading.Thread):
759 class IPShellQt(threading.Thread):
744 """Run a Qt event loop in a separate thread.
760 """Run a Qt event loop in a separate thread.
745
761
746 Python commands can be passed to the thread where they will be executed.
762 Python commands can be passed to the thread where they will be executed.
747 This is implemented by periodically checking for passed code using a
763 This is implemented by periodically checking for passed code using a
748 Qt timer / slot."""
764 Qt timer / slot."""
749
765
750 TIMEOUT = 100 # Millisecond interval between timeouts.
766 TIMEOUT = 100 # Millisecond interval between timeouts.
751
767
752 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
768 def __init__(self,argv=None,user_ns=None,user_global_ns=None,
753 debug=0,shell_class=MTInteractiveShell):
769 debug=0,shell_class=MTInteractiveShell):
754
770
755 import qt
771 import qt
756
772
757 class newQApplication:
773 class newQApplication:
758 def __init__( self ):
774 def __init__( self ):
759 self.QApplication = qt.QApplication
775 self.QApplication = qt.QApplication
760
776
761 def __call__( *args, **kwargs ):
777 def __call__( *args, **kwargs ):
762 return qt.qApp
778 return qt.qApp
763
779
764 def exec_loop( *args, **kwargs ):
780 def exec_loop( *args, **kwargs ):
765 pass
781 pass
766
782
767 def __getattr__( self, name ):
783 def __getattr__( self, name ):
768 return getattr( self.QApplication, name )
784 return getattr( self.QApplication, name )
769
785
770 qt.QApplication = newQApplication()
786 qt.QApplication = newQApplication()
771
787
772 # Allows us to use both Tk and QT.
788 # Allows us to use both Tk and QT.
773 self.tk = get_tk()
789 self.tk = get_tk()
774
790
775 self.IP = make_IPython(argv,user_ns=user_ns,
791 self.IP = make_IPython(argv,user_ns=user_ns,
776 user_global_ns=user_global_ns,
792 user_global_ns=user_global_ns,
777 debug=debug,
793 debug=debug,
778 shell_class=shell_class,
794 shell_class=shell_class,
779 on_kill=[qt.qApp.exit])
795 on_kill=[qt.qApp.exit])
780
796
781 # HACK: slot for banner in self; it will be passed to the mainloop
797 # HACK: slot for banner in self; it will be passed to the mainloop
782 # method only and .run() needs it. The actual value will be set by
798 # method only and .run() needs it. The actual value will be set by
783 # .mainloop().
799 # .mainloop().
784 self._banner = None
800 self._banner = None
785
801
786 threading.Thread.__init__(self)
802 threading.Thread.__init__(self)
787
803
788 def run(self):
804 def run(self):
789 self.IP.mainloop(self._banner)
805 self.IP.mainloop(self._banner)
790 self.IP.kill()
806 self.IP.kill()
791
807
792 def mainloop(self,sys_exit=0,banner=None):
808 def mainloop(self,sys_exit=0,banner=None):
793
809
794 import qt
810 import qt
795
811
796 self._banner = banner
812 self._banner = banner
797
813
798 if qt.QApplication.startingUp():
814 if qt.QApplication.startingUp():
799 a = qt.QApplication.QApplication(sys.argv)
815 a = qt.QApplication.QApplication(sys.argv)
800 self.timer = qt.QTimer()
816 self.timer = qt.QTimer()
801 qt.QObject.connect( self.timer, qt.SIGNAL( 'timeout()' ), self.on_timer )
817 qt.QObject.connect( self.timer, qt.SIGNAL( 'timeout()' ), self.on_timer )
802
818
803 self.start()
819 self.start()
804 self.timer.start( self.TIMEOUT, True )
820 self.timer.start( self.TIMEOUT, True )
805 while True:
821 while True:
806 if self.IP._kill: break
822 if self.IP._kill: break
807 qt.qApp.exec_loop()
823 qt.qApp.exec_loop()
808 self.join()
824 self.join()
809
825
810 def on_timer(self):
826 def on_timer(self):
811 update_tk(self.tk)
827 update_tk(self.tk)
812 result = self.IP.runcode()
828 result = self.IP.runcode()
813 self.timer.start( self.TIMEOUT, True )
829 self.timer.start( self.TIMEOUT, True )
814 return result
830 return result
815
831
816 # A set of matplotlib public IPython shell classes, for single-threaded
832 # A set of matplotlib public IPython shell classes, for single-threaded
817 # (Tk* and FLTK* backends) and multithreaded (GTK* and WX* backends) use.
833 # (Tk* and FLTK* backends) and multithreaded (GTK* and WX* backends) use.
818 class IPShellMatplotlib(IPShell):
834 class IPShellMatplotlib(IPShell):
819 """Subclass IPShell with MatplotlibShell as the internal shell.
835 """Subclass IPShell with MatplotlibShell as the internal shell.
820
836
821 Single-threaded class, meant for the Tk* and FLTK* backends.
837 Single-threaded class, meant for the Tk* and FLTK* backends.
822
838
823 Having this on a separate class simplifies the external driver code."""
839 Having this on a separate class simplifies the external driver code."""
824
840
825 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
841 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
826 IPShell.__init__(self,argv,user_ns,user_global_ns,debug,
842 IPShell.__init__(self,argv,user_ns,user_global_ns,debug,
827 shell_class=MatplotlibShell)
843 shell_class=MatplotlibShell)
828
844
829 class IPShellMatplotlibGTK(IPShellGTK):
845 class IPShellMatplotlibGTK(IPShellGTK):
830 """Subclass IPShellGTK with MatplotlibMTShell as the internal shell.
846 """Subclass IPShellGTK with MatplotlibMTShell as the internal shell.
831
847
832 Multi-threaded class, meant for the GTK* backends."""
848 Multi-threaded class, meant for the GTK* backends."""
833
849
834 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
850 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
835 IPShellGTK.__init__(self,argv,user_ns,user_global_ns,debug,
851 IPShellGTK.__init__(self,argv,user_ns,user_global_ns,debug,
836 shell_class=MatplotlibMTShell)
852 shell_class=MatplotlibMTShell)
837
853
838 class IPShellMatplotlibWX(IPShellWX):
854 class IPShellMatplotlibWX(IPShellWX):
839 """Subclass IPShellWX with MatplotlibMTShell as the internal shell.
855 """Subclass IPShellWX with MatplotlibMTShell as the internal shell.
840
856
841 Multi-threaded class, meant for the WX* backends."""
857 Multi-threaded class, meant for the WX* backends."""
842
858
843 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
859 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
844 IPShellWX.__init__(self,argv,user_ns,user_global_ns,debug,
860 IPShellWX.__init__(self,argv,user_ns,user_global_ns,debug,
845 shell_class=MatplotlibMTShell)
861 shell_class=MatplotlibMTShell)
846
862
847 class IPShellMatplotlibQt(IPShellQt):
863 class IPShellMatplotlibQt(IPShellQt):
848 """Subclass IPShellQt with MatplotlibMTShell as the internal shell.
864 """Subclass IPShellQt with MatplotlibMTShell as the internal shell.
849
865
850 Multi-threaded class, meant for the Qt* backends."""
866 Multi-threaded class, meant for the Qt* backends."""
851
867
852 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
868 def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
853 IPShellQt.__init__(self,argv,user_ns,user_global_ns,debug,
869 IPShellQt.__init__(self,argv,user_ns,user_global_ns,debug,
854 shell_class=MatplotlibMTShell)
870 shell_class=MatplotlibMTShell)
855
871
856 #-----------------------------------------------------------------------------
872 #-----------------------------------------------------------------------------
857 # Factory functions to actually start the proper thread-aware shell
873 # Factory functions to actually start the proper thread-aware shell
858
874
859 def _matplotlib_shell_class():
875 def _matplotlib_shell_class():
860 """Factory function to handle shell class selection for matplotlib.
876 """Factory function to handle shell class selection for matplotlib.
861
877
862 The proper shell class to use depends on the matplotlib backend, since
878 The proper shell class to use depends on the matplotlib backend, since
863 each backend requires a different threading strategy."""
879 each backend requires a different threading strategy."""
864
880
865 try:
881 try:
866 import matplotlib
882 import matplotlib
867 except ImportError:
883 except ImportError:
868 error('matplotlib could NOT be imported! Starting normal IPython.')
884 error('matplotlib could NOT be imported! Starting normal IPython.')
869 sh_class = IPShell
885 sh_class = IPShell
870 else:
886 else:
871 backend = matplotlib.rcParams['backend']
887 backend = matplotlib.rcParams['backend']
872 if backend.startswith('GTK'):
888 if backend.startswith('GTK'):
873 sh_class = IPShellMatplotlibGTK
889 sh_class = IPShellMatplotlibGTK
874 elif backend.startswith('WX'):
890 elif backend.startswith('WX'):
875 sh_class = IPShellMatplotlibWX
891 sh_class = IPShellMatplotlibWX
876 elif backend.startswith('Qt'):
892 elif backend.startswith('Qt'):
877 sh_class = IPShellMatplotlibQt
893 sh_class = IPShellMatplotlibQt
878 else:
894 else:
879 sh_class = IPShellMatplotlib
895 sh_class = IPShellMatplotlib
880 #print 'Using %s with the %s backend.' % (sh_class,backend) # dbg
896 #print 'Using %s with the %s backend.' % (sh_class,backend) # dbg
881 return sh_class
897 return sh_class
882
898
883 # This is the one which should be called by external code.
899 # This is the one which should be called by external code.
884 def start():
900 def start():
885 """Return a running shell instance, dealing with threading options.
901 """Return a running shell instance, dealing with threading options.
886
902
887 This is a factory function which will instantiate the proper IPython shell
903 This is a factory function which will instantiate the proper IPython shell
888 based on the user's threading choice. Such a selector is needed because
904 based on the user's threading choice. Such a selector is needed because
889 different GUI toolkits require different thread handling details."""
905 different GUI toolkits require different thread handling details."""
890
906
891 global USE_TK
907 global USE_TK
892 # Crude sys.argv hack to extract the threading options.
908 # Crude sys.argv hack to extract the threading options.
893 argv = sys.argv
909 argv = sys.argv
894 if len(argv) > 1:
910 if len(argv) > 1:
895 if len(argv) > 2:
911 if len(argv) > 2:
896 arg2 = argv[2]
912 arg2 = argv[2]
897 if arg2.endswith('-tk'):
913 if arg2.endswith('-tk'):
898 USE_TK = True
914 USE_TK = True
899 arg1 = argv[1]
915 arg1 = argv[1]
900 if arg1.endswith('-gthread'):
916 if arg1.endswith('-gthread'):
901 shell = IPShellGTK
917 shell = IPShellGTK
902 elif arg1.endswith( '-qthread' ):
918 elif arg1.endswith( '-qthread' ):
903 shell = IPShellQt
919 shell = IPShellQt
904 elif arg1.endswith('-wthread'):
920 elif arg1.endswith('-wthread'):
905 shell = IPShellWX
921 shell = IPShellWX
906 elif arg1.endswith('-pylab'):
922 elif arg1.endswith('-pylab'):
907 shell = _matplotlib_shell_class()
923 shell = _matplotlib_shell_class()
908 else:
924 else:
909 shell = IPShell
925 shell = IPShell
910 else:
926 else:
911 shell = IPShell
927 shell = IPShell
912 return shell()
928 return shell()
913
929
914 # Some aliases for backwards compatibility
930 # Some aliases for backwards compatibility
915 IPythonShell = IPShell
931 IPythonShell = IPShell
916 IPythonShellEmbed = IPShellEmbed
932 IPythonShellEmbed = IPShellEmbed
917 #************************ End of file <Shell.py> ***************************
933 #************************ End of file <Shell.py> ***************************
@@ -1,587 +1,597 b''
1 # -*- Mode: Shell-Script -*- Not really, but shows comments correctly
1 # -*- Mode: Shell-Script -*- Not really, but shows comments correctly
2 # $Id: ipythonrc 990 2006-01-04 06:59:02Z fperez $
2 # $Id: ipythonrc 998 2006-01-09 06:57:40Z fperez $
3
3
4 #***************************************************************************
4 #***************************************************************************
5 #
5 #
6 # Configuration file for IPython -- ipythonrc format
6 # Configuration file for IPython -- ipythonrc format
7 #
7 #
8 # The format of this file is simply one of 'key value' lines.
8 # The format of this file is simply one of 'key value' lines.
9 # Lines containing only whitespace at the beginning and then a # are ignored
9 # Lines containing only whitespace at the beginning and then a # are ignored
10 # as comments. But comments can NOT be put on lines with data.
10 # as comments. But comments can NOT be put on lines with data.
11
11
12 # The meaning and use of each key are explained below.
12 # The meaning and use of each key are explained below.
13
13
14 #---------------------------------------------------------------------------
14 #---------------------------------------------------------------------------
15 # Section: included files
15 # Section: included files
16
16
17 # Put one or more *config* files (with the syntax of this file) you want to
17 # Put one or more *config* files (with the syntax of this file) you want to
18 # include. For keys with a unique value the outermost file has precedence. For
18 # include. For keys with a unique value the outermost file has precedence. For
19 # keys with multiple values, they all get assembled into a list which then
19 # keys with multiple values, they all get assembled into a list which then
20 # gets loaded by IPython.
20 # gets loaded by IPython.
21
21
22 # In this file, all lists of things should simply be space-separated.
22 # In this file, all lists of things should simply be space-separated.
23
23
24 # This allows you to build hierarchies of files which recursively load
24 # This allows you to build hierarchies of files which recursively load
25 # lower-level services. If this is your main ~/.ipython/ipythonrc file, you
25 # lower-level services. If this is your main ~/.ipython/ipythonrc file, you
26 # should only keep here basic things you always want available. Then you can
26 # should only keep here basic things you always want available. Then you can
27 # include it in every other special-purpose config file you create.
27 # include it in every other special-purpose config file you create.
28 include
28 include
29
29
30 #---------------------------------------------------------------------------
30 #---------------------------------------------------------------------------
31 # Section: startup setup
31 # Section: startup setup
32
32
33 # These are mostly things which parallel a command line option of the same
33 # These are mostly things which parallel a command line option of the same
34 # name.
34 # name.
35
35
36 # Keys in this section should only appear once. If any key from this section
36 # Keys in this section should only appear once. If any key from this section
37 # is encountered more than once, the last value remains, all earlier ones get
37 # is encountered more than once, the last value remains, all earlier ones get
38 # discarded.
38 # discarded.
39
39
40
40
41 # Automatic calling of callable objects. If set to 1 or 2, callable objects
41 # Automatic calling of callable objects. If set to 1 or 2, callable objects
42 # are automatically called when invoked at the command line, even if you don't
42 # are automatically called when invoked at the command line, even if you don't
43 # type parentheses. IPython adds the parentheses for you. For example:
43 # type parentheses. IPython adds the parentheses for you. For example:
44
44
45 #In [1]: str 45
45 #In [1]: str 45
46 #------> str(45)
46 #------> str(45)
47 #Out[1]: '45'
47 #Out[1]: '45'
48
48
49 # IPython reprints your line with '---->' indicating that it added
49 # IPython reprints your line with '---->' indicating that it added
50 # parentheses. While this option is very convenient for interactive use, it
50 # parentheses. While this option is very convenient for interactive use, it
51 # may occasionally cause problems with objects which have side-effects if
51 # may occasionally cause problems with objects which have side-effects if
52 # called unexpectedly.
52 # called unexpectedly.
53
53
54 # The valid values for autocall are:
54 # The valid values for autocall are:
55
55
56 # autocall 0 -> disabled (you can toggle it at runtime with the %autocall magic)
56 # autocall 0 -> disabled (you can toggle it at runtime with the %autocall magic)
57
57
58 # autocall 1 -> active, but do not apply if there are no arguments on the line.
58 # autocall 1 -> active, but do not apply if there are no arguments on the line.
59
59
60 # In this mode, you get:
60 # In this mode, you get:
61
61
62 #In [1]: callable
62 #In [1]: callable
63 #Out[1]: <built-in function callable>
63 #Out[1]: <built-in function callable>
64
64
65 #In [2]: callable 'hello'
65 #In [2]: callable 'hello'
66 #------> callable('hello')
66 #------> callable('hello')
67 #Out[2]: False
67 #Out[2]: False
68
68
69 # 2 -> Active always. Even if no arguments are present, the callable object
69 # 2 -> Active always. Even if no arguments are present, the callable object
70 # is called:
70 # is called:
71
71
72 #In [4]: callable
72 #In [4]: callable
73 #------> callable()
73 #------> callable()
74
74
75 # Note that even with autocall off, you can still use '/' at the start of a
75 # Note that even with autocall off, you can still use '/' at the start of a
76 # line to treat the first argument on the command line as a function and add
76 # line to treat the first argument on the command line as a function and add
77 # parentheses to it:
77 # parentheses to it:
78
78
79 #In [8]: /str 43
79 #In [8]: /str 43
80 #------> str(43)
80 #------> str(43)
81 #Out[8]: '43'
81 #Out[8]: '43'
82
82
83 autocall 1
83 autocall 1
84
84
85 # Auto-edit syntax errors. When you use the %edit magic in ipython to edit
85 # Auto-edit syntax errors. When you use the %edit magic in ipython to edit
86 # source code (see the 'editor' variable below), it is possible that you save
86 # source code (see the 'editor' variable below), it is possible that you save
87 # a file with syntax errors in it. If this variable is true, IPython will ask
87 # a file with syntax errors in it. If this variable is true, IPython will ask
88 # you whether to re-open the editor immediately to correct such an error.
88 # you whether to re-open the editor immediately to correct such an error.
89
89
90 autoedit_syntax 1
90 autoedit_syntax 1
91
91
92 # Auto-indent. IPython can recognize lines ending in ':' and indent the next
92 # Auto-indent. IPython can recognize lines ending in ':' and indent the next
93 # line, while also un-indenting automatically after 'raise' or 'return'.
93 # line, while also un-indenting automatically after 'raise' or 'return'.
94
94
95 # This feature uses the readline library, so it will honor your ~/.inputrc
95 # This feature uses the readline library, so it will honor your ~/.inputrc
96 # configuration (or whatever file your INPUTRC variable points to). Adding
96 # configuration (or whatever file your INPUTRC variable points to). Adding
97 # the following lines to your .inputrc file can make indent/unindenting more
97 # the following lines to your .inputrc file can make indent/unindenting more
98 # convenient (M-i indents, M-u unindents):
98 # convenient (M-i indents, M-u unindents):
99
99
100 # $if Python
100 # $if Python
101 # "\M-i": " "
101 # "\M-i": " "
102 # "\M-u": "\d\d\d\d"
102 # "\M-u": "\d\d\d\d"
103 # $endif
103 # $endif
104
104
105 # The feature is potentially a bit dangerous, because it can cause problems
105 # The feature is potentially a bit dangerous, because it can cause problems
106 # with pasting of indented code (the pasted code gets re-indented on each
106 # with pasting of indented code (the pasted code gets re-indented on each
107 # line). But it's a huge time-saver when working interactively. The magic
107 # line). But it's a huge time-saver when working interactively. The magic
108 # function @autoindent allows you to toggle it on/off at runtime.
108 # function @autoindent allows you to toggle it on/off at runtime.
109
109
110 autoindent 1
110 autoindent 1
111
111
112 # Auto-magic. This gives you access to all the magic functions without having
112 # Auto-magic. This gives you access to all the magic functions without having
113 # to prepend them with an @ sign. If you define a variable with the same name
113 # to prepend them with an @ sign. If you define a variable with the same name
114 # as a magic function (say who=1), you will need to access the magic function
114 # as a magic function (say who=1), you will need to access the magic function
115 # with @ (@who in this example). However, if later you delete your variable
115 # with @ (@who in this example). However, if later you delete your variable
116 # (del who), you'll recover the automagic calling form.
116 # (del who), you'll recover the automagic calling form.
117
117
118 # Considering that many magic functions provide a lot of shell-like
118 # Considering that many magic functions provide a lot of shell-like
119 # functionality, automagic gives you something close to a full Python+system
119 # functionality, automagic gives you something close to a full Python+system
120 # shell environment (and you can extend it further if you want).
120 # shell environment (and you can extend it further if you want).
121
121
122 automagic 1
122 automagic 1
123
123
124 # Size of the output cache. After this many entries are stored, the cache will
124 # Size of the output cache. After this many entries are stored, the cache will
125 # get flushed. Depending on the size of your intermediate calculations, you
125 # get flushed. Depending on the size of your intermediate calculations, you
126 # may have memory problems if you make it too big, since keeping things in the
126 # may have memory problems if you make it too big, since keeping things in the
127 # cache prevents Python from reclaiming the memory for old results. Experiment
127 # cache prevents Python from reclaiming the memory for old results. Experiment
128 # with a value that works well for you.
128 # with a value that works well for you.
129
129
130 # If you choose cache_size 0 IPython will revert to python's regular >>>
130 # If you choose cache_size 0 IPython will revert to python's regular >>>
131 # unnumbered prompt. You will still have _, __ and ___ for your last three
131 # unnumbered prompt. You will still have _, __ and ___ for your last three
132 # results, but that will be it. No dynamic _1, _2, etc. will be created. If
132 # results, but that will be it. No dynamic _1, _2, etc. will be created. If
133 # you are running on a slow machine or with very limited memory, this may
133 # you are running on a slow machine or with very limited memory, this may
134 # help.
134 # help.
135
135
136 cache_size 1000
136 cache_size 1000
137
137
138 # Classic mode: Setting 'classic 1' you lose many of IPython niceties,
138 # Classic mode: Setting 'classic 1' you lose many of IPython niceties,
139 # but that's your choice! Classic 1 -> same as IPython -classic.
139 # but that's your choice! Classic 1 -> same as IPython -classic.
140 # Note that this is _not_ the normal python interpreter, it's simply
140 # Note that this is _not_ the normal python interpreter, it's simply
141 # IPython emulating most of the classic interpreter's behavior.
141 # IPython emulating most of the classic interpreter's behavior.
142 classic 0
142 classic 0
143
143
144 # colors - Coloring option for prompts and traceback printouts.
144 # colors - Coloring option for prompts and traceback printouts.
145
145
146 # Currently available schemes: NoColor, Linux, LightBG.
146 # Currently available schemes: NoColor, Linux, LightBG.
147
147
148 # This option allows coloring the prompts and traceback printouts. This
148 # This option allows coloring the prompts and traceback printouts. This
149 # requires a terminal which can properly handle color escape sequences. If you
149 # requires a terminal which can properly handle color escape sequences. If you
150 # are having problems with this, use the NoColor scheme (uses no color escapes
150 # are having problems with this, use the NoColor scheme (uses no color escapes
151 # at all).
151 # at all).
152
152
153 # The Linux option works well in linux console type environments: dark
153 # The Linux option works well in linux console type environments: dark
154 # background with light fonts.
154 # background with light fonts.
155
155
156 # LightBG is similar to Linux but swaps dark/light colors to be more readable
156 # LightBG is similar to Linux but swaps dark/light colors to be more readable
157 # in light background terminals.
157 # in light background terminals.
158
158
159 # keep uncommented only the one you want:
159 # keep uncommented only the one you want:
160 colors Linux
160 colors Linux
161 #colors LightBG
161 #colors LightBG
162 #colors NoColor
162 #colors NoColor
163
163
164 ########################
164 ########################
165 # Note to Windows users
165 # Note to Windows users
166 #
166 #
167 # Color and readline support is avaialble to Windows users via Gary Bishop's
167 # Color and readline support is avaialble to Windows users via Gary Bishop's
168 # readline library. You can find Gary's tools at
168 # readline library. You can find Gary's tools at
169 # http://sourceforge.net/projects/uncpythontools.
169 # http://sourceforge.net/projects/uncpythontools.
170 # Note that his readline module requires in turn the ctypes library, available
170 # Note that his readline module requires in turn the ctypes library, available
171 # at http://starship.python.net/crew/theller/ctypes.
171 # at http://starship.python.net/crew/theller/ctypes.
172 ########################
172 ########################
173
173
174 # color_info: IPython can display information about objects via a set of
174 # color_info: IPython can display information about objects via a set of
175 # functions, and optionally can use colors for this, syntax highlighting
175 # functions, and optionally can use colors for this, syntax highlighting
176 # source code and various other elements. This information is passed through a
176 # source code and various other elements. This information is passed through a
177 # pager (it defaults to 'less' if $PAGER is not set).
177 # pager (it defaults to 'less' if $PAGER is not set).
178
178
179 # If your pager has problems, try to setting it to properly handle escapes
179 # If your pager has problems, try to setting it to properly handle escapes
180 # (see the less manpage for detail), or disable this option. The magic
180 # (see the less manpage for detail), or disable this option. The magic
181 # function @color_info allows you to toggle this interactively for testing.
181 # function @color_info allows you to toggle this interactively for testing.
182
182
183 color_info 1
183 color_info 1
184
184
185 # confirm_exit: set to 1 if you want IPython to confirm when you try to exit
185 # confirm_exit: set to 1 if you want IPython to confirm when you try to exit
186 # with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using
186 # with an EOF (Control-d in Unix, Control-Z/Enter in Windows). Note that using
187 # the magic functions @Exit or @Quit you can force a direct exit, bypassing
187 # the magic functions @Exit or @Quit you can force a direct exit, bypassing
188 # any confirmation.
188 # any confirmation.
189
189
190 confirm_exit 1
190 confirm_exit 1
191
191
192 # Use deep_reload() as a substitute for reload() by default. deep_reload() is
192 # Use deep_reload() as a substitute for reload() by default. deep_reload() is
193 # still available as dreload() and appears as a builtin.
193 # still available as dreload() and appears as a builtin.
194
194
195 deep_reload 0
195 deep_reload 0
196
196
197 # Which editor to use with the @edit command. If you leave this at 0, IPython
197 # Which editor to use with the @edit command. If you leave this at 0, IPython
198 # will honor your EDITOR environment variable. Since this editor is invoked on
198 # will honor your EDITOR environment variable. Since this editor is invoked on
199 # the fly by ipython and is meant for editing small code snippets, you may
199 # the fly by ipython and is meant for editing small code snippets, you may
200 # want to use a small, lightweight editor here.
200 # want to use a small, lightweight editor here.
201
201
202 # For Emacs users, setting up your Emacs server properly as described in the
202 # For Emacs users, setting up your Emacs server properly as described in the
203 # manual is a good idea. An alternative is to use jed, a very light editor
203 # manual is a good idea. An alternative is to use jed, a very light editor
204 # with much of the feel of Emacs (though not as powerful for heavy-duty work).
204 # with much of the feel of Emacs (though not as powerful for heavy-duty work).
205
205
206 editor 0
206 editor 0
207
207
208 # log 1 -> same as ipython -log. This automatically logs to ./ipython.log
208 # log 1 -> same as ipython -log. This automatically logs to ./ipython.log
209 log 0
209 log 0
210
210
211 # Same as ipython -Logfile YourLogfileName.
211 # Same as ipython -Logfile YourLogfileName.
212 # Don't use with log 1 (use one or the other)
212 # Don't use with log 1 (use one or the other)
213 logfile ''
213 logfile ''
214
214
215 # banner 0 -> same as ipython -nobanner
215 # banner 0 -> same as ipython -nobanner
216 banner 1
216 banner 1
217
217
218 # messages 0 -> same as ipython -nomessages
218 # messages 0 -> same as ipython -nomessages
219 messages 1
219 messages 1
220
220
221 # Automatically call the pdb debugger after every uncaught exception. If you
221 # Automatically call the pdb debugger after every uncaught exception. If you
222 # are used to debugging using pdb, this puts you automatically inside of it
222 # are used to debugging using pdb, this puts you automatically inside of it
223 # after any call (either in IPython or in code called by it) which triggers an
223 # after any call (either in IPython or in code called by it) which triggers an
224 # exception which goes uncaught.
224 # exception which goes uncaught.
225 pdb 0
225 pdb 0
226
226
227 # Enable the pprint module for printing. pprint tends to give a more readable
227 # Enable the pprint module for printing. pprint tends to give a more readable
228 # display (than print) for complex nested data structures.
228 # display (than print) for complex nested data structures.
229 pprint 1
229 pprint 1
230
230
231 # Prompt strings
231 # Prompt strings
232
232
233 # Most bash-like escapes can be used to customize IPython's prompts, as well as
233 # Most bash-like escapes can be used to customize IPython's prompts, as well as
234 # a few additional ones which are IPython-specific. All valid prompt escapes
234 # a few additional ones which are IPython-specific. All valid prompt escapes
235 # are described in detail in the Customization section of the IPython HTML/PDF
235 # are described in detail in the Customization section of the IPython HTML/PDF
236 # manual.
236 # manual.
237
237
238 # Use \# to represent the current prompt number, and quote them to protect
238 # Use \# to represent the current prompt number, and quote them to protect
239 # spaces.
239 # spaces.
240 prompt_in1 'In [\#]: '
240 prompt_in1 'In [\#]: '
241
241
242 # \D is replaced by as many dots as there are digits in the
242 # \D is replaced by as many dots as there are digits in the
243 # current value of \#.
243 # current value of \#.
244 prompt_in2 ' .\D.: '
244 prompt_in2 ' .\D.: '
245
245
246 prompt_out 'Out[\#]: '
246 prompt_out 'Out[\#]: '
247
247
248 # Select whether to left-pad the output prompts to match the length of the
248 # Select whether to left-pad the output prompts to match the length of the
249 # input ones. This allows you for example to use a simple '>' as an output
249 # input ones. This allows you for example to use a simple '>' as an output
250 # prompt, and yet have the output line up with the input. If set to false,
250 # prompt, and yet have the output line up with the input. If set to false,
251 # the output prompts will be unpadded (flush left).
251 # the output prompts will be unpadded (flush left).
252 prompts_pad_left 1
252 prompts_pad_left 1
253
253
254 # quick 1 -> same as ipython -quick
254 # quick 1 -> same as ipython -quick
255 quick 0
255 quick 0
256
256
257 # Use the readline library (1) or not (0). Most users will want this on, but
257 # Use the readline library (1) or not (0). Most users will want this on, but
258 # if you experience strange problems with line management (mainly when using
258 # if you experience strange problems with line management (mainly when using
259 # IPython inside Emacs buffers) you may try disabling it. Not having it on
259 # IPython inside Emacs buffers) you may try disabling it. Not having it on
260 # prevents you from getting command history with the arrow keys, searching and
260 # prevents you from getting command history with the arrow keys, searching and
261 # name completion using TAB.
261 # name completion using TAB.
262
262
263 readline 1
263 readline 1
264
264
265 # Screen Length: number of lines of your screen. This is used to control
265 # Screen Length: number of lines of your screen. This is used to control
266 # printing of very long strings. Strings longer than this number of lines will
266 # printing of very long strings. Strings longer than this number of lines will
267 # be paged with the less command instead of directly printed.
267 # be paged with the less command instead of directly printed.
268
268
269 # The default value for this is 0, which means IPython will auto-detect your
269 # The default value for this is 0, which means IPython will auto-detect your
270 # screen size every time it needs to print. If for some reason this isn't
270 # screen size every time it needs to print. If for some reason this isn't
271 # working well (it needs curses support), specify it yourself. Otherwise don't
271 # working well (it needs curses support), specify it yourself. Otherwise don't
272 # change the default.
272 # change the default.
273
273
274 screen_length 0
274 screen_length 0
275
275
276 # Prompt separators for input and output.
276 # Prompt separators for input and output.
277 # Use \n for newline explicitly, without quotes.
277 # Use \n for newline explicitly, without quotes.
278 # Use 0 (like at the cmd line) to turn off a given separator.
278 # Use 0 (like at the cmd line) to turn off a given separator.
279
279
280 # The structure of prompt printing is:
280 # The structure of prompt printing is:
281 # (SeparateIn)Input....
281 # (SeparateIn)Input....
282 # (SeparateOut)Output...
282 # (SeparateOut)Output...
283 # (SeparateOut2), # that is, no newline is printed after Out2
283 # (SeparateOut2), # that is, no newline is printed after Out2
284 # By choosing these you can organize your output any way you want.
284 # By choosing these you can organize your output any way you want.
285
285
286 separate_in \n
286 separate_in \n
287 separate_out 0
287 separate_out 0
288 separate_out2 0
288 separate_out2 0
289
289
290 # 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'.
290 # 'nosep 1' is a shorthand for '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'.
291 # Simply removes all input/output separators, overriding the choices above.
291 # Simply removes all input/output separators, overriding the choices above.
292 nosep 0
292 nosep 0
293
293
294 # Wildcard searches - IPython has a system for searching names using
294 # Wildcard searches - IPython has a system for searching names using
295 # shell-like wildcards; type %psearch? for details. This variables sets
295 # shell-like wildcards; type %psearch? for details. This variables sets
296 # whether by default such searches should be case sensitive or not. You can
296 # whether by default such searches should be case sensitive or not. You can
297 # always override the default at the system command line or the IPython
297 # always override the default at the system command line or the IPython
298 # prompt.
298 # prompt.
299
299
300 wildcards_case_sensitive 1
300 wildcards_case_sensitive 1
301
301
302 # xmode - Exception reporting mode.
302 # xmode - Exception reporting mode.
303
303
304 # Valid modes: Plain, Context and Verbose.
304 # Valid modes: Plain, Context and Verbose.
305
305
306 # Plain: similar to python's normal traceback printing.
306 # Plain: similar to python's normal traceback printing.
307
307
308 # Context: prints 5 lines of context source code around each line in the
308 # Context: prints 5 lines of context source code around each line in the
309 # traceback.
309 # traceback.
310
310
311 # Verbose: similar to Context, but additionally prints the variables currently
311 # Verbose: similar to Context, but additionally prints the variables currently
312 # visible where the exception happened (shortening their strings if too
312 # visible where the exception happened (shortening their strings if too
313 # long). This can potentially be very slow, if you happen to have a huge data
313 # long). This can potentially be very slow, if you happen to have a huge data
314 # structure whose string representation is complex to compute. Your computer
314 # structure whose string representation is complex to compute. Your computer
315 # may appear to freeze for a while with cpu usage at 100%. If this occurs, you
315 # may appear to freeze for a while with cpu usage at 100%. If this occurs, you
316 # can cancel the traceback with Ctrl-C (maybe hitting it more than once).
316 # can cancel the traceback with Ctrl-C (maybe hitting it more than once).
317
317
318 #xmode Plain
318 #xmode Plain
319 xmode Context
319 xmode Context
320 #xmode Verbose
320 #xmode Verbose
321
321
322 # multi_line_specials: if true, allow magics, aliases and shell escapes (via
322 # multi_line_specials: if true, allow magics, aliases and shell escapes (via
323 # !cmd) to be used in multi-line input (like for loops). For example, if you
323 # !cmd) to be used in multi-line input (like for loops). For example, if you
324 # have this active, the following is valid in IPython:
324 # have this active, the following is valid in IPython:
325 #
325 #
326 #In [17]: for i in range(3):
326 #In [17]: for i in range(3):
327 # ....: mkdir $i
327 # ....: mkdir $i
328 # ....: !touch $i/hello
328 # ....: !touch $i/hello
329 # ....: ls -l $i
329 # ....: ls -l $i
330
330
331 multi_line_specials 1
331 multi_line_specials 1
332
332
333 # wxversion: request a specific wxPython version (used for -wthread)
334
335 # Set this to the value of wxPython you want to use, but note that this
336 # feature requires you to have the wxversion Python module to work. If you
337 # don't have the wxversion module (try 'import wxversion' at the prompt to
338 # check) or simply want to leave the system to pick up the default, leave this
339 # variable at 0.
340
341 wxversion 0
342
333 #---------------------------------------------------------------------------
343 #---------------------------------------------------------------------------
334 # Section: Readline configuration (readline is not available for MS-Windows)
344 # Section: Readline configuration (readline is not available for MS-Windows)
335
345
336 # This is done via the following options:
346 # This is done via the following options:
337
347
338 # (i) readline_parse_and_bind: this option can appear as many times as you
348 # (i) readline_parse_and_bind: this option can appear as many times as you
339 # want, each time defining a string to be executed via a
349 # want, each time defining a string to be executed via a
340 # readline.parse_and_bind() command. The syntax for valid commands of this
350 # readline.parse_and_bind() command. The syntax for valid commands of this
341 # kind can be found by reading the documentation for the GNU readline library,
351 # kind can be found by reading the documentation for the GNU readline library,
342 # as these commands are of the kind which readline accepts in its
352 # as these commands are of the kind which readline accepts in its
343 # configuration file.
353 # configuration file.
344
354
345 # The TAB key can be used to complete names at the command line in one of two
355 # The TAB key can be used to complete names at the command line in one of two
346 # ways: 'complete' and 'menu-complete'. The difference is that 'complete' only
356 # ways: 'complete' and 'menu-complete'. The difference is that 'complete' only
347 # completes as much as possible while 'menu-complete' cycles through all
357 # completes as much as possible while 'menu-complete' cycles through all
348 # possible completions. Leave the one you prefer uncommented.
358 # possible completions. Leave the one you prefer uncommented.
349
359
350 readline_parse_and_bind tab: complete
360 readline_parse_and_bind tab: complete
351 #readline_parse_and_bind tab: menu-complete
361 #readline_parse_and_bind tab: menu-complete
352
362
353 # This binds Control-l to printing the list of all possible completions when
363 # This binds Control-l to printing the list of all possible completions when
354 # there is more than one (what 'complete' does when hitting TAB twice, or at
364 # there is more than one (what 'complete' does when hitting TAB twice, or at
355 # the first TAB if show-all-if-ambiguous is on)
365 # the first TAB if show-all-if-ambiguous is on)
356 readline_parse_and_bind "\C-l": possible-completions
366 readline_parse_and_bind "\C-l": possible-completions
357
367
358 # This forces readline to automatically print the above list when tab
368 # This forces readline to automatically print the above list when tab
359 # completion is set to 'complete'. You can still get this list manually by
369 # completion is set to 'complete'. You can still get this list manually by
360 # using the key bound to 'possible-completions' (Control-l by default) or by
370 # using the key bound to 'possible-completions' (Control-l by default) or by
361 # hitting TAB twice. Turning this on makes the printing happen at the first
371 # hitting TAB twice. Turning this on makes the printing happen at the first
362 # TAB.
372 # TAB.
363 readline_parse_and_bind set show-all-if-ambiguous on
373 readline_parse_and_bind set show-all-if-ambiguous on
364
374
365 # If you have TAB set to complete names, you can rebind any key (Control-o by
375 # If you have TAB set to complete names, you can rebind any key (Control-o by
366 # default) to insert a true TAB character.
376 # default) to insert a true TAB character.
367 readline_parse_and_bind "\C-o": tab-insert
377 readline_parse_and_bind "\C-o": tab-insert
368
378
369 # These commands allow you to indent/unindent easily, with the 4-space
379 # These commands allow you to indent/unindent easily, with the 4-space
370 # convention of the Python coding standards. Since IPython's internal
380 # convention of the Python coding standards. Since IPython's internal
371 # auto-indent system also uses 4 spaces, you should not change the number of
381 # auto-indent system also uses 4 spaces, you should not change the number of
372 # spaces in the code below.
382 # spaces in the code below.
373 readline_parse_and_bind "\M-i": " "
383 readline_parse_and_bind "\M-i": " "
374 readline_parse_and_bind "\M-o": "\d\d\d\d"
384 readline_parse_and_bind "\M-o": "\d\d\d\d"
375 readline_parse_and_bind "\M-I": "\d\d\d\d"
385 readline_parse_and_bind "\M-I": "\d\d\d\d"
376
386
377 # Bindings for incremental searches in the history. These searches use the
387 # Bindings for incremental searches in the history. These searches use the
378 # string typed so far on the command line and search anything in the previous
388 # string typed so far on the command line and search anything in the previous
379 # input history containing them.
389 # input history containing them.
380 readline_parse_and_bind "\C-r": reverse-search-history
390 readline_parse_and_bind "\C-r": reverse-search-history
381 readline_parse_and_bind "\C-s": forward-search-history
391 readline_parse_and_bind "\C-s": forward-search-history
382
392
383 # Bindings for completing the current line in the history of previous
393 # Bindings for completing the current line in the history of previous
384 # commands. This allows you to recall any previous command by typing its first
394 # commands. This allows you to recall any previous command by typing its first
385 # few letters and hitting Control-p, bypassing all intermediate commands which
395 # few letters and hitting Control-p, bypassing all intermediate commands which
386 # may be in the history (much faster than hitting up-arrow 50 times!)
396 # may be in the history (much faster than hitting up-arrow 50 times!)
387 readline_parse_and_bind "\C-p": history-search-backward
397 readline_parse_and_bind "\C-p": history-search-backward
388 readline_parse_and_bind "\C-n": history-search-forward
398 readline_parse_and_bind "\C-n": history-search-forward
389
399
390 # I also like to have the same functionality on the plain arrow keys. If you'd
400 # I also like to have the same functionality on the plain arrow keys. If you'd
391 # rather have the arrows use all the history (and not just match what you've
401 # rather have the arrows use all the history (and not just match what you've
392 # typed so far), comment out or delete the next two lines.
402 # typed so far), comment out or delete the next two lines.
393 readline_parse_and_bind "\e[A": history-search-backward
403 readline_parse_and_bind "\e[A": history-search-backward
394 readline_parse_and_bind "\e[B": history-search-forward
404 readline_parse_and_bind "\e[B": history-search-forward
395
405
396 # These are typically on by default under *nix, but not win32.
406 # These are typically on by default under *nix, but not win32.
397 readline_parse_and_bind "\C-k": kill-line
407 readline_parse_and_bind "\C-k": kill-line
398 readline_parse_and_bind "\C-u": unix-line-discard
408 readline_parse_and_bind "\C-u": unix-line-discard
399
409
400 # (ii) readline_remove_delims: a string of characters to be removed from the
410 # (ii) readline_remove_delims: a string of characters to be removed from the
401 # default word-delimiters list used by readline, so that completions may be
411 # default word-delimiters list used by readline, so that completions may be
402 # performed on strings which contain them.
412 # performed on strings which contain them.
403
413
404 readline_remove_delims -/~
414 readline_remove_delims -/~
405
415
406 # (iii) readline_merge_completions: whether to merge the result of all
416 # (iii) readline_merge_completions: whether to merge the result of all
407 # possible completions or not. If true, IPython will complete filenames,
417 # possible completions or not. If true, IPython will complete filenames,
408 # python names and aliases and return all possible completions. If you set it
418 # python names and aliases and return all possible completions. If you set it
409 # to false, each completer is used at a time, and only if it doesn't return
419 # to false, each completer is used at a time, and only if it doesn't return
410 # any completions is the next one used.
420 # any completions is the next one used.
411
421
412 # The default order is: [python_matches, file_matches, alias_matches]
422 # The default order is: [python_matches, file_matches, alias_matches]
413
423
414 readline_merge_completions 1
424 readline_merge_completions 1
415
425
416 # (iv) readline_omit__names: normally hitting <tab> after a '.' in a name
426 # (iv) readline_omit__names: normally hitting <tab> after a '.' in a name
417 # will complete all attributes of an object, including all the special methods
427 # will complete all attributes of an object, including all the special methods
418 # whose names start with single or double underscores (like __getitem__ or
428 # whose names start with single or double underscores (like __getitem__ or
419 # __class__).
429 # __class__).
420
430
421 # This variable allows you to control this completion behavior:
431 # This variable allows you to control this completion behavior:
422
432
423 # readline_omit__names 1 -> completion will omit showing any names starting
433 # readline_omit__names 1 -> completion will omit showing any names starting
424 # with two __, but it will still show names starting with one _.
434 # with two __, but it will still show names starting with one _.
425
435
426 # readline_omit__names 2 -> completion will omit all names beginning with one
436 # readline_omit__names 2 -> completion will omit all names beginning with one
427 # _ (which obviously means filtering out the double __ ones).
437 # _ (which obviously means filtering out the double __ ones).
428
438
429 # Even when this option is set, you can still see those names by explicitly
439 # Even when this option is set, you can still see those names by explicitly
430 # typing a _ after the period and hitting <tab>: 'name._<tab>' will always
440 # typing a _ after the period and hitting <tab>: 'name._<tab>' will always
431 # complete attribute names starting with '_'.
441 # complete attribute names starting with '_'.
432
442
433 # This option is off by default so that new users see all attributes of any
443 # This option is off by default so that new users see all attributes of any
434 # objects they are dealing with.
444 # objects they are dealing with.
435
445
436 readline_omit__names 0
446 readline_omit__names 0
437
447
438 #---------------------------------------------------------------------------
448 #---------------------------------------------------------------------------
439 # Section: modules to be loaded with 'import ...'
449 # Section: modules to be loaded with 'import ...'
440
450
441 # List, separated by spaces, the names of the modules you want to import
451 # List, separated by spaces, the names of the modules you want to import
442
452
443 # Example:
453 # Example:
444 # import_mod sys os
454 # import_mod sys os
445 # will produce internally the statements
455 # will produce internally the statements
446 # import sys
456 # import sys
447 # import os
457 # import os
448
458
449 # Each import is executed in its own try/except block, so if one module
459 # Each import is executed in its own try/except block, so if one module
450 # fails to load the others will still be ok.
460 # fails to load the others will still be ok.
451
461
452 import_mod
462 import_mod
453
463
454 #---------------------------------------------------------------------------
464 #---------------------------------------------------------------------------
455 # Section: modules to import some functions from: 'from ... import ...'
465 # Section: modules to import some functions from: 'from ... import ...'
456
466
457 # List, one per line, the modules for which you want only to import some
467 # List, one per line, the modules for which you want only to import some
458 # functions. Give the module name first and then the name of functions to be
468 # functions. Give the module name first and then the name of functions to be
459 # imported from that module.
469 # imported from that module.
460
470
461 # Example:
471 # Example:
462
472
463 # import_some IPython.genutils timing timings
473 # import_some IPython.genutils timing timings
464 # will produce internally the statement
474 # will produce internally the statement
465 # from IPython.genutils import timing, timings
475 # from IPython.genutils import timing, timings
466
476
467 # timing() and timings() are two IPython utilities for timing the execution of
477 # timing() and timings() are two IPython utilities for timing the execution of
468 # your own functions, which you may find useful. Just commment out the above
478 # your own functions, which you may find useful. Just commment out the above
469 # line if you want to test them.
479 # line if you want to test them.
470
480
471 # If you have more than one modules_some line, each gets its own try/except
481 # If you have more than one modules_some line, each gets its own try/except
472 # block (like modules, see above).
482 # block (like modules, see above).
473
483
474 import_some
484 import_some
475
485
476 #---------------------------------------------------------------------------
486 #---------------------------------------------------------------------------
477 # Section: modules to import all from : 'from ... import *'
487 # Section: modules to import all from : 'from ... import *'
478
488
479 # List (same syntax as import_mod above) those modules for which you want to
489 # List (same syntax as import_mod above) those modules for which you want to
480 # import all functions. Remember, this is a potentially dangerous thing to do,
490 # import all functions. Remember, this is a potentially dangerous thing to do,
481 # since it is very easy to overwrite names of things you need. Use with
491 # since it is very easy to overwrite names of things you need. Use with
482 # caution.
492 # caution.
483
493
484 # Example:
494 # Example:
485 # import_all sys os
495 # import_all sys os
486 # will produce internally the statements
496 # will produce internally the statements
487 # from sys import *
497 # from sys import *
488 # from os import *
498 # from os import *
489
499
490 # As before, each will be called in a separate try/except block.
500 # As before, each will be called in a separate try/except block.
491
501
492 import_all
502 import_all
493
503
494 #---------------------------------------------------------------------------
504 #---------------------------------------------------------------------------
495 # Section: Python code to execute.
505 # Section: Python code to execute.
496
506
497 # Put here code to be explicitly executed (keep it simple!)
507 # Put here code to be explicitly executed (keep it simple!)
498 # Put one line of python code per line. All whitespace is removed (this is a
508 # Put one line of python code per line. All whitespace is removed (this is a
499 # feature, not a bug), so don't get fancy building loops here.
509 # feature, not a bug), so don't get fancy building loops here.
500 # This is just for quick convenient creation of things you want available.
510 # This is just for quick convenient creation of things you want available.
501
511
502 # Example:
512 # Example:
503 # execute x = 1
513 # execute x = 1
504 # execute print 'hello world'; y = z = 'a'
514 # execute print 'hello world'; y = z = 'a'
505 # will produce internally
515 # will produce internally
506 # x = 1
516 # x = 1
507 # print 'hello world'; y = z = 'a'
517 # print 'hello world'; y = z = 'a'
508 # and each *line* (not each statement, we don't do python syntax parsing) is
518 # and each *line* (not each statement, we don't do python syntax parsing) is
509 # executed in its own try/except block.
519 # executed in its own try/except block.
510
520
511 execute
521 execute
512
522
513 # Note for the adventurous: you can use this to define your own names for the
523 # Note for the adventurous: you can use this to define your own names for the
514 # magic functions, by playing some namespace tricks:
524 # magic functions, by playing some namespace tricks:
515
525
516 # execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
526 # execute __IPYTHON__.magic_pf = __IPYTHON__.magic_profile
517
527
518 # defines @pf as a new name for @profile.
528 # defines @pf as a new name for @profile.
519
529
520 #---------------------------------------------------------------------------
530 #---------------------------------------------------------------------------
521 # Section: Pyhton files to load and execute.
531 # Section: Pyhton files to load and execute.
522
532
523 # Put here the full names of files you want executed with execfile(file). If
533 # Put here the full names of files you want executed with execfile(file). If
524 # you want complicated initialization, just write whatever you want in a
534 # you want complicated initialization, just write whatever you want in a
525 # regular python file and load it from here.
535 # regular python file and load it from here.
526
536
527 # Filenames defined here (which *must* include the extension) are searched for
537 # Filenames defined here (which *must* include the extension) are searched for
528 # through all of sys.path. Since IPython adds your .ipython directory to
538 # through all of sys.path. Since IPython adds your .ipython directory to
529 # sys.path, they can also be placed in your .ipython dir and will be
539 # sys.path, they can also be placed in your .ipython dir and will be
530 # found. Otherwise (if you want to execute things not in .ipyton nor in
540 # found. Otherwise (if you want to execute things not in .ipyton nor in
531 # sys.path) give a full path (you can use ~, it gets expanded)
541 # sys.path) give a full path (you can use ~, it gets expanded)
532
542
533 # Example:
543 # Example:
534 # execfile file1.py ~/file2.py
544 # execfile file1.py ~/file2.py
535 # will generate
545 # will generate
536 # execfile('file1.py')
546 # execfile('file1.py')
537 # execfile('_path_to_your_home/file2.py')
547 # execfile('_path_to_your_home/file2.py')
538
548
539 # As before, each file gets its own try/except block.
549 # As before, each file gets its own try/except block.
540
550
541 execfile
551 execfile
542
552
543 # If you are feeling adventurous, you can even add functionality to IPython
553 # If you are feeling adventurous, you can even add functionality to IPython
544 # through here. IPython works through a global variable called __ip which
554 # through here. IPython works through a global variable called __ip which
545 # exists at the time when these files are read. If you know what you are doing
555 # exists at the time when these files are read. If you know what you are doing
546 # (read the source) you can add functions to __ip in files loaded here.
556 # (read the source) you can add functions to __ip in files loaded here.
547
557
548 # The file example-magic.py contains a simple but correct example. Try it:
558 # The file example-magic.py contains a simple but correct example. Try it:
549
559
550 # execfile example-magic.py
560 # execfile example-magic.py
551
561
552 # Look at the examples in IPython/iplib.py for more details on how these magic
562 # Look at the examples in IPython/iplib.py for more details on how these magic
553 # functions need to process their arguments.
563 # functions need to process their arguments.
554
564
555 #---------------------------------------------------------------------------
565 #---------------------------------------------------------------------------
556 # Section: aliases for system shell commands
566 # Section: aliases for system shell commands
557
567
558 # Here you can define your own names for system commands. The syntax is
568 # Here you can define your own names for system commands. The syntax is
559 # similar to that of the builtin @alias function:
569 # similar to that of the builtin @alias function:
560
570
561 # alias alias_name command_string
571 # alias alias_name command_string
562
572
563 # The resulting aliases are auto-generated magic functions (hence usable as
573 # The resulting aliases are auto-generated magic functions (hence usable as
564 # @alias_name)
574 # @alias_name)
565
575
566 # For example:
576 # For example:
567
577
568 # alias myls ls -la
578 # alias myls ls -la
569
579
570 # will define 'myls' as an alias for executing the system command 'ls -la'.
580 # will define 'myls' as an alias for executing the system command 'ls -la'.
571 # This allows you to customize IPython's environment to have the same aliases
581 # This allows you to customize IPython's environment to have the same aliases
572 # you are accustomed to from your own shell.
582 # you are accustomed to from your own shell.
573
583
574 # You can also define aliases with parameters using %s specifiers (one per
584 # You can also define aliases with parameters using %s specifiers (one per
575 # parameter):
585 # parameter):
576
586
577 # alias parts echo first %s second %s
587 # alias parts echo first %s second %s
578
588
579 # will give you in IPython:
589 # will give you in IPython:
580 # >>> @parts A B
590 # >>> @parts A B
581 # first A second B
591 # first A second B
582
592
583 # Use one 'alias' statement per alias you wish to define.
593 # Use one 'alias' statement per alias you wish to define.
584
594
585 # alias
595 # alias
586
596
587 #************************* end of file <ipythonrc> ************************
597 #************************* end of file <ipythonrc> ************************
@@ -1,64 +1,64 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 IPython -- An enhanced Interactive Python
3 IPython -- An enhanced Interactive Python
4
4
5 One of Python's nicest features is its interactive interpreter. This allows
5 One of Python's nicest features is its interactive interpreter. This allows
6 very fast testing of ideas without the overhead of creating test files as is
6 very fast testing of ideas without the overhead of creating test files as is
7 typical in most programming languages. However, the interpreter supplied with
7 typical in most programming languages. However, the interpreter supplied with
8 the standard Python distribution is fairly primitive (and IDLE isn't really
8 the standard Python distribution is fairly primitive (and IDLE isn't really
9 much better).
9 much better).
10
10
11 IPython tries to:
11 IPython tries to:
12
12
13 i - provide an efficient environment for interactive work in Python
13 i - provide an efficient environment for interactive work in Python
14 programming. It tries to address what we see as shortcomings of the standard
14 programming. It tries to address what we see as shortcomings of the standard
15 Python prompt, and adds many features to make interactive work much more
15 Python prompt, and adds many features to make interactive work much more
16 efficient.
16 efficient.
17
17
18 ii - offer a flexible framework so that it can be used as the base
18 ii - offer a flexible framework so that it can be used as the base
19 environment for other projects and problems where Python can be the
19 environment for other projects and problems where Python can be the
20 underlying language. Specifically scientific environments like Mathematica,
20 underlying language. Specifically scientific environments like Mathematica,
21 IDL and Mathcad inspired its design, but similar ideas can be useful in many
21 IDL and Mathcad inspired its design, but similar ideas can be useful in many
22 fields. Python is a fabulous language for implementing this kind of system
22 fields. Python is a fabulous language for implementing this kind of system
23 (due to its dynamic and introspective features), and with suitable libraries
23 (due to its dynamic and introspective features), and with suitable libraries
24 entire systems could be built leveraging Python's power.
24 entire systems could be built leveraging Python's power.
25
25
26 iii - serve as an embeddable, ready to go interpreter for your own programs.
26 iii - serve as an embeddable, ready to go interpreter for your own programs.
27
27
28 IPython requires Python 2.2 or newer.
28 IPython requires Python 2.2 or newer.
29
29
30 $Id: __init__.py 775 2005-09-01 20:24:59Z fperez $"""
30 $Id: __init__.py 998 2006-01-09 06:57:40Z fperez $"""
31
31
32 #*****************************************************************************
32 #*****************************************************************************
33 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
33 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
34 #
34 #
35 # Distributed under the terms of the BSD License. The full license is in
35 # Distributed under the terms of the BSD License. The full license is in
36 # the file COPYING, distributed as part of this software.
36 # the file COPYING, distributed as part of this software.
37 #*****************************************************************************
37 #*****************************************************************************
38
38
39 # Enforce proper version requirements
39 # Enforce proper version requirements
40 import sys
40 import sys
41 if sys.version[0:3] < '2.2':
41 if sys.version[0:3] < '2.3':
42 raise ImportError, 'Python Version 2.2 or above is required.'
42 raise ImportError, 'Python Version 2.3 or above is required.'
43
43
44 # Define what gets imported with a 'from IPython import *'
44 # Define what gets imported with a 'from IPython import *'
45 __all__ = ['deep_reload','genutils','ultraTB','DPyGetOpt','Itpl','hooks',
45 __all__ = ['deep_reload','genutils','ultraTB','DPyGetOpt','Itpl','hooks',
46 'ConfigLoader','OutputTrap','Release','Struct','Shell']
46 'ConfigLoader','OutputTrap','Release','Struct','Shell']
47
47
48 # Load __all__ in IPython namespace so that a simple 'import IPython' gives
48 # Load __all__ in IPython namespace so that a simple 'import IPython' gives
49 # access to them via IPython.<name>
49 # access to them via IPython.<name>
50 glob,loc = globals(),locals()
50 glob,loc = globals(),locals()
51 for name in __all__:
51 for name in __all__:
52 __import__(name,glob,loc,[])
52 __import__(name,glob,loc,[])
53
53
54 # Release data
54 # Release data
55 from IPython import Release # do it explicitly so pydoc can see it - pydoc bug
55 from IPython import Release # do it explicitly so pydoc can see it - pydoc bug
56 __author__ = '%s <%s>\n%s <%s>\n%s <%s>' % \
56 __author__ = '%s <%s>\n%s <%s>\n%s <%s>' % \
57 ( Release.authors['Fernando'] + Release.authors['Janko'] + \
57 ( Release.authors['Fernando'] + Release.authors['Janko'] + \
58 Release.authors['Nathan'] )
58 Release.authors['Nathan'] )
59 __license__ = Release.license
59 __license__ = Release.license
60 __version__ = Release.version
60 __version__ = Release.version
61 __revision__ = Release.revision
61 __revision__ = Release.revision
62
62
63 # Namespace cleanup
63 # Namespace cleanup
64 del name,glob,loc
64 del name,glob,loc
@@ -1,701 +1,703 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """
2 """
3 IPython -- An enhanced Interactive Python
3 IPython -- An enhanced Interactive Python
4
4
5 Requires Python 2.1 or better.
5 Requires Python 2.1 or better.
6
6
7 This file contains the main make_IPython() starter function.
7 This file contains the main make_IPython() starter function.
8
8
9 $Id: ipmaker.py 994 2006-01-08 08:29:44Z fperez $"""
9 $Id: ipmaker.py 998 2006-01-09 06:57:40Z fperez $"""
10
10
11 #*****************************************************************************
11 #*****************************************************************************
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
12 # Copyright (C) 2001-2006 Fernando Perez. <fperez@colorado.edu>
13 #
13 #
14 # Distributed under the terms of the BSD License. The full license is in
14 # Distributed under the terms of the BSD License. The full license is in
15 # the file COPYING, distributed as part of this software.
15 # the file COPYING, distributed as part of this software.
16 #*****************************************************************************
16 #*****************************************************************************
17
17
18 from IPython import Release
18 from IPython import Release
19 __author__ = '%s <%s>' % Release.authors['Fernando']
19 __author__ = '%s <%s>' % Release.authors['Fernando']
20 __license__ = Release.license
20 __license__ = Release.license
21 __version__ = Release.version
21 __version__ = Release.version
22
22
23 credits._Printer__data = """
23 credits._Printer__data = """
24 Python: %s
24 Python: %s
25
25
26 IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
26 IPython: Fernando Perez, Janko Hauser, Nathan Gray, and many users.
27 See http://ipython.scipy.org for more information.""" \
27 See http://ipython.scipy.org for more information.""" \
28 % credits._Printer__data
28 % credits._Printer__data
29
29
30 copyright._Printer__data += """
30 copyright._Printer__data += """
31
31
32 Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
32 Copyright (c) 2001-2004 Fernando Perez, Janko Hauser, Nathan Gray.
33 All Rights Reserved."""
33 All Rights Reserved."""
34
34
35 #****************************************************************************
35 #****************************************************************************
36 # Required modules
36 # Required modules
37
37
38 # From the standard library
38 # From the standard library
39 import __main__
39 import __main__
40 import __builtin__
40 import __builtin__
41 import os
41 import os
42 import re
42 import re
43 import sys
43 import sys
44 import types
44 import types
45 from pprint import pprint,pformat
45 from pprint import pprint,pformat
46
46
47 # Our own
47 # Our own
48 from IPython import DPyGetOpt
48 from IPython import DPyGetOpt
49 from IPython.Struct import Struct
49 from IPython.Struct import Struct
50 from IPython.OutputTrap import OutputTrap
50 from IPython.OutputTrap import OutputTrap
51 from IPython.ConfigLoader import ConfigLoader
51 from IPython.ConfigLoader import ConfigLoader
52 from IPython.iplib import InteractiveShell
52 from IPython.iplib import InteractiveShell
53 from IPython.usage import cmd_line_usage,interactive_usage
53 from IPython.usage import cmd_line_usage,interactive_usage
54 from IPython.genutils import *
54 from IPython.genutils import *
55
55
56 #-----------------------------------------------------------------------------
56 #-----------------------------------------------------------------------------
57 def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
57 def make_IPython(argv=None,user_ns=None,user_global_ns=None,debug=1,
58 rc_override=None,shell_class=InteractiveShell,
58 rc_override=None,shell_class=InteractiveShell,
59 embedded=False,**kw):
59 embedded=False,**kw):
60 """This is a dump of IPython into a single function.
60 """This is a dump of IPython into a single function.
61
61
62 Later it will have to be broken up in a sensible manner.
62 Later it will have to be broken up in a sensible manner.
63
63
64 Arguments:
64 Arguments:
65
65
66 - argv: a list similar to sys.argv[1:]. It should NOT contain the desired
66 - argv: a list similar to sys.argv[1:]. It should NOT contain the desired
67 script name, b/c DPyGetOpt strips the first argument only for the real
67 script name, b/c DPyGetOpt strips the first argument only for the real
68 sys.argv.
68 sys.argv.
69
69
70 - user_ns: a dict to be used as the user's namespace."""
70 - user_ns: a dict to be used as the user's namespace."""
71
71
72 #----------------------------------------------------------------------
72 #----------------------------------------------------------------------
73 # Defaults and initialization
73 # Defaults and initialization
74
74
75 # For developer debugging, deactivates crash handler and uses pdb.
75 # For developer debugging, deactivates crash handler and uses pdb.
76 DEVDEBUG = False
76 DEVDEBUG = False
77
77
78 if argv is None:
78 if argv is None:
79 argv = sys.argv
79 argv = sys.argv
80
80
81 # __IP is the main global that lives throughout and represents the whole
81 # __IP is the main global that lives throughout and represents the whole
82 # application. If the user redefines it, all bets are off as to what
82 # application. If the user redefines it, all bets are off as to what
83 # happens.
83 # happens.
84
84
85 # __IP is the name of he global which the caller will have accessible as
85 # __IP is the name of he global which the caller will have accessible as
86 # __IP.name. We set its name via the first parameter passed to
86 # __IP.name. We set its name via the first parameter passed to
87 # InteractiveShell:
87 # InteractiveShell:
88
88
89 IP = shell_class('__IP',user_ns=user_ns,user_global_ns=user_global_ns,
89 IP = shell_class('__IP',user_ns=user_ns,user_global_ns=user_global_ns,
90 embedded=embedded,**kw)
90 embedded=embedded,**kw)
91
91
92 # Put 'help' in the user namespace
92 # Put 'help' in the user namespace
93 from site import _Helper
93 from site import _Helper
94 IP.user_ns['help'] = _Helper()
94 IP.user_ns['help'] = _Helper()
95
95
96
96
97 if DEVDEBUG:
97 if DEVDEBUG:
98 # For developer debugging only (global flag)
98 # For developer debugging only (global flag)
99 from IPython import ultraTB
99 from IPython import ultraTB
100 sys.excepthook = ultraTB.VerboseTB(call_pdb=1)
100 sys.excepthook = ultraTB.VerboseTB(call_pdb=1)
101
101
102 IP.BANNER_PARTS = ['Python %s\n'
102 IP.BANNER_PARTS = ['Python %s\n'
103 'Type "copyright", "credits" or "license" '
103 'Type "copyright", "credits" or "license" '
104 'for more information.\n'
104 'for more information.\n'
105 % (sys.version.split('\n')[0],),
105 % (sys.version.split('\n')[0],),
106 "IPython %s -- An enhanced Interactive Python."
106 "IPython %s -- An enhanced Interactive Python."
107 % (__version__,),
107 % (__version__,),
108 """? -> Introduction to IPython's features.
108 """? -> Introduction to IPython's features.
109 %magic -> Information about IPython's 'magic' % functions.
109 %magic -> Information about IPython's 'magic' % functions.
110 help -> Python's own help system.
110 help -> Python's own help system.
111 object? -> Details about 'object'. ?object also works, ?? prints more.
111 object? -> Details about 'object'. ?object also works, ?? prints more.
112 """ ]
112 """ ]
113
113
114 IP.usage = interactive_usage
114 IP.usage = interactive_usage
115
115
116 # Platform-dependent suffix and directory names. We use _ipython instead
116 # Platform-dependent suffix and directory names. We use _ipython instead
117 # of .ipython under win32 b/c there's software that breaks with .named
117 # of .ipython under win32 b/c there's software that breaks with .named
118 # directories on that platform.
118 # directories on that platform.
119 if os.name == 'posix':
119 if os.name == 'posix':
120 rc_suffix = ''
120 rc_suffix = ''
121 ipdir_def = '.ipython'
121 ipdir_def = '.ipython'
122 else:
122 else:
123 rc_suffix = '.ini'
123 rc_suffix = '.ini'
124 ipdir_def = '_ipython'
124 ipdir_def = '_ipython'
125
125
126 # default directory for configuration
126 # default directory for configuration
127 ipythondir = os.path.abspath(os.environ.get('IPYTHONDIR',
127 ipythondir = os.path.abspath(os.environ.get('IPYTHONDIR',
128 os.path.join(IP.home_dir,ipdir_def)))
128 os.path.join(IP.home_dir,ipdir_def)))
129
129
130 # we need the directory where IPython itself is installed
130 # we need the directory where IPython itself is installed
131 import IPython
131 import IPython
132 IPython_dir = os.path.dirname(IPython.__file__)
132 IPython_dir = os.path.dirname(IPython.__file__)
133 del IPython
133 del IPython
134
134
135 #-------------------------------------------------------------------------
135 #-------------------------------------------------------------------------
136 # Command line handling
136 # Command line handling
137
137
138 # Valid command line options (uses DPyGetOpt syntax, like Perl's
138 # Valid command line options (uses DPyGetOpt syntax, like Perl's
139 # GetOpt::Long)
139 # GetOpt::Long)
140
140
141 # Any key not listed here gets deleted even if in the file (like session
141 # Any key not listed here gets deleted even if in the file (like session
142 # or profile). That's deliberate, to maintain the rc namespace clean.
142 # or profile). That's deliberate, to maintain the rc namespace clean.
143
143
144 # Each set of options appears twice: under _conv only the names are
144 # Each set of options appears twice: under _conv only the names are
145 # listed, indicating which type they must be converted to when reading the
145 # listed, indicating which type they must be converted to when reading the
146 # ipythonrc file. And under DPyGetOpt they are listed with the regular
146 # ipythonrc file. And under DPyGetOpt they are listed with the regular
147 # DPyGetOpt syntax (=s,=i,:f,etc).
147 # DPyGetOpt syntax (=s,=i,:f,etc).
148
148
149 # Make sure there's a space before each end of line (they get auto-joined!)
149 # Make sure there's a space before each end of line (they get auto-joined!)
150 cmdline_opts = ('autocall=i autoindent! automagic! banner! cache_size|cs=i '
150 cmdline_opts = ('autocall=i autoindent! automagic! banner! cache_size|cs=i '
151 'c=s classic|cl color_info! colors=s confirm_exit! '
151 'c=s classic|cl color_info! colors=s confirm_exit! '
152 'debug! deep_reload! editor=s log|l messages! nosep pdb! '
152 'debug! deep_reload! editor=s log|l messages! nosep pdb! '
153 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s '
153 'pprint! prompt_in1|pi1=s prompt_in2|pi2=s prompt_out|po=s '
154 'quick screen_length|sl=i prompts_pad_left=i '
154 'quick screen_length|sl=i prompts_pad_left=i '
155 'logfile|lf=s logplay|lp=s profile|p=s '
155 'logfile|lf=s logplay|lp=s profile|p=s '
156 'readline! readline_merge_completions! '
156 'readline! readline_merge_completions! '
157 'readline_omit__names! '
157 'readline_omit__names! '
158 'rcfile=s separate_in|si=s separate_out|so=s '
158 'rcfile=s separate_in|si=s separate_out|so=s '
159 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
159 'separate_out2|so2=s xmode=s wildcards_case_sensitive! '
160 'magic_docstrings system_verbose! '
160 'magic_docstrings system_verbose! '
161 'multi_line_specials! '
161 'multi_line_specials! '
162 'wxversion=s '
162 'autoedit_syntax!')
163 'autoedit_syntax!')
163
164
164 # Options that can *only* appear at the cmd line (not in rcfiles).
165 # Options that can *only* appear at the cmd line (not in rcfiles).
165
166
166 # The "ignore" option is a kludge so that Emacs buffers don't crash, since
167 # The "ignore" option is a kludge so that Emacs buffers don't crash, since
167 # the 'C-c !' command in emacs automatically appends a -i option at the end.
168 # the 'C-c !' command in emacs automatically appends a -i option at the end.
168 cmdline_only = ('help ignore|i ipythondir=s Version upgrade '
169 cmdline_only = ('help ignore|i ipythondir=s Version upgrade '
169 'gthread! qthread! wthread! pylab! tk!')
170 'gthread! qthread! wthread! pylab! tk!')
170
171
171 # Build the actual name list to be used by DPyGetOpt
172 # Build the actual name list to be used by DPyGetOpt
172 opts_names = qw(cmdline_opts) + qw(cmdline_only)
173 opts_names = qw(cmdline_opts) + qw(cmdline_only)
173
174
174 # Set sensible command line defaults.
175 # Set sensible command line defaults.
175 # This should have everything from cmdline_opts and cmdline_only
176 # This should have everything from cmdline_opts and cmdline_only
176 opts_def = Struct(autocall = 1,
177 opts_def = Struct(autocall = 1,
177 autoedit_syntax = 1,
178 autoedit_syntax = 1,
178 autoindent=0,
179 autoindent=0,
179 automagic = 1,
180 automagic = 1,
180 banner = 1,
181 banner = 1,
181 cache_size = 1000,
182 cache_size = 1000,
182 c = '',
183 c = '',
183 classic = 0,
184 classic = 0,
184 colors = 'NoColor',
185 colors = 'NoColor',
185 color_info = 0,
186 color_info = 0,
186 confirm_exit = 1,
187 confirm_exit = 1,
187 debug = 0,
188 debug = 0,
188 deep_reload = 0,
189 deep_reload = 0,
189 editor = '0',
190 editor = '0',
190 help = 0,
191 help = 0,
191 ignore = 0,
192 ignore = 0,
192 ipythondir = ipythondir,
193 ipythondir = ipythondir,
193 log = 0,
194 log = 0,
194 logfile = '',
195 logfile = '',
195 logplay = '',
196 logplay = '',
196 multi_line_specials = 1,
197 multi_line_specials = 1,
197 messages = 1,
198 messages = 1,
198 nosep = 0,
199 nosep = 0,
199 pdb = 0,
200 pdb = 0,
200 pprint = 0,
201 pprint = 0,
201 profile = '',
202 profile = '',
202 prompt_in1 = 'In [\\#]: ',
203 prompt_in1 = 'In [\\#]: ',
203 prompt_in2 = ' .\\D.: ',
204 prompt_in2 = ' .\\D.: ',
204 prompt_out = 'Out[\\#]: ',
205 prompt_out = 'Out[\\#]: ',
205 prompts_pad_left = 1,
206 prompts_pad_left = 1,
206 quick = 0,
207 quick = 0,
207 readline = 1,
208 readline = 1,
208 readline_merge_completions = 1,
209 readline_merge_completions = 1,
209 readline_omit__names = 0,
210 readline_omit__names = 0,
210 rcfile = 'ipythonrc' + rc_suffix,
211 rcfile = 'ipythonrc' + rc_suffix,
211 screen_length = 0,
212 screen_length = 0,
212 separate_in = '\n',
213 separate_in = '\n',
213 separate_out = '\n',
214 separate_out = '\n',
214 separate_out2 = '',
215 separate_out2 = '',
215 system_verbose = 0,
216 system_verbose = 0,
216 gthread = 0,
217 gthread = 0,
217 qthread = 0,
218 qthread = 0,
218 wthread = 0,
219 wthread = 0,
219 pylab = 0,
220 pylab = 0,
220 tk = 0,
221 tk = 0,
221 upgrade = 0,
222 upgrade = 0,
222 Version = 0,
223 Version = 0,
223 xmode = 'Verbose',
224 xmode = 'Verbose',
224 wildcards_case_sensitive = 1,
225 wildcards_case_sensitive = 1,
226 wxversion = '0',
225 magic_docstrings = 0, # undocumented, for doc generation
227 magic_docstrings = 0, # undocumented, for doc generation
226 )
228 )
227
229
228 # Things that will *only* appear in rcfiles (not at the command line).
230 # Things that will *only* appear in rcfiles (not at the command line).
229 # Make sure there's a space before each end of line (they get auto-joined!)
231 # Make sure there's a space before each end of line (they get auto-joined!)
230 rcfile_opts = { qwflat: 'include import_mod import_all execfile ',
232 rcfile_opts = { qwflat: 'include import_mod import_all execfile ',
231 qw_lol: 'import_some ',
233 qw_lol: 'import_some ',
232 # for things with embedded whitespace:
234 # for things with embedded whitespace:
233 list_strings:'execute alias readline_parse_and_bind ',
235 list_strings:'execute alias readline_parse_and_bind ',
234 # Regular strings need no conversion:
236 # Regular strings need no conversion:
235 None:'readline_remove_delims ',
237 None:'readline_remove_delims ',
236 }
238 }
237 # Default values for these
239 # Default values for these
238 rc_def = Struct(include = [],
240 rc_def = Struct(include = [],
239 import_mod = [],
241 import_mod = [],
240 import_all = [],
242 import_all = [],
241 import_some = [[]],
243 import_some = [[]],
242 execute = [],
244 execute = [],
243 execfile = [],
245 execfile = [],
244 alias = [],
246 alias = [],
245 readline_parse_and_bind = [],
247 readline_parse_and_bind = [],
246 readline_remove_delims = '',
248 readline_remove_delims = '',
247 )
249 )
248
250
249 # Build the type conversion dictionary from the above tables:
251 # Build the type conversion dictionary from the above tables:
250 typeconv = rcfile_opts.copy()
252 typeconv = rcfile_opts.copy()
251 typeconv.update(optstr2types(cmdline_opts))
253 typeconv.update(optstr2types(cmdline_opts))
252
254
253 # FIXME: the None key appears in both, put that back together by hand. Ugly!
255 # FIXME: the None key appears in both, put that back together by hand. Ugly!
254 typeconv[None] += ' ' + rcfile_opts[None]
256 typeconv[None] += ' ' + rcfile_opts[None]
255
257
256 # Remove quotes at ends of all strings (used to protect spaces)
258 # Remove quotes at ends of all strings (used to protect spaces)
257 typeconv[unquote_ends] = typeconv[None]
259 typeconv[unquote_ends] = typeconv[None]
258 del typeconv[None]
260 del typeconv[None]
259
261
260 # Build the list we'll use to make all config decisions with defaults:
262 # Build the list we'll use to make all config decisions with defaults:
261 opts_all = opts_def.copy()
263 opts_all = opts_def.copy()
262 opts_all.update(rc_def)
264 opts_all.update(rc_def)
263
265
264 # Build conflict resolver for recursive loading of config files:
266 # Build conflict resolver for recursive loading of config files:
265 # - preserve means the outermost file maintains the value, it is not
267 # - preserve means the outermost file maintains the value, it is not
266 # overwritten if an included file has the same key.
268 # overwritten if an included file has the same key.
267 # - add_flip applies + to the two values, so it better make sense to add
269 # - add_flip applies + to the two values, so it better make sense to add
268 # those types of keys. But it flips them first so that things loaded
270 # those types of keys. But it flips them first so that things loaded
269 # deeper in the inclusion chain have lower precedence.
271 # deeper in the inclusion chain have lower precedence.
270 conflict = {'preserve': ' '.join([ typeconv[int],
272 conflict = {'preserve': ' '.join([ typeconv[int],
271 typeconv[unquote_ends] ]),
273 typeconv[unquote_ends] ]),
272 'add_flip': ' '.join([ typeconv[qwflat],
274 'add_flip': ' '.join([ typeconv[qwflat],
273 typeconv[qw_lol],
275 typeconv[qw_lol],
274 typeconv[list_strings] ])
276 typeconv[list_strings] ])
275 }
277 }
276
278
277 # Now actually process the command line
279 # Now actually process the command line
278 getopt = DPyGetOpt.DPyGetOpt()
280 getopt = DPyGetOpt.DPyGetOpt()
279 getopt.setIgnoreCase(0)
281 getopt.setIgnoreCase(0)
280
282
281 getopt.parseConfiguration(opts_names)
283 getopt.parseConfiguration(opts_names)
282
284
283 try:
285 try:
284 getopt.processArguments(argv)
286 getopt.processArguments(argv)
285 except:
287 except:
286 print cmd_line_usage
288 print cmd_line_usage
287 warn('\nError in Arguments: ' + `sys.exc_value`)
289 warn('\nError in Arguments: ' + `sys.exc_value`)
288 sys.exit(1)
290 sys.exit(1)
289
291
290 # convert the options dict to a struct for much lighter syntax later
292 # convert the options dict to a struct for much lighter syntax later
291 opts = Struct(getopt.optionValues)
293 opts = Struct(getopt.optionValues)
292 args = getopt.freeValues
294 args = getopt.freeValues
293
295
294 # this is the struct (which has default values at this point) with which
296 # this is the struct (which has default values at this point) with which
295 # we make all decisions:
297 # we make all decisions:
296 opts_all.update(opts)
298 opts_all.update(opts)
297
299
298 # Options that force an immediate exit
300 # Options that force an immediate exit
299 if opts_all.help:
301 if opts_all.help:
300 page(cmd_line_usage)
302 page(cmd_line_usage)
301 sys.exit()
303 sys.exit()
302
304
303 if opts_all.Version:
305 if opts_all.Version:
304 print __version__
306 print __version__
305 sys.exit()
307 sys.exit()
306
308
307 if opts_all.magic_docstrings:
309 if opts_all.magic_docstrings:
308 IP.magic_magic('-latex')
310 IP.magic_magic('-latex')
309 sys.exit()
311 sys.exit()
310
312
311 # Create user config directory if it doesn't exist. This must be done
313 # Create user config directory if it doesn't exist. This must be done
312 # *after* getting the cmd line options.
314 # *after* getting the cmd line options.
313 if not os.path.isdir(opts_all.ipythondir):
315 if not os.path.isdir(opts_all.ipythondir):
314 IP.user_setup(opts_all.ipythondir,rc_suffix,'install')
316 IP.user_setup(opts_all.ipythondir,rc_suffix,'install')
315
317
316 # upgrade user config files while preserving a copy of the originals
318 # upgrade user config files while preserving a copy of the originals
317 if opts_all.upgrade:
319 if opts_all.upgrade:
318 IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade')
320 IP.user_setup(opts_all.ipythondir,rc_suffix,'upgrade')
319
321
320 # check mutually exclusive options in the *original* command line
322 # check mutually exclusive options in the *original* command line
321 mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'),
323 mutex_opts(opts,[qw('log logfile'),qw('rcfile profile'),
322 qw('classic profile'),qw('classic rcfile')])
324 qw('classic profile'),qw('classic rcfile')])
323
325
324 #---------------------------------------------------------------------------
326 #---------------------------------------------------------------------------
325 # Log replay
327 # Log replay
326
328
327 # if -logplay, we need to 'become' the other session. That basically means
329 # if -logplay, we need to 'become' the other session. That basically means
328 # replacing the current command line environment with that of the old
330 # replacing the current command line environment with that of the old
329 # session and moving on.
331 # session and moving on.
330
332
331 # this is needed so that later we know we're in session reload mode, as
333 # this is needed so that later we know we're in session reload mode, as
332 # opts_all will get overwritten:
334 # opts_all will get overwritten:
333 load_logplay = 0
335 load_logplay = 0
334
336
335 if opts_all.logplay:
337 if opts_all.logplay:
336 load_logplay = opts_all.logplay
338 load_logplay = opts_all.logplay
337 opts_debug_save = opts_all.debug
339 opts_debug_save = opts_all.debug
338 try:
340 try:
339 logplay = open(opts_all.logplay)
341 logplay = open(opts_all.logplay)
340 except IOError:
342 except IOError:
341 if opts_all.debug: IP.InteractiveTB()
343 if opts_all.debug: IP.InteractiveTB()
342 warn('Could not open logplay file '+`opts_all.logplay`)
344 warn('Could not open logplay file '+`opts_all.logplay`)
343 # restore state as if nothing had happened and move on, but make
345 # restore state as if nothing had happened and move on, but make
344 # sure that later we don't try to actually load the session file
346 # sure that later we don't try to actually load the session file
345 logplay = None
347 logplay = None
346 load_logplay = 0
348 load_logplay = 0
347 del opts_all.logplay
349 del opts_all.logplay
348 else:
350 else:
349 try:
351 try:
350 logplay.readline()
352 logplay.readline()
351 logplay.readline();
353 logplay.readline();
352 # this reloads that session's command line
354 # this reloads that session's command line
353 cmd = logplay.readline()[6:]
355 cmd = logplay.readline()[6:]
354 exec cmd
356 exec cmd
355 # restore the true debug flag given so that the process of
357 # restore the true debug flag given so that the process of
356 # session loading itself can be monitored.
358 # session loading itself can be monitored.
357 opts.debug = opts_debug_save
359 opts.debug = opts_debug_save
358 # save the logplay flag so later we don't overwrite the log
360 # save the logplay flag so later we don't overwrite the log
359 opts.logplay = load_logplay
361 opts.logplay = load_logplay
360 # now we must update our own structure with defaults
362 # now we must update our own structure with defaults
361 opts_all.update(opts)
363 opts_all.update(opts)
362 # now load args
364 # now load args
363 cmd = logplay.readline()[6:]
365 cmd = logplay.readline()[6:]
364 exec cmd
366 exec cmd
365 logplay.close()
367 logplay.close()
366 except:
368 except:
367 logplay.close()
369 logplay.close()
368 if opts_all.debug: IP.InteractiveTB()
370 if opts_all.debug: IP.InteractiveTB()
369 warn("Logplay file lacking full configuration information.\n"
371 warn("Logplay file lacking full configuration information.\n"
370 "I'll try to read it, but some things may not work.")
372 "I'll try to read it, but some things may not work.")
371
373
372 #-------------------------------------------------------------------------
374 #-------------------------------------------------------------------------
373 # set up output traps: catch all output from files, being run, modules
375 # set up output traps: catch all output from files, being run, modules
374 # loaded, etc. Then give it to the user in a clean form at the end.
376 # loaded, etc. Then give it to the user in a clean form at the end.
375
377
376 msg_out = 'Output messages. '
378 msg_out = 'Output messages. '
377 msg_err = 'Error messages. '
379 msg_err = 'Error messages. '
378 msg_sep = '\n'
380 msg_sep = '\n'
379 msg = Struct(config = OutputTrap('Configuration Loader',msg_out,
381 msg = Struct(config = OutputTrap('Configuration Loader',msg_out,
380 msg_err,msg_sep,debug,
382 msg_err,msg_sep,debug,
381 quiet_out=1),
383 quiet_out=1),
382 user_exec = OutputTrap('User File Execution',msg_out,
384 user_exec = OutputTrap('User File Execution',msg_out,
383 msg_err,msg_sep,debug),
385 msg_err,msg_sep,debug),
384 logplay = OutputTrap('Log Loader',msg_out,
386 logplay = OutputTrap('Log Loader',msg_out,
385 msg_err,msg_sep,debug),
387 msg_err,msg_sep,debug),
386 summary = ''
388 summary = ''
387 )
389 )
388
390
389 #-------------------------------------------------------------------------
391 #-------------------------------------------------------------------------
390 # Process user ipythonrc-type configuration files
392 # Process user ipythonrc-type configuration files
391
393
392 # turn on output trapping and log to msg.config
394 # turn on output trapping and log to msg.config
393 # remember that with debug on, trapping is actually disabled
395 # remember that with debug on, trapping is actually disabled
394 msg.config.trap_all()
396 msg.config.trap_all()
395
397
396 # look for rcfile in current or default directory
398 # look for rcfile in current or default directory
397 try:
399 try:
398 opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir)
400 opts_all.rcfile = filefind(opts_all.rcfile,opts_all.ipythondir)
399 except IOError:
401 except IOError:
400 if opts_all.debug: IP.InteractiveTB()
402 if opts_all.debug: IP.InteractiveTB()
401 warn('Configuration file %s not found. Ignoring request.'
403 warn('Configuration file %s not found. Ignoring request.'
402 % (opts_all.rcfile) )
404 % (opts_all.rcfile) )
403
405
404 # 'profiles' are a shorthand notation for config filenames
406 # 'profiles' are a shorthand notation for config filenames
405 if opts_all.profile:
407 if opts_all.profile:
406 try:
408 try:
407 opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile
409 opts_all.rcfile = filefind('ipythonrc-' + opts_all.profile
408 + rc_suffix,
410 + rc_suffix,
409 opts_all.ipythondir)
411 opts_all.ipythondir)
410 except IOError:
412 except IOError:
411 if opts_all.debug: IP.InteractiveTB()
413 if opts_all.debug: IP.InteractiveTB()
412 opts.profile = '' # remove profile from options if invalid
414 opts.profile = '' # remove profile from options if invalid
413 warn('Profile configuration file %s not found. Ignoring request.'
415 warn('Profile configuration file %s not found. Ignoring request.'
414 % (opts_all.profile) )
416 % (opts_all.profile) )
415
417
416 # load the config file
418 # load the config file
417 rcfiledata = None
419 rcfiledata = None
418 if opts_all.quick:
420 if opts_all.quick:
419 print 'Launching IPython in quick mode. No config file read.'
421 print 'Launching IPython in quick mode. No config file read.'
420 elif opts_all.classic:
422 elif opts_all.classic:
421 print 'Launching IPython in classic mode. No config file read.'
423 print 'Launching IPython in classic mode. No config file read.'
422 elif opts_all.rcfile:
424 elif opts_all.rcfile:
423 try:
425 try:
424 cfg_loader = ConfigLoader(conflict)
426 cfg_loader = ConfigLoader(conflict)
425 rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
427 rcfiledata = cfg_loader.load(opts_all.rcfile,typeconv,
426 'include',opts_all.ipythondir,
428 'include',opts_all.ipythondir,
427 purge = 1,
429 purge = 1,
428 unique = conflict['preserve'])
430 unique = conflict['preserve'])
429 except:
431 except:
430 IP.InteractiveTB()
432 IP.InteractiveTB()
431 warn('Problems loading configuration file '+
433 warn('Problems loading configuration file '+
432 `opts_all.rcfile`+
434 `opts_all.rcfile`+
433 '\nStarting with default -bare bones- configuration.')
435 '\nStarting with default -bare bones- configuration.')
434 else:
436 else:
435 warn('No valid configuration file found in either currrent directory\n'+
437 warn('No valid configuration file found in either currrent directory\n'+
436 'or in the IPython config. directory: '+`opts_all.ipythondir`+
438 'or in the IPython config. directory: '+`opts_all.ipythondir`+
437 '\nProceeding with internal defaults.')
439 '\nProceeding with internal defaults.')
438
440
439 #------------------------------------------------------------------------
441 #------------------------------------------------------------------------
440 # Set exception handlers in mode requested by user.
442 # Set exception handlers in mode requested by user.
441 otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode
443 otrap = OutputTrap(trap_out=1) # trap messages from magic_xmode
442 IP.magic_xmode(opts_all.xmode)
444 IP.magic_xmode(opts_all.xmode)
443 otrap.release_out()
445 otrap.release_out()
444
446
445 #------------------------------------------------------------------------
447 #------------------------------------------------------------------------
446 # Execute user config
448 # Execute user config
447
449
448 # Create a valid config structure with the right precedence order:
450 # Create a valid config structure with the right precedence order:
449 # defaults < rcfile < command line. This needs to be in the instance, so
451 # defaults < rcfile < command line. This needs to be in the instance, so
450 # that method calls below that rely on it find it.
452 # that method calls below that rely on it find it.
451 IP.rc = rc_def.copy()
453 IP.rc = rc_def.copy()
452
454
453 # Work with a local alias inside this routine to avoid unnecessary
455 # Work with a local alias inside this routine to avoid unnecessary
454 # attribute lookups.
456 # attribute lookups.
455 IP_rc = IP.rc
457 IP_rc = IP.rc
456
458
457 IP_rc.update(opts_def)
459 IP_rc.update(opts_def)
458 if rcfiledata:
460 if rcfiledata:
459 # now we can update
461 # now we can update
460 IP_rc.update(rcfiledata)
462 IP_rc.update(rcfiledata)
461 IP_rc.update(opts)
463 IP_rc.update(opts)
462 IP_rc.update(rc_override)
464 IP_rc.update(rc_override)
463
465
464 # Store the original cmd line for reference:
466 # Store the original cmd line for reference:
465 IP_rc.opts = opts
467 IP_rc.opts = opts
466 IP_rc.args = args
468 IP_rc.args = args
467
469
468 # create a *runtime* Struct like rc for holding parameters which may be
470 # create a *runtime* Struct like rc for holding parameters which may be
469 # created and/or modified by runtime user extensions.
471 # created and/or modified by runtime user extensions.
470 IP.runtime_rc = Struct()
472 IP.runtime_rc = Struct()
471
473
472 # from this point on, all config should be handled through IP_rc,
474 # from this point on, all config should be handled through IP_rc,
473 # opts* shouldn't be used anymore.
475 # opts* shouldn't be used anymore.
474
476
475 # add personal .ipython dir to sys.path so that users can put things in
477 # add personal .ipython dir to sys.path so that users can put things in
476 # there for customization
478 # there for customization
477 sys.path.append(IP_rc.ipythondir)
479 sys.path.append(IP_rc.ipythondir)
478 sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran
480 sys.path.insert(0, '') # add . to sys.path. Fix from Prabhu Ramachandran
479
481
480 # update IP_rc with some special things that need manual
482 # update IP_rc with some special things that need manual
481 # tweaks. Basically options which affect other options. I guess this
483 # tweaks. Basically options which affect other options. I guess this
482 # should just be written so that options are fully orthogonal and we
484 # should just be written so that options are fully orthogonal and we
483 # wouldn't worry about this stuff!
485 # wouldn't worry about this stuff!
484
486
485 if IP_rc.classic:
487 if IP_rc.classic:
486 IP_rc.quick = 1
488 IP_rc.quick = 1
487 IP_rc.cache_size = 0
489 IP_rc.cache_size = 0
488 IP_rc.pprint = 0
490 IP_rc.pprint = 0
489 IP_rc.prompt_in1 = '>>> '
491 IP_rc.prompt_in1 = '>>> '
490 IP_rc.prompt_in2 = '... '
492 IP_rc.prompt_in2 = '... '
491 IP_rc.prompt_out = ''
493 IP_rc.prompt_out = ''
492 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
494 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
493 IP_rc.colors = 'NoColor'
495 IP_rc.colors = 'NoColor'
494 IP_rc.xmode = 'Plain'
496 IP_rc.xmode = 'Plain'
495
497
496 # configure readline
498 # configure readline
497 # Define the history file for saving commands in between sessions
499 # Define the history file for saving commands in between sessions
498 if IP_rc.profile:
500 if IP_rc.profile:
499 histfname = 'history-%s' % IP_rc.profile
501 histfname = 'history-%s' % IP_rc.profile
500 else:
502 else:
501 histfname = 'history'
503 histfname = 'history'
502 IP.histfile = os.path.join(opts_all.ipythondir,histfname)
504 IP.histfile = os.path.join(opts_all.ipythondir,histfname)
503
505
504 # update exception handlers with rc file status
506 # update exception handlers with rc file status
505 otrap.trap_out() # I don't want these messages ever.
507 otrap.trap_out() # I don't want these messages ever.
506 IP.magic_xmode(IP_rc.xmode)
508 IP.magic_xmode(IP_rc.xmode)
507 otrap.release_out()
509 otrap.release_out()
508
510
509 # activate logging if requested and not reloading a log
511 # activate logging if requested and not reloading a log
510 if IP_rc.logplay:
512 if IP_rc.logplay:
511 IP.magic_logstart(IP_rc.logplay + ' append')
513 IP.magic_logstart(IP_rc.logplay + ' append')
512 elif IP_rc.logfile:
514 elif IP_rc.logfile:
513 IP.magic_logstart(IP_rc.logfile)
515 IP.magic_logstart(IP_rc.logfile)
514 elif IP_rc.log:
516 elif IP_rc.log:
515 IP.magic_logstart()
517 IP.magic_logstart()
516
518
517 # find user editor so that it we don't have to look it up constantly
519 # find user editor so that it we don't have to look it up constantly
518 if IP_rc.editor.strip()=='0':
520 if IP_rc.editor.strip()=='0':
519 try:
521 try:
520 ed = os.environ['EDITOR']
522 ed = os.environ['EDITOR']
521 except KeyError:
523 except KeyError:
522 if os.name == 'posix':
524 if os.name == 'posix':
523 ed = 'vi' # the only one guaranteed to be there!
525 ed = 'vi' # the only one guaranteed to be there!
524 else:
526 else:
525 ed = 'notepad' # same in Windows!
527 ed = 'notepad' # same in Windows!
526 IP_rc.editor = ed
528 IP_rc.editor = ed
527
529
528 # Keep track of whether this is an embedded instance or not (useful for
530 # Keep track of whether this is an embedded instance or not (useful for
529 # post-mortems).
531 # post-mortems).
530 IP_rc.embedded = IP.embedded
532 IP_rc.embedded = IP.embedded
531
533
532 # Recursive reload
534 # Recursive reload
533 try:
535 try:
534 from IPython import deep_reload
536 from IPython import deep_reload
535 if IP_rc.deep_reload:
537 if IP_rc.deep_reload:
536 __builtin__.reload = deep_reload.reload
538 __builtin__.reload = deep_reload.reload
537 else:
539 else:
538 __builtin__.dreload = deep_reload.reload
540 __builtin__.dreload = deep_reload.reload
539 del deep_reload
541 del deep_reload
540 except ImportError:
542 except ImportError:
541 pass
543 pass
542
544
543 # Save the current state of our namespace so that the interactive shell
545 # Save the current state of our namespace so that the interactive shell
544 # can later know which variables have been created by us from config files
546 # can later know which variables have been created by us from config files
545 # and loading. This way, loading a file (in any way) is treated just like
547 # and loading. This way, loading a file (in any way) is treated just like
546 # defining things on the command line, and %who works as expected.
548 # defining things on the command line, and %who works as expected.
547
549
548 # DON'T do anything that affects the namespace beyond this point!
550 # DON'T do anything that affects the namespace beyond this point!
549 IP.internal_ns.update(__main__.__dict__)
551 IP.internal_ns.update(__main__.__dict__)
550
552
551 #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who
553 #IP.internal_ns.update(locals()) # so our stuff doesn't show up in %who
552
554
553 # Now run through the different sections of the users's config
555 # Now run through the different sections of the users's config
554 if IP_rc.debug:
556 if IP_rc.debug:
555 print 'Trying to execute the following configuration structure:'
557 print 'Trying to execute the following configuration structure:'
556 print '(Things listed first are deeper in the inclusion tree and get'
558 print '(Things listed first are deeper in the inclusion tree and get'
557 print 'loaded first).\n'
559 print 'loaded first).\n'
558 pprint(IP_rc.__dict__)
560 pprint(IP_rc.__dict__)
559
561
560 for mod in IP_rc.import_mod:
562 for mod in IP_rc.import_mod:
561 try:
563 try:
562 exec 'import '+mod in IP.user_ns
564 exec 'import '+mod in IP.user_ns
563 except :
565 except :
564 IP.InteractiveTB()
566 IP.InteractiveTB()
565 import_fail_info(mod)
567 import_fail_info(mod)
566
568
567 for mod_fn in IP_rc.import_some:
569 for mod_fn in IP_rc.import_some:
568 if mod_fn == []: break
570 if mod_fn == []: break
569 mod,fn = mod_fn[0],','.join(mod_fn[1:])
571 mod,fn = mod_fn[0],','.join(mod_fn[1:])
570 try:
572 try:
571 exec 'from '+mod+' import '+fn in IP.user_ns
573 exec 'from '+mod+' import '+fn in IP.user_ns
572 except :
574 except :
573 IP.InteractiveTB()
575 IP.InteractiveTB()
574 import_fail_info(mod,fn)
576 import_fail_info(mod,fn)
575
577
576 for mod in IP_rc.import_all:
578 for mod in IP_rc.import_all:
577 try:
579 try:
578 exec 'from '+mod+' import *' in IP.user_ns
580 exec 'from '+mod+' import *' in IP.user_ns
579 except :
581 except :
580 IP.InteractiveTB()
582 IP.InteractiveTB()
581 import_fail_info(mod)
583 import_fail_info(mod)
582
584
583 for code in IP_rc.execute:
585 for code in IP_rc.execute:
584 try:
586 try:
585 exec code in IP.user_ns
587 exec code in IP.user_ns
586 except:
588 except:
587 IP.InteractiveTB()
589 IP.InteractiveTB()
588 warn('Failure executing code: ' + `code`)
590 warn('Failure executing code: ' + `code`)
589
591
590 # Execute the files the user wants in ipythonrc
592 # Execute the files the user wants in ipythonrc
591 for file in IP_rc.execfile:
593 for file in IP_rc.execfile:
592 try:
594 try:
593 file = filefind(file,sys.path+[IPython_dir])
595 file = filefind(file,sys.path+[IPython_dir])
594 except IOError:
596 except IOError:
595 warn(itpl('File $file not found. Skipping it.'))
597 warn(itpl('File $file not found. Skipping it.'))
596 else:
598 else:
597 IP.safe_execfile(os.path.expanduser(file),IP.user_ns)
599 IP.safe_execfile(os.path.expanduser(file),IP.user_ns)
598
600
599 # release stdout and stderr and save config log into a global summary
601 # release stdout and stderr and save config log into a global summary
600 msg.config.release_all()
602 msg.config.release_all()
601 if IP_rc.messages:
603 if IP_rc.messages:
602 msg.summary += msg.config.summary_all()
604 msg.summary += msg.config.summary_all()
603
605
604 #------------------------------------------------------------------------
606 #------------------------------------------------------------------------
605 # Setup interactive session
607 # Setup interactive session
606
608
607 # Now we should be fully configured. We can then execute files or load
609 # Now we should be fully configured. We can then execute files or load
608 # things only needed for interactive use. Then we'll open the shell.
610 # things only needed for interactive use. Then we'll open the shell.
609
611
610 # Take a snapshot of the user namespace before opening the shell. That way
612 # Take a snapshot of the user namespace before opening the shell. That way
611 # we'll be able to identify which things were interactively defined and
613 # we'll be able to identify which things were interactively defined and
612 # which were defined through config files.
614 # which were defined through config files.
613 IP.user_config_ns = IP.user_ns.copy()
615 IP.user_config_ns = IP.user_ns.copy()
614
616
615 # Force reading a file as if it were a session log. Slower but safer.
617 # Force reading a file as if it were a session log. Slower but safer.
616 if load_logplay:
618 if load_logplay:
617 print 'Replaying log...'
619 print 'Replaying log...'
618 try:
620 try:
619 if IP_rc.debug:
621 if IP_rc.debug:
620 logplay_quiet = 0
622 logplay_quiet = 0
621 else:
623 else:
622 logplay_quiet = 1
624 logplay_quiet = 1
623
625
624 msg.logplay.trap_all()
626 msg.logplay.trap_all()
625 IP.safe_execfile(load_logplay,IP.user_ns,
627 IP.safe_execfile(load_logplay,IP.user_ns,
626 islog = 1, quiet = logplay_quiet)
628 islog = 1, quiet = logplay_quiet)
627 msg.logplay.release_all()
629 msg.logplay.release_all()
628 if IP_rc.messages:
630 if IP_rc.messages:
629 msg.summary += msg.logplay.summary_all()
631 msg.summary += msg.logplay.summary_all()
630 except:
632 except:
631 warn('Problems replaying logfile %s.' % load_logplay)
633 warn('Problems replaying logfile %s.' % load_logplay)
632 IP.InteractiveTB()
634 IP.InteractiveTB()
633
635
634 # Load remaining files in command line
636 # Load remaining files in command line
635 msg.user_exec.trap_all()
637 msg.user_exec.trap_all()
636
638
637 # Do NOT execute files named in the command line as scripts to be loaded
639 # Do NOT execute files named in the command line as scripts to be loaded
638 # by embedded instances. Doing so has the potential for an infinite
640 # by embedded instances. Doing so has the potential for an infinite
639 # recursion if there are exceptions thrown in the process.
641 # recursion if there are exceptions thrown in the process.
640
642
641 # XXX FIXME: the execution of user files should be moved out to after
643 # XXX FIXME: the execution of user files should be moved out to after
642 # ipython is fully initialized, just as if they were run via %run at the
644 # ipython is fully initialized, just as if they were run via %run at the
643 # ipython prompt. This would also give them the benefit of ipython's
645 # ipython prompt. This would also give them the benefit of ipython's
644 # nice tracebacks.
646 # nice tracebacks.
645
647
646 if not embedded and IP_rc.args:
648 if not embedded and IP_rc.args:
647 name_save = IP.user_ns['__name__']
649 name_save = IP.user_ns['__name__']
648 IP.user_ns['__name__'] = '__main__'
650 IP.user_ns['__name__'] = '__main__'
649 try:
651 try:
650 # Set our own excepthook in case the user code tries to call it
652 # Set our own excepthook in case the user code tries to call it
651 # directly. This prevents triggering the IPython crash handler.
653 # directly. This prevents triggering the IPython crash handler.
652 old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook
654 old_excepthook,sys.excepthook = sys.excepthook, IP.excepthook
653 for run in args:
655 for run in args:
654 IP.safe_execfile(run,IP.user_ns)
656 IP.safe_execfile(run,IP.user_ns)
655 finally:
657 finally:
656 # Reset our crash handler in place
658 # Reset our crash handler in place
657 sys.excepthook = old_excepthook
659 sys.excepthook = old_excepthook
658
660
659 IP.user_ns['__name__'] = name_save
661 IP.user_ns['__name__'] = name_save
660
662
661 msg.user_exec.release_all()
663 msg.user_exec.release_all()
662 if IP_rc.messages:
664 if IP_rc.messages:
663 msg.summary += msg.user_exec.summary_all()
665 msg.summary += msg.user_exec.summary_all()
664
666
665 # since we can't specify a null string on the cmd line, 0 is the equivalent:
667 # since we can't specify a null string on the cmd line, 0 is the equivalent:
666 if IP_rc.nosep:
668 if IP_rc.nosep:
667 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
669 IP_rc.separate_in = IP_rc.separate_out = IP_rc.separate_out2 = '0'
668 if IP_rc.separate_in == '0': IP_rc.separate_in = ''
670 if IP_rc.separate_in == '0': IP_rc.separate_in = ''
669 if IP_rc.separate_out == '0': IP_rc.separate_out = ''
671 if IP_rc.separate_out == '0': IP_rc.separate_out = ''
670 if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = ''
672 if IP_rc.separate_out2 == '0': IP_rc.separate_out2 = ''
671 IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n')
673 IP_rc.separate_in = IP_rc.separate_in.replace('\\n','\n')
672 IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n')
674 IP_rc.separate_out = IP_rc.separate_out.replace('\\n','\n')
673 IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n')
675 IP_rc.separate_out2 = IP_rc.separate_out2.replace('\\n','\n')
674
676
675 # Determine how many lines at the bottom of the screen are needed for
677 # Determine how many lines at the bottom of the screen are needed for
676 # showing prompts, so we can know wheter long strings are to be printed or
678 # showing prompts, so we can know wheter long strings are to be printed or
677 # paged:
679 # paged:
678 num_lines_bot = IP_rc.separate_in.count('\n')+1
680 num_lines_bot = IP_rc.separate_in.count('\n')+1
679 IP_rc.screen_length = IP_rc.screen_length - num_lines_bot
681 IP_rc.screen_length = IP_rc.screen_length - num_lines_bot
680
682
681 # configure startup banner
683 # configure startup banner
682 if IP_rc.c: # regular python doesn't print the banner with -c
684 if IP_rc.c: # regular python doesn't print the banner with -c
683 IP_rc.banner = 0
685 IP_rc.banner = 0
684 if IP_rc.banner:
686 if IP_rc.banner:
685 BANN_P = IP.BANNER_PARTS
687 BANN_P = IP.BANNER_PARTS
686 else:
688 else:
687 BANN_P = []
689 BANN_P = []
688
690
689 if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile)
691 if IP_rc.profile: BANN_P.append('IPython profile: %s\n' % IP_rc.profile)
690
692
691 # add message log (possibly empty)
693 # add message log (possibly empty)
692 if msg.summary: BANN_P.append(msg.summary)
694 if msg.summary: BANN_P.append(msg.summary)
693 # Final banner is a string
695 # Final banner is a string
694 IP.BANNER = '\n'.join(BANN_P)
696 IP.BANNER = '\n'.join(BANN_P)
695
697
696 # Finalize the IPython instance. This assumes the rc structure is fully
698 # Finalize the IPython instance. This assumes the rc structure is fully
697 # in place.
699 # in place.
698 IP.post_config_initialization()
700 IP.post_config_initialization()
699
701
700 return IP
702 return IP
701 #************************ end of file <ipmaker.py> **************************
703 #************************ end of file <ipmaker.py> **************************
@@ -1,589 +1,599 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 #*****************************************************************************
2 #*****************************************************************************
3 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
3 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
4 #
4 #
5 # Distributed under the terms of the BSD License. The full license is in
5 # Distributed under the terms of the BSD License. The full license is in
6 # the file COPYING, distributed as part of this software.
6 # the file COPYING, distributed as part of this software.
7 #*****************************************************************************
7 #*****************************************************************************
8
8
9 # $Id: usage.py 990 2006-01-04 06:59:02Z fperez $
9 # $Id: usage.py 998 2006-01-09 06:57:40Z fperez $
10
10
11 from IPython import Release
11 from IPython import Release
12 __author__ = '%s <%s>' % Release.authors['Fernando']
12 __author__ = '%s <%s>' % Release.authors['Fernando']
13 __license__ = Release.license
13 __license__ = Release.license
14 __version__ = Release.version
14 __version__ = Release.version
15
15
16 __doc__ = """
16 __doc__ = """
17 IPython -- An enhanced Interactive Python
17 IPython -- An enhanced Interactive Python
18 =========================================
18 =========================================
19
19
20 A Python shell with automatic history (input and output), dynamic object
20 A Python shell with automatic history (input and output), dynamic object
21 introspection, easier configuration, command completion, access to the system
21 introspection, easier configuration, command completion, access to the system
22 shell and more.
22 shell and more.
23
23
24 IPython can also be embedded in running programs. See EMBEDDING below.
24 IPython can also be embedded in running programs. See EMBEDDING below.
25
25
26
26
27 USAGE
27 USAGE
28 ipython [options] files
28 ipython [options] files
29
29
30 If invoked with no options, it executes all the files listed in
30 If invoked with no options, it executes all the files listed in
31 sequence and drops you into the interpreter while still acknowledging
31 sequence and drops you into the interpreter while still acknowledging
32 any options you may have set in your ipythonrc file. This behavior is
32 any options you may have set in your ipythonrc file. This behavior is
33 different from standard Python, which when called as python -i will
33 different from standard Python, which when called as python -i will
34 only execute one file and will ignore your configuration setup.
34 only execute one file and will ignore your configuration setup.
35
35
36 Please note that some of the configuration options are not available at
36 Please note that some of the configuration options are not available at
37 the command line, simply because they are not practical here. Look into
37 the command line, simply because they are not practical here. Look into
38 your ipythonrc configuration file for details on those. This file
38 your ipythonrc configuration file for details on those. This file
39 typically installed in the $HOME/.ipython directory.
39 typically installed in the $HOME/.ipython directory.
40
40
41 For Windows users, $HOME resolves to C:\\Documents and
41 For Windows users, $HOME resolves to C:\\Documents and
42 Settings\\YourUserName in most instances, and _ipython is used instead
42 Settings\\YourUserName in most instances, and _ipython is used instead
43 of .ipython, since some Win32 programs have problems with dotted names
43 of .ipython, since some Win32 programs have problems with dotted names
44 in directories.
44 in directories.
45
45
46 In the rest of this text, we will refer to this directory as
46 In the rest of this text, we will refer to this directory as
47 IPYTHONDIR.
47 IPYTHONDIR.
48
48
49
49
50 SPECIAL THREADING OPTIONS
50 SPECIAL THREADING OPTIONS
51 The following special options are ONLY valid at the beginning of the
51 The following special options are ONLY valid at the beginning of the
52 command line, and not later. This is because they control the initial-
52 command line, and not later. This is because they control the initial-
53 ization of ipython itself, before the normal option-handling mechanism
53 ization of ipython itself, before the normal option-handling mechanism
54 is active.
54 is active.
55
55
56 -gthread, -qthread, -wthread, -pylab
56 -gthread, -qthread, -wthread, -pylab
57
57
58 Only ONE of these can be given, and it can only be given as the
58 Only ONE of these can be given, and it can only be given as the
59 first option passed to IPython (it will have no effect in any
59 first option passed to IPython (it will have no effect in any
60 other position). They provide threading support for the GTK, QT
60 other position). They provide threading support for the GTK, QT
61 and WXWidgets toolkits, and for the matplotlib library.
61 and WXWidgets toolkits, and for the matplotlib library.
62
62
63 With any of the first three options, IPython starts running a
63 With any of the first three options, IPython starts running a
64 separate thread for the graphical toolkit's operation, so that
64 separate thread for the graphical toolkit's operation, so that
65 you can open and control graphical elements from within an
65 you can open and control graphical elements from within an
66 IPython command line, without blocking. All three provide
66 IPython command line, without blocking. All three provide
67 essentially the same functionality, respectively for GTK, QT and
67 essentially the same functionality, respectively for GTK, QT and
68 WXWidgets (via their Python interfaces).
68 WXWidgets (via their Python interfaces).
69
69
70 Note that with -wthread, you can additionally use the -wxversion
71 option to request a specific version of wx to be used. This
72 requires that you have the 'wxversion' Python module installed,
73 which is part of recent wxPython distributions.
74
70 If -pylab is given, IPython loads special support for the mat-
75 If -pylab is given, IPython loads special support for the mat-
71 plotlib library (http://matplotlib.sourceforge.net), allowing
76 plotlib library (http://matplotlib.sourceforge.net), allowing
72 interactive usage of any of its backends as defined in the
77 interactive usage of any of its backends as defined in the
73 user's .matplotlibrc file. It automatically activates GTK, QT
78 user's .matplotlibrc file. It automatically activates GTK, QT
74 or WX threading for IPyhton if the choice of matplotlib backend
79 or WX threading for IPyhton if the choice of matplotlib backend
75 requires it. It also modifies the %run command to correctly
80 requires it. It also modifies the %run command to correctly
76 execute (without blocking) any matplotlib-based script which
81 execute (without blocking) any matplotlib-based script which
77 calls show() at the end.
82 calls show() at the end.
78
83
79 -tk The -g/q/wthread options, and -pylab (if matplotlib is
84 -tk The -g/q/wthread options, and -pylab (if matplotlib is
80 configured to use GTK, QT or WX), will normally block Tk
85 configured to use GTK, QT or WX), will normally block Tk
81 graphical interfaces. This means that when GTK, QT or WX
86 graphical interfaces. This means that when GTK, QT or WX
82 threading is active, any attempt to open a Tk GUI will result in
87 threading is active, any attempt to open a Tk GUI will result in
83 a dead window, and possibly cause the Python interpreter to
88 a dead window, and possibly cause the Python interpreter to
84 crash. An extra option, -tk, is available to address this
89 crash. An extra option, -tk, is available to address this
85 issue. It can ONLY be given as a SECOND option after any of the
90 issue. It can ONLY be given as a SECOND option after any of the
86 above (-gthread, -qthread, -wthread or -pylab).
91 above (-gthread, -qthread, -wthread or -pylab).
87
92
88 If -tk is given, IPython will try to coordinate Tk threading
93 If -tk is given, IPython will try to coordinate Tk threading
89 with GTK, QT or WX. This is however potentially unreliable, and
94 with GTK, QT or WX. This is however potentially unreliable, and
90 you will have to test on your platform and Python configuration
95 you will have to test on your platform and Python configuration
91 to determine whether it works for you. Debian users have
96 to determine whether it works for you. Debian users have
92 reported success, apparently due to the fact that Debian builds
97 reported success, apparently due to the fact that Debian builds
93 all of Tcl, Tk, Tkinter and Python with pthreads support. Under
98 all of Tcl, Tk, Tkinter and Python with pthreads support. Under
94 other Linux environments (such as Fedora Core 2/3), this option
99 other Linux environments (such as Fedora Core 2/3), this option
95 has caused random crashes and lockups of the Python interpreter.
100 has caused random crashes and lockups of the Python interpreter.
96 Under other operating systems (Mac OSX and Windows), you'll need
101 Under other operating systems (Mac OSX and Windows), you'll need
97 to try it to find out, since currently no user reports are
102 to try it to find out, since currently no user reports are
98 available.
103 available.
99
104
100 There is unfortunately no way for IPython to determine at run-
105 There is unfortunately no way for IPython to determine at run-
101 time whether -tk will work reliably or not, so you will need to
106 time whether -tk will work reliably or not, so you will need to
102 do some experiments before relying on it for regular work.
107 do some experiments before relying on it for regular work.
103
108
104 A WARNING ABOUT SIGNALS AND THREADS
109 A WARNING ABOUT SIGNALS AND THREADS
105
110
106 When any of the thread systems (GTK, QT or WX) are active, either
111 When any of the thread systems (GTK, QT or WX) are active, either
107 directly or via -pylab with a threaded backend, it is impossible to
112 directly or via -pylab with a threaded backend, it is impossible to
108 interrupt long-running Python code via Ctrl-C. IPython can not pass
113 interrupt long-running Python code via Ctrl-C. IPython can not pass
109 the KeyboardInterrupt exception (or the underlying SIGINT) across
114 the KeyboardInterrupt exception (or the underlying SIGINT) across
110 threads, so any long-running process started from IPython will run to
115 threads, so any long-running process started from IPython will run to
111 completion, or will have to be killed via an external (OS-based)
116 completion, or will have to be killed via an external (OS-based)
112 mechanism.
117 mechanism.
113
118
114 To the best of my knowledge, this limitation is imposed by the Python
119 To the best of my knowledge, this limitation is imposed by the Python
115 interpreter itself, and it comes from the difficulty of writing
120 interpreter itself, and it comes from the difficulty of writing
116 portable signal/threaded code. If any user is an expert on this topic
121 portable signal/threaded code. If any user is an expert on this topic
117 and can suggest a better solution, I would love to hear about it. In
122 and can suggest a better solution, I would love to hear about it. In
118 the IPython sources, look at the Shell.py module, and in particular at
123 the IPython sources, look at the Shell.py module, and in particular at
119 the runcode() method.
124 the runcode() method.
120
125
121 REGULAR OPTIONS
126 REGULAR OPTIONS
122 After the above threading options have been given, regular options can
127 After the above threading options have been given, regular options can
123 follow in any order. All options can be abbreviated to their shortest
128 follow in any order. All options can be abbreviated to their shortest
124 non-ambiguous form and are case-sensitive. One or two dashes can be
129 non-ambiguous form and are case-sensitive. One or two dashes can be
125 used. Some options have an alternate short form, indicated after a |.
130 used. Some options have an alternate short form, indicated after a |.
126
131
127 Most options can also be set from your ipythonrc configuration file.
132 Most options can also be set from your ipythonrc configuration file.
128 See the provided examples for assistance. Options given on the comman-
133 See the provided examples for assistance. Options given on the comman-
129 dline override the values set in the ipythonrc file.
134 dline override the values set in the ipythonrc file.
130
135
131 All options with a [no] prepended can be specified in negated form
136 All options with a [no] prepended can be specified in negated form
132 (using -nooption instead of -option) to turn the feature off.
137 (using -nooption instead of -option) to turn the feature off.
133
138
134 -h, --help
139 -h, --help
135 Show summary of options.
140 Show summary of options.
136
141
137 -pylab This can only be given as the first option passed to IPython (it
142 -pylab This can only be given as the first option passed to IPython (it
138 will have no effect in any other position). It adds special sup-
143 will have no effect in any other position). It adds special sup-
139 port for the matplotlib library (http://matplotlib.source-
144 port for the matplotlib library (http://matplotlib.source-
140 forge.net), allowing interactive usage of any of its backends as
145 forge.net), allowing interactive usage of any of its backends as
141 defined in the user’s .matplotlibrc file. It automatically
146 defined in the user’s .matplotlibrc file. It automatically
142 activates GTK or WX threading for IPyhton if the choice of mat-
147 activates GTK or WX threading for IPyhton if the choice of mat-
143 plotlib backend requires it. It also modifies the @run command
148 plotlib backend requires it. It also modifies the @run command
144 to correctly execute (without blocking) any matplotlib-based
149 to correctly execute (without blocking) any matplotlib-based
145 script which calls show() at the end.
150 script which calls show() at the end.
146
151
147 -autocall <val>
152 -autocall <val>
148 Make IPython automatically call any callable object even if you
153 Make IPython automatically call any callable object even if you
149 didn't type explicit parentheses. For example, 'str 43' becomes
154 didn't type explicit parentheses. For example, 'str 43' becomes
150 'str(43)' automatically. The value can be '0' to disable the
155 'str(43)' automatically. The value can be '0' to disable the
151 feature, '1' for 'smart' autocall, where it is not applied if
156 feature, '1' for 'smart' autocall, where it is not applied if
152 there are no more arguments on the line, and '2' for 'full'
157 there are no more arguments on the line, and '2' for 'full'
153 autocall, where all callable objects are automatically called
158 autocall, where all callable objects are automatically called
154 (even if no arguments are present). The default is '1'.
159 (even if no arguments are present). The default is '1'.
155
160
156 -[no]autoindent
161 -[no]autoindent
157 Turn automatic indentation on/off.
162 Turn automatic indentation on/off.
158
163
159 -[no]automagic
164 -[no]automagic
160 Make magic commands automatic (without needing their first char-
165 Make magic commands automatic (without needing their first char-
161 acter to be %). Type %magic at the IPython prompt for more
166 acter to be %). Type %magic at the IPython prompt for more
162 information.
167 information.
163
168
164 -[no]autoedit_syntax
169 -[no]autoedit_syntax
165 When a syntax error occurs after editing a file, automatically
170 When a syntax error occurs after editing a file, automatically
166 open the file to the trouble causing line for convenient fixing.
171 open the file to the trouble causing line for convenient fixing.
167
172
168 -[no]banner
173 -[no]banner
169 Print the intial information banner (default on).
174 Print the intial information banner (default on).
170
175
171 -c <command>
176 -c <command>
172 Execute the given command string, and set sys.argv to [’c’].
177 Execute the given command string, and set sys.argv to [’c’].
173 This is similar to the -c option in the normal Python inter-
178 This is similar to the -c option in the normal Python inter-
174 preter.
179 preter.
175
180
176 -cache_size|cs <n>
181 -cache_size|cs <n>
177 Size of the output cache (maximum number of entries to hold in
182 Size of the output cache (maximum number of entries to hold in
178 memory). The default is 1000, you can change it permanently in
183 memory). The default is 1000, you can change it permanently in
179 your config file. Setting it to 0 completely disables the
184 your config file. Setting it to 0 completely disables the
180 caching system, and the minimum value accepted is 20 (if you
185 caching system, and the minimum value accepted is 20 (if you
181 provide a value less than 20, it is reset to 0 and a warning is
186 provide a value less than 20, it is reset to 0 and a warning is
182 issued). This limit is defined because otherwise you’ll spend
187 issued). This limit is defined because otherwise you’ll spend
183 more time re-flushing a too small cache than working.
188 more time re-flushing a too small cache than working.
184
189
185 -classic|cl
190 -classic|cl
186 Gives IPython a similar feel to the classic Python prompt.
191 Gives IPython a similar feel to the classic Python prompt.
187
192
188 -colors <scheme>
193 -colors <scheme>
189 Color scheme for prompts and exception reporting. Currently
194 Color scheme for prompts and exception reporting. Currently
190 implemented: NoColor, Linux, and LightBG.
195 implemented: NoColor, Linux, and LightBG.
191
196
192 -[no]color_info
197 -[no]color_info
193 IPython can display information about objects via a set of func-
198 IPython can display information about objects via a set of func-
194 tions, and optionally can use colors for this, syntax highlight-
199 tions, and optionally can use colors for this, syntax highlight-
195 ing source code and various other elements. However, because
200 ing source code and various other elements. However, because
196 this information is passed through a pager (like ’less’) and
201 this information is passed through a pager (like ’less’) and
197 many pagers get confused with color codes, this option is off by
202 many pagers get confused with color codes, this option is off by
198 default. You can test it and turn it on permanently in your
203 default. You can test it and turn it on permanently in your
199 ipythonrc file if it works for you. As a reference, the ’less’
204 ipythonrc file if it works for you. As a reference, the ’less’
200 pager supplied with Mandrake 8.2 works ok, but that in RedHat
205 pager supplied with Mandrake 8.2 works ok, but that in RedHat
201 7.2 doesn’t.
206 7.2 doesn’t.
202
207
203 Test it and turn it on permanently if it works with your system.
208 Test it and turn it on permanently if it works with your system.
204 The magic function @color_info allows you to toggle this inter-
209 The magic function @color_info allows you to toggle this inter-
205 actively for testing.
210 actively for testing.
206
211
207 -[no]confirm_exit
212 -[no]confirm_exit
208 Set to confirm when you try to exit IPython with an EOF (Con-
213 Set to confirm when you try to exit IPython with an EOF (Con-
209 trol-D in Unix, Control-Z/Enter in Windows). Note that using the
214 trol-D in Unix, Control-Z/Enter in Windows). Note that using the
210 magic functions @Exit or @Quit you can force a direct exit,
215 magic functions @Exit or @Quit you can force a direct exit,
211 bypassing any confirmation.
216 bypassing any confirmation.
212
217
213 -[no]debug
218 -[no]debug
214 Show information about the loading process. Very useful to pin
219 Show information about the loading process. Very useful to pin
215 down problems with your configuration files or to get details
220 down problems with your configuration files or to get details
216 about session restores.
221 about session restores.
217
222
218 -[no]deep_reload
223 -[no]deep_reload
219 IPython can use the deep_reload module which reloads changes in
224 IPython can use the deep_reload module which reloads changes in
220 modules recursively (it replaces the reload() function, so you
225 modules recursively (it replaces the reload() function, so you
221 don’t need to change anything to use it). deep_reload() forces a
226 don’t need to change anything to use it). deep_reload() forces a
222 full reload of modules whose code may have changed, which the
227 full reload of modules whose code may have changed, which the
223 default reload() function does not.
228 default reload() function does not.
224
229
225 When deep_reload is off, IPython will use the normal reload(),
230 When deep_reload is off, IPython will use the normal reload(),
226 but deep_reload will still be available as dreload(). This fea-
231 but deep_reload will still be available as dreload(). This fea-
227 ture is off by default [which means that you have both normal
232 ture is off by default [which means that you have both normal
228 reload() and dreload()].
233 reload() and dreload()].
229
234
230 -editor <name>
235 -editor <name>
231 Which editor to use with the @edit command. By default, IPython
236 Which editor to use with the @edit command. By default, IPython
232 will honor your EDITOR environment variable (if not set, vi is
237 will honor your EDITOR environment variable (if not set, vi is
233 the Unix default and notepad the Windows one). Since this editor
238 the Unix default and notepad the Windows one). Since this editor
234 is invoked on the fly by IPython and is meant for editing small
239 is invoked on the fly by IPython and is meant for editing small
235 code snippets, you may want to use a small, lightweight editor
240 code snippets, you may want to use a small, lightweight editor
236 here (in case your default EDITOR is something like Emacs).
241 here (in case your default EDITOR is something like Emacs).
237
242
238 -ipythondir <name>
243 -ipythondir <name>
239 The name of your IPython configuration directory IPYTHONDIR.
244 The name of your IPython configuration directory IPYTHONDIR.
240 This can also be specified through the environment variable
245 This can also be specified through the environment variable
241 IPYTHONDIR.
246 IPYTHONDIR.
242
247
243 -log|l Generate a log file of all input. The file is named
248 -log|l Generate a log file of all input. The file is named
244 ipython_log.py in your current directory (which prevents logs
249 ipython_log.py in your current directory (which prevents logs
245 from multiple IPython sessions from trampling each other). You
250 from multiple IPython sessions from trampling each other). You
246 can use this to later restore a session by loading your logfile
251 can use this to later restore a session by loading your logfile
247 as a file to be executed with option -logplay (see below).
252 as a file to be executed with option -logplay (see below).
248
253
249 -logfile|lf
254 -logfile|lf
250 Specify the name of your logfile.
255 Specify the name of your logfile.
251
256
252 -logplay|lp
257 -logplay|lp
253 Replay a previous log. For restoring a session as close as pos-
258 Replay a previous log. For restoring a session as close as pos-
254 sible to the state you left it in, use this option (don’t just
259 sible to the state you left it in, use this option (don’t just
255 run the logfile). With -logplay, IPython will try to reconstruct
260 run the logfile). With -logplay, IPython will try to reconstruct
256 the previous working environment in full, not just execute the
261 the previous working environment in full, not just execute the
257 commands in the logfile.
262 commands in the logfile.
258 When a session is restored, logging is automatically turned on
263 When a session is restored, logging is automatically turned on
259 again with the name of the logfile it was invoked with (it is
264 again with the name of the logfile it was invoked with (it is
260 read from the log header). So once you’ve turned logging on for
265 read from the log header). So once you’ve turned logging on for
261 a session, you can quit IPython and reload it as many times as
266 a session, you can quit IPython and reload it as many times as
262 you want and it will continue to log its history and restore
267 you want and it will continue to log its history and restore
263 from the beginning every time.
268 from the beginning every time.
264
269
265 Caveats: there are limitations in this option. The history vari-
270 Caveats: there are limitations in this option. The history vari-
266 ables _i*,_* and _dh don’t get restored properly. In the future
271 ables _i*,_* and _dh don’t get restored properly. In the future
267 we will try to implement full session saving by writing and
272 we will try to implement full session saving by writing and
268 retrieving a failed because of inherent limitations of Python’s
273 retrieving a failed because of inherent limitations of Python’s
269 Pickle module, so this may have to wait.
274 Pickle module, so this may have to wait.
270
275
271 -[no]messages
276 -[no]messages
272 Print messages which IPython collects about its startup process
277 Print messages which IPython collects about its startup process
273 (default on).
278 (default on).
274
279
275 -[no]pdb
280 -[no]pdb
276 Automatically call the pdb debugger after every uncaught excep-
281 Automatically call the pdb debugger after every uncaught excep-
277 tion. If you are used to debugging using pdb, this puts you
282 tion. If you are used to debugging using pdb, this puts you
278 automatically inside of it after any call (either in IPython or
283 automatically inside of it after any call (either in IPython or
279 in code called by it) which triggers an exception which goes
284 in code called by it) which triggers an exception which goes
280 uncaught.
285 uncaught.
281
286
282 -[no]pprint
287 -[no]pprint
283 IPython can optionally use the pprint (pretty printer) module
288 IPython can optionally use the pprint (pretty printer) module
284 for displaying results. pprint tends to give a nicer display of
289 for displaying results. pprint tends to give a nicer display of
285 nested data structures. If you like it, you can turn it on per-
290 nested data structures. If you like it, you can turn it on per-
286 manently in your config file (default off).
291 manently in your config file (default off).
287
292
288 -profile|p <name>
293 -profile|p <name>
289 Assume that your config file is ipythonrc-<name> (looks in cur-
294 Assume that your config file is ipythonrc-<name> (looks in cur-
290 rent dir first, then in IPYTHONDIR). This is a quick way to keep
295 rent dir first, then in IPYTHONDIR). This is a quick way to keep
291 and load multiple config files for different tasks, especially
296 and load multiple config files for different tasks, especially
292 if you use the include option of config files. You can keep a
297 if you use the include option of config files. You can keep a
293 basic IPYTHONDIR/ipythonrc file and then have other ’profiles’
298 basic IPYTHONDIR/ipythonrc file and then have other ’profiles’
294 which include this one and load extra things for particular
299 which include this one and load extra things for particular
295 tasks. For example:
300 tasks. For example:
296
301
297 1) $HOME/.ipython/ipythonrc : load basic things you always want.
302 1) $HOME/.ipython/ipythonrc : load basic things you always want.
298 2) $HOME/.ipython/ipythonrc-math : load (1) and basic math-
303 2) $HOME/.ipython/ipythonrc-math : load (1) and basic math-
299 related modules.
304 related modules.
300 3) $HOME/.ipython/ipythonrc-numeric : load (1) and Numeric and
305 3) $HOME/.ipython/ipythonrc-numeric : load (1) and Numeric and
301 plotting modules.
306 plotting modules.
302
307
303 Since it is possible to create an endless loop by having circu-
308 Since it is possible to create an endless loop by having circu-
304 lar file inclusions, IPython will stop if it reaches 15 recur-
309 lar file inclusions, IPython will stop if it reaches 15 recur-
305 sive inclusions.
310 sive inclusions.
306
311
307 -prompt_in1|pi1 <string>
312 -prompt_in1|pi1 <string>
308 Specify the string used for input prompts. Note that if you are
313 Specify the string used for input prompts. Note that if you are
309 using numbered prompts, the number is represented with a ’\#’ in
314 using numbered prompts, the number is represented with a ’\#’ in
310 the string. Don’t forget to quote strings with spaces embedded
315 the string. Don’t forget to quote strings with spaces embedded
311 in them. Default: ’In [\#]:’.
316 in them. Default: ’In [\#]:’.
312
317
313 Most bash-like escapes can be used to customize IPython’s
318 Most bash-like escapes can be used to customize IPython’s
314 prompts, as well as a few additional ones which are IPython-spe-
319 prompts, as well as a few additional ones which are IPython-spe-
315 cific. All valid prompt escapes are described in detail in the
320 cific. All valid prompt escapes are described in detail in the
316 Customization section of the IPython HTML/PDF manual.
321 Customization section of the IPython HTML/PDF manual.
317
322
318 -prompt_in2|pi2 <string>
323 -prompt_in2|pi2 <string>
319 Similar to the previous option, but used for the continuation
324 Similar to the previous option, but used for the continuation
320 prompts. The special sequence ’\D’ is similar to ’\#’, but with
325 prompts. The special sequence ’\D’ is similar to ’\#’, but with
321 all digits replaced dots (so you can have your continuation
326 all digits replaced dots (so you can have your continuation
322 prompt aligned with your input prompt). Default: ’ .\D.:’
327 prompt aligned with your input prompt). Default: ’ .\D.:’
323 (note three spaces at the start for alignment with ’In [\#]’).
328 (note three spaces at the start for alignment with ’In [\#]’).
324
329
325 -prompt_out|po <string>
330 -prompt_out|po <string>
326 String used for output prompts, also uses numbers like
331 String used for output prompts, also uses numbers like
327 prompt_in1. Default: ’Out[\#]:’.
332 prompt_in1. Default: ’Out[\#]:’.
328
333
329 -quick Start in bare bones mode (no config file loaded).
334 -quick Start in bare bones mode (no config file loaded).
330
335
331 -rcfile <name>
336 -rcfile <name>
332 Name of your IPython resource configuration file. normally
337 Name of your IPython resource configuration file. normally
333 IPython loads ipythonrc (from current directory) or
338 IPython loads ipythonrc (from current directory) or
334 IPYTHONDIR/ipythonrc. If the loading of your config file fails,
339 IPYTHONDIR/ipythonrc. If the loading of your config file fails,
335 IPython starts with a bare bones configuration (no modules
340 IPython starts with a bare bones configuration (no modules
336 loaded at all).
341 loaded at all).
337
342
338 -[no]readline
343 -[no]readline
339 Use the readline library, which is needed to support name com-
344 Use the readline library, which is needed to support name com-
340 pletion and command history, among other things. It is enabled
345 pletion and command history, among other things. It is enabled
341 by default, but may cause problems for users of X/Emacs in
346 by default, but may cause problems for users of X/Emacs in
342 Python comint or shell buffers.
347 Python comint or shell buffers.
343
348
344 Note that emacs ’eterm’ buffers (opened with M-x term) support
349 Note that emacs ’eterm’ buffers (opened with M-x term) support
345 IPython’s readline and syntax coloring fine, only ’emacs’ (M-x
350 IPython’s readline and syntax coloring fine, only ’emacs’ (M-x
346 shell and C-c !) buffers do not.
351 shell and C-c !) buffers do not.
347
352
348 -screen_length|sl <n>
353 -screen_length|sl <n>
349 Number of lines of your screen. This is used to control print-
354 Number of lines of your screen. This is used to control print-
350 ing of very long strings. Strings longer than this number of
355 ing of very long strings. Strings longer than this number of
351 lines will be sent through a pager instead of directly printed.
356 lines will be sent through a pager instead of directly printed.
352
357
353 The default value for this is 0, which means IPython will auto-
358 The default value for this is 0, which means IPython will auto-
354 detect your screen size every time it needs to print certain
359 detect your screen size every time it needs to print certain
355 potentially long strings (this doesn’t change the behavior of
360 potentially long strings (this doesn’t change the behavior of
356 the ’print’ keyword, it’s only triggered internally). If for
361 the ’print’ keyword, it’s only triggered internally). If for
357 some reason this isn’t working well (it needs curses support),
362 some reason this isn’t working well (it needs curses support),
358 specify it yourself. Otherwise don’t change the default.
363 specify it yourself. Otherwise don’t change the default.
359
364
360 -separate_in|si <string>
365 -separate_in|si <string>
361 Separator before input prompts. Default ’0.
366 Separator before input prompts. Default ’0.
362
367
363 -separate_out|so <string>
368 -separate_out|so <string>
364 Separator before output prompts. Default: 0 (nothing).
369 Separator before output prompts. Default: 0 (nothing).
365
370
366 -separate_out2|so2 <string>
371 -separate_out2|so2 <string>
367 Separator after output prompts. Default: 0 (nothing).
372 Separator after output prompts. Default: 0 (nothing).
368
373
369 -nosep Shorthand for ’-separate_in 0 -separate_out 0 -separate_out2 0’.
374 -nosep Shorthand for ’-separate_in 0 -separate_out 0 -separate_out2 0’.
370 Simply removes all input/output separators.
375 Simply removes all input/output separators.
371
376
372 -upgrade
377 -upgrade
373 Allows you to upgrade your IPYTHONDIR configuration when you
378 Allows you to upgrade your IPYTHONDIR configuration when you
374 install a new version of IPython. Since new versions may
379 install a new version of IPython. Since new versions may
375 include new command lines options or example files, this copies
380 include new command lines options or example files, this copies
376 updated ipythonrc-type files. However, it backs up (with a .old
381 updated ipythonrc-type files. However, it backs up (with a .old
377 extension) all files which it overwrites so that you can merge
382 extension) all files which it overwrites so that you can merge
378 back any custimizations you might have in your personal files.
383 back any custimizations you might have in your personal files.
379
384
380 -Version
385 -Version
381 Print version information and exit.
386 Print version information and exit.
382
387
388 -wxversion <string>
389 Select a specific version of wxPython (used in conjunction with
390 -wthread). Requires the wxversion module, part of recent
391 wxPython distributions.
392
383 -xmode <modename>
393 -xmode <modename>
384 Mode for exception reporting. The valid modes are Plain, Con-
394 Mode for exception reporting. The valid modes are Plain, Con-
385 text, and Verbose.
395 text, and Verbose.
386
396
387 - Plain: similar to python’s normal traceback printing.
397 - Plain: similar to python’s normal traceback printing.
388
398
389 - Context: prints 5 lines of context source code around each
399 - Context: prints 5 lines of context source code around each
390 line in the traceback.
400 line in the traceback.
391
401
392 - Verbose: similar to Context, but additionally prints the vari-
402 - Verbose: similar to Context, but additionally prints the vari-
393 ables currently visible where the exception happened (shortening
403 ables currently visible where the exception happened (shortening
394 their strings if too long). This can potentially be very slow,
404 their strings if too long). This can potentially be very slow,
395 if you happen to have a huge data structure whose string repre-
405 if you happen to have a huge data structure whose string repre-
396 sentation is complex to compute. Your computer may appear to
406 sentation is complex to compute. Your computer may appear to
397 freeze for a while with cpu usage at 100%. If this occurs, you
407 freeze for a while with cpu usage at 100%. If this occurs, you
398 can cancel the traceback with Ctrl-C (maybe hitting it more than
408 can cancel the traceback with Ctrl-C (maybe hitting it more than
399 once).
409 once).
400
410
401
411
402 EMBEDDING
412 EMBEDDING
403 It is possible to start an IPython instance inside your own Python pro-
413 It is possible to start an IPython instance inside your own Python pro-
404 grams. In the documentation example files there are some illustrations
414 grams. In the documentation example files there are some illustrations
405 on how to do this.
415 on how to do this.
406
416
407 This feature allows you to evalutate dynamically the state of your
417 This feature allows you to evalutate dynamically the state of your
408 code, operate with your variables, analyze them, etc. Note however
418 code, operate with your variables, analyze them, etc. Note however
409 that any changes you make to values while in the shell do NOT propagate
419 that any changes you make to values while in the shell do NOT propagate
410 back to the running code, so it is safe to modify your values because
420 back to the running code, so it is safe to modify your values because
411 you won’t break your code in bizarre ways by doing so.
421 you won’t break your code in bizarre ways by doing so.
412 """
422 """
413
423
414 cmd_line_usage = __doc__
424 cmd_line_usage = __doc__
415
425
416 #---------------------------------------------------------------------------
426 #---------------------------------------------------------------------------
417 interactive_usage = """
427 interactive_usage = """
418 IPython -- An enhanced Interactive Python
428 IPython -- An enhanced Interactive Python
419 =========================================
429 =========================================
420
430
421 IPython offers a combination of convenient shell features, special commands
431 IPython offers a combination of convenient shell features, special commands
422 and a history mechanism for both input (command history) and output (results
432 and a history mechanism for both input (command history) and output (results
423 caching, similar to Mathematica). It is intended to be a fully compatible
433 caching, similar to Mathematica). It is intended to be a fully compatible
424 replacement for the standard Python interpreter, while offering vastly
434 replacement for the standard Python interpreter, while offering vastly
425 improved functionality and flexibility.
435 improved functionality and flexibility.
426
436
427 At your system command line, type 'ipython -help' to see the command line
437 At your system command line, type 'ipython -help' to see the command line
428 options available. This document only describes interactive features.
438 options available. This document only describes interactive features.
429
439
430 Warning: IPython relies on the existence of a global variable called __IP which
440 Warning: IPython relies on the existence of a global variable called __IP which
431 controls the shell itself. If you redefine __IP to anything, bizarre behavior
441 controls the shell itself. If you redefine __IP to anything, bizarre behavior
432 will quickly occur.
442 will quickly occur.
433
443
434 MAIN FEATURES
444 MAIN FEATURES
435
445
436 * Access to the standard Python help. As of Python 2.1, a help system is
446 * Access to the standard Python help. As of Python 2.1, a help system is
437 available with access to object docstrings and the Python manuals. Simply
447 available with access to object docstrings and the Python manuals. Simply
438 type 'help' (no quotes) to access it.
448 type 'help' (no quotes) to access it.
439
449
440 * Magic commands: type %magic for information on the magic subsystem.
450 * Magic commands: type %magic for information on the magic subsystem.
441
451
442 * System command aliases, via the %alias command or the ipythonrc config file.
452 * System command aliases, via the %alias command or the ipythonrc config file.
443
453
444 * Dynamic object information:
454 * Dynamic object information:
445
455
446 Typing ?word or word? prints detailed information about an object. If
456 Typing ?word or word? prints detailed information about an object. If
447 certain strings in the object are too long (docstrings, code, etc.) they get
457 certain strings in the object are too long (docstrings, code, etc.) they get
448 snipped in the center for brevity.
458 snipped in the center for brevity.
449
459
450 Typing ??word or word?? gives access to the full information without
460 Typing ??word or word?? gives access to the full information without
451 snipping long strings. Long strings are sent to the screen through the less
461 snipping long strings. Long strings are sent to the screen through the less
452 pager if longer than the screen, printed otherwise.
462 pager if longer than the screen, printed otherwise.
453
463
454 The ?/?? system gives access to the full source code for any object (if
464 The ?/?? system gives access to the full source code for any object (if
455 available), shows function prototypes and other useful information.
465 available), shows function prototypes and other useful information.
456
466
457 If you just want to see an object's docstring, type '%pdoc object' (without
467 If you just want to see an object's docstring, type '%pdoc object' (without
458 quotes, and without % if you have automagic on).
468 quotes, and without % if you have automagic on).
459
469
460 Both %pdoc and ?/?? give you access to documentation even on things which are
470 Both %pdoc and ?/?? give you access to documentation even on things which are
461 not explicitely defined. Try for example typing {}.get? or after import os,
471 not explicitely defined. Try for example typing {}.get? or after import os,
462 type os.path.abspath??. The magic functions %pdef, %source and %file operate
472 type os.path.abspath??. The magic functions %pdef, %source and %file operate
463 similarly.
473 similarly.
464
474
465 * Completion in the local namespace, by typing TAB at the prompt.
475 * Completion in the local namespace, by typing TAB at the prompt.
466
476
467 At any time, hitting tab will complete any available python commands or
477 At any time, hitting tab will complete any available python commands or
468 variable names, and show you a list of the possible completions if there's
478 variable names, and show you a list of the possible completions if there's
469 no unambiguous one. It will also complete filenames in the current directory.
479 no unambiguous one. It will also complete filenames in the current directory.
470
480
471 This feature requires the readline and rlcomplete modules, so it won't work
481 This feature requires the readline and rlcomplete modules, so it won't work
472 if your Python lacks readline support (such as under Windows).
482 if your Python lacks readline support (such as under Windows).
473
483
474 * Search previous command history in two ways (also requires readline):
484 * Search previous command history in two ways (also requires readline):
475
485
476 - Start typing, and then use Ctrl-p (previous,up) and Ctrl-n (next,down) to
486 - Start typing, and then use Ctrl-p (previous,up) and Ctrl-n (next,down) to
477 search through only the history items that match what you've typed so
487 search through only the history items that match what you've typed so
478 far. If you use Ctrl-p/Ctrl-n at a blank prompt, they just behave like
488 far. If you use Ctrl-p/Ctrl-n at a blank prompt, they just behave like
479 normal arrow keys.
489 normal arrow keys.
480
490
481 - Hit Ctrl-r: opens a search prompt. Begin typing and the system searches
491 - Hit Ctrl-r: opens a search prompt. Begin typing and the system searches
482 your history for lines that match what you've typed so far, completing as
492 your history for lines that match what you've typed so far, completing as
483 much as it can.
493 much as it can.
484
494
485 * Persistent command history across sessions (readline required).
495 * Persistent command history across sessions (readline required).
486
496
487 * Logging of input with the ability to save and restore a working session.
497 * Logging of input with the ability to save and restore a working session.
488
498
489 * System escape with !. Typing !ls will run 'ls' in the current directory.
499 * System escape with !. Typing !ls will run 'ls' in the current directory.
490
500
491 * The reload command does a 'deep' reload of a module: changes made to the
501 * The reload command does a 'deep' reload of a module: changes made to the
492 module since you imported will actually be available without having to exit.
502 module since you imported will actually be available without having to exit.
493
503
494 * Verbose and colored exception traceback printouts. See the magic xmode and
504 * Verbose and colored exception traceback printouts. See the magic xmode and
495 xcolor functions for details (just type %magic).
505 xcolor functions for details (just type %magic).
496
506
497 * Input caching system:
507 * Input caching system:
498
508
499 IPython offers numbered prompts (In/Out) with input and output caching. All
509 IPython offers numbered prompts (In/Out) with input and output caching. All
500 input is saved and can be retrieved as variables (besides the usual arrow
510 input is saved and can be retrieved as variables (besides the usual arrow
501 key recall).
511 key recall).
502
512
503 The following GLOBAL variables always exist (so don't overwrite them!):
513 The following GLOBAL variables always exist (so don't overwrite them!):
504 _i: stores previous input.
514 _i: stores previous input.
505 _ii: next previous.
515 _ii: next previous.
506 _iii: next-next previous.
516 _iii: next-next previous.
507 _ih : a list of all input _ih[n] is the input from line n.
517 _ih : a list of all input _ih[n] is the input from line n.
508
518
509 Additionally, global variables named _i<n> are dynamically created (<n>
519 Additionally, global variables named _i<n> are dynamically created (<n>
510 being the prompt counter), such that _i<n> == _ih[<n>]
520 being the prompt counter), such that _i<n> == _ih[<n>]
511
521
512 For example, what you typed at prompt 14 is available as _i14 and _ih[14].
522 For example, what you typed at prompt 14 is available as _i14 and _ih[14].
513
523
514 You can create macros which contain multiple input lines from this history,
524 You can create macros which contain multiple input lines from this history,
515 for later re-execution, with the %macro function.
525 for later re-execution, with the %macro function.
516
526
517 The history function %hist allows you to see any part of your input history
527 The history function %hist allows you to see any part of your input history
518 by printing a range of the _i variables. Note that inputs which contain
528 by printing a range of the _i variables. Note that inputs which contain
519 magic functions (%) appear in the history with a prepended comment. This is
529 magic functions (%) appear in the history with a prepended comment. This is
520 because they aren't really valid Python code, so you can't exec them.
530 because they aren't really valid Python code, so you can't exec them.
521
531
522 * Output caching system:
532 * Output caching system:
523
533
524 For output that is returned from actions, a system similar to the input
534 For output that is returned from actions, a system similar to the input
525 cache exists but using _ instead of _i. Only actions that produce a result
535 cache exists but using _ instead of _i. Only actions that produce a result
526 (NOT assignments, for example) are cached. If you are familiar with
536 (NOT assignments, for example) are cached. If you are familiar with
527 Mathematica, IPython's _ variables behave exactly like Mathematica's %
537 Mathematica, IPython's _ variables behave exactly like Mathematica's %
528 variables.
538 variables.
529
539
530 The following GLOBAL variables always exist (so don't overwrite them!):
540 The following GLOBAL variables always exist (so don't overwrite them!):
531 _ (one underscore): previous output.
541 _ (one underscore): previous output.
532 __ (two underscores): next previous.
542 __ (two underscores): next previous.
533 ___ (three underscores): next-next previous.
543 ___ (three underscores): next-next previous.
534
544
535 Global variables named _<n> are dynamically created (<n> being the prompt
545 Global variables named _<n> are dynamically created (<n> being the prompt
536 counter), such that the result of output <n> is always available as _<n>.
546 counter), such that the result of output <n> is always available as _<n>.
537
547
538 Finally, a global dictionary named _oh exists with entries for all lines
548 Finally, a global dictionary named _oh exists with entries for all lines
539 which generated output.
549 which generated output.
540
550
541 * Directory history:
551 * Directory history:
542
552
543 Your history of visited directories is kept in the global list _dh, and the
553 Your history of visited directories is kept in the global list _dh, and the
544 magic %cd command can be used to go to any entry in that list.
554 magic %cd command can be used to go to any entry in that list.
545
555
546 * Auto-parentheses and auto-quotes (adapted from Nathan Gray's LazyPython)
556 * Auto-parentheses and auto-quotes (adapted from Nathan Gray's LazyPython)
547
557
548 1. Auto-parentheses
558 1. Auto-parentheses
549 Callable objects (i.e. functions, methods, etc) can be invoked like
559 Callable objects (i.e. functions, methods, etc) can be invoked like
550 this (notice the commas between the arguments):
560 this (notice the commas between the arguments):
551 >>> callable_ob arg1, arg2, arg3
561 >>> callable_ob arg1, arg2, arg3
552 and the input will be translated to this:
562 and the input will be translated to this:
553 --> callable_ob(arg1, arg2, arg3)
563 --> callable_ob(arg1, arg2, arg3)
554 You can force auto-parentheses by using '/' as the first character
564 You can force auto-parentheses by using '/' as the first character
555 of a line. For example:
565 of a line. For example:
556 >>> /globals # becomes 'globals()'
566 >>> /globals # becomes 'globals()'
557 Note that the '/' MUST be the first character on the line! This
567 Note that the '/' MUST be the first character on the line! This
558 won't work:
568 won't work:
559 >>> print /globals # syntax error
569 >>> print /globals # syntax error
560
570
561 In most cases the automatic algorithm should work, so you should
571 In most cases the automatic algorithm should work, so you should
562 rarely need to explicitly invoke /. One notable exception is if you
572 rarely need to explicitly invoke /. One notable exception is if you
563 are trying to call a function with a list of tuples as arguments (the
573 are trying to call a function with a list of tuples as arguments (the
564 parenthesis will confuse IPython):
574 parenthesis will confuse IPython):
565 In [1]: zip (1,2,3),(4,5,6) # won't work
575 In [1]: zip (1,2,3),(4,5,6) # won't work
566 but this will work:
576 but this will work:
567 In [2]: /zip (1,2,3),(4,5,6)
577 In [2]: /zip (1,2,3),(4,5,6)
568 ------> zip ((1,2,3),(4,5,6))
578 ------> zip ((1,2,3),(4,5,6))
569 Out[2]= [(1, 4), (2, 5), (3, 6)]
579 Out[2]= [(1, 4), (2, 5), (3, 6)]
570
580
571 IPython tells you that it has altered your command line by
581 IPython tells you that it has altered your command line by
572 displaying the new command line preceded by -->. e.g.:
582 displaying the new command line preceded by -->. e.g.:
573 In [18]: callable list
583 In [18]: callable list
574 -------> callable (list)
584 -------> callable (list)
575
585
576 2. Auto-Quoting
586 2. Auto-Quoting
577 You can force auto-quoting of a function's arguments by using ',' as
587 You can force auto-quoting of a function's arguments by using ',' as
578 the first character of a line. For example:
588 the first character of a line. For example:
579 >>> ,my_function /home/me # becomes my_function("/home/me")
589 >>> ,my_function /home/me # becomes my_function("/home/me")
580
590
581 If you use ';' instead, the whole argument is quoted as a single
591 If you use ';' instead, the whole argument is quoted as a single
582 string (while ',' splits on whitespace):
592 string (while ',' splits on whitespace):
583 >>> ,my_function a b c # becomes my_function("a","b","c")
593 >>> ,my_function a b c # becomes my_function("a","b","c")
584 >>> ;my_function a b c # becomes my_function("a b c")
594 >>> ;my_function a b c # becomes my_function("a b c")
585
595
586 Note that the ',' MUST be the first character on the line! This
596 Note that the ',' MUST be the first character on the line! This
587 won't work:
597 won't work:
588 >>> x = ,my_function /home/me # syntax error
598 >>> x = ,my_function /home/me # syntax error
589 """
599 """
@@ -1,4794 +1,4799 b''
1 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
1 2006-01-08 Fernando Perez <Fernando.Perez@colorado.edu>
2
2
3 * IPython/Shell.py (IPShellWX.__init__): add support for WXPython
4 version selection (new -wxversion command line and ipythonrc
5 parameter). Patch contributed by Arnd Baecker
6 <arnd.baecker-AT-web.de>.
7
3 * IPython/iplib.py (embed_mainloop): fix tab-completion in
8 * IPython/iplib.py (embed_mainloop): fix tab-completion in
4 embedded instances, for variables defined at the interactive
9 embedded instances, for variables defined at the interactive
5 prompt of the embedded ipython. Reported by Arnd.
10 prompt of the embedded ipython. Reported by Arnd.
6
11
7 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
12 * IPython/Magic.py (magic_autocall): Fix %autocall magic. Now
8 it can be used as a (stateful) toggle, or with a direct parameter.
13 it can be used as a (stateful) toggle, or with a direct parameter.
9
14
10 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
15 * IPython/ultraTB.py (_fixed_getinnerframes): remove debug assert which
11 could be triggered in certain cases and cause the traceback
16 could be triggered in certain cases and cause the traceback
12 printer not to work.
17 printer not to work.
13
18
14 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
19 2006-01-07 Fernando Perez <Fernando.Perez@colorado.edu>
15
20
16 * IPython/iplib.py (_should_recompile): Small fix, closes
21 * IPython/iplib.py (_should_recompile): Small fix, closes
17 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
22 http://www.scipy.net/roundup/ipython/issue48. Patch by Scott.
18
23
19 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
24 2006-01-04 Fernando Perez <Fernando.Perez@colorado.edu>
20
25
21 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
26 * IPython/Shell.py (IPShellGTK.mainloop): fix bug in the GTK
22 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
27 backend for matplotlib (100% cpu utiliziation). Thanks to Charlie
23 Moad for help with tracking it down.
28 Moad for help with tracking it down.
24
29
25 * IPython/iplib.py (handle_auto): fix autocall handling for
30 * IPython/iplib.py (handle_auto): fix autocall handling for
26 objects which support BOTH __getitem__ and __call__ (so that f [x]
31 objects which support BOTH __getitem__ and __call__ (so that f [x]
27 is left alone, instead of becoming f([x]) automatically).
32 is left alone, instead of becoming f([x]) automatically).
28
33
29 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
34 * IPython/Magic.py (magic_cd): fix crash when cd -b was used.
30 Ville's patch.
35 Ville's patch.
31
36
32 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
37 2006-01-03 Fernando Perez <Fernando.Perez@colorado.edu>
33
38
34 * IPython/iplib.py (handle_auto): changed autocall semantics to
39 * IPython/iplib.py (handle_auto): changed autocall semantics to
35 include 'smart' mode, where the autocall transformation is NOT
40 include 'smart' mode, where the autocall transformation is NOT
36 applied if there are no arguments on the line. This allows you to
41 applied if there are no arguments on the line. This allows you to
37 just type 'foo' if foo is a callable to see its internal form,
42 just type 'foo' if foo is a callable to see its internal form,
38 instead of having it called with no arguments (typically a
43 instead of having it called with no arguments (typically a
39 mistake). The old 'full' autocall still exists: for that, you
44 mistake). The old 'full' autocall still exists: for that, you
40 need to set the 'autocall' parameter to 2 in your ipythonrc file.
45 need to set the 'autocall' parameter to 2 in your ipythonrc file.
41
46
42 * IPython/completer.py (Completer.attr_matches): add
47 * IPython/completer.py (Completer.attr_matches): add
43 tab-completion support for Enthoughts' traits. After a report by
48 tab-completion support for Enthoughts' traits. After a report by
44 Arnd and a patch by Prabhu.
49 Arnd and a patch by Prabhu.
45
50
46 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
51 2006-01-02 Fernando Perez <Fernando.Perez@colorado.edu>
47
52
48 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
53 * IPython/ultraTB.py (_fixed_getinnerframes): added Alex
49 Schmolck's patch to fix inspect.getinnerframes().
54 Schmolck's patch to fix inspect.getinnerframes().
50
55
51 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
56 * IPython/iplib.py (InteractiveShell.__init__): significant fixes
52 for embedded instances, regarding handling of namespaces and items
57 for embedded instances, regarding handling of namespaces and items
53 added to the __builtin__ one. Multiple embedded instances and
58 added to the __builtin__ one. Multiple embedded instances and
54 recursive embeddings should work better now (though I'm not sure
59 recursive embeddings should work better now (though I'm not sure
55 I've got all the corner cases fixed, that code is a bit of a brain
60 I've got all the corner cases fixed, that code is a bit of a brain
56 twister).
61 twister).
57
62
58 * IPython/Magic.py (magic_edit): added support to edit in-memory
63 * IPython/Magic.py (magic_edit): added support to edit in-memory
59 macros (automatically creates the necessary temp files). %edit
64 macros (automatically creates the necessary temp files). %edit
60 also doesn't return the file contents anymore, it's just noise.
65 also doesn't return the file contents anymore, it's just noise.
61
66
62 * IPython/completer.py (Completer.attr_matches): revert change to
67 * IPython/completer.py (Completer.attr_matches): revert change to
63 complete only on attributes listed in __all__. I realized it
68 complete only on attributes listed in __all__. I realized it
64 cripples the tab-completion system as a tool for exploring the
69 cripples the tab-completion system as a tool for exploring the
65 internals of unknown libraries (it renders any non-__all__
70 internals of unknown libraries (it renders any non-__all__
66 attribute off-limits). I got bit by this when trying to see
71 attribute off-limits). I got bit by this when trying to see
67 something inside the dis module.
72 something inside the dis module.
68
73
69 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
74 2005-12-31 Fernando Perez <Fernando.Perez@colorado.edu>
70
75
71 * IPython/iplib.py (InteractiveShell.__init__): add .meta
76 * IPython/iplib.py (InteractiveShell.__init__): add .meta
72 namespace for users and extension writers to hold data in. This
77 namespace for users and extension writers to hold data in. This
73 follows the discussion in
78 follows the discussion in
74 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
79 http://projects.scipy.org/ipython/ipython/wiki/RefactoringIPython.
75
80
76 * IPython/completer.py (IPCompleter.complete): small patch to help
81 * IPython/completer.py (IPCompleter.complete): small patch to help
77 tab-completion under Emacs, after a suggestion by John Barnard
82 tab-completion under Emacs, after a suggestion by John Barnard
78 <barnarj-AT-ccf.org>.
83 <barnarj-AT-ccf.org>.
79
84
80 * IPython/Magic.py (Magic.extract_input_slices): added support for
85 * IPython/Magic.py (Magic.extract_input_slices): added support for
81 the slice notation in magics to use N-M to represent numbers N...M
86 the slice notation in magics to use N-M to represent numbers N...M
82 (closed endpoints). This is used by %macro and %save.
87 (closed endpoints). This is used by %macro and %save.
83
88
84 * IPython/completer.py (Completer.attr_matches): for modules which
89 * IPython/completer.py (Completer.attr_matches): for modules which
85 define __all__, complete only on those. After a patch by Jeffrey
90 define __all__, complete only on those. After a patch by Jeffrey
86 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
91 Collins <jcollins_boulder-AT-earthlink.net>. Also, clean up and
87 speed up this routine.
92 speed up this routine.
88
93
89 * IPython/Logger.py (Logger.log): fix a history handling bug. I
94 * IPython/Logger.py (Logger.log): fix a history handling bug. I
90 don't know if this is the end of it, but the behavior now is
95 don't know if this is the end of it, but the behavior now is
91 certainly much more correct. Note that coupled with macros,
96 certainly much more correct. Note that coupled with macros,
92 slightly surprising (at first) behavior may occur: a macro will in
97 slightly surprising (at first) behavior may occur: a macro will in
93 general expand to multiple lines of input, so upon exiting, the
98 general expand to multiple lines of input, so upon exiting, the
94 in/out counters will both be bumped by the corresponding amount
99 in/out counters will both be bumped by the corresponding amount
95 (as if the macro's contents had been typed interactively). Typing
100 (as if the macro's contents had been typed interactively). Typing
96 %hist will reveal the intermediate (silently processed) lines.
101 %hist will reveal the intermediate (silently processed) lines.
97
102
98 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
103 * IPython/Magic.py (magic_run): fix a subtle bug which could cause
99 pickle to fail (%run was overwriting __main__ and not restoring
104 pickle to fail (%run was overwriting __main__ and not restoring
100 it, but pickle relies on __main__ to operate).
105 it, but pickle relies on __main__ to operate).
101
106
102 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
107 * IPython/iplib.py (InteractiveShell): fix pdb calling: I'm now
103 using properties, but forgot to make the main InteractiveShell
108 using properties, but forgot to make the main InteractiveShell
104 class a new-style class. Properties fail silently, and
109 class a new-style class. Properties fail silently, and
105 misteriously, with old-style class (getters work, but
110 misteriously, with old-style class (getters work, but
106 setters don't do anything).
111 setters don't do anything).
107
112
108 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
113 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
109
114
110 * IPython/Magic.py (magic_history): fix history reporting bug (I
115 * IPython/Magic.py (magic_history): fix history reporting bug (I
111 know some nasties are still there, I just can't seem to find a
116 know some nasties are still there, I just can't seem to find a
112 reproducible test case to track them down; the input history is
117 reproducible test case to track them down; the input history is
113 falling out of sync...)
118 falling out of sync...)
114
119
115 * IPython/iplib.py (handle_shell_escape): fix bug where both
120 * IPython/iplib.py (handle_shell_escape): fix bug where both
116 aliases and system accesses where broken for indented code (such
121 aliases and system accesses where broken for indented code (such
117 as loops).
122 as loops).
118
123
119 * IPython/genutils.py (shell): fix small but critical bug for
124 * IPython/genutils.py (shell): fix small but critical bug for
120 win32 system access.
125 win32 system access.
121
126
122 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
127 2005-12-29 Fernando Perez <Fernando.Perez@colorado.edu>
123
128
124 * IPython/iplib.py (showtraceback): remove use of the
129 * IPython/iplib.py (showtraceback): remove use of the
125 sys.last_{type/value/traceback} structures, which are non
130 sys.last_{type/value/traceback} structures, which are non
126 thread-safe.
131 thread-safe.
127 (_prefilter): change control flow to ensure that we NEVER
132 (_prefilter): change control flow to ensure that we NEVER
128 introspect objects when autocall is off. This will guarantee that
133 introspect objects when autocall is off. This will guarantee that
129 having an input line of the form 'x.y', where access to attribute
134 having an input line of the form 'x.y', where access to attribute
130 'y' has side effects, doesn't trigger the side effect TWICE. It
135 'y' has side effects, doesn't trigger the side effect TWICE. It
131 is important to note that, with autocall on, these side effects
136 is important to note that, with autocall on, these side effects
132 can still happen.
137 can still happen.
133 (ipsystem): new builtin, to complete the ip{magic/alias/system}
138 (ipsystem): new builtin, to complete the ip{magic/alias/system}
134 trio. IPython offers these three kinds of special calls which are
139 trio. IPython offers these three kinds of special calls which are
135 not python code, and it's a good thing to have their call method
140 not python code, and it's a good thing to have their call method
136 be accessible as pure python functions (not just special syntax at
141 be accessible as pure python functions (not just special syntax at
137 the command line). It gives us a better internal implementation
142 the command line). It gives us a better internal implementation
138 structure, as well as exposing these for user scripting more
143 structure, as well as exposing these for user scripting more
139 cleanly.
144 cleanly.
140
145
141 * IPython/macro.py (Macro.__init__): moved macros to a standalone
146 * IPython/macro.py (Macro.__init__): moved macros to a standalone
142 file. Now that they'll be more likely to be used with the
147 file. Now that they'll be more likely to be used with the
143 persistance system (%store), I want to make sure their module path
148 persistance system (%store), I want to make sure their module path
144 doesn't change in the future, so that we don't break things for
149 doesn't change in the future, so that we don't break things for
145 users' persisted data.
150 users' persisted data.
146
151
147 * IPython/iplib.py (autoindent_update): move indentation
152 * IPython/iplib.py (autoindent_update): move indentation
148 management into the _text_ processing loop, not the keyboard
153 management into the _text_ processing loop, not the keyboard
149 interactive one. This is necessary to correctly process non-typed
154 interactive one. This is necessary to correctly process non-typed
150 multiline input (such as macros).
155 multiline input (such as macros).
151
156
152 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
157 * IPython/Magic.py (Magic.format_latex): patch by Stefan van der
153 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
158 Walt <stefan-AT-sun.ac.za> to fix latex formatting of docstrings,
154 which was producing problems in the resulting manual.
159 which was producing problems in the resulting manual.
155 (magic_whos): improve reporting of instances (show their class,
160 (magic_whos): improve reporting of instances (show their class,
156 instead of simply printing 'instance' which isn't terribly
161 instead of simply printing 'instance' which isn't terribly
157 informative).
162 informative).
158
163
159 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
164 * IPython/genutils.py (shell): commit Jorgen Stenarson's patch
160 (minor mods) to support network shares under win32.
165 (minor mods) to support network shares under win32.
161
166
162 * IPython/winconsole.py (get_console_size): add new winconsole
167 * IPython/winconsole.py (get_console_size): add new winconsole
163 module and fixes to page_dumb() to improve its behavior under
168 module and fixes to page_dumb() to improve its behavior under
164 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
169 win32. Contributed by Alexander Belchenko <bialix-AT-ukr.net>.
165
170
166 * IPython/Magic.py (Macro): simplified Macro class to just
171 * IPython/Magic.py (Macro): simplified Macro class to just
167 subclass list. We've had only 2.2 compatibility for a very long
172 subclass list. We've had only 2.2 compatibility for a very long
168 time, yet I was still avoiding subclassing the builtin types. No
173 time, yet I was still avoiding subclassing the builtin types. No
169 more (I'm also starting to use properties, though I won't shift to
174 more (I'm also starting to use properties, though I won't shift to
170 2.3-specific features quite yet).
175 2.3-specific features quite yet).
171 (magic_store): added Ville's patch for lightweight variable
176 (magic_store): added Ville's patch for lightweight variable
172 persistence, after a request on the user list by Matt Wilkie
177 persistence, after a request on the user list by Matt Wilkie
173 <maphew-AT-gmail.com>. The new %store magic's docstring has full
178 <maphew-AT-gmail.com>. The new %store magic's docstring has full
174 details.
179 details.
175
180
176 * IPython/iplib.py (InteractiveShell.post_config_initialization):
181 * IPython/iplib.py (InteractiveShell.post_config_initialization):
177 changed the default logfile name from 'ipython.log' to
182 changed the default logfile name from 'ipython.log' to
178 'ipython_log.py'. These logs are real python files, and now that
183 'ipython_log.py'. These logs are real python files, and now that
179 we have much better multiline support, people are more likely to
184 we have much better multiline support, people are more likely to
180 want to use them as such. Might as well name them correctly.
185 want to use them as such. Might as well name them correctly.
181
186
182 * IPython/Magic.py: substantial cleanup. While we can't stop
187 * IPython/Magic.py: substantial cleanup. While we can't stop
183 using magics as mixins, due to the existing customizations 'out
188 using magics as mixins, due to the existing customizations 'out
184 there' which rely on the mixin naming conventions, at least I
189 there' which rely on the mixin naming conventions, at least I
185 cleaned out all cross-class name usage. So once we are OK with
190 cleaned out all cross-class name usage. So once we are OK with
186 breaking compatibility, the two systems can be separated.
191 breaking compatibility, the two systems can be separated.
187
192
188 * IPython/Logger.py: major cleanup. This one is NOT a mixin
193 * IPython/Logger.py: major cleanup. This one is NOT a mixin
189 anymore, and the class is a fair bit less hideous as well. New
194 anymore, and the class is a fair bit less hideous as well. New
190 features were also introduced: timestamping of input, and logging
195 features were also introduced: timestamping of input, and logging
191 of output results. These are user-visible with the -t and -o
196 of output results. These are user-visible with the -t and -o
192 options to %logstart. Closes
197 options to %logstart. Closes
193 http://www.scipy.net/roundup/ipython/issue11 and a request by
198 http://www.scipy.net/roundup/ipython/issue11 and a request by
194 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
199 William Stein (SAGE developer - http://modular.ucsd.edu/sage).
195
200
196 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
201 2005-12-28 Fernando Perez <Fernando.Perez@colorado.edu>
197
202
198 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
203 * IPython/iplib.py (handle_shell_escape): add Ville's patch to
199 better hadnle backslashes in paths. See the thread 'More Windows
204 better hadnle backslashes in paths. See the thread 'More Windows
200 questions part 2 - \/ characters revisited' on the iypthon user
205 questions part 2 - \/ characters revisited' on the iypthon user
201 list:
206 list:
202 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
207 http://scipy.net/pipermail/ipython-user/2005-June/000907.html
203
208
204 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
209 (InteractiveShell.__init__): fix tab-completion bug in threaded shells.
205
210
206 (InteractiveShell.__init__): change threaded shells to not use the
211 (InteractiveShell.__init__): change threaded shells to not use the
207 ipython crash handler. This was causing more problems than not,
212 ipython crash handler. This was causing more problems than not,
208 as exceptions in the main thread (GUI code, typically) would
213 as exceptions in the main thread (GUI code, typically) would
209 always show up as a 'crash', when they really weren't.
214 always show up as a 'crash', when they really weren't.
210
215
211 The colors and exception mode commands (%colors/%xmode) have been
216 The colors and exception mode commands (%colors/%xmode) have been
212 synchronized to also take this into account, so users can get
217 synchronized to also take this into account, so users can get
213 verbose exceptions for their threaded code as well. I also added
218 verbose exceptions for their threaded code as well. I also added
214 support for activating pdb inside this exception handler as well,
219 support for activating pdb inside this exception handler as well,
215 so now GUI authors can use IPython's enhanced pdb at runtime.
220 so now GUI authors can use IPython's enhanced pdb at runtime.
216
221
217 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
222 * IPython/ipmaker.py (make_IPython): make the autoedit_syntax flag
218 true by default, and add it to the shipped ipythonrc file. Since
223 true by default, and add it to the shipped ipythonrc file. Since
219 this asks the user before proceeding, I think it's OK to make it
224 this asks the user before proceeding, I think it's OK to make it
220 true by default.
225 true by default.
221
226
222 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
227 * IPython/Magic.py (magic_exit): make new exit/quit magics instead
223 of the previous special-casing of input in the eval loop. I think
228 of the previous special-casing of input in the eval loop. I think
224 this is cleaner, as they really are commands and shouldn't have
229 this is cleaner, as they really are commands and shouldn't have
225 a special role in the middle of the core code.
230 a special role in the middle of the core code.
226
231
227 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
232 2005-12-27 Fernando Perez <Fernando.Perez@colorado.edu>
228
233
229 * IPython/iplib.py (edit_syntax_error): added support for
234 * IPython/iplib.py (edit_syntax_error): added support for
230 automatically reopening the editor if the file had a syntax error
235 automatically reopening the editor if the file had a syntax error
231 in it. Thanks to scottt who provided the patch at:
236 in it. Thanks to scottt who provided the patch at:
232 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
237 http://www.scipy.net/roundup/ipython/issue36 (slightly modified
233 version committed).
238 version committed).
234
239
235 * IPython/iplib.py (handle_normal): add suport for multi-line
240 * IPython/iplib.py (handle_normal): add suport for multi-line
236 input with emtpy lines. This fixes
241 input with emtpy lines. This fixes
237 http://www.scipy.net/roundup/ipython/issue43 and a similar
242 http://www.scipy.net/roundup/ipython/issue43 and a similar
238 discussion on the user list.
243 discussion on the user list.
239
244
240 WARNING: a behavior change is necessarily introduced to support
245 WARNING: a behavior change is necessarily introduced to support
241 blank lines: now a single blank line with whitespace does NOT
246 blank lines: now a single blank line with whitespace does NOT
242 break the input loop, which means that when autoindent is on, by
247 break the input loop, which means that when autoindent is on, by
243 default hitting return on the next (indented) line does NOT exit.
248 default hitting return on the next (indented) line does NOT exit.
244
249
245 Instead, to exit a multiline input you can either have:
250 Instead, to exit a multiline input you can either have:
246
251
247 - TWO whitespace lines (just hit return again), or
252 - TWO whitespace lines (just hit return again), or
248 - a single whitespace line of a different length than provided
253 - a single whitespace line of a different length than provided
249 by the autoindent (add or remove a space).
254 by the autoindent (add or remove a space).
250
255
251 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
256 * IPython/completer.py (MagicCompleter.__init__): new 'completer'
252 module to better organize all readline-related functionality.
257 module to better organize all readline-related functionality.
253 I've deleted FlexCompleter and put all completion clases here.
258 I've deleted FlexCompleter and put all completion clases here.
254
259
255 * IPython/iplib.py (raw_input): improve indentation management.
260 * IPython/iplib.py (raw_input): improve indentation management.
256 It is now possible to paste indented code with autoindent on, and
261 It is now possible to paste indented code with autoindent on, and
257 the code is interpreted correctly (though it still looks bad on
262 the code is interpreted correctly (though it still looks bad on
258 screen, due to the line-oriented nature of ipython).
263 screen, due to the line-oriented nature of ipython).
259 (MagicCompleter.complete): change behavior so that a TAB key on an
264 (MagicCompleter.complete): change behavior so that a TAB key on an
260 otherwise empty line actually inserts a tab, instead of completing
265 otherwise empty line actually inserts a tab, instead of completing
261 on the entire global namespace. This makes it easier to use the
266 on the entire global namespace. This makes it easier to use the
262 TAB key for indentation. After a request by Hans Meine
267 TAB key for indentation. After a request by Hans Meine
263 <hans_meine-AT-gmx.net>
268 <hans_meine-AT-gmx.net>
264 (_prefilter): add support so that typing plain 'exit' or 'quit'
269 (_prefilter): add support so that typing plain 'exit' or 'quit'
265 does a sensible thing. Originally I tried to deviate as little as
270 does a sensible thing. Originally I tried to deviate as little as
266 possible from the default python behavior, but even that one may
271 possible from the default python behavior, but even that one may
267 change in this direction (thread on python-dev to that effect).
272 change in this direction (thread on python-dev to that effect).
268 Regardless, ipython should do the right thing even if CPython's
273 Regardless, ipython should do the right thing even if CPython's
269 '>>>' prompt doesn't.
274 '>>>' prompt doesn't.
270 (InteractiveShell): removed subclassing code.InteractiveConsole
275 (InteractiveShell): removed subclassing code.InteractiveConsole
271 class. By now we'd overridden just about all of its methods: I've
276 class. By now we'd overridden just about all of its methods: I've
272 copied the remaining two over, and now ipython is a standalone
277 copied the remaining two over, and now ipython is a standalone
273 class. This will provide a clearer picture for the chainsaw
278 class. This will provide a clearer picture for the chainsaw
274 branch refactoring.
279 branch refactoring.
275
280
276 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
281 2005-12-26 Fernando Perez <Fernando.Perez@colorado.edu>
277
282
278 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
283 * IPython/ultraTB.py (VerboseTB.text): harden reporting against
279 failures for objects which break when dir() is called on them.
284 failures for objects which break when dir() is called on them.
280
285
281 * IPython/FlexCompleter.py (Completer.__init__): Added support for
286 * IPython/FlexCompleter.py (Completer.__init__): Added support for
282 distinct local and global namespaces in the completer API. This
287 distinct local and global namespaces in the completer API. This
283 change allows us top properly handle completion with distinct
288 change allows us top properly handle completion with distinct
284 scopes, including in embedded instances (this had never really
289 scopes, including in embedded instances (this had never really
285 worked correctly).
290 worked correctly).
286
291
287 Note: this introduces a change in the constructor for
292 Note: this introduces a change in the constructor for
288 MagicCompleter, as a new global_namespace parameter is now the
293 MagicCompleter, as a new global_namespace parameter is now the
289 second argument (the others were bumped one position).
294 second argument (the others were bumped one position).
290
295
291 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
296 2005-12-25 Fernando Perez <Fernando.Perez@colorado.edu>
292
297
293 * IPython/iplib.py (embed_mainloop): fix tab-completion in
298 * IPython/iplib.py (embed_mainloop): fix tab-completion in
294 embedded instances (which can be done now thanks to Vivian's
299 embedded instances (which can be done now thanks to Vivian's
295 frame-handling fixes for pdb).
300 frame-handling fixes for pdb).
296 (InteractiveShell.__init__): Fix namespace handling problem in
301 (InteractiveShell.__init__): Fix namespace handling problem in
297 embedded instances. We were overwriting __main__ unconditionally,
302 embedded instances. We were overwriting __main__ unconditionally,
298 and this should only be done for 'full' (non-embedded) IPython;
303 and this should only be done for 'full' (non-embedded) IPython;
299 embedded instances must respect the caller's __main__. Thanks to
304 embedded instances must respect the caller's __main__. Thanks to
300 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
305 a bug report by Yaroslav Bulatov <yaroslavvb-AT-gmail.com>
301
306
302 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
307 2005-12-24 Fernando Perez <Fernando.Perez@colorado.edu>
303
308
304 * setup.py: added download_url to setup(). This registers the
309 * setup.py: added download_url to setup(). This registers the
305 download address at PyPI, which is not only useful to humans
310 download address at PyPI, which is not only useful to humans
306 browsing the site, but is also picked up by setuptools (the Eggs
311 browsing the site, but is also picked up by setuptools (the Eggs
307 machinery). Thanks to Ville and R. Kern for the info/discussion
312 machinery). Thanks to Ville and R. Kern for the info/discussion
308 on this.
313 on this.
309
314
310 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
315 2005-12-23 Fernando Perez <Fernando.Perez@colorado.edu>
311
316
312 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
317 * IPython/Debugger.py (Pdb.__init__): Major pdb mode enhancements.
313 This brings a lot of nice functionality to the pdb mode, which now
318 This brings a lot of nice functionality to the pdb mode, which now
314 has tab-completion, syntax highlighting, and better stack handling
319 has tab-completion, syntax highlighting, and better stack handling
315 than before. Many thanks to Vivian De Smedt
320 than before. Many thanks to Vivian De Smedt
316 <vivian-AT-vdesmedt.com> for the original patches.
321 <vivian-AT-vdesmedt.com> for the original patches.
317
322
318 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
323 2005-12-08 Fernando Perez <Fernando.Perez@colorado.edu>
319
324
320 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
325 * IPython/Shell.py (IPShellGTK.mainloop): fix mainloop() calling
321 sequence to consistently accept the banner argument. The
326 sequence to consistently accept the banner argument. The
322 inconsistency was tripping SAGE, thanks to Gary Zablackis
327 inconsistency was tripping SAGE, thanks to Gary Zablackis
323 <gzabl-AT-yahoo.com> for the report.
328 <gzabl-AT-yahoo.com> for the report.
324
329
325 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
330 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
326
331
327 * IPython/iplib.py (InteractiveShell.post_config_initialization):
332 * IPython/iplib.py (InteractiveShell.post_config_initialization):
328 Fix bug where a naked 'alias' call in the ipythonrc file would
333 Fix bug where a naked 'alias' call in the ipythonrc file would
329 cause a crash. Bug reported by Jorgen Stenarson.
334 cause a crash. Bug reported by Jorgen Stenarson.
330
335
331 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
336 2005-11-15 Fernando Perez <Fernando.Perez@colorado.edu>
332
337
333 * IPython/ipmaker.py (make_IPython): cleanups which should improve
338 * IPython/ipmaker.py (make_IPython): cleanups which should improve
334 startup time.
339 startup time.
335
340
336 * IPython/iplib.py (runcode): my globals 'fix' for embedded
341 * IPython/iplib.py (runcode): my globals 'fix' for embedded
337 instances had introduced a bug with globals in normal code. Now
342 instances had introduced a bug with globals in normal code. Now
338 it's working in all cases.
343 it's working in all cases.
339
344
340 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
345 * IPython/Magic.py (magic_psearch): Finish wildcard cleanup and
341 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
346 API changes. A new ipytonrc option, 'wildcards_case_sensitive'
342 has been introduced to set the default case sensitivity of the
347 has been introduced to set the default case sensitivity of the
343 searches. Users can still select either mode at runtime on a
348 searches. Users can still select either mode at runtime on a
344 per-search basis.
349 per-search basis.
345
350
346 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
351 2005-11-13 Fernando Perez <Fernando.Perez@colorado.edu>
347
352
348 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
353 * IPython/wildcard.py (NameSpace.__init__): fix resolution of
349 attributes in wildcard searches for subclasses. Modified version
354 attributes in wildcard searches for subclasses. Modified version
350 of a patch by Jorgen.
355 of a patch by Jorgen.
351
356
352 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
357 2005-11-12 Fernando Perez <Fernando.Perez@colorado.edu>
353
358
354 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
359 * IPython/iplib.py (embed_mainloop): Fix handling of globals for
355 embedded instances. I added a user_global_ns attribute to the
360 embedded instances. I added a user_global_ns attribute to the
356 InteractiveShell class to handle this.
361 InteractiveShell class to handle this.
357
362
358 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
363 2005-10-31 Fernando Perez <Fernando.Perez@colorado.edu>
359
364
360 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
365 * IPython/Shell.py (IPShellGTK.mainloop): Change timeout_add to
361 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
366 idle_add, which fixes horrible keyboard lag problems under gtk 2.6
362 (reported under win32, but may happen also in other platforms).
367 (reported under win32, but may happen also in other platforms).
363 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
368 Bug report and fix courtesy of Sean Moore <smm-AT-logic.bm>
364
369
365 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
370 2005-10-15 Fernando Perez <Fernando.Perez@colorado.edu>
366
371
367 * IPython/Magic.py (magic_psearch): new support for wildcard
372 * IPython/Magic.py (magic_psearch): new support for wildcard
368 patterns. Now, typing ?a*b will list all names which begin with a
373 patterns. Now, typing ?a*b will list all names which begin with a
369 and end in b, for example. The %psearch magic has full
374 and end in b, for example. The %psearch magic has full
370 docstrings. Many thanks to JΓΆrgen Stenarson
375 docstrings. Many thanks to JΓΆrgen Stenarson
371 <jorgen.stenarson-AT-bostream.nu>, author of the patches
376 <jorgen.stenarson-AT-bostream.nu>, author of the patches
372 implementing this functionality.
377 implementing this functionality.
373
378
374 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
379 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
375
380
376 * Manual: fixed long-standing annoyance of double-dashes (as in
381 * Manual: fixed long-standing annoyance of double-dashes (as in
377 --prefix=~, for example) being stripped in the HTML version. This
382 --prefix=~, for example) being stripped in the HTML version. This
378 is a latex2html bug, but a workaround was provided. Many thanks
383 is a latex2html bug, but a workaround was provided. Many thanks
379 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
384 to George K. Thiruvathukal <gthiruv-AT-luc.edu> for the detailed
380 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
385 help, and Michael Tobis <mtobis-AT-gmail.com> for getting the ball
381 rolling. This seemingly small issue had tripped a number of users
386 rolling. This seemingly small issue had tripped a number of users
382 when first installing, so I'm glad to see it gone.
387 when first installing, so I'm glad to see it gone.
383
388
384 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
389 2005-09-27 Fernando Perez <Fernando.Perez@colorado.edu>
385
390
386 * IPython/Extensions/numeric_formats.py: fix missing import,
391 * IPython/Extensions/numeric_formats.py: fix missing import,
387 reported by Stephen Walton.
392 reported by Stephen Walton.
388
393
389 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
394 2005-09-24 Fernando Perez <Fernando.Perez@colorado.edu>
390
395
391 * IPython/demo.py: finish demo module, fully documented now.
396 * IPython/demo.py: finish demo module, fully documented now.
392
397
393 * IPython/genutils.py (file_read): simple little utility to read a
398 * IPython/genutils.py (file_read): simple little utility to read a
394 file and ensure it's closed afterwards.
399 file and ensure it's closed afterwards.
395
400
396 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
401 2005-09-23 Fernando Perez <Fernando.Perez@colorado.edu>
397
402
398 * IPython/demo.py (Demo.__init__): added support for individually
403 * IPython/demo.py (Demo.__init__): added support for individually
399 tagging blocks for automatic execution.
404 tagging blocks for automatic execution.
400
405
401 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
406 * IPython/Magic.py (magic_pycat): new %pycat magic for showing
402 syntax-highlighted python sources, requested by John.
407 syntax-highlighted python sources, requested by John.
403
408
404 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
409 2005-09-22 Fernando Perez <Fernando.Perez@colorado.edu>
405
410
406 * IPython/demo.py (Demo.again): fix bug where again() blocks after
411 * IPython/demo.py (Demo.again): fix bug where again() blocks after
407 finishing.
412 finishing.
408
413
409 * IPython/genutils.py (shlex_split): moved from Magic to here,
414 * IPython/genutils.py (shlex_split): moved from Magic to here,
410 where all 2.2 compatibility stuff lives. I needed it for demo.py.
415 where all 2.2 compatibility stuff lives. I needed it for demo.py.
411
416
412 * IPython/demo.py (Demo.__init__): added support for silent
417 * IPython/demo.py (Demo.__init__): added support for silent
413 blocks, improved marks as regexps, docstrings written.
418 blocks, improved marks as regexps, docstrings written.
414 (Demo.__init__): better docstring, added support for sys.argv.
419 (Demo.__init__): better docstring, added support for sys.argv.
415
420
416 * IPython/genutils.py (marquee): little utility used by the demo
421 * IPython/genutils.py (marquee): little utility used by the demo
417 code, handy in general.
422 code, handy in general.
418
423
419 * IPython/demo.py (Demo.__init__): new class for interactive
424 * IPython/demo.py (Demo.__init__): new class for interactive
420 demos. Not documented yet, I just wrote it in a hurry for
425 demos. Not documented yet, I just wrote it in a hurry for
421 scipy'05. Will docstring later.
426 scipy'05. Will docstring later.
422
427
423 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
428 2005-09-20 Fernando Perez <Fernando.Perez@colorado.edu>
424
429
425 * IPython/Shell.py (sigint_handler): Drastic simplification which
430 * IPython/Shell.py (sigint_handler): Drastic simplification which
426 also seems to make Ctrl-C work correctly across threads! This is
431 also seems to make Ctrl-C work correctly across threads! This is
427 so simple, that I can't beleive I'd missed it before. Needs more
432 so simple, that I can't beleive I'd missed it before. Needs more
428 testing, though.
433 testing, though.
429 (KBINT): Never mind, revert changes. I'm sure I'd tried something
434 (KBINT): Never mind, revert changes. I'm sure I'd tried something
430 like this before...
435 like this before...
431
436
432 * IPython/genutils.py (get_home_dir): add protection against
437 * IPython/genutils.py (get_home_dir): add protection against
433 non-dirs in win32 registry.
438 non-dirs in win32 registry.
434
439
435 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
440 * IPython/iplib.py (InteractiveShell.alias_table_validate): fix
436 bug where dict was mutated while iterating (pysh crash).
441 bug where dict was mutated while iterating (pysh crash).
437
442
438 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
443 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
439
444
440 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
445 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
441 spurious newlines added by this routine. After a report by
446 spurious newlines added by this routine. After a report by
442 F. Mantegazza.
447 F. Mantegazza.
443
448
444 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
449 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
445
450
446 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
451 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
447 calls. These were a leftover from the GTK 1.x days, and can cause
452 calls. These were a leftover from the GTK 1.x days, and can cause
448 problems in certain cases (after a report by John Hunter).
453 problems in certain cases (after a report by John Hunter).
449
454
450 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
455 * IPython/iplib.py (InteractiveShell.__init__): Trap exception if
451 os.getcwd() fails at init time. Thanks to patch from David Remahl
456 os.getcwd() fails at init time. Thanks to patch from David Remahl
452 <chmod007-AT-mac.com>.
457 <chmod007-AT-mac.com>.
453 (InteractiveShell.__init__): prevent certain special magics from
458 (InteractiveShell.__init__): prevent certain special magics from
454 being shadowed by aliases. Closes
459 being shadowed by aliases. Closes
455 http://www.scipy.net/roundup/ipython/issue41.
460 http://www.scipy.net/roundup/ipython/issue41.
456
461
457 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
462 2005-08-31 Fernando Perez <Fernando.Perez@colorado.edu>
458
463
459 * IPython/iplib.py (InteractiveShell.complete): Added new
464 * IPython/iplib.py (InteractiveShell.complete): Added new
460 top-level completion method to expose the completion mechanism
465 top-level completion method to expose the completion mechanism
461 beyond readline-based environments.
466 beyond readline-based environments.
462
467
463 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
468 2005-08-19 Fernando Perez <Fernando.Perez@colorado.edu>
464
469
465 * tools/ipsvnc (svnversion): fix svnversion capture.
470 * tools/ipsvnc (svnversion): fix svnversion capture.
466
471
467 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
472 * IPython/iplib.py (InteractiveShell.__init__): Add has_readline
468 attribute to self, which was missing. Before, it was set by a
473 attribute to self, which was missing. Before, it was set by a
469 routine which in certain cases wasn't being called, so the
474 routine which in certain cases wasn't being called, so the
470 instance could end up missing the attribute. This caused a crash.
475 instance could end up missing the attribute. This caused a crash.
471 Closes http://www.scipy.net/roundup/ipython/issue40.
476 Closes http://www.scipy.net/roundup/ipython/issue40.
472
477
473 2005-08-16 Fernando Perez <fperez@colorado.edu>
478 2005-08-16 Fernando Perez <fperez@colorado.edu>
474
479
475 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
480 * IPython/ultraTB.py (VerboseTB.text): don't crash if object
476 contains non-string attribute. Closes
481 contains non-string attribute. Closes
477 http://www.scipy.net/roundup/ipython/issue38.
482 http://www.scipy.net/roundup/ipython/issue38.
478
483
479 2005-08-14 Fernando Perez <fperez@colorado.edu>
484 2005-08-14 Fernando Perez <fperez@colorado.edu>
480
485
481 * tools/ipsvnc: Minor improvements, to add changeset info.
486 * tools/ipsvnc: Minor improvements, to add changeset info.
482
487
483 2005-08-12 Fernando Perez <fperez@colorado.edu>
488 2005-08-12 Fernando Perez <fperez@colorado.edu>
484
489
485 * IPython/iplib.py (runsource): remove self.code_to_run_src
490 * IPython/iplib.py (runsource): remove self.code_to_run_src
486 attribute. I realized this is nothing more than
491 attribute. I realized this is nothing more than
487 '\n'.join(self.buffer), and having the same data in two different
492 '\n'.join(self.buffer), and having the same data in two different
488 places is just asking for synchronization bugs. This may impact
493 places is just asking for synchronization bugs. This may impact
489 people who have custom exception handlers, so I need to warn
494 people who have custom exception handlers, so I need to warn
490 ipython-dev about it (F. Mantegazza may use them).
495 ipython-dev about it (F. Mantegazza may use them).
491
496
492 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
497 2005-07-29 Fernando Perez <Fernando.Perez@colorado.edu>
493
498
494 * IPython/genutils.py: fix 2.2 compatibility (generators)
499 * IPython/genutils.py: fix 2.2 compatibility (generators)
495
500
496 2005-07-18 Fernando Perez <fperez@colorado.edu>
501 2005-07-18 Fernando Perez <fperez@colorado.edu>
497
502
498 * IPython/genutils.py (get_home_dir): fix to help users with
503 * IPython/genutils.py (get_home_dir): fix to help users with
499 invalid $HOME under win32.
504 invalid $HOME under win32.
500
505
501 2005-07-17 Fernando Perez <fperez@colorado.edu>
506 2005-07-17 Fernando Perez <fperez@colorado.edu>
502
507
503 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
508 * IPython/Prompts.py (str_safe): Make unicode-safe. Also remove
504 some old hacks and clean up a bit other routines; code should be
509 some old hacks and clean up a bit other routines; code should be
505 simpler and a bit faster.
510 simpler and a bit faster.
506
511
507 * IPython/iplib.py (interact): removed some last-resort attempts
512 * IPython/iplib.py (interact): removed some last-resort attempts
508 to survive broken stdout/stderr. That code was only making it
513 to survive broken stdout/stderr. That code was only making it
509 harder to abstract out the i/o (necessary for gui integration),
514 harder to abstract out the i/o (necessary for gui integration),
510 and the crashes it could prevent were extremely rare in practice
515 and the crashes it could prevent were extremely rare in practice
511 (besides being fully user-induced in a pretty violent manner).
516 (besides being fully user-induced in a pretty violent manner).
512
517
513 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
518 * IPython/genutils.py (IOStream.__init__): Simplify the i/o stuff.
514 Nothing major yet, but the code is simpler to read; this should
519 Nothing major yet, but the code is simpler to read; this should
515 make it easier to do more serious modifications in the future.
520 make it easier to do more serious modifications in the future.
516
521
517 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
522 * IPython/Extensions/InterpreterExec.py: Fix auto-quoting in pysh,
518 which broke in .15 (thanks to a report by Ville).
523 which broke in .15 (thanks to a report by Ville).
519
524
520 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
525 * IPython/Itpl.py (Itpl.__init__): add unicode support (it may not
521 be quite correct, I know next to nothing about unicode). This
526 be quite correct, I know next to nothing about unicode). This
522 will allow unicode strings to be used in prompts, amongst other
527 will allow unicode strings to be used in prompts, amongst other
523 cases. It also will prevent ipython from crashing when unicode
528 cases. It also will prevent ipython from crashing when unicode
524 shows up unexpectedly in many places. If ascii encoding fails, we
529 shows up unexpectedly in many places. If ascii encoding fails, we
525 assume utf_8. Currently the encoding is not a user-visible
530 assume utf_8. Currently the encoding is not a user-visible
526 setting, though it could be made so if there is demand for it.
531 setting, though it could be made so if there is demand for it.
527
532
528 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
533 * IPython/ipmaker.py (make_IPython): remove old 2.1-specific hack.
529
534
530 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
535 * IPython/Struct.py (Struct.merge): switch keys() to iterator.
531
536
532 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
537 * IPython/background_jobs.py: moved 2.2 compatibility to genutils.
533
538
534 * IPython/genutils.py: Add 2.2 compatibility here, so all other
539 * IPython/genutils.py: Add 2.2 compatibility here, so all other
535 code can work transparently for 2.2/2.3.
540 code can work transparently for 2.2/2.3.
536
541
537 2005-07-16 Fernando Perez <fperez@colorado.edu>
542 2005-07-16 Fernando Perez <fperez@colorado.edu>
538
543
539 * IPython/ultraTB.py (ExceptionColors): Make a global variable
544 * IPython/ultraTB.py (ExceptionColors): Make a global variable
540 out of the color scheme table used for coloring exception
545 out of the color scheme table used for coloring exception
541 tracebacks. This allows user code to add new schemes at runtime.
546 tracebacks. This allows user code to add new schemes at runtime.
542 This is a minimally modified version of the patch at
547 This is a minimally modified version of the patch at
543 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
548 http://www.scipy.net/roundup/ipython/issue35, many thanks to pabw
544 for the contribution.
549 for the contribution.
545
550
546 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
551 * IPython/FlexCompleter.py (Completer.attr_matches): Add a
547 slightly modified version of the patch in
552 slightly modified version of the patch in
548 http://www.scipy.net/roundup/ipython/issue34, which also allows me
553 http://www.scipy.net/roundup/ipython/issue34, which also allows me
549 to remove the previous try/except solution (which was costlier).
554 to remove the previous try/except solution (which was costlier).
550 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
555 Thanks to Gaetan Lehmann <gaetan.lehmann-AT-jouy.inra.fr> for the fix.
551
556
552 2005-06-08 Fernando Perez <fperez@colorado.edu>
557 2005-06-08 Fernando Perez <fperez@colorado.edu>
553
558
554 * IPython/iplib.py (write/write_err): Add methods to abstract all
559 * IPython/iplib.py (write/write_err): Add methods to abstract all
555 I/O a bit more.
560 I/O a bit more.
556
561
557 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
562 * IPython/Shell.py (IPShellGTK.mainloop): Fix GTK deprecation
558 warning, reported by Aric Hagberg, fix by JD Hunter.
563 warning, reported by Aric Hagberg, fix by JD Hunter.
559
564
560 2005-06-02 *** Released version 0.6.15
565 2005-06-02 *** Released version 0.6.15
561
566
562 2005-06-01 Fernando Perez <fperez@colorado.edu>
567 2005-06-01 Fernando Perez <fperez@colorado.edu>
563
568
564 * IPython/iplib.py (MagicCompleter.file_matches): Fix
569 * IPython/iplib.py (MagicCompleter.file_matches): Fix
565 tab-completion of filenames within open-quoted strings. Note that
570 tab-completion of filenames within open-quoted strings. Note that
566 this requires that in ~/.ipython/ipythonrc, users change the
571 this requires that in ~/.ipython/ipythonrc, users change the
567 readline delimiters configuration to read:
572 readline delimiters configuration to read:
568
573
569 readline_remove_delims -/~
574 readline_remove_delims -/~
570
575
571
576
572 2005-05-31 *** Released version 0.6.14
577 2005-05-31 *** Released version 0.6.14
573
578
574 2005-05-29 Fernando Perez <fperez@colorado.edu>
579 2005-05-29 Fernando Perez <fperez@colorado.edu>
575
580
576 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
581 * IPython/ultraTB.py (VerboseTB.text): Fix crash for tracebacks
577 with files not on the filesystem. Reported by Eliyahu Sandler
582 with files not on the filesystem. Reported by Eliyahu Sandler
578 <eli@gondolin.net>
583 <eli@gondolin.net>
579
584
580 2005-05-22 Fernando Perez <fperez@colorado.edu>
585 2005-05-22 Fernando Perez <fperez@colorado.edu>
581
586
582 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
587 * IPython/iplib.py: Fix a few crashes in the --upgrade option.
583 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
588 After an initial report by LUK ShunTim <shuntim.luk@polyu.edu.hk>.
584
589
585 2005-05-19 Fernando Perez <fperez@colorado.edu>
590 2005-05-19 Fernando Perez <fperez@colorado.edu>
586
591
587 * IPython/iplib.py (safe_execfile): close a file which could be
592 * IPython/iplib.py (safe_execfile): close a file which could be
588 left open (causing problems in win32, which locks open files).
593 left open (causing problems in win32, which locks open files).
589 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
594 Thanks to a bug report by D Brown <dbrown2@yahoo.com>.
590
595
591 2005-05-18 Fernando Perez <fperez@colorado.edu>
596 2005-05-18 Fernando Perez <fperez@colorado.edu>
592
597
593 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
598 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): pass all
594 keyword arguments correctly to safe_execfile().
599 keyword arguments correctly to safe_execfile().
595
600
596 2005-05-13 Fernando Perez <fperez@colorado.edu>
601 2005-05-13 Fernando Perez <fperez@colorado.edu>
597
602
598 * ipython.1: Added info about Qt to manpage, and threads warning
603 * ipython.1: Added info about Qt to manpage, and threads warning
599 to usage page (invoked with --help).
604 to usage page (invoked with --help).
600
605
601 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
606 * IPython/iplib.py (MagicCompleter.python_func_kw_matches): Added
602 new matcher (it goes at the end of the priority list) to do
607 new matcher (it goes at the end of the priority list) to do
603 tab-completion on named function arguments. Submitted by George
608 tab-completion on named function arguments. Submitted by George
604 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
609 Sakkis <gsakkis-AT-eden.rutgers.edu>. See the thread at
605 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
610 http://www.scipy.net/pipermail/ipython-dev/2005-April/000436.html
606 for more details.
611 for more details.
607
612
608 * IPython/Magic.py (magic_run): Added new -e flag to ignore
613 * IPython/Magic.py (magic_run): Added new -e flag to ignore
609 SystemExit exceptions in the script being run. Thanks to a report
614 SystemExit exceptions in the script being run. Thanks to a report
610 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
615 by danny shevitz <danny_shevitz-AT-yahoo.com>, about this
611 producing very annoying behavior when running unit tests.
616 producing very annoying behavior when running unit tests.
612
617
613 2005-05-12 Fernando Perez <fperez@colorado.edu>
618 2005-05-12 Fernando Perez <fperez@colorado.edu>
614
619
615 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
620 * IPython/iplib.py (handle_auto): fixed auto-quoting and parens,
616 which I'd broken (again) due to a changed regexp. In the process,
621 which I'd broken (again) due to a changed regexp. In the process,
617 added ';' as an escape to auto-quote the whole line without
622 added ';' as an escape to auto-quote the whole line without
618 splitting its arguments. Thanks to a report by Jerry McRae
623 splitting its arguments. Thanks to a report by Jerry McRae
619 <qrs0xyc02-AT-sneakemail.com>.
624 <qrs0xyc02-AT-sneakemail.com>.
620
625
621 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
626 * IPython/ultraTB.py (VerboseTB.text): protect against rare but
622 possible crashes caused by a TokenError. Reported by Ed Schofield
627 possible crashes caused by a TokenError. Reported by Ed Schofield
623 <schofield-AT-ftw.at>.
628 <schofield-AT-ftw.at>.
624
629
625 2005-05-06 Fernando Perez <fperez@colorado.edu>
630 2005-05-06 Fernando Perez <fperez@colorado.edu>
626
631
627 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
632 * IPython/Shell.py (hijack_wx): Fix to work with WX v.2.6.
628
633
629 2005-04-29 Fernando Perez <fperez@colorado.edu>
634 2005-04-29 Fernando Perez <fperez@colorado.edu>
630
635
631 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
636 * IPython/Shell.py (IPShellQt): Thanks to Denis Rivière
632 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
637 <nudz-AT-free.fr>, Yann Cointepas <yann-AT-sapetnioc.org> and Benjamin
633 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
638 Thyreau <Benji2-AT-decideur.info>, we now have a -qthread option
634 which provides support for Qt interactive usage (similar to the
639 which provides support for Qt interactive usage (similar to the
635 existing one for WX and GTK). This had been often requested.
640 existing one for WX and GTK). This had been often requested.
636
641
637 2005-04-14 *** Released version 0.6.13
642 2005-04-14 *** Released version 0.6.13
638
643
639 2005-04-08 Fernando Perez <fperez@colorado.edu>
644 2005-04-08 Fernando Perez <fperez@colorado.edu>
640
645
641 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
646 * IPython/Magic.py (Magic._ofind): remove docstring evaluation
642 from _ofind, which gets called on almost every input line. Now,
647 from _ofind, which gets called on almost every input line. Now,
643 we only try to get docstrings if they are actually going to be
648 we only try to get docstrings if they are actually going to be
644 used (the overhead of fetching unnecessary docstrings can be
649 used (the overhead of fetching unnecessary docstrings can be
645 noticeable for certain objects, such as Pyro proxies).
650 noticeable for certain objects, such as Pyro proxies).
646
651
647 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
652 * IPython/iplib.py (MagicCompleter.python_matches): Change the API
648 for completers. For some reason I had been passing them the state
653 for completers. For some reason I had been passing them the state
649 variable, which completers never actually need, and was in
654 variable, which completers never actually need, and was in
650 conflict with the rlcompleter API. Custom completers ONLY need to
655 conflict with the rlcompleter API. Custom completers ONLY need to
651 take the text parameter.
656 take the text parameter.
652
657
653 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
658 * IPython/Extensions/InterpreterExec.py: Fix regexp so that magics
654 work correctly in pysh. I've also moved all the logic which used
659 work correctly in pysh. I've also moved all the logic which used
655 to be in pysh.py here, which will prevent problems with future
660 to be in pysh.py here, which will prevent problems with future
656 upgrades. However, this time I must warn users to update their
661 upgrades. However, this time I must warn users to update their
657 pysh profile to include the line
662 pysh profile to include the line
658
663
659 import_all IPython.Extensions.InterpreterExec
664 import_all IPython.Extensions.InterpreterExec
660
665
661 because otherwise things won't work for them. They MUST also
666 because otherwise things won't work for them. They MUST also
662 delete pysh.py and the line
667 delete pysh.py and the line
663
668
664 execfile pysh.py
669 execfile pysh.py
665
670
666 from their ipythonrc-pysh.
671 from their ipythonrc-pysh.
667
672
668 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
673 * IPython/FlexCompleter.py (Completer.attr_matches): Make more
669 robust in the face of objects whose dir() returns non-strings
674 robust in the face of objects whose dir() returns non-strings
670 (which it shouldn't, but some broken libs like ITK do). Thanks to
675 (which it shouldn't, but some broken libs like ITK do). Thanks to
671 a patch by John Hunter (implemented differently, though). Also
676 a patch by John Hunter (implemented differently, though). Also
672 minor improvements by using .extend instead of + on lists.
677 minor improvements by using .extend instead of + on lists.
673
678
674 * pysh.py:
679 * pysh.py:
675
680
676 2005-04-06 Fernando Perez <fperez@colorado.edu>
681 2005-04-06 Fernando Perez <fperez@colorado.edu>
677
682
678 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
683 * IPython/ipmaker.py (make_IPython): Make multi_line_specials on
679 by default, so that all users benefit from it. Those who don't
684 by default, so that all users benefit from it. Those who don't
680 want it can still turn it off.
685 want it can still turn it off.
681
686
682 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
687 * IPython/UserConfig/ipythonrc: Add multi_line_specials to the
683 config file, I'd forgotten about this, so users were getting it
688 config file, I'd forgotten about this, so users were getting it
684 off by default.
689 off by default.
685
690
686 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
691 * IPython/iplib.py (ipmagic): big overhaul of the magic system for
687 consistency. Now magics can be called in multiline statements,
692 consistency. Now magics can be called in multiline statements,
688 and python variables can be expanded in magic calls via $var.
693 and python variables can be expanded in magic calls via $var.
689 This makes the magic system behave just like aliases or !system
694 This makes the magic system behave just like aliases or !system
690 calls.
695 calls.
691
696
692 2005-03-28 Fernando Perez <fperez@colorado.edu>
697 2005-03-28 Fernando Perez <fperez@colorado.edu>
693
698
694 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
699 * IPython/iplib.py (handle_auto): cleanup to use %s instead of
695 expensive string additions for building command. Add support for
700 expensive string additions for building command. Add support for
696 trailing ';' when autocall is used.
701 trailing ';' when autocall is used.
697
702
698 2005-03-26 Fernando Perez <fperez@colorado.edu>
703 2005-03-26 Fernando Perez <fperez@colorado.edu>
699
704
700 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
705 * ipython.el: Fix http://www.scipy.net/roundup/ipython/issue31.
701 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
706 Bugfix by A. Schmolck, the ipython.el maintainer. Also make
702 ipython.el robust against prompts with any number of spaces
707 ipython.el robust against prompts with any number of spaces
703 (including 0) after the ':' character.
708 (including 0) after the ':' character.
704
709
705 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
710 * IPython/Prompts.py (Prompt2.set_p_str): Fix spurious space in
706 continuation prompt, which misled users to think the line was
711 continuation prompt, which misled users to think the line was
707 already indented. Closes debian Bug#300847, reported to me by
712 already indented. Closes debian Bug#300847, reported to me by
708 Norbert Tretkowski <tretkowski-AT-inittab.de>.
713 Norbert Tretkowski <tretkowski-AT-inittab.de>.
709
714
710 2005-03-23 Fernando Perez <fperez@colorado.edu>
715 2005-03-23 Fernando Perez <fperez@colorado.edu>
711
716
712 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
717 * IPython/Prompts.py (Prompt1.__str__): Make sure that prompts are
713 properly aligned if they have embedded newlines.
718 properly aligned if they have embedded newlines.
714
719
715 * IPython/iplib.py (runlines): Add a public method to expose
720 * IPython/iplib.py (runlines): Add a public method to expose
716 IPython's code execution machinery, so that users can run strings
721 IPython's code execution machinery, so that users can run strings
717 as if they had been typed at the prompt interactively.
722 as if they had been typed at the prompt interactively.
718 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
723 (InteractiveShell.__init__): Added getoutput() to the __IPYTHON__
719 methods which can call the system shell, but with python variable
724 methods which can call the system shell, but with python variable
720 expansion. The three such methods are: __IPYTHON__.system,
725 expansion. The three such methods are: __IPYTHON__.system,
721 .getoutput and .getoutputerror. These need to be documented in a
726 .getoutput and .getoutputerror. These need to be documented in a
722 'public API' section (to be written) of the manual.
727 'public API' section (to be written) of the manual.
723
728
724 2005-03-20 Fernando Perez <fperez@colorado.edu>
729 2005-03-20 Fernando Perez <fperez@colorado.edu>
725
730
726 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
731 * IPython/iplib.py (InteractiveShell.set_custom_exc): new system
727 for custom exception handling. This is quite powerful, and it
732 for custom exception handling. This is quite powerful, and it
728 allows for user-installable exception handlers which can trap
733 allows for user-installable exception handlers which can trap
729 custom exceptions at runtime and treat them separately from
734 custom exceptions at runtime and treat them separately from
730 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
735 IPython's default mechanisms. At the request of FrΓ©dΓ©ric
731 Mantegazza <mantegazza-AT-ill.fr>.
736 Mantegazza <mantegazza-AT-ill.fr>.
732 (InteractiveShell.set_custom_completer): public API function to
737 (InteractiveShell.set_custom_completer): public API function to
733 add new completers at runtime.
738 add new completers at runtime.
734
739
735 2005-03-19 Fernando Perez <fperez@colorado.edu>
740 2005-03-19 Fernando Perez <fperez@colorado.edu>
736
741
737 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
742 * IPython/OInspect.py (getdoc): Add a call to obj.getdoc(), to
738 allow objects which provide their docstrings via non-standard
743 allow objects which provide their docstrings via non-standard
739 mechanisms (like Pyro proxies) to still be inspected by ipython's
744 mechanisms (like Pyro proxies) to still be inspected by ipython's
740 ? system.
745 ? system.
741
746
742 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
747 * IPython/iplib.py (InteractiveShell.__init__): back off the _o/_e
743 automatic capture system. I tried quite hard to make it work
748 automatic capture system. I tried quite hard to make it work
744 reliably, and simply failed. I tried many combinations with the
749 reliably, and simply failed. I tried many combinations with the
745 subprocess module, but eventually nothing worked in all needed
750 subprocess module, but eventually nothing worked in all needed
746 cases (not blocking stdin for the child, duplicating stdout
751 cases (not blocking stdin for the child, duplicating stdout
747 without blocking, etc). The new %sc/%sx still do capture to these
752 without blocking, etc). The new %sc/%sx still do capture to these
748 magical list/string objects which make shell use much more
753 magical list/string objects which make shell use much more
749 conveninent, so not all is lost.
754 conveninent, so not all is lost.
750
755
751 XXX - FIX MANUAL for the change above!
756 XXX - FIX MANUAL for the change above!
752
757
753 (runsource): I copied code.py's runsource() into ipython to modify
758 (runsource): I copied code.py's runsource() into ipython to modify
754 it a bit. Now the code object and source to be executed are
759 it a bit. Now the code object and source to be executed are
755 stored in ipython. This makes this info accessible to third-party
760 stored in ipython. This makes this info accessible to third-party
756 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
761 tools, like custom exception handlers. After a request by FrΓ©dΓ©ric
757 Mantegazza <mantegazza-AT-ill.fr>.
762 Mantegazza <mantegazza-AT-ill.fr>.
758
763
759 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
764 * IPython/UserConfig/ipythonrc: Add up/down arrow keys to
760 history-search via readline (like C-p/C-n). I'd wanted this for a
765 history-search via readline (like C-p/C-n). I'd wanted this for a
761 long time, but only recently found out how to do it. For users
766 long time, but only recently found out how to do it. For users
762 who already have their ipythonrc files made and want this, just
767 who already have their ipythonrc files made and want this, just
763 add:
768 add:
764
769
765 readline_parse_and_bind "\e[A": history-search-backward
770 readline_parse_and_bind "\e[A": history-search-backward
766 readline_parse_and_bind "\e[B": history-search-forward
771 readline_parse_and_bind "\e[B": history-search-forward
767
772
768 2005-03-18 Fernando Perez <fperez@colorado.edu>
773 2005-03-18 Fernando Perez <fperez@colorado.edu>
769
774
770 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
775 * IPython/Magic.py (magic_sc): %sc and %sx now use the fancy
771 LSString and SList classes which allow transparent conversions
776 LSString and SList classes which allow transparent conversions
772 between list mode and whitespace-separated string.
777 between list mode and whitespace-separated string.
773 (magic_r): Fix recursion problem in %r.
778 (magic_r): Fix recursion problem in %r.
774
779
775 * IPython/genutils.py (LSString): New class to be used for
780 * IPython/genutils.py (LSString): New class to be used for
776 automatic storage of the results of all alias/system calls in _o
781 automatic storage of the results of all alias/system calls in _o
777 and _e (stdout/err). These provide a .l/.list attribute which
782 and _e (stdout/err). These provide a .l/.list attribute which
778 does automatic splitting on newlines. This means that for most
783 does automatic splitting on newlines. This means that for most
779 uses, you'll never need to do capturing of output with %sc/%sx
784 uses, you'll never need to do capturing of output with %sc/%sx
780 anymore, since ipython keeps this always done for you. Note that
785 anymore, since ipython keeps this always done for you. Note that
781 only the LAST results are stored, the _o/e variables are
786 only the LAST results are stored, the _o/e variables are
782 overwritten on each call. If you need to save their contents
787 overwritten on each call. If you need to save their contents
783 further, simply bind them to any other name.
788 further, simply bind them to any other name.
784
789
785 2005-03-17 Fernando Perez <fperez@colorado.edu>
790 2005-03-17 Fernando Perez <fperez@colorado.edu>
786
791
787 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
792 * IPython/Prompts.py (BasePrompt.cwd_filt): a few more fixes for
788 prompt namespace handling.
793 prompt namespace handling.
789
794
790 2005-03-16 Fernando Perez <fperez@colorado.edu>
795 2005-03-16 Fernando Perez <fperez@colorado.edu>
791
796
792 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
797 * IPython/Prompts.py (CachedOutput.__init__): Fix default and
793 classic prompts to be '>>> ' (final space was missing, and it
798 classic prompts to be '>>> ' (final space was missing, and it
794 trips the emacs python mode).
799 trips the emacs python mode).
795 (BasePrompt.__str__): Added safe support for dynamic prompt
800 (BasePrompt.__str__): Added safe support for dynamic prompt
796 strings. Now you can set your prompt string to be '$x', and the
801 strings. Now you can set your prompt string to be '$x', and the
797 value of x will be printed from your interactive namespace. The
802 value of x will be printed from your interactive namespace. The
798 interpolation syntax includes the full Itpl support, so
803 interpolation syntax includes the full Itpl support, so
799 ${foo()+x+bar()} is a valid prompt string now, and the function
804 ${foo()+x+bar()} is a valid prompt string now, and the function
800 calls will be made at runtime.
805 calls will be made at runtime.
801
806
802 2005-03-15 Fernando Perez <fperez@colorado.edu>
807 2005-03-15 Fernando Perez <fperez@colorado.edu>
803
808
804 * IPython/Magic.py (magic_history): renamed %hist to %history, to
809 * IPython/Magic.py (magic_history): renamed %hist to %history, to
805 avoid name clashes in pylab. %hist still works, it just forwards
810 avoid name clashes in pylab. %hist still works, it just forwards
806 the call to %history.
811 the call to %history.
807
812
808 2005-03-02 *** Released version 0.6.12
813 2005-03-02 *** Released version 0.6.12
809
814
810 2005-03-02 Fernando Perez <fperez@colorado.edu>
815 2005-03-02 Fernando Perez <fperez@colorado.edu>
811
816
812 * IPython/iplib.py (handle_magic): log magic calls properly as
817 * IPython/iplib.py (handle_magic): log magic calls properly as
813 ipmagic() function calls.
818 ipmagic() function calls.
814
819
815 * IPython/Magic.py (magic_time): Improved %time to support
820 * IPython/Magic.py (magic_time): Improved %time to support
816 statements and provide wall-clock as well as CPU time.
821 statements and provide wall-clock as well as CPU time.
817
822
818 2005-02-27 Fernando Perez <fperez@colorado.edu>
823 2005-02-27 Fernando Perez <fperez@colorado.edu>
819
824
820 * IPython/hooks.py: New hooks module, to expose user-modifiable
825 * IPython/hooks.py: New hooks module, to expose user-modifiable
821 IPython functionality in a clean manner. For now only the editor
826 IPython functionality in a clean manner. For now only the editor
822 hook is actually written, and other thigns which I intend to turn
827 hook is actually written, and other thigns which I intend to turn
823 into proper hooks aren't yet there. The display and prefilter
828 into proper hooks aren't yet there. The display and prefilter
824 stuff, for example, should be hooks. But at least now the
829 stuff, for example, should be hooks. But at least now the
825 framework is in place, and the rest can be moved here with more
830 framework is in place, and the rest can be moved here with more
826 time later. IPython had had a .hooks variable for a long time for
831 time later. IPython had had a .hooks variable for a long time for
827 this purpose, but I'd never actually used it for anything.
832 this purpose, but I'd never actually used it for anything.
828
833
829 2005-02-26 Fernando Perez <fperez@colorado.edu>
834 2005-02-26 Fernando Perez <fperez@colorado.edu>
830
835
831 * IPython/ipmaker.py (make_IPython): make the default ipython
836 * IPython/ipmaker.py (make_IPython): make the default ipython
832 directory be called _ipython under win32, to follow more the
837 directory be called _ipython under win32, to follow more the
833 naming peculiarities of that platform (where buggy software like
838 naming peculiarities of that platform (where buggy software like
834 Visual Sourcesafe breaks with .named directories). Reported by
839 Visual Sourcesafe breaks with .named directories). Reported by
835 Ville Vainio.
840 Ville Vainio.
836
841
837 2005-02-23 Fernando Perez <fperez@colorado.edu>
842 2005-02-23 Fernando Perez <fperez@colorado.edu>
838
843
839 * IPython/iplib.py (InteractiveShell.__init__): removed a few
844 * IPython/iplib.py (InteractiveShell.__init__): removed a few
840 auto_aliases for win32 which were causing problems. Users can
845 auto_aliases for win32 which were causing problems. Users can
841 define the ones they personally like.
846 define the ones they personally like.
842
847
843 2005-02-21 Fernando Perez <fperez@colorado.edu>
848 2005-02-21 Fernando Perez <fperez@colorado.edu>
844
849
845 * IPython/Magic.py (magic_time): new magic to time execution of
850 * IPython/Magic.py (magic_time): new magic to time execution of
846 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
851 expressions. After a request by Charles Moad <cmoad-AT-indiana.edu>.
847
852
848 2005-02-19 Fernando Perez <fperez@colorado.edu>
853 2005-02-19 Fernando Perez <fperez@colorado.edu>
849
854
850 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
855 * IPython/ConfigLoader.py (ConfigLoader.load): Allow empty strings
851 into keys (for prompts, for example).
856 into keys (for prompts, for example).
852
857
853 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
858 * IPython/Prompts.py (BasePrompt.set_p_str): Fix to allow empty
854 prompts in case users want them. This introduces a small behavior
859 prompts in case users want them. This introduces a small behavior
855 change: ipython does not automatically add a space to all prompts
860 change: ipython does not automatically add a space to all prompts
856 anymore. To get the old prompts with a space, users should add it
861 anymore. To get the old prompts with a space, users should add it
857 manually to their ipythonrc file, so for example prompt_in1 should
862 manually to their ipythonrc file, so for example prompt_in1 should
858 now read 'In [\#]: ' instead of 'In [\#]:'.
863 now read 'In [\#]: ' instead of 'In [\#]:'.
859 (BasePrompt.__init__): New option prompts_pad_left (only in rc
864 (BasePrompt.__init__): New option prompts_pad_left (only in rc
860 file) to control left-padding of secondary prompts.
865 file) to control left-padding of secondary prompts.
861
866
862 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
867 * IPython/Magic.py (Magic.profile_missing_notice): Don't crash if
863 the profiler can't be imported. Fix for Debian, which removed
868 the profiler can't be imported. Fix for Debian, which removed
864 profile.py because of License issues. I applied a slightly
869 profile.py because of License issues. I applied a slightly
865 modified version of the original Debian patch at
870 modified version of the original Debian patch at
866 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
871 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=294500.
867
872
868 2005-02-17 Fernando Perez <fperez@colorado.edu>
873 2005-02-17 Fernando Perez <fperez@colorado.edu>
869
874
870 * IPython/genutils.py (native_line_ends): Fix bug which would
875 * IPython/genutils.py (native_line_ends): Fix bug which would
871 cause improper line-ends under win32 b/c I was not opening files
876 cause improper line-ends under win32 b/c I was not opening files
872 in binary mode. Bug report and fix thanks to Ville.
877 in binary mode. Bug report and fix thanks to Ville.
873
878
874 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
879 * IPython/iplib.py (handle_auto): Fix bug which I introduced when
875 trying to catch spurious foo[1] autocalls. My fix actually broke
880 trying to catch spurious foo[1] autocalls. My fix actually broke
876 ',/' autoquote/call with explicit escape (bad regexp).
881 ',/' autoquote/call with explicit escape (bad regexp).
877
882
878 2005-02-15 *** Released version 0.6.11
883 2005-02-15 *** Released version 0.6.11
879
884
880 2005-02-14 Fernando Perez <fperez@colorado.edu>
885 2005-02-14 Fernando Perez <fperez@colorado.edu>
881
886
882 * IPython/background_jobs.py: New background job management
887 * IPython/background_jobs.py: New background job management
883 subsystem. This is implemented via a new set of classes, and
888 subsystem. This is implemented via a new set of classes, and
884 IPython now provides a builtin 'jobs' object for background job
889 IPython now provides a builtin 'jobs' object for background job
885 execution. A convenience %bg magic serves as a lightweight
890 execution. A convenience %bg magic serves as a lightweight
886 frontend for starting the more common type of calls. This was
891 frontend for starting the more common type of calls. This was
887 inspired by discussions with B. Granger and the BackgroundCommand
892 inspired by discussions with B. Granger and the BackgroundCommand
888 class described in the book Python Scripting for Computational
893 class described in the book Python Scripting for Computational
889 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
894 Science, by H. P. Langtangen: http://folk.uio.no/hpl/scripting
890 (although ultimately no code from this text was used, as IPython's
895 (although ultimately no code from this text was used, as IPython's
891 system is a separate implementation).
896 system is a separate implementation).
892
897
893 * IPython/iplib.py (MagicCompleter.python_matches): add new option
898 * IPython/iplib.py (MagicCompleter.python_matches): add new option
894 to control the completion of single/double underscore names
899 to control the completion of single/double underscore names
895 separately. As documented in the example ipytonrc file, the
900 separately. As documented in the example ipytonrc file, the
896 readline_omit__names variable can now be set to 2, to omit even
901 readline_omit__names variable can now be set to 2, to omit even
897 single underscore names. Thanks to a patch by Brian Wong
902 single underscore names. Thanks to a patch by Brian Wong
898 <BrianWong-AT-AirgoNetworks.Com>.
903 <BrianWong-AT-AirgoNetworks.Com>.
899 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
904 (InteractiveShell.__init__): Fix bug which would cause foo[1] to
900 be autocalled as foo([1]) if foo were callable. A problem for
905 be autocalled as foo([1]) if foo were callable. A problem for
901 things which are both callable and implement __getitem__.
906 things which are both callable and implement __getitem__.
902 (init_readline): Fix autoindentation for win32. Thanks to a patch
907 (init_readline): Fix autoindentation for win32. Thanks to a patch
903 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
908 by Vivian De Smedt <vivian-AT-vdesmedt.com>.
904
909
905 2005-02-12 Fernando Perez <fperez@colorado.edu>
910 2005-02-12 Fernando Perez <fperez@colorado.edu>
906
911
907 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
912 * IPython/ipmaker.py (make_IPython): Disabled the stout traps
908 which I had written long ago to sort out user error messages which
913 which I had written long ago to sort out user error messages which
909 may occur during startup. This seemed like a good idea initially,
914 may occur during startup. This seemed like a good idea initially,
910 but it has proven a disaster in retrospect. I don't want to
915 but it has proven a disaster in retrospect. I don't want to
911 change much code for now, so my fix is to set the internal 'debug'
916 change much code for now, so my fix is to set the internal 'debug'
912 flag to true everywhere, whose only job was precisely to control
917 flag to true everywhere, whose only job was precisely to control
913 this subsystem. This closes issue 28 (as well as avoiding all
918 this subsystem. This closes issue 28 (as well as avoiding all
914 sorts of strange hangups which occur from time to time).
919 sorts of strange hangups which occur from time to time).
915
920
916 2005-02-07 Fernando Perez <fperez@colorado.edu>
921 2005-02-07 Fernando Perez <fperez@colorado.edu>
917
922
918 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
923 * IPython/Magic.py (magic_edit): Fix 'ed -p' not working when the
919 previous call produced a syntax error.
924 previous call produced a syntax error.
920
925
921 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
926 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
922 classes without constructor.
927 classes without constructor.
923
928
924 2005-02-06 Fernando Perez <fperez@colorado.edu>
929 2005-02-06 Fernando Perez <fperez@colorado.edu>
925
930
926 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
931 * IPython/iplib.py (MagicCompleter.complete): Extend the list of
927 completions with the results of each matcher, so we return results
932 completions with the results of each matcher, so we return results
928 to the user from all namespaces. This breaks with ipython
933 to the user from all namespaces. This breaks with ipython
929 tradition, but I think it's a nicer behavior. Now you get all
934 tradition, but I think it's a nicer behavior. Now you get all
930 possible completions listed, from all possible namespaces (python,
935 possible completions listed, from all possible namespaces (python,
931 filesystem, magics...) After a request by John Hunter
936 filesystem, magics...) After a request by John Hunter
932 <jdhunter-AT-nitace.bsd.uchicago.edu>.
937 <jdhunter-AT-nitace.bsd.uchicago.edu>.
933
938
934 2005-02-05 Fernando Perez <fperez@colorado.edu>
939 2005-02-05 Fernando Perez <fperez@colorado.edu>
935
940
936 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
941 * IPython/Magic.py (magic_prun): Fix bug where prun would fail if
937 the call had quote characters in it (the quotes were stripped).
942 the call had quote characters in it (the quotes were stripped).
938
943
939 2005-01-31 Fernando Perez <fperez@colorado.edu>
944 2005-01-31 Fernando Perez <fperez@colorado.edu>
940
945
941 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
946 * IPython/iplib.py (InteractiveShell.__init__): reduce reliance on
942 Itpl.itpl() to make the code more robust against psyco
947 Itpl.itpl() to make the code more robust against psyco
943 optimizations.
948 optimizations.
944
949
945 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
950 * IPython/Itpl.py (Itpl.__str__): Use a _getframe() call instead
946 of causing an exception. Quicker, cleaner.
951 of causing an exception. Quicker, cleaner.
947
952
948 2005-01-28 Fernando Perez <fperez@colorado.edu>
953 2005-01-28 Fernando Perez <fperez@colorado.edu>
949
954
950 * scripts/ipython_win_post_install.py (install): hardcode
955 * scripts/ipython_win_post_install.py (install): hardcode
951 sys.prefix+'python.exe' as the executable path. It turns out that
956 sys.prefix+'python.exe' as the executable path. It turns out that
952 during the post-installation run, sys.executable resolves to the
957 during the post-installation run, sys.executable resolves to the
953 name of the binary installer! I should report this as a distutils
958 name of the binary installer! I should report this as a distutils
954 bug, I think. I updated the .10 release with this tiny fix, to
959 bug, I think. I updated the .10 release with this tiny fix, to
955 avoid annoying the lists further.
960 avoid annoying the lists further.
956
961
957 2005-01-27 *** Released version 0.6.10
962 2005-01-27 *** Released version 0.6.10
958
963
959 2005-01-27 Fernando Perez <fperez@colorado.edu>
964 2005-01-27 Fernando Perez <fperez@colorado.edu>
960
965
961 * IPython/numutils.py (norm): Added 'inf' as optional name for
966 * IPython/numutils.py (norm): Added 'inf' as optional name for
962 L-infinity norm, included references to mathworld.com for vector
967 L-infinity norm, included references to mathworld.com for vector
963 norm definitions.
968 norm definitions.
964 (amin/amax): added amin/amax for array min/max. Similar to what
969 (amin/amax): added amin/amax for array min/max. Similar to what
965 pylab ships with after the recent reorganization of names.
970 pylab ships with after the recent reorganization of names.
966 (spike/spike_odd): removed deprecated spike/spike_odd functions.
971 (spike/spike_odd): removed deprecated spike/spike_odd functions.
967
972
968 * ipython.el: committed Alex's recent fixes and improvements.
973 * ipython.el: committed Alex's recent fixes and improvements.
969 Tested with python-mode from CVS, and it looks excellent. Since
974 Tested with python-mode from CVS, and it looks excellent. Since
970 python-mode hasn't released anything in a while, I'm temporarily
975 python-mode hasn't released anything in a while, I'm temporarily
971 putting a copy of today's CVS (v 4.70) of python-mode in:
976 putting a copy of today's CVS (v 4.70) of python-mode in:
972 http://ipython.scipy.org/tmp/python-mode.el
977 http://ipython.scipy.org/tmp/python-mode.el
973
978
974 * scripts/ipython_win_post_install.py (install): Win32 fix to use
979 * scripts/ipython_win_post_install.py (install): Win32 fix to use
975 sys.executable for the executable name, instead of assuming it's
980 sys.executable for the executable name, instead of assuming it's
976 called 'python.exe' (the post-installer would have produced broken
981 called 'python.exe' (the post-installer would have produced broken
977 setups on systems with a differently named python binary).
982 setups on systems with a differently named python binary).
978
983
979 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
984 * IPython/PyColorize.py (Parser.__call__): change explicit '\n'
980 references to os.linesep, to make the code more
985 references to os.linesep, to make the code more
981 platform-independent. This is also part of the win32 coloring
986 platform-independent. This is also part of the win32 coloring
982 fixes.
987 fixes.
983
988
984 * IPython/genutils.py (page_dumb): Remove attempts to chop long
989 * IPython/genutils.py (page_dumb): Remove attempts to chop long
985 lines, which actually cause coloring bugs because the length of
990 lines, which actually cause coloring bugs because the length of
986 the line is very difficult to correctly compute with embedded
991 the line is very difficult to correctly compute with embedded
987 escapes. This was the source of all the coloring problems under
992 escapes. This was the source of all the coloring problems under
988 Win32. I think that _finally_, Win32 users have a properly
993 Win32. I think that _finally_, Win32 users have a properly
989 working ipython in all respects. This would never have happened
994 working ipython in all respects. This would never have happened
990 if not for Gary Bishop and Viktor Ransmayr's great help and work.
995 if not for Gary Bishop and Viktor Ransmayr's great help and work.
991
996
992 2005-01-26 *** Released version 0.6.9
997 2005-01-26 *** Released version 0.6.9
993
998
994 2005-01-25 Fernando Perez <fperez@colorado.edu>
999 2005-01-25 Fernando Perez <fperez@colorado.edu>
995
1000
996 * setup.py: finally, we have a true Windows installer, thanks to
1001 * setup.py: finally, we have a true Windows installer, thanks to
997 the excellent work of Viktor Ransmayr
1002 the excellent work of Viktor Ransmayr
998 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
1003 <viktor.ransmayr-AT-t-online.de>. The docs have been updated for
999 Windows users. The setup routine is quite a bit cleaner thanks to
1004 Windows users. The setup routine is quite a bit cleaner thanks to
1000 this, and the post-install script uses the proper functions to
1005 this, and the post-install script uses the proper functions to
1001 allow a clean de-installation using the standard Windows Control
1006 allow a clean de-installation using the standard Windows Control
1002 Panel.
1007 Panel.
1003
1008
1004 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1009 * IPython/genutils.py (get_home_dir): changed to use the $HOME
1005 environment variable under all OSes (including win32) if
1010 environment variable under all OSes (including win32) if
1006 available. This will give consistency to win32 users who have set
1011 available. This will give consistency to win32 users who have set
1007 this variable for any reason. If os.environ['HOME'] fails, the
1012 this variable for any reason. If os.environ['HOME'] fails, the
1008 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1013 previous policy of using HOMEDRIVE\HOMEPATH kicks in.
1009
1014
1010 2005-01-24 Fernando Perez <fperez@colorado.edu>
1015 2005-01-24 Fernando Perez <fperez@colorado.edu>
1011
1016
1012 * IPython/numutils.py (empty_like): add empty_like(), similar to
1017 * IPython/numutils.py (empty_like): add empty_like(), similar to
1013 zeros_like() but taking advantage of the new empty() Numeric routine.
1018 zeros_like() but taking advantage of the new empty() Numeric routine.
1014
1019
1015 2005-01-23 *** Released version 0.6.8
1020 2005-01-23 *** Released version 0.6.8
1016
1021
1017 2005-01-22 Fernando Perez <fperez@colorado.edu>
1022 2005-01-22 Fernando Perez <fperez@colorado.edu>
1018
1023
1019 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1024 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): I removed the
1020 automatic show() calls. After discussing things with JDH, it
1025 automatic show() calls. After discussing things with JDH, it
1021 turns out there are too many corner cases where this can go wrong.
1026 turns out there are too many corner cases where this can go wrong.
1022 It's best not to try to be 'too smart', and simply have ipython
1027 It's best not to try to be 'too smart', and simply have ipython
1023 reproduce as much as possible the default behavior of a normal
1028 reproduce as much as possible the default behavior of a normal
1024 python shell.
1029 python shell.
1025
1030
1026 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1031 * IPython/iplib.py (InteractiveShell.__init__): Modified the
1027 line-splitting regexp and _prefilter() to avoid calling getattr()
1032 line-splitting regexp and _prefilter() to avoid calling getattr()
1028 on assignments. This closes
1033 on assignments. This closes
1029 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1034 http://www.scipy.net/roundup/ipython/issue24. Note that Python's
1030 readline uses getattr(), so a simple <TAB> keypress is still
1035 readline uses getattr(), so a simple <TAB> keypress is still
1031 enough to trigger getattr() calls on an object.
1036 enough to trigger getattr() calls on an object.
1032
1037
1033 2005-01-21 Fernando Perez <fperez@colorado.edu>
1038 2005-01-21 Fernando Perez <fperez@colorado.edu>
1034
1039
1035 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1040 * IPython/Shell.py (MatplotlibShellBase.magic_run): Fix the %run
1036 docstring under pylab so it doesn't mask the original.
1041 docstring under pylab so it doesn't mask the original.
1037
1042
1038 2005-01-21 *** Released version 0.6.7
1043 2005-01-21 *** Released version 0.6.7
1039
1044
1040 2005-01-21 Fernando Perez <fperez@colorado.edu>
1045 2005-01-21 Fernando Perez <fperez@colorado.edu>
1041
1046
1042 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
1047 * IPython/Shell.py (MTInteractiveShell.runcode): Trap a crash with
1043 signal handling for win32 users in multithreaded mode.
1048 signal handling for win32 users in multithreaded mode.
1044
1049
1045 2005-01-17 Fernando Perez <fperez@colorado.edu>
1050 2005-01-17 Fernando Perez <fperez@colorado.edu>
1046
1051
1047 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1052 * IPython/OInspect.py (Inspector.pinfo): Fix crash when inspecting
1048 instances with no __init__. After a crash report by Norbert Nemec
1053 instances with no __init__. After a crash report by Norbert Nemec
1049 <Norbert-AT-nemec-online.de>.
1054 <Norbert-AT-nemec-online.de>.
1050
1055
1051 2005-01-14 Fernando Perez <fperez@colorado.edu>
1056 2005-01-14 Fernando Perez <fperez@colorado.edu>
1052
1057
1053 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
1058 * IPython/ultraTB.py (VerboseTB.text): Fix bug in reporting of
1054 names for verbose exceptions, when multiple dotted names and the
1059 names for verbose exceptions, when multiple dotted names and the
1055 'parent' object were present on the same line.
1060 'parent' object were present on the same line.
1056
1061
1057 2005-01-11 Fernando Perez <fperez@colorado.edu>
1062 2005-01-11 Fernando Perez <fperez@colorado.edu>
1058
1063
1059 * IPython/genutils.py (flag_calls): new utility to trap and flag
1064 * IPython/genutils.py (flag_calls): new utility to trap and flag
1060 calls in functions. I need it to clean up matplotlib support.
1065 calls in functions. I need it to clean up matplotlib support.
1061 Also removed some deprecated code in genutils.
1066 Also removed some deprecated code in genutils.
1062
1067
1063 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
1068 * IPython/Shell.py (MatplotlibShellBase.mplot_exec): small fix so
1064 that matplotlib scripts called with %run, which don't call show()
1069 that matplotlib scripts called with %run, which don't call show()
1065 themselves, still have their plotting windows open.
1070 themselves, still have their plotting windows open.
1066
1071
1067 2005-01-05 Fernando Perez <fperez@colorado.edu>
1072 2005-01-05 Fernando Perez <fperez@colorado.edu>
1068
1073
1069 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1074 * IPython/Shell.py (IPShellGTK.__init__): Patch by Andrew Straw
1070 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1075 <astraw-AT-caltech.edu>, to fix gtk deprecation warnings.
1071
1076
1072 2004-12-19 Fernando Perez <fperez@colorado.edu>
1077 2004-12-19 Fernando Perez <fperez@colorado.edu>
1073
1078
1074 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1079 * IPython/Shell.py (MTInteractiveShell.runcode): Get rid of
1075 parent_runcode, which was an eyesore. The same result can be
1080 parent_runcode, which was an eyesore. The same result can be
1076 obtained with Python's regular superclass mechanisms.
1081 obtained with Python's regular superclass mechanisms.
1077
1082
1078 2004-12-17 Fernando Perez <fperez@colorado.edu>
1083 2004-12-17 Fernando Perez <fperez@colorado.edu>
1079
1084
1080 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1085 * IPython/Magic.py (Magic.magic_sc): Fix quote stripping problem
1081 reported by Prabhu.
1086 reported by Prabhu.
1082 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1087 (Magic.magic_sx): direct all errors to Term.cerr (defaults to
1083 sys.stderr) instead of explicitly calling sys.stderr. This helps
1088 sys.stderr) instead of explicitly calling sys.stderr. This helps
1084 maintain our I/O abstractions clean, for future GUI embeddings.
1089 maintain our I/O abstractions clean, for future GUI embeddings.
1085
1090
1086 * IPython/genutils.py (info): added new utility for sys.stderr
1091 * IPython/genutils.py (info): added new utility for sys.stderr
1087 unified info message handling (thin wrapper around warn()).
1092 unified info message handling (thin wrapper around warn()).
1088
1093
1089 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1094 * IPython/ultraTB.py (VerboseTB.text): Fix misreported global
1090 composite (dotted) names on verbose exceptions.
1095 composite (dotted) names on verbose exceptions.
1091 (VerboseTB.nullrepr): harden against another kind of errors which
1096 (VerboseTB.nullrepr): harden against another kind of errors which
1092 Python's inspect module can trigger, and which were crashing
1097 Python's inspect module can trigger, and which were crashing
1093 IPython. Thanks to a report by Marco Lombardi
1098 IPython. Thanks to a report by Marco Lombardi
1094 <mlombard-AT-ma010192.hq.eso.org>.
1099 <mlombard-AT-ma010192.hq.eso.org>.
1095
1100
1096 2004-12-13 *** Released version 0.6.6
1101 2004-12-13 *** Released version 0.6.6
1097
1102
1098 2004-12-12 Fernando Perez <fperez@colorado.edu>
1103 2004-12-12 Fernando Perez <fperez@colorado.edu>
1099
1104
1100 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1105 * IPython/Shell.py (IPShellGTK.mainloop): catch RuntimeErrors
1101 generated by pygtk upon initialization if it was built without
1106 generated by pygtk upon initialization if it was built without
1102 threads (for matplotlib users). After a crash reported by
1107 threads (for matplotlib users). After a crash reported by
1103 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1108 Leguijt, Jaap J SIEP-EPT-RES <Jaap.Leguijt-AT-shell.com>.
1104
1109
1105 * IPython/ipmaker.py (make_IPython): fix small bug in the
1110 * IPython/ipmaker.py (make_IPython): fix small bug in the
1106 import_some parameter for multiple imports.
1111 import_some parameter for multiple imports.
1107
1112
1108 * IPython/iplib.py (ipmagic): simplified the interface of
1113 * IPython/iplib.py (ipmagic): simplified the interface of
1109 ipmagic() to take a single string argument, just as it would be
1114 ipmagic() to take a single string argument, just as it would be
1110 typed at the IPython cmd line.
1115 typed at the IPython cmd line.
1111 (ipalias): Added new ipalias() with an interface identical to
1116 (ipalias): Added new ipalias() with an interface identical to
1112 ipmagic(). This completes exposing a pure python interface to the
1117 ipmagic(). This completes exposing a pure python interface to the
1113 alias and magic system, which can be used in loops or more complex
1118 alias and magic system, which can be used in loops or more complex
1114 code where IPython's automatic line mangling is not active.
1119 code where IPython's automatic line mangling is not active.
1115
1120
1116 * IPython/genutils.py (timing): changed interface of timing to
1121 * IPython/genutils.py (timing): changed interface of timing to
1117 simply run code once, which is the most common case. timings()
1122 simply run code once, which is the most common case. timings()
1118 remains unchanged, for the cases where you want multiple runs.
1123 remains unchanged, for the cases where you want multiple runs.
1119
1124
1120 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1125 * IPython/Shell.py (MatplotlibShellBase._matplotlib_config): Fix a
1121 bug where Python2.2 crashes with exec'ing code which does not end
1126 bug where Python2.2 crashes with exec'ing code which does not end
1122 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1127 in a single newline. Python 2.3 is OK, so I hadn't noticed this
1123 before.
1128 before.
1124
1129
1125 2004-12-10 Fernando Perez <fperez@colorado.edu>
1130 2004-12-10 Fernando Perez <fperez@colorado.edu>
1126
1131
1127 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1132 * IPython/Magic.py (Magic.magic_prun): changed name of option from
1128 -t to -T, to accomodate the new -t flag in %run (the %run and
1133 -t to -T, to accomodate the new -t flag in %run (the %run and
1129 %prun options are kind of intermixed, and it's not easy to change
1134 %prun options are kind of intermixed, and it's not easy to change
1130 this with the limitations of python's getopt).
1135 this with the limitations of python's getopt).
1131
1136
1132 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1137 * IPython/Magic.py (Magic.magic_run): Added new -t option to time
1133 the execution of scripts. It's not as fine-tuned as timeit.py,
1138 the execution of scripts. It's not as fine-tuned as timeit.py,
1134 but it works from inside ipython (and under 2.2, which lacks
1139 but it works from inside ipython (and under 2.2, which lacks
1135 timeit.py). Optionally a number of runs > 1 can be given for
1140 timeit.py). Optionally a number of runs > 1 can be given for
1136 timing very short-running code.
1141 timing very short-running code.
1137
1142
1138 * IPython/genutils.py (uniq_stable): new routine which returns a
1143 * IPython/genutils.py (uniq_stable): new routine which returns a
1139 list of unique elements in any iterable, but in stable order of
1144 list of unique elements in any iterable, but in stable order of
1140 appearance. I needed this for the ultraTB fixes, and it's a handy
1145 appearance. I needed this for the ultraTB fixes, and it's a handy
1141 utility.
1146 utility.
1142
1147
1143 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1148 * IPython/ultraTB.py (VerboseTB.text): Fix proper reporting of
1144 dotted names in Verbose exceptions. This had been broken since
1149 dotted names in Verbose exceptions. This had been broken since
1145 the very start, now x.y will properly be printed in a Verbose
1150 the very start, now x.y will properly be printed in a Verbose
1146 traceback, instead of x being shown and y appearing always as an
1151 traceback, instead of x being shown and y appearing always as an
1147 'undefined global'. Getting this to work was a bit tricky,
1152 'undefined global'. Getting this to work was a bit tricky,
1148 because by default python tokenizers are stateless. Saved by
1153 because by default python tokenizers are stateless. Saved by
1149 python's ability to easily add a bit of state to an arbitrary
1154 python's ability to easily add a bit of state to an arbitrary
1150 function (without needing to build a full-blown callable object).
1155 function (without needing to build a full-blown callable object).
1151
1156
1152 Also big cleanup of this code, which had horrendous runtime
1157 Also big cleanup of this code, which had horrendous runtime
1153 lookups of zillions of attributes for colorization. Moved all
1158 lookups of zillions of attributes for colorization. Moved all
1154 this code into a few templates, which make it cleaner and quicker.
1159 this code into a few templates, which make it cleaner and quicker.
1155
1160
1156 Printout quality was also improved for Verbose exceptions: one
1161 Printout quality was also improved for Verbose exceptions: one
1157 variable per line, and memory addresses are printed (this can be
1162 variable per line, and memory addresses are printed (this can be
1158 quite handy in nasty debugging situations, which is what Verbose
1163 quite handy in nasty debugging situations, which is what Verbose
1159 is for).
1164 is for).
1160
1165
1161 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1166 * IPython/ipmaker.py (make_IPython): Do NOT execute files named in
1162 the command line as scripts to be loaded by embedded instances.
1167 the command line as scripts to be loaded by embedded instances.
1163 Doing so has the potential for an infinite recursion if there are
1168 Doing so has the potential for an infinite recursion if there are
1164 exceptions thrown in the process. This fixes a strange crash
1169 exceptions thrown in the process. This fixes a strange crash
1165 reported by Philippe MULLER <muller-AT-irit.fr>.
1170 reported by Philippe MULLER <muller-AT-irit.fr>.
1166
1171
1167 2004-12-09 Fernando Perez <fperez@colorado.edu>
1172 2004-12-09 Fernando Perez <fperez@colorado.edu>
1168
1173
1169 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1174 * IPython/Shell.py (MatplotlibShellBase.use): Change pylab support
1170 to reflect new names in matplotlib, which now expose the
1175 to reflect new names in matplotlib, which now expose the
1171 matlab-compatible interface via a pylab module instead of the
1176 matlab-compatible interface via a pylab module instead of the
1172 'matlab' name. The new code is backwards compatible, so users of
1177 'matlab' name. The new code is backwards compatible, so users of
1173 all matplotlib versions are OK. Patch by J. Hunter.
1178 all matplotlib versions are OK. Patch by J. Hunter.
1174
1179
1175 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1180 * IPython/OInspect.py (Inspector.pinfo): Add to object? printing
1176 of __init__ docstrings for instances (class docstrings are already
1181 of __init__ docstrings for instances (class docstrings are already
1177 automatically printed). Instances with customized docstrings
1182 automatically printed). Instances with customized docstrings
1178 (indep. of the class) are also recognized and all 3 separate
1183 (indep. of the class) are also recognized and all 3 separate
1179 docstrings are printed (instance, class, constructor). After some
1184 docstrings are printed (instance, class, constructor). After some
1180 comments/suggestions by J. Hunter.
1185 comments/suggestions by J. Hunter.
1181
1186
1182 2004-12-05 Fernando Perez <fperez@colorado.edu>
1187 2004-12-05 Fernando Perez <fperez@colorado.edu>
1183
1188
1184 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1189 * IPython/iplib.py (MagicCompleter.complete): Remove annoying
1185 warnings when tab-completion fails and triggers an exception.
1190 warnings when tab-completion fails and triggers an exception.
1186
1191
1187 2004-12-03 Fernando Perez <fperez@colorado.edu>
1192 2004-12-03 Fernando Perez <fperez@colorado.edu>
1188
1193
1189 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1194 * IPython/Magic.py (magic_prun): Fix bug where an exception would
1190 be triggered when using 'run -p'. An incorrect option flag was
1195 be triggered when using 'run -p'. An incorrect option flag was
1191 being set ('d' instead of 'D').
1196 being set ('d' instead of 'D').
1192 (manpage): fix missing escaped \- sign.
1197 (manpage): fix missing escaped \- sign.
1193
1198
1194 2004-11-30 *** Released version 0.6.5
1199 2004-11-30 *** Released version 0.6.5
1195
1200
1196 2004-11-30 Fernando Perez <fperez@colorado.edu>
1201 2004-11-30 Fernando Perez <fperez@colorado.edu>
1197
1202
1198 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1203 * IPython/Magic.py (Magic.magic_run): Fix bug in breakpoint
1199 setting with -d option.
1204 setting with -d option.
1200
1205
1201 * setup.py (docfiles): Fix problem where the doc glob I was using
1206 * setup.py (docfiles): Fix problem where the doc glob I was using
1202 was COMPLETELY BROKEN. It was giving the right files by pure
1207 was COMPLETELY BROKEN. It was giving the right files by pure
1203 accident, but failed once I tried to include ipython.el. Note:
1208 accident, but failed once I tried to include ipython.el. Note:
1204 glob() does NOT allow you to do exclusion on multiple endings!
1209 glob() does NOT allow you to do exclusion on multiple endings!
1205
1210
1206 2004-11-29 Fernando Perez <fperez@colorado.edu>
1211 2004-11-29 Fernando Perez <fperez@colorado.edu>
1207
1212
1208 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1213 * IPython/usage.py (__doc__): cleaned up usage docstring, by using
1209 the manpage as the source. Better formatting & consistency.
1214 the manpage as the source. Better formatting & consistency.
1210
1215
1211 * IPython/Magic.py (magic_run): Added new -d option, to run
1216 * IPython/Magic.py (magic_run): Added new -d option, to run
1212 scripts under the control of the python pdb debugger. Note that
1217 scripts under the control of the python pdb debugger. Note that
1213 this required changing the %prun option -d to -D, to avoid a clash
1218 this required changing the %prun option -d to -D, to avoid a clash
1214 (since %run must pass options to %prun, and getopt is too dumb to
1219 (since %run must pass options to %prun, and getopt is too dumb to
1215 handle options with string values with embedded spaces). Thanks
1220 handle options with string values with embedded spaces). Thanks
1216 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1221 to a suggestion by Matthew Arnison <maffew-AT-cat.org.au>.
1217 (magic_who_ls): added type matching to %who and %whos, so that one
1222 (magic_who_ls): added type matching to %who and %whos, so that one
1218 can filter their output to only include variables of certain
1223 can filter their output to only include variables of certain
1219 types. Another suggestion by Matthew.
1224 types. Another suggestion by Matthew.
1220 (magic_whos): Added memory summaries in kb and Mb for arrays.
1225 (magic_whos): Added memory summaries in kb and Mb for arrays.
1221 (magic_who): Improve formatting (break lines every 9 vars).
1226 (magic_who): Improve formatting (break lines every 9 vars).
1222
1227
1223 2004-11-28 Fernando Perez <fperez@colorado.edu>
1228 2004-11-28 Fernando Perez <fperez@colorado.edu>
1224
1229
1225 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1230 * IPython/Logger.py (Logger.log): Fix bug in syncing the input
1226 cache when empty lines were present.
1231 cache when empty lines were present.
1227
1232
1228 2004-11-24 Fernando Perez <fperez@colorado.edu>
1233 2004-11-24 Fernando Perez <fperez@colorado.edu>
1229
1234
1230 * IPython/usage.py (__doc__): document the re-activated threading
1235 * IPython/usage.py (__doc__): document the re-activated threading
1231 options for WX and GTK.
1236 options for WX and GTK.
1232
1237
1233 2004-11-23 Fernando Perez <fperez@colorado.edu>
1238 2004-11-23 Fernando Perez <fperez@colorado.edu>
1234
1239
1235 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1240 * IPython/Shell.py (start): Added Prabhu's big patch to reactivate
1236 the -wthread and -gthread options, along with a new -tk one to try
1241 the -wthread and -gthread options, along with a new -tk one to try
1237 and coordinate Tk threading with wx/gtk. The tk support is very
1242 and coordinate Tk threading with wx/gtk. The tk support is very
1238 platform dependent, since it seems to require Tcl and Tk to be
1243 platform dependent, since it seems to require Tcl and Tk to be
1239 built with threads (Fedora1/2 appears NOT to have it, but in
1244 built with threads (Fedora1/2 appears NOT to have it, but in
1240 Prabhu's Debian boxes it works OK). But even with some Tk
1245 Prabhu's Debian boxes it works OK). But even with some Tk
1241 limitations, this is a great improvement.
1246 limitations, this is a great improvement.
1242
1247
1243 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1248 * IPython/Prompts.py (prompt_specials_color): Added \t for time
1244 info in user prompts. Patch by Prabhu.
1249 info in user prompts. Patch by Prabhu.
1245
1250
1246 2004-11-18 Fernando Perez <fperez@colorado.edu>
1251 2004-11-18 Fernando Perez <fperez@colorado.edu>
1247
1252
1248 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1253 * IPython/genutils.py (ask_yes_no): Add check for a max of 20
1249 EOFErrors and bail, to avoid infinite loops if a non-terminating
1254 EOFErrors and bail, to avoid infinite loops if a non-terminating
1250 file is fed into ipython. Patch submitted in issue 19 by user,
1255 file is fed into ipython. Patch submitted in issue 19 by user,
1251 many thanks.
1256 many thanks.
1252
1257
1253 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1258 * IPython/iplib.py (InteractiveShell.handle_auto): do NOT trigger
1254 autoquote/parens in continuation prompts, which can cause lots of
1259 autoquote/parens in continuation prompts, which can cause lots of
1255 problems. Closes roundup issue 20.
1260 problems. Closes roundup issue 20.
1256
1261
1257 2004-11-17 Fernando Perez <fperez@colorado.edu>
1262 2004-11-17 Fernando Perez <fperez@colorado.edu>
1258
1263
1259 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1264 * debian/control (Build-Depends-Indep): Fix dpatch dependency,
1260 reported as debian bug #280505. I'm not sure my local changelog
1265 reported as debian bug #280505. I'm not sure my local changelog
1261 entry has the proper debian format (Jack?).
1266 entry has the proper debian format (Jack?).
1262
1267
1263 2004-11-08 *** Released version 0.6.4
1268 2004-11-08 *** Released version 0.6.4
1264
1269
1265 2004-11-08 Fernando Perez <fperez@colorado.edu>
1270 2004-11-08 Fernando Perez <fperez@colorado.edu>
1266
1271
1267 * IPython/iplib.py (init_readline): Fix exit message for Windows
1272 * IPython/iplib.py (init_readline): Fix exit message for Windows
1268 when readline is active. Thanks to a report by Eric Jones
1273 when readline is active. Thanks to a report by Eric Jones
1269 <eric-AT-enthought.com>.
1274 <eric-AT-enthought.com>.
1270
1275
1271 2004-11-07 Fernando Perez <fperez@colorado.edu>
1276 2004-11-07 Fernando Perez <fperez@colorado.edu>
1272
1277
1273 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1278 * IPython/genutils.py (page): Add a trap for OSError exceptions,
1274 sometimes seen by win2k/cygwin users.
1279 sometimes seen by win2k/cygwin users.
1275
1280
1276 2004-11-06 Fernando Perez <fperez@colorado.edu>
1281 2004-11-06 Fernando Perez <fperez@colorado.edu>
1277
1282
1278 * IPython/iplib.py (interact): Change the handling of %Exit from
1283 * IPython/iplib.py (interact): Change the handling of %Exit from
1279 trying to propagate a SystemExit to an internal ipython flag.
1284 trying to propagate a SystemExit to an internal ipython flag.
1280 This is less elegant than using Python's exception mechanism, but
1285 This is less elegant than using Python's exception mechanism, but
1281 I can't get that to work reliably with threads, so under -pylab
1286 I can't get that to work reliably with threads, so under -pylab
1282 %Exit was hanging IPython. Cross-thread exception handling is
1287 %Exit was hanging IPython. Cross-thread exception handling is
1283 really a bitch. Thaks to a bug report by Stephen Walton
1288 really a bitch. Thaks to a bug report by Stephen Walton
1284 <stephen.walton-AT-csun.edu>.
1289 <stephen.walton-AT-csun.edu>.
1285
1290
1286 2004-11-04 Fernando Perez <fperez@colorado.edu>
1291 2004-11-04 Fernando Perez <fperez@colorado.edu>
1287
1292
1288 * IPython/iplib.py (raw_input_original): store a pointer to the
1293 * IPython/iplib.py (raw_input_original): store a pointer to the
1289 true raw_input to harden against code which can modify it
1294 true raw_input to harden against code which can modify it
1290 (wx.py.PyShell does this and would otherwise crash ipython).
1295 (wx.py.PyShell does this and would otherwise crash ipython).
1291 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1296 Thanks to a bug report by Jim Flowers <james.flowers-AT-lgx.com>.
1292
1297
1293 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1298 * IPython/Shell.py (MTInteractiveShell.runsource): Cleaner fix for
1294 Ctrl-C problem, which does not mess up the input line.
1299 Ctrl-C problem, which does not mess up the input line.
1295
1300
1296 2004-11-03 Fernando Perez <fperez@colorado.edu>
1301 2004-11-03 Fernando Perez <fperez@colorado.edu>
1297
1302
1298 * IPython/Release.py: Changed licensing to BSD, in all files.
1303 * IPython/Release.py: Changed licensing to BSD, in all files.
1299 (name): lowercase name for tarball/RPM release.
1304 (name): lowercase name for tarball/RPM release.
1300
1305
1301 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1306 * IPython/OInspect.py (getdoc): wrap inspect.getdoc() safely for
1302 use throughout ipython.
1307 use throughout ipython.
1303
1308
1304 * IPython/Magic.py (Magic._ofind): Switch to using the new
1309 * IPython/Magic.py (Magic._ofind): Switch to using the new
1305 OInspect.getdoc() function.
1310 OInspect.getdoc() function.
1306
1311
1307 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1312 * IPython/Shell.py (sigint_handler): Hack to ignore the execution
1308 of the line currently being canceled via Ctrl-C. It's extremely
1313 of the line currently being canceled via Ctrl-C. It's extremely
1309 ugly, but I don't know how to do it better (the problem is one of
1314 ugly, but I don't know how to do it better (the problem is one of
1310 handling cross-thread exceptions).
1315 handling cross-thread exceptions).
1311
1316
1312 2004-10-28 Fernando Perez <fperez@colorado.edu>
1317 2004-10-28 Fernando Perez <fperez@colorado.edu>
1313
1318
1314 * IPython/Shell.py (signal_handler): add signal handlers to trap
1319 * IPython/Shell.py (signal_handler): add signal handlers to trap
1315 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1320 SIGINT and SIGSEGV in threaded code properly. Thanks to a bug
1316 report by Francesc Alted.
1321 report by Francesc Alted.
1317
1322
1318 2004-10-21 Fernando Perez <fperez@colorado.edu>
1323 2004-10-21 Fernando Perez <fperez@colorado.edu>
1319
1324
1320 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1325 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Fix @
1321 to % for pysh syntax extensions.
1326 to % for pysh syntax extensions.
1322
1327
1323 2004-10-09 Fernando Perez <fperez@colorado.edu>
1328 2004-10-09 Fernando Perez <fperez@colorado.edu>
1324
1329
1325 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1330 * IPython/Magic.py (Magic.magic_whos): modify output of Numeric
1326 arrays to print a more useful summary, without calling str(arr).
1331 arrays to print a more useful summary, without calling str(arr).
1327 This avoids the problem of extremely lengthy computations which
1332 This avoids the problem of extremely lengthy computations which
1328 occur if arr is large, and appear to the user as a system lockup
1333 occur if arr is large, and appear to the user as a system lockup
1329 with 100% cpu activity. After a suggestion by Kristian Sandberg
1334 with 100% cpu activity. After a suggestion by Kristian Sandberg
1330 <Kristian.Sandberg@colorado.edu>.
1335 <Kristian.Sandberg@colorado.edu>.
1331 (Magic.__init__): fix bug in global magic escapes not being
1336 (Magic.__init__): fix bug in global magic escapes not being
1332 correctly set.
1337 correctly set.
1333
1338
1334 2004-10-08 Fernando Perez <fperez@colorado.edu>
1339 2004-10-08 Fernando Perez <fperez@colorado.edu>
1335
1340
1336 * IPython/Magic.py (__license__): change to absolute imports of
1341 * IPython/Magic.py (__license__): change to absolute imports of
1337 ipython's own internal packages, to start adapting to the absolute
1342 ipython's own internal packages, to start adapting to the absolute
1338 import requirement of PEP-328.
1343 import requirement of PEP-328.
1339
1344
1340 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1345 * IPython/genutils.py (__author__): Fix coding to utf-8 on all
1341 files, and standardize author/license marks through the Release
1346 files, and standardize author/license marks through the Release
1342 module instead of having per/file stuff (except for files with
1347 module instead of having per/file stuff (except for files with
1343 particular licenses, like the MIT/PSF-licensed codes).
1348 particular licenses, like the MIT/PSF-licensed codes).
1344
1349
1345 * IPython/Debugger.py: remove dead code for python 2.1
1350 * IPython/Debugger.py: remove dead code for python 2.1
1346
1351
1347 2004-10-04 Fernando Perez <fperez@colorado.edu>
1352 2004-10-04 Fernando Perez <fperez@colorado.edu>
1348
1353
1349 * IPython/iplib.py (ipmagic): New function for accessing magics
1354 * IPython/iplib.py (ipmagic): New function for accessing magics
1350 via a normal python function call.
1355 via a normal python function call.
1351
1356
1352 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1357 * IPython/Magic.py (Magic.magic_magic): Change the magic escape
1353 from '@' to '%', to accomodate the new @decorator syntax of python
1358 from '@' to '%', to accomodate the new @decorator syntax of python
1354 2.4.
1359 2.4.
1355
1360
1356 2004-09-29 Fernando Perez <fperez@colorado.edu>
1361 2004-09-29 Fernando Perez <fperez@colorado.edu>
1357
1362
1358 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1363 * IPython/Shell.py (MatplotlibShellBase.use): Added a wrapper to
1359 matplotlib.use to prevent running scripts which try to switch
1364 matplotlib.use to prevent running scripts which try to switch
1360 interactive backends from within ipython. This will just crash
1365 interactive backends from within ipython. This will just crash
1361 the python interpreter, so we can't allow it (but a detailed error
1366 the python interpreter, so we can't allow it (but a detailed error
1362 is given to the user).
1367 is given to the user).
1363
1368
1364 2004-09-28 Fernando Perez <fperez@colorado.edu>
1369 2004-09-28 Fernando Perez <fperez@colorado.edu>
1365
1370
1366 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1371 * IPython/Shell.py (MatplotlibShellBase.mplot_exec):
1367 matplotlib-related fixes so that using @run with non-matplotlib
1372 matplotlib-related fixes so that using @run with non-matplotlib
1368 scripts doesn't pop up spurious plot windows. This requires
1373 scripts doesn't pop up spurious plot windows. This requires
1369 matplotlib >= 0.63, where I had to make some changes as well.
1374 matplotlib >= 0.63, where I had to make some changes as well.
1370
1375
1371 * IPython/ipmaker.py (make_IPython): update version requirement to
1376 * IPython/ipmaker.py (make_IPython): update version requirement to
1372 python 2.2.
1377 python 2.2.
1373
1378
1374 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1379 * IPython/iplib.py (InteractiveShell.mainloop): Add an optional
1375 banner arg for embedded customization.
1380 banner arg for embedded customization.
1376
1381
1377 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1382 * IPython/Magic.py (Magic.__init__): big cleanup to remove all
1378 explicit uses of __IP as the IPython's instance name. Now things
1383 explicit uses of __IP as the IPython's instance name. Now things
1379 are properly handled via the shell.name value. The actual code
1384 are properly handled via the shell.name value. The actual code
1380 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1385 is a bit ugly b/c I'm doing it via a global in Magic.py, but this
1381 is much better than before. I'll clean things completely when the
1386 is much better than before. I'll clean things completely when the
1382 magic stuff gets a real overhaul.
1387 magic stuff gets a real overhaul.
1383
1388
1384 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1389 * ipython.1: small fixes, sent in by Jack Moffit. He also sent in
1385 minor changes to debian dir.
1390 minor changes to debian dir.
1386
1391
1387 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1392 * IPython/iplib.py (InteractiveShell.__init__): Fix adding a
1388 pointer to the shell itself in the interactive namespace even when
1393 pointer to the shell itself in the interactive namespace even when
1389 a user-supplied dict is provided. This is needed for embedding
1394 a user-supplied dict is provided. This is needed for embedding
1390 purposes (found by tests with Michel Sanner).
1395 purposes (found by tests with Michel Sanner).
1391
1396
1392 2004-09-27 Fernando Perez <fperez@colorado.edu>
1397 2004-09-27 Fernando Perez <fperez@colorado.edu>
1393
1398
1394 * IPython/UserConfig/ipythonrc: remove []{} from
1399 * IPython/UserConfig/ipythonrc: remove []{} from
1395 readline_remove_delims, so that things like [modname.<TAB> do
1400 readline_remove_delims, so that things like [modname.<TAB> do
1396 proper completion. This disables [].TAB, but that's a less common
1401 proper completion. This disables [].TAB, but that's a less common
1397 case than module names in list comprehensions, for example.
1402 case than module names in list comprehensions, for example.
1398 Thanks to a report by Andrea Riciputi.
1403 Thanks to a report by Andrea Riciputi.
1399
1404
1400 2004-09-09 Fernando Perez <fperez@colorado.edu>
1405 2004-09-09 Fernando Perez <fperez@colorado.edu>
1401
1406
1402 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1407 * IPython/Shell.py (IPShellGTK.mainloop): reorder to avoid
1403 blocking problems in win32 and osx. Fix by John.
1408 blocking problems in win32 and osx. Fix by John.
1404
1409
1405 2004-09-08 Fernando Perez <fperez@colorado.edu>
1410 2004-09-08 Fernando Perez <fperez@colorado.edu>
1406
1411
1407 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1412 * IPython/Shell.py (IPShellWX.OnInit): Fix output redirection bug
1408 for Win32 and OSX. Fix by John Hunter.
1413 for Win32 and OSX. Fix by John Hunter.
1409
1414
1410 2004-08-30 *** Released version 0.6.3
1415 2004-08-30 *** Released version 0.6.3
1411
1416
1412 2004-08-30 Fernando Perez <fperez@colorado.edu>
1417 2004-08-30 Fernando Perez <fperez@colorado.edu>
1413
1418
1414 * setup.py (isfile): Add manpages to list of dependent files to be
1419 * setup.py (isfile): Add manpages to list of dependent files to be
1415 updated.
1420 updated.
1416
1421
1417 2004-08-27 Fernando Perez <fperez@colorado.edu>
1422 2004-08-27 Fernando Perez <fperez@colorado.edu>
1418
1423
1419 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1424 * IPython/Shell.py (start): I've disabled -wthread and -gthread
1420 for now. They don't really work with standalone WX/GTK code
1425 for now. They don't really work with standalone WX/GTK code
1421 (though matplotlib IS working fine with both of those backends).
1426 (though matplotlib IS working fine with both of those backends).
1422 This will neeed much more testing. I disabled most things with
1427 This will neeed much more testing. I disabled most things with
1423 comments, so turning it back on later should be pretty easy.
1428 comments, so turning it back on later should be pretty easy.
1424
1429
1425 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1430 * IPython/iplib.py (InteractiveShell.__init__): Fix accidental
1426 autocalling of expressions like r'foo', by modifying the line
1431 autocalling of expressions like r'foo', by modifying the line
1427 split regexp. Closes
1432 split regexp. Closes
1428 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1433 http://www.scipy.net/roundup/ipython/issue18, reported by Nicholas
1429 Riley <ipythonbugs-AT-sabi.net>.
1434 Riley <ipythonbugs-AT-sabi.net>.
1430 (InteractiveShell.mainloop): honor --nobanner with banner
1435 (InteractiveShell.mainloop): honor --nobanner with banner
1431 extensions.
1436 extensions.
1432
1437
1433 * IPython/Shell.py: Significant refactoring of all classes, so
1438 * IPython/Shell.py: Significant refactoring of all classes, so
1434 that we can really support ALL matplotlib backends and threading
1439 that we can really support ALL matplotlib backends and threading
1435 models (John spotted a bug with Tk which required this). Now we
1440 models (John spotted a bug with Tk which required this). Now we
1436 should support single-threaded, WX-threads and GTK-threads, both
1441 should support single-threaded, WX-threads and GTK-threads, both
1437 for generic code and for matplotlib.
1442 for generic code and for matplotlib.
1438
1443
1439 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1444 * IPython/ipmaker.py (__call__): Changed -mpthread option to
1440 -pylab, to simplify things for users. Will also remove the pylab
1445 -pylab, to simplify things for users. Will also remove the pylab
1441 profile, since now all of matplotlib configuration is directly
1446 profile, since now all of matplotlib configuration is directly
1442 handled here. This also reduces startup time.
1447 handled here. This also reduces startup time.
1443
1448
1444 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1449 * IPython/Shell.py (IPShellGTK.run): Fixed bug where mainloop() of
1445 shell wasn't being correctly called. Also in IPShellWX.
1450 shell wasn't being correctly called. Also in IPShellWX.
1446
1451
1447 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1452 * IPython/iplib.py (InteractiveShell.__init__): Added option to
1448 fine-tune banner.
1453 fine-tune banner.
1449
1454
1450 * IPython/numutils.py (spike): Deprecate these spike functions,
1455 * IPython/numutils.py (spike): Deprecate these spike functions,
1451 delete (long deprecated) gnuplot_exec handler.
1456 delete (long deprecated) gnuplot_exec handler.
1452
1457
1453 2004-08-26 Fernando Perez <fperez@colorado.edu>
1458 2004-08-26 Fernando Perez <fperez@colorado.edu>
1454
1459
1455 * ipython.1: Update for threading options, plus some others which
1460 * ipython.1: Update for threading options, plus some others which
1456 were missing.
1461 were missing.
1457
1462
1458 * IPython/ipmaker.py (__call__): Added -wthread option for
1463 * IPython/ipmaker.py (__call__): Added -wthread option for
1459 wxpython thread handling. Make sure threading options are only
1464 wxpython thread handling. Make sure threading options are only
1460 valid at the command line.
1465 valid at the command line.
1461
1466
1462 * scripts/ipython: moved shell selection into a factory function
1467 * scripts/ipython: moved shell selection into a factory function
1463 in Shell.py, to keep the starter script to a minimum.
1468 in Shell.py, to keep the starter script to a minimum.
1464
1469
1465 2004-08-25 Fernando Perez <fperez@colorado.edu>
1470 2004-08-25 Fernando Perez <fperez@colorado.edu>
1466
1471
1467 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1472 * IPython/Shell.py (IPShellWX.wxexit): fixes to WX threading, by
1468 John. Along with some recent changes he made to matplotlib, the
1473 John. Along with some recent changes he made to matplotlib, the
1469 next versions of both systems should work very well together.
1474 next versions of both systems should work very well together.
1470
1475
1471 2004-08-24 Fernando Perez <fperez@colorado.edu>
1476 2004-08-24 Fernando Perez <fperez@colorado.edu>
1472
1477
1473 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1478 * IPython/Magic.py (Magic.magic_prun): cleanup some dead code. I
1474 tried to switch the profiling to using hotshot, but I'm getting
1479 tried to switch the profiling to using hotshot, but I'm getting
1475 strange errors from prof.runctx() there. I may be misreading the
1480 strange errors from prof.runctx() there. I may be misreading the
1476 docs, but it looks weird. For now the profiling code will
1481 docs, but it looks weird. For now the profiling code will
1477 continue to use the standard profiler.
1482 continue to use the standard profiler.
1478
1483
1479 2004-08-23 Fernando Perez <fperez@colorado.edu>
1484 2004-08-23 Fernando Perez <fperez@colorado.edu>
1480
1485
1481 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1486 * IPython/Shell.py (IPShellWX.__init__): Improvements to the WX
1482 threaded shell, by John Hunter. It's not quite ready yet, but
1487 threaded shell, by John Hunter. It's not quite ready yet, but
1483 close.
1488 close.
1484
1489
1485 2004-08-22 Fernando Perez <fperez@colorado.edu>
1490 2004-08-22 Fernando Perez <fperez@colorado.edu>
1486
1491
1487 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1492 * IPython/iplib.py (InteractiveShell.interact): tab cleanups, also
1488 in Magic and ultraTB.
1493 in Magic and ultraTB.
1489
1494
1490 * ipython.1: document threading options in manpage.
1495 * ipython.1: document threading options in manpage.
1491
1496
1492 * scripts/ipython: Changed name of -thread option to -gthread,
1497 * scripts/ipython: Changed name of -thread option to -gthread,
1493 since this is GTK specific. I want to leave the door open for a
1498 since this is GTK specific. I want to leave the door open for a
1494 -wthread option for WX, which will most likely be necessary. This
1499 -wthread option for WX, which will most likely be necessary. This
1495 change affects usage and ipmaker as well.
1500 change affects usage and ipmaker as well.
1496
1501
1497 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1502 * IPython/Shell.py (matplotlib_shell): Add a factory function to
1498 handle the matplotlib shell issues. Code by John Hunter
1503 handle the matplotlib shell issues. Code by John Hunter
1499 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1504 <jdhunter-AT-nitace.bsd.uchicago.edu>.
1500 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1505 (IPShellMatplotlibWX.__init__): Rudimentary WX support. It's
1501 broken (and disabled for end users) for now, but it puts the
1506 broken (and disabled for end users) for now, but it puts the
1502 infrastructure in place.
1507 infrastructure in place.
1503
1508
1504 2004-08-21 Fernando Perez <fperez@colorado.edu>
1509 2004-08-21 Fernando Perez <fperez@colorado.edu>
1505
1510
1506 * ipythonrc-pylab: Add matplotlib support.
1511 * ipythonrc-pylab: Add matplotlib support.
1507
1512
1508 * matplotlib_config.py: new files for matplotlib support, part of
1513 * matplotlib_config.py: new files for matplotlib support, part of
1509 the pylab profile.
1514 the pylab profile.
1510
1515
1511 * IPython/usage.py (__doc__): documented the threading options.
1516 * IPython/usage.py (__doc__): documented the threading options.
1512
1517
1513 2004-08-20 Fernando Perez <fperez@colorado.edu>
1518 2004-08-20 Fernando Perez <fperez@colorado.edu>
1514
1519
1515 * ipython: Modified the main calling routine to handle the -thread
1520 * ipython: Modified the main calling routine to handle the -thread
1516 and -mpthread options. This needs to be done as a top-level hack,
1521 and -mpthread options. This needs to be done as a top-level hack,
1517 because it determines which class to instantiate for IPython
1522 because it determines which class to instantiate for IPython
1518 itself.
1523 itself.
1519
1524
1520 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
1525 * IPython/Shell.py (MTInteractiveShell.__init__): New set of
1521 classes to support multithreaded GTK operation without blocking,
1526 classes to support multithreaded GTK operation without blocking,
1522 and matplotlib with all backends. This is a lot of still very
1527 and matplotlib with all backends. This is a lot of still very
1523 experimental code, and threads are tricky. So it may still have a
1528 experimental code, and threads are tricky. So it may still have a
1524 few rough edges... This code owes a lot to
1529 few rough edges... This code owes a lot to
1525 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
1530 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65109, by
1526 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
1531 Brian # McErlean and John Finlay, to Antoon Pardon for fixes, and
1527 to John Hunter for all the matplotlib work.
1532 to John Hunter for all the matplotlib work.
1528
1533
1529 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
1534 * IPython/ipmaker.py (__call__): Added -thread and -mpthread
1530 options for gtk thread and matplotlib support.
1535 options for gtk thread and matplotlib support.
1531
1536
1532 2004-08-16 Fernando Perez <fperez@colorado.edu>
1537 2004-08-16 Fernando Perez <fperez@colorado.edu>
1533
1538
1534 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
1539 * IPython/iplib.py (InteractiveShell.__init__): don't trigger
1535 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
1540 autocall for things like p*q,p/q,p+q,p-q, when p is callable. Bug
1536 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
1541 reported by Stephen Walton <stephen.walton-AT-csun.edu>.
1537
1542
1538 2004-08-11 Fernando Perez <fperez@colorado.edu>
1543 2004-08-11 Fernando Perez <fperez@colorado.edu>
1539
1544
1540 * setup.py (isfile): Fix build so documentation gets updated for
1545 * setup.py (isfile): Fix build so documentation gets updated for
1541 rpms (it was only done for .tgz builds).
1546 rpms (it was only done for .tgz builds).
1542
1547
1543 2004-08-10 Fernando Perez <fperez@colorado.edu>
1548 2004-08-10 Fernando Perez <fperez@colorado.edu>
1544
1549
1545 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
1550 * genutils.py (Term): Fix misspell of stdin stream (sin->cin).
1546
1551
1547 * iplib.py : Silence syntax error exceptions in tab-completion.
1552 * iplib.py : Silence syntax error exceptions in tab-completion.
1548
1553
1549 2004-08-05 Fernando Perez <fperez@colorado.edu>
1554 2004-08-05 Fernando Perez <fperez@colorado.edu>
1550
1555
1551 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
1556 * IPython/Prompts.py (Prompt2.set_colors): Fix incorrectly set
1552 'color off' mark for continuation prompts. This was causing long
1557 'color off' mark for continuation prompts. This was causing long
1553 continuation lines to mis-wrap.
1558 continuation lines to mis-wrap.
1554
1559
1555 2004-08-01 Fernando Perez <fperez@colorado.edu>
1560 2004-08-01 Fernando Perez <fperez@colorado.edu>
1556
1561
1557 * IPython/ipmaker.py (make_IPython): Allow the shell class used
1562 * IPython/ipmaker.py (make_IPython): Allow the shell class used
1558 for building ipython to be a parameter. All this is necessary
1563 for building ipython to be a parameter. All this is necessary
1559 right now to have a multithreaded version, but this insane
1564 right now to have a multithreaded version, but this insane
1560 non-design will be cleaned up soon. For now, it's a hack that
1565 non-design will be cleaned up soon. For now, it's a hack that
1561 works.
1566 works.
1562
1567
1563 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
1568 * IPython/Shell.py (IPShell.__init__): Stop using mutable default
1564 args in various places. No bugs so far, but it's a dangerous
1569 args in various places. No bugs so far, but it's a dangerous
1565 practice.
1570 practice.
1566
1571
1567 2004-07-31 Fernando Perez <fperez@colorado.edu>
1572 2004-07-31 Fernando Perez <fperez@colorado.edu>
1568
1573
1569 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
1574 * IPython/iplib.py (complete): ignore SyntaxError exceptions to
1570 fix completion of files with dots in their names under most
1575 fix completion of files with dots in their names under most
1571 profiles (pysh was OK because the completion order is different).
1576 profiles (pysh was OK because the completion order is different).
1572
1577
1573 2004-07-27 Fernando Perez <fperez@colorado.edu>
1578 2004-07-27 Fernando Perez <fperez@colorado.edu>
1574
1579
1575 * IPython/iplib.py (InteractiveShell.__init__): build dict of
1580 * IPython/iplib.py (InteractiveShell.__init__): build dict of
1576 keywords manually, b/c the one in keyword.py was removed in python
1581 keywords manually, b/c the one in keyword.py was removed in python
1577 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
1582 2.4. Patch by Anakim Border <aborder-AT-users.sourceforge.net>.
1578 This is NOT a bug under python 2.3 and earlier.
1583 This is NOT a bug under python 2.3 and earlier.
1579
1584
1580 2004-07-26 Fernando Perez <fperez@colorado.edu>
1585 2004-07-26 Fernando Perez <fperez@colorado.edu>
1581
1586
1582 * IPython/ultraTB.py (VerboseTB.text): Add another
1587 * IPython/ultraTB.py (VerboseTB.text): Add another
1583 linecache.checkcache() call to try to prevent inspect.py from
1588 linecache.checkcache() call to try to prevent inspect.py from
1584 crashing under python 2.3. I think this fixes
1589 crashing under python 2.3. I think this fixes
1585 http://www.scipy.net/roundup/ipython/issue17.
1590 http://www.scipy.net/roundup/ipython/issue17.
1586
1591
1587 2004-07-26 *** Released version 0.6.2
1592 2004-07-26 *** Released version 0.6.2
1588
1593
1589 2004-07-26 Fernando Perez <fperez@colorado.edu>
1594 2004-07-26 Fernando Perez <fperez@colorado.edu>
1590
1595
1591 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
1596 * IPython/Magic.py (Magic.magic_cd): Fix bug where 'cd -N' would
1592 fail for any number.
1597 fail for any number.
1593 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
1598 (Magic.magic_bookmark): Fix bug where 'bookmark -l' would fail for
1594 empty bookmarks.
1599 empty bookmarks.
1595
1600
1596 2004-07-26 *** Released version 0.6.1
1601 2004-07-26 *** Released version 0.6.1
1597
1602
1598 2004-07-26 Fernando Perez <fperez@colorado.edu>
1603 2004-07-26 Fernando Perez <fperez@colorado.edu>
1599
1604
1600 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
1605 * ipython_win_post_install.py (run): Added pysh shortcut for Windows.
1601
1606
1602 * IPython/iplib.py (protect_filename): Applied Ville's patch for
1607 * IPython/iplib.py (protect_filename): Applied Ville's patch for
1603 escaping '()[]{}' in filenames.
1608 escaping '()[]{}' in filenames.
1604
1609
1605 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
1610 * IPython/Magic.py (shlex_split): Fix handling of '*' and '?' for
1606 Python 2.2 users who lack a proper shlex.split.
1611 Python 2.2 users who lack a proper shlex.split.
1607
1612
1608 2004-07-19 Fernando Perez <fperez@colorado.edu>
1613 2004-07-19 Fernando Perez <fperez@colorado.edu>
1609
1614
1610 * IPython/iplib.py (InteractiveShell.init_readline): Add support
1615 * IPython/iplib.py (InteractiveShell.init_readline): Add support
1611 for reading readline's init file. I follow the normal chain:
1616 for reading readline's init file. I follow the normal chain:
1612 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
1617 $INPUTRC is honored, otherwise ~/.inputrc is used. Thanks to a
1613 report by Mike Heeter. This closes
1618 report by Mike Heeter. This closes
1614 http://www.scipy.net/roundup/ipython/issue16.
1619 http://www.scipy.net/roundup/ipython/issue16.
1615
1620
1616 2004-07-18 Fernando Perez <fperez@colorado.edu>
1621 2004-07-18 Fernando Perez <fperez@colorado.edu>
1617
1622
1618 * IPython/iplib.py (__init__): Add better handling of '\' under
1623 * IPython/iplib.py (__init__): Add better handling of '\' under
1619 Win32 for filenames. After a patch by Ville.
1624 Win32 for filenames. After a patch by Ville.
1620
1625
1621 2004-07-17 Fernando Perez <fperez@colorado.edu>
1626 2004-07-17 Fernando Perez <fperez@colorado.edu>
1622
1627
1623 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
1628 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
1624 autocalling would be triggered for 'foo is bar' if foo is
1629 autocalling would be triggered for 'foo is bar' if foo is
1625 callable. I also cleaned up the autocall detection code to use a
1630 callable. I also cleaned up the autocall detection code to use a
1626 regexp, which is faster. Bug reported by Alexander Schmolck.
1631 regexp, which is faster. Bug reported by Alexander Schmolck.
1627
1632
1628 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
1633 * IPython/Magic.py (Magic.magic_pinfo): Fix bug where strings with
1629 '?' in them would confuse the help system. Reported by Alex
1634 '?' in them would confuse the help system. Reported by Alex
1630 Schmolck.
1635 Schmolck.
1631
1636
1632 2004-07-16 Fernando Perez <fperez@colorado.edu>
1637 2004-07-16 Fernando Perez <fperez@colorado.edu>
1633
1638
1634 * IPython/GnuplotInteractive.py (__all__): added plot2.
1639 * IPython/GnuplotInteractive.py (__all__): added plot2.
1635
1640
1636 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
1641 * IPython/Gnuplot2.py (Gnuplot.plot2): added new function for
1637 plotting dictionaries, lists or tuples of 1d arrays.
1642 plotting dictionaries, lists or tuples of 1d arrays.
1638
1643
1639 * IPython/Magic.py (Magic.magic_hist): small clenaups and
1644 * IPython/Magic.py (Magic.magic_hist): small clenaups and
1640 optimizations.
1645 optimizations.
1641
1646
1642 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
1647 * IPython/iplib.py:Remove old Changelog info for cleanup. This is
1643 the information which was there from Janko's original IPP code:
1648 the information which was there from Janko's original IPP code:
1644
1649
1645 03.05.99 20:53 porto.ifm.uni-kiel.de
1650 03.05.99 20:53 porto.ifm.uni-kiel.de
1646 --Started changelog.
1651 --Started changelog.
1647 --make clear do what it say it does
1652 --make clear do what it say it does
1648 --added pretty output of lines from inputcache
1653 --added pretty output of lines from inputcache
1649 --Made Logger a mixin class, simplifies handling of switches
1654 --Made Logger a mixin class, simplifies handling of switches
1650 --Added own completer class. .string<TAB> expands to last history
1655 --Added own completer class. .string<TAB> expands to last history
1651 line which starts with string. The new expansion is also present
1656 line which starts with string. The new expansion is also present
1652 with Ctrl-r from the readline library. But this shows, who this
1657 with Ctrl-r from the readline library. But this shows, who this
1653 can be done for other cases.
1658 can be done for other cases.
1654 --Added convention that all shell functions should accept a
1659 --Added convention that all shell functions should accept a
1655 parameter_string This opens the door for different behaviour for
1660 parameter_string This opens the door for different behaviour for
1656 each function. @cd is a good example of this.
1661 each function. @cd is a good example of this.
1657
1662
1658 04.05.99 12:12 porto.ifm.uni-kiel.de
1663 04.05.99 12:12 porto.ifm.uni-kiel.de
1659 --added logfile rotation
1664 --added logfile rotation
1660 --added new mainloop method which freezes first the namespace
1665 --added new mainloop method which freezes first the namespace
1661
1666
1662 07.05.99 21:24 porto.ifm.uni-kiel.de
1667 07.05.99 21:24 porto.ifm.uni-kiel.de
1663 --added the docreader classes. Now there is a help system.
1668 --added the docreader classes. Now there is a help system.
1664 -This is only a first try. Currently it's not easy to put new
1669 -This is only a first try. Currently it's not easy to put new
1665 stuff in the indices. But this is the way to go. Info would be
1670 stuff in the indices. But this is the way to go. Info would be
1666 better, but HTML is every where and not everybody has an info
1671 better, but HTML is every where and not everybody has an info
1667 system installed and it's not so easy to change html-docs to info.
1672 system installed and it's not so easy to change html-docs to info.
1668 --added global logfile option
1673 --added global logfile option
1669 --there is now a hook for object inspection method pinfo needs to
1674 --there is now a hook for object inspection method pinfo needs to
1670 be provided for this. Can be reached by two '??'.
1675 be provided for this. Can be reached by two '??'.
1671
1676
1672 08.05.99 20:51 porto.ifm.uni-kiel.de
1677 08.05.99 20:51 porto.ifm.uni-kiel.de
1673 --added a README
1678 --added a README
1674 --bug in rc file. Something has changed so functions in the rc
1679 --bug in rc file. Something has changed so functions in the rc
1675 file need to reference the shell and not self. Not clear if it's a
1680 file need to reference the shell and not self. Not clear if it's a
1676 bug or feature.
1681 bug or feature.
1677 --changed rc file for new behavior
1682 --changed rc file for new behavior
1678
1683
1679 2004-07-15 Fernando Perez <fperez@colorado.edu>
1684 2004-07-15 Fernando Perez <fperez@colorado.edu>
1680
1685
1681 * IPython/Logger.py (Logger.log): fixed recent bug where the input
1686 * IPython/Logger.py (Logger.log): fixed recent bug where the input
1682 cache was falling out of sync in bizarre manners when multi-line
1687 cache was falling out of sync in bizarre manners when multi-line
1683 input was present. Minor optimizations and cleanup.
1688 input was present. Minor optimizations and cleanup.
1684
1689
1685 (Logger): Remove old Changelog info for cleanup. This is the
1690 (Logger): Remove old Changelog info for cleanup. This is the
1686 information which was there from Janko's original code:
1691 information which was there from Janko's original code:
1687
1692
1688 Changes to Logger: - made the default log filename a parameter
1693 Changes to Logger: - made the default log filename a parameter
1689
1694
1690 - put a check for lines beginning with !@? in log(). Needed
1695 - put a check for lines beginning with !@? in log(). Needed
1691 (even if the handlers properly log their lines) for mid-session
1696 (even if the handlers properly log their lines) for mid-session
1692 logging activation to work properly. Without this, lines logged
1697 logging activation to work properly. Without this, lines logged
1693 in mid session, which get read from the cache, would end up
1698 in mid session, which get read from the cache, would end up
1694 'bare' (with !@? in the open) in the log. Now they are caught
1699 'bare' (with !@? in the open) in the log. Now they are caught
1695 and prepended with a #.
1700 and prepended with a #.
1696
1701
1697 * IPython/iplib.py (InteractiveShell.init_readline): added check
1702 * IPython/iplib.py (InteractiveShell.init_readline): added check
1698 in case MagicCompleter fails to be defined, so we don't crash.
1703 in case MagicCompleter fails to be defined, so we don't crash.
1699
1704
1700 2004-07-13 Fernando Perez <fperez@colorado.edu>
1705 2004-07-13 Fernando Perez <fperez@colorado.edu>
1701
1706
1702 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
1707 * IPython/Gnuplot2.py (Gnuplot.hardcopy): add automatic generation
1703 of EPS if the requested filename ends in '.eps'.
1708 of EPS if the requested filename ends in '.eps'.
1704
1709
1705 2004-07-04 Fernando Perez <fperez@colorado.edu>
1710 2004-07-04 Fernando Perez <fperez@colorado.edu>
1706
1711
1707 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
1712 * IPython/iplib.py (InteractiveShell.handle_shell_escape): Fix
1708 escaping of quotes when calling the shell.
1713 escaping of quotes when calling the shell.
1709
1714
1710 2004-07-02 Fernando Perez <fperez@colorado.edu>
1715 2004-07-02 Fernando Perez <fperez@colorado.edu>
1711
1716
1712 * IPython/Prompts.py (CachedOutput.update): Fix problem with
1717 * IPython/Prompts.py (CachedOutput.update): Fix problem with
1713 gettext not working because we were clobbering '_'. Fixes
1718 gettext not working because we were clobbering '_'. Fixes
1714 http://www.scipy.net/roundup/ipython/issue6.
1719 http://www.scipy.net/roundup/ipython/issue6.
1715
1720
1716 2004-07-01 Fernando Perez <fperez@colorado.edu>
1721 2004-07-01 Fernando Perez <fperez@colorado.edu>
1717
1722
1718 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
1723 * IPython/Magic.py (Magic.magic_cd): integrated bookmark handling
1719 into @cd. Patch by Ville.
1724 into @cd. Patch by Ville.
1720
1725
1721 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1726 * IPython/iplib.py (InteractiveShell.post_config_initialization):
1722 new function to store things after ipmaker runs. Patch by Ville.
1727 new function to store things after ipmaker runs. Patch by Ville.
1723 Eventually this will go away once ipmaker is removed and the class
1728 Eventually this will go away once ipmaker is removed and the class
1724 gets cleaned up, but for now it's ok. Key functionality here is
1729 gets cleaned up, but for now it's ok. Key functionality here is
1725 the addition of the persistent storage mechanism, a dict for
1730 the addition of the persistent storage mechanism, a dict for
1726 keeping data across sessions (for now just bookmarks, but more can
1731 keeping data across sessions (for now just bookmarks, but more can
1727 be implemented later).
1732 be implemented later).
1728
1733
1729 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
1734 * IPython/Magic.py (Magic.magic_bookmark): New bookmark system,
1730 persistent across sections. Patch by Ville, I modified it
1735 persistent across sections. Patch by Ville, I modified it
1731 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
1736 soemwhat to allow bookmarking arbitrary dirs other than CWD. Also
1732 added a '-l' option to list all bookmarks.
1737 added a '-l' option to list all bookmarks.
1733
1738
1734 * IPython/iplib.py (InteractiveShell.atexit_operations): new
1739 * IPython/iplib.py (InteractiveShell.atexit_operations): new
1735 center for cleanup. Registered with atexit.register(). I moved
1740 center for cleanup. Registered with atexit.register(). I moved
1736 here the old exit_cleanup(). After a patch by Ville.
1741 here the old exit_cleanup(). After a patch by Ville.
1737
1742
1738 * IPython/Magic.py (get_py_filename): added '~' to the accepted
1743 * IPython/Magic.py (get_py_filename): added '~' to the accepted
1739 characters in the hacked shlex_split for python 2.2.
1744 characters in the hacked shlex_split for python 2.2.
1740
1745
1741 * IPython/iplib.py (file_matches): more fixes to filenames with
1746 * IPython/iplib.py (file_matches): more fixes to filenames with
1742 whitespace in them. It's not perfect, but limitations in python's
1747 whitespace in them. It's not perfect, but limitations in python's
1743 readline make it impossible to go further.
1748 readline make it impossible to go further.
1744
1749
1745 2004-06-29 Fernando Perez <fperez@colorado.edu>
1750 2004-06-29 Fernando Perez <fperez@colorado.edu>
1746
1751
1747 * IPython/iplib.py (file_matches): escape whitespace correctly in
1752 * IPython/iplib.py (file_matches): escape whitespace correctly in
1748 filename completions. Bug reported by Ville.
1753 filename completions. Bug reported by Ville.
1749
1754
1750 2004-06-28 Fernando Perez <fperez@colorado.edu>
1755 2004-06-28 Fernando Perez <fperez@colorado.edu>
1751
1756
1752 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
1757 * IPython/ipmaker.py (__call__): Added per-profile histories. Now
1753 the history file will be called 'history-PROFNAME' (or just
1758 the history file will be called 'history-PROFNAME' (or just
1754 'history' if no profile is loaded). I was getting annoyed at
1759 'history' if no profile is loaded). I was getting annoyed at
1755 getting my Numerical work history clobbered by pysh sessions.
1760 getting my Numerical work history clobbered by pysh sessions.
1756
1761
1757 * IPython/iplib.py (InteractiveShell.__init__): Internal
1762 * IPython/iplib.py (InteractiveShell.__init__): Internal
1758 getoutputerror() function so that we can honor the system_verbose
1763 getoutputerror() function so that we can honor the system_verbose
1759 flag for _all_ system calls. I also added escaping of #
1764 flag for _all_ system calls. I also added escaping of #
1760 characters here to avoid confusing Itpl.
1765 characters here to avoid confusing Itpl.
1761
1766
1762 * IPython/Magic.py (shlex_split): removed call to shell in
1767 * IPython/Magic.py (shlex_split): removed call to shell in
1763 parse_options and replaced it with shlex.split(). The annoying
1768 parse_options and replaced it with shlex.split(). The annoying
1764 part was that in Python 2.2, shlex.split() doesn't exist, so I had
1769 part was that in Python 2.2, shlex.split() doesn't exist, so I had
1765 to backport it from 2.3, with several frail hacks (the shlex
1770 to backport it from 2.3, with several frail hacks (the shlex
1766 module is rather limited in 2.2). Thanks to a suggestion by Ville
1771 module is rather limited in 2.2). Thanks to a suggestion by Ville
1767 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
1772 Vainio <vivainio@kolumbus.fi>. For Python 2.3 there should be no
1768 problem.
1773 problem.
1769
1774
1770 (Magic.magic_system_verbose): new toggle to print the actual
1775 (Magic.magic_system_verbose): new toggle to print the actual
1771 system calls made by ipython. Mainly for debugging purposes.
1776 system calls made by ipython. Mainly for debugging purposes.
1772
1777
1773 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
1778 * IPython/GnuplotRuntime.py (gnu_out): fix bug for cygwin, which
1774 doesn't support persistence. Reported (and fix suggested) by
1779 doesn't support persistence. Reported (and fix suggested) by
1775 Travis Caldwell <travis_caldwell2000@yahoo.com>.
1780 Travis Caldwell <travis_caldwell2000@yahoo.com>.
1776
1781
1777 2004-06-26 Fernando Perez <fperez@colorado.edu>
1782 2004-06-26 Fernando Perez <fperez@colorado.edu>
1778
1783
1779 * IPython/Logger.py (Logger.log): fix to handle correctly empty
1784 * IPython/Logger.py (Logger.log): fix to handle correctly empty
1780 continue prompts.
1785 continue prompts.
1781
1786
1782 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
1787 * IPython/Extensions/InterpreterExec.py (pysh): moved the pysh()
1783 function (basically a big docstring) and a few more things here to
1788 function (basically a big docstring) and a few more things here to
1784 speedup startup. pysh.py is now very lightweight. We want because
1789 speedup startup. pysh.py is now very lightweight. We want because
1785 it gets execfile'd, while InterpreterExec gets imported, so
1790 it gets execfile'd, while InterpreterExec gets imported, so
1786 byte-compilation saves time.
1791 byte-compilation saves time.
1787
1792
1788 2004-06-25 Fernando Perez <fperez@colorado.edu>
1793 2004-06-25 Fernando Perez <fperez@colorado.edu>
1789
1794
1790 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
1795 * IPython/Magic.py (Magic.magic_cd): Fixed to restore usage of 'cd
1791 -NUM', which was recently broken.
1796 -NUM', which was recently broken.
1792
1797
1793 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
1798 * IPython/iplib.py (InteractiveShell.handle_shell_escape): allow !
1794 in multi-line input (but not !!, which doesn't make sense there).
1799 in multi-line input (but not !!, which doesn't make sense there).
1795
1800
1796 * IPython/UserConfig/ipythonrc: made autoindent on by default.
1801 * IPython/UserConfig/ipythonrc: made autoindent on by default.
1797 It's just too useful, and people can turn it off in the less
1802 It's just too useful, and people can turn it off in the less
1798 common cases where it's a problem.
1803 common cases where it's a problem.
1799
1804
1800 2004-06-24 Fernando Perez <fperez@colorado.edu>
1805 2004-06-24 Fernando Perez <fperez@colorado.edu>
1801
1806
1802 * IPython/iplib.py (InteractiveShell._prefilter): big change -
1807 * IPython/iplib.py (InteractiveShell._prefilter): big change -
1803 special syntaxes (like alias calling) is now allied in multi-line
1808 special syntaxes (like alias calling) is now allied in multi-line
1804 input. This is still _very_ experimental, but it's necessary for
1809 input. This is still _very_ experimental, but it's necessary for
1805 efficient shell usage combining python looping syntax with system
1810 efficient shell usage combining python looping syntax with system
1806 calls. For now it's restricted to aliases, I don't think it
1811 calls. For now it's restricted to aliases, I don't think it
1807 really even makes sense to have this for magics.
1812 really even makes sense to have this for magics.
1808
1813
1809 2004-06-23 Fernando Perez <fperez@colorado.edu>
1814 2004-06-23 Fernando Perez <fperez@colorado.edu>
1810
1815
1811 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
1816 * IPython/Extensions/InterpreterExec.py (prefilter_shell): Added
1812 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
1817 $var=cmd <=> @sc var=cmd and $$var=cmd <=> @sc -l var=cmd.
1813
1818
1814 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
1819 * IPython/Magic.py (Magic.magic_rehashx): modified to handle
1815 extensions under Windows (after code sent by Gary Bishop). The
1820 extensions under Windows (after code sent by Gary Bishop). The
1816 extensions considered 'executable' are stored in IPython's rc
1821 extensions considered 'executable' are stored in IPython's rc
1817 structure as win_exec_ext.
1822 structure as win_exec_ext.
1818
1823
1819 * IPython/genutils.py (shell): new function, like system() but
1824 * IPython/genutils.py (shell): new function, like system() but
1820 without return value. Very useful for interactive shell work.
1825 without return value. Very useful for interactive shell work.
1821
1826
1822 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
1827 * IPython/Magic.py (Magic.magic_unalias): New @unalias function to
1823 delete aliases.
1828 delete aliases.
1824
1829
1825 * IPython/iplib.py (InteractiveShell.alias_table_update): make
1830 * IPython/iplib.py (InteractiveShell.alias_table_update): make
1826 sure that the alias table doesn't contain python keywords.
1831 sure that the alias table doesn't contain python keywords.
1827
1832
1828 2004-06-21 Fernando Perez <fperez@colorado.edu>
1833 2004-06-21 Fernando Perez <fperez@colorado.edu>
1829
1834
1830 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
1835 * IPython/Magic.py (Magic.magic_rehash): Fix crash when
1831 non-existent items are found in $PATH. Reported by Thorsten.
1836 non-existent items are found in $PATH. Reported by Thorsten.
1832
1837
1833 2004-06-20 Fernando Perez <fperez@colorado.edu>
1838 2004-06-20 Fernando Perez <fperez@colorado.edu>
1834
1839
1835 * IPython/iplib.py (complete): modified the completer so that the
1840 * IPython/iplib.py (complete): modified the completer so that the
1836 order of priorities can be easily changed at runtime.
1841 order of priorities can be easily changed at runtime.
1837
1842
1838 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
1843 * IPython/Extensions/InterpreterExec.py (prefilter_shell):
1839 Modified to auto-execute all lines beginning with '~', '/' or '.'.
1844 Modified to auto-execute all lines beginning with '~', '/' or '.'.
1840
1845
1841 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
1846 * IPython/Magic.py (Magic.magic_sx): modified @sc and @sx to
1842 expand Python variables prepended with $ in all system calls. The
1847 expand Python variables prepended with $ in all system calls. The
1843 same was done to InteractiveShell.handle_shell_escape. Now all
1848 same was done to InteractiveShell.handle_shell_escape. Now all
1844 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
1849 system access mechanisms (!, !!, @sc, @sx and aliases) allow the
1845 expansion of python variables and expressions according to the
1850 expansion of python variables and expressions according to the
1846 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
1851 syntax of PEP-215 - http://www.python.org/peps/pep-0215.html.
1847
1852
1848 Though PEP-215 has been rejected, a similar (but simpler) one
1853 Though PEP-215 has been rejected, a similar (but simpler) one
1849 seems like it will go into Python 2.4, PEP-292 -
1854 seems like it will go into Python 2.4, PEP-292 -
1850 http://www.python.org/peps/pep-0292.html.
1855 http://www.python.org/peps/pep-0292.html.
1851
1856
1852 I'll keep the full syntax of PEP-215, since IPython has since the
1857 I'll keep the full syntax of PEP-215, since IPython has since the
1853 start used Ka-Ping Yee's reference implementation discussed there
1858 start used Ka-Ping Yee's reference implementation discussed there
1854 (Itpl), and I actually like the powerful semantics it offers.
1859 (Itpl), and I actually like the powerful semantics it offers.
1855
1860
1856 In order to access normal shell variables, the $ has to be escaped
1861 In order to access normal shell variables, the $ has to be escaped
1857 via an extra $. For example:
1862 via an extra $. For example:
1858
1863
1859 In [7]: PATH='a python variable'
1864 In [7]: PATH='a python variable'
1860
1865
1861 In [8]: !echo $PATH
1866 In [8]: !echo $PATH
1862 a python variable
1867 a python variable
1863
1868
1864 In [9]: !echo $$PATH
1869 In [9]: !echo $$PATH
1865 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
1870 /usr/local/lf9560/bin:/usr/local/intel/compiler70/ia32/bin:...
1866
1871
1867 (Magic.parse_options): escape $ so the shell doesn't evaluate
1872 (Magic.parse_options): escape $ so the shell doesn't evaluate
1868 things prematurely.
1873 things prematurely.
1869
1874
1870 * IPython/iplib.py (InteractiveShell.call_alias): added the
1875 * IPython/iplib.py (InteractiveShell.call_alias): added the
1871 ability for aliases to expand python variables via $.
1876 ability for aliases to expand python variables via $.
1872
1877
1873 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
1878 * IPython/Magic.py (Magic.magic_rehash): based on the new alias
1874 system, now there's a @rehash/@rehashx pair of magics. These work
1879 system, now there's a @rehash/@rehashx pair of magics. These work
1875 like the csh rehash command, and can be invoked at any time. They
1880 like the csh rehash command, and can be invoked at any time. They
1876 build a table of aliases to everything in the user's $PATH
1881 build a table of aliases to everything in the user's $PATH
1877 (@rehash uses everything, @rehashx is slower but only adds
1882 (@rehash uses everything, @rehashx is slower but only adds
1878 executable files). With this, the pysh.py-based shell profile can
1883 executable files). With this, the pysh.py-based shell profile can
1879 now simply call rehash upon startup, and full access to all
1884 now simply call rehash upon startup, and full access to all
1880 programs in the user's path is obtained.
1885 programs in the user's path is obtained.
1881
1886
1882 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
1887 * IPython/iplib.py (InteractiveShell.call_alias): The new alias
1883 functionality is now fully in place. I removed the old dynamic
1888 functionality is now fully in place. I removed the old dynamic
1884 code generation based approach, in favor of a much lighter one
1889 code generation based approach, in favor of a much lighter one
1885 based on a simple dict. The advantage is that this allows me to
1890 based on a simple dict. The advantage is that this allows me to
1886 now have thousands of aliases with negligible cost (unthinkable
1891 now have thousands of aliases with negligible cost (unthinkable
1887 with the old system).
1892 with the old system).
1888
1893
1889 2004-06-19 Fernando Perez <fperez@colorado.edu>
1894 2004-06-19 Fernando Perez <fperez@colorado.edu>
1890
1895
1891 * IPython/iplib.py (__init__): extended MagicCompleter class to
1896 * IPython/iplib.py (__init__): extended MagicCompleter class to
1892 also complete (last in priority) on user aliases.
1897 also complete (last in priority) on user aliases.
1893
1898
1894 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
1899 * IPython/Itpl.py (Itpl.__str__): fixed order of globals/locals in
1895 call to eval.
1900 call to eval.
1896 (ItplNS.__init__): Added a new class which functions like Itpl,
1901 (ItplNS.__init__): Added a new class which functions like Itpl,
1897 but allows configuring the namespace for the evaluation to occur
1902 but allows configuring the namespace for the evaluation to occur
1898 in.
1903 in.
1899
1904
1900 2004-06-18 Fernando Perez <fperez@colorado.edu>
1905 2004-06-18 Fernando Perez <fperez@colorado.edu>
1901
1906
1902 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
1907 * IPython/iplib.py (InteractiveShell.runcode): modify to print a
1903 better message when 'exit' or 'quit' are typed (a common newbie
1908 better message when 'exit' or 'quit' are typed (a common newbie
1904 confusion).
1909 confusion).
1905
1910
1906 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
1911 * IPython/Magic.py (Magic.magic_colors): Added the runtime color
1907 check for Windows users.
1912 check for Windows users.
1908
1913
1909 * IPython/iplib.py (InteractiveShell.user_setup): removed
1914 * IPython/iplib.py (InteractiveShell.user_setup): removed
1910 disabling of colors for Windows. I'll test at runtime and issue a
1915 disabling of colors for Windows. I'll test at runtime and issue a
1911 warning if Gary's readline isn't found, as to nudge users to
1916 warning if Gary's readline isn't found, as to nudge users to
1912 download it.
1917 download it.
1913
1918
1914 2004-06-16 Fernando Perez <fperez@colorado.edu>
1919 2004-06-16 Fernando Perez <fperez@colorado.edu>
1915
1920
1916 * IPython/genutils.py (Stream.__init__): changed to print errors
1921 * IPython/genutils.py (Stream.__init__): changed to print errors
1917 to sys.stderr. I had a circular dependency here. Now it's
1922 to sys.stderr. I had a circular dependency here. Now it's
1918 possible to run ipython as IDLE's shell (consider this pre-alpha,
1923 possible to run ipython as IDLE's shell (consider this pre-alpha,
1919 since true stdout things end up in the starting terminal instead
1924 since true stdout things end up in the starting terminal instead
1920 of IDLE's out).
1925 of IDLE's out).
1921
1926
1922 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
1927 * IPython/Prompts.py (Prompt2.set_colors): prevent crashes for
1923 users who haven't # updated their prompt_in2 definitions. Remove
1928 users who haven't # updated their prompt_in2 definitions. Remove
1924 eventually.
1929 eventually.
1925 (multiple_replace): added credit to original ASPN recipe.
1930 (multiple_replace): added credit to original ASPN recipe.
1926
1931
1927 2004-06-15 Fernando Perez <fperez@colorado.edu>
1932 2004-06-15 Fernando Perez <fperez@colorado.edu>
1928
1933
1929 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
1934 * IPython/iplib.py (InteractiveShell.__init__): add 'cp' to the
1930 list of auto-defined aliases.
1935 list of auto-defined aliases.
1931
1936
1932 2004-06-13 Fernando Perez <fperez@colorado.edu>
1937 2004-06-13 Fernando Perez <fperez@colorado.edu>
1933
1938
1934 * setup.py (scriptfiles): Don't trigger win_post_install unless an
1939 * setup.py (scriptfiles): Don't trigger win_post_install unless an
1935 install was really requested (so setup.py can be used for other
1940 install was really requested (so setup.py can be used for other
1936 things under Windows).
1941 things under Windows).
1937
1942
1938 2004-06-10 Fernando Perez <fperez@colorado.edu>
1943 2004-06-10 Fernando Perez <fperez@colorado.edu>
1939
1944
1940 * IPython/Logger.py (Logger.create_log): Manually remove any old
1945 * IPython/Logger.py (Logger.create_log): Manually remove any old
1941 backup, since os.remove may fail under Windows. Fixes bug
1946 backup, since os.remove may fail under Windows. Fixes bug
1942 reported by Thorsten.
1947 reported by Thorsten.
1943
1948
1944 2004-06-09 Fernando Perez <fperez@colorado.edu>
1949 2004-06-09 Fernando Perez <fperez@colorado.edu>
1945
1950
1946 * examples/example-embed.py: fixed all references to %n (replaced
1951 * examples/example-embed.py: fixed all references to %n (replaced
1947 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
1952 with \\# for ps1/out prompts and with \\D for ps2 prompts). Done
1948 for all examples and the manual as well.
1953 for all examples and the manual as well.
1949
1954
1950 2004-06-08 Fernando Perez <fperez@colorado.edu>
1955 2004-06-08 Fernando Perez <fperez@colorado.edu>
1951
1956
1952 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
1957 * IPython/Prompts.py (Prompt2.set_p_str): fixed all prompt
1953 alignment and color management. All 3 prompt subsystems now
1958 alignment and color management. All 3 prompt subsystems now
1954 inherit from BasePrompt.
1959 inherit from BasePrompt.
1955
1960
1956 * tools/release: updates for windows installer build and tag rpms
1961 * tools/release: updates for windows installer build and tag rpms
1957 with python version (since paths are fixed).
1962 with python version (since paths are fixed).
1958
1963
1959 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
1964 * IPython/UserConfig/ipythonrc: modified to use \# instead of %n,
1960 which will become eventually obsolete. Also fixed the default
1965 which will become eventually obsolete. Also fixed the default
1961 prompt_in2 to use \D, so at least new users start with the correct
1966 prompt_in2 to use \D, so at least new users start with the correct
1962 defaults.
1967 defaults.
1963 WARNING: Users with existing ipythonrc files will need to apply
1968 WARNING: Users with existing ipythonrc files will need to apply
1964 this fix manually!
1969 this fix manually!
1965
1970
1966 * setup.py: make windows installer (.exe). This is finally the
1971 * setup.py: make windows installer (.exe). This is finally the
1967 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
1972 integration of an old patch by Cory Dodt <dodt-AT-fcoe.k12.ca.us>,
1968 which I hadn't included because it required Python 2.3 (or recent
1973 which I hadn't included because it required Python 2.3 (or recent
1969 distutils).
1974 distutils).
1970
1975
1971 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
1976 * IPython/usage.py (__doc__): update docs (and manpage) to reflect
1972 usage of new '\D' escape.
1977 usage of new '\D' escape.
1973
1978
1974 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
1979 * IPython/Prompts.py (ROOT_SYMBOL): Small fix for Windows (which
1975 lacks os.getuid())
1980 lacks os.getuid())
1976 (CachedOutput.set_colors): Added the ability to turn coloring
1981 (CachedOutput.set_colors): Added the ability to turn coloring
1977 on/off with @colors even for manually defined prompt colors. It
1982 on/off with @colors even for manually defined prompt colors. It
1978 uses a nasty global, but it works safely and via the generic color
1983 uses a nasty global, but it works safely and via the generic color
1979 handling mechanism.
1984 handling mechanism.
1980 (Prompt2.__init__): Introduced new escape '\D' for continuation
1985 (Prompt2.__init__): Introduced new escape '\D' for continuation
1981 prompts. It represents the counter ('\#') as dots.
1986 prompts. It represents the counter ('\#') as dots.
1982 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
1987 *** NOTE *** THIS IS A BACKWARDS-INCOMPATIBLE CHANGE. Users will
1983 need to update their ipythonrc files and replace '%n' with '\D' in
1988 need to update their ipythonrc files and replace '%n' with '\D' in
1984 their prompt_in2 settings everywhere. Sorry, but there's
1989 their prompt_in2 settings everywhere. Sorry, but there's
1985 otherwise no clean way to get all prompts to properly align. The
1990 otherwise no clean way to get all prompts to properly align. The
1986 ipythonrc shipped with IPython has been updated.
1991 ipythonrc shipped with IPython has been updated.
1987
1992
1988 2004-06-07 Fernando Perez <fperez@colorado.edu>
1993 2004-06-07 Fernando Perez <fperez@colorado.edu>
1989
1994
1990 * setup.py (isfile): Pass local_icons option to latex2html, so the
1995 * setup.py (isfile): Pass local_icons option to latex2html, so the
1991 resulting HTML file is self-contained. Thanks to
1996 resulting HTML file is self-contained. Thanks to
1992 dryice-AT-liu.com.cn for the tip.
1997 dryice-AT-liu.com.cn for the tip.
1993
1998
1994 * pysh.py: I created a new profile 'shell', which implements a
1999 * pysh.py: I created a new profile 'shell', which implements a
1995 _rudimentary_ IPython-based shell. This is in NO WAY a realy
2000 _rudimentary_ IPython-based shell. This is in NO WAY a realy
1996 system shell, nor will it become one anytime soon. It's mainly
2001 system shell, nor will it become one anytime soon. It's mainly
1997 meant to illustrate the use of the new flexible bash-like prompts.
2002 meant to illustrate the use of the new flexible bash-like prompts.
1998 I guess it could be used by hardy souls for true shell management,
2003 I guess it could be used by hardy souls for true shell management,
1999 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2004 but it's no tcsh/bash... pysh.py is loaded by the 'shell'
2000 profile. This uses the InterpreterExec extension provided by
2005 profile. This uses the InterpreterExec extension provided by
2001 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2006 W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl>
2002
2007
2003 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2008 * IPython/Prompts.py (PromptOut.__str__): now it will correctly
2004 auto-align itself with the length of the previous input prompt
2009 auto-align itself with the length of the previous input prompt
2005 (taking into account the invisible color escapes).
2010 (taking into account the invisible color escapes).
2006 (CachedOutput.__init__): Large restructuring of this class. Now
2011 (CachedOutput.__init__): Large restructuring of this class. Now
2007 all three prompts (primary1, primary2, output) are proper objects,
2012 all three prompts (primary1, primary2, output) are proper objects,
2008 managed by the 'parent' CachedOutput class. The code is still a
2013 managed by the 'parent' CachedOutput class. The code is still a
2009 bit hackish (all prompts share state via a pointer to the cache),
2014 bit hackish (all prompts share state via a pointer to the cache),
2010 but it's overall far cleaner than before.
2015 but it's overall far cleaner than before.
2011
2016
2012 * IPython/genutils.py (getoutputerror): modified to add verbose,
2017 * IPython/genutils.py (getoutputerror): modified to add verbose,
2013 debug and header options. This makes the interface of all getout*
2018 debug and header options. This makes the interface of all getout*
2014 functions uniform.
2019 functions uniform.
2015 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2020 (SystemExec.getoutputerror): added getoutputerror to SystemExec.
2016
2021
2017 * IPython/Magic.py (Magic.default_option): added a function to
2022 * IPython/Magic.py (Magic.default_option): added a function to
2018 allow registering default options for any magic command. This
2023 allow registering default options for any magic command. This
2019 makes it easy to have profiles which customize the magics globally
2024 makes it easy to have profiles which customize the magics globally
2020 for a certain use. The values set through this function are
2025 for a certain use. The values set through this function are
2021 picked up by the parse_options() method, which all magics should
2026 picked up by the parse_options() method, which all magics should
2022 use to parse their options.
2027 use to parse their options.
2023
2028
2024 * IPython/genutils.py (warn): modified the warnings framework to
2029 * IPython/genutils.py (warn): modified the warnings framework to
2025 use the Term I/O class. I'm trying to slowly unify all of
2030 use the Term I/O class. I'm trying to slowly unify all of
2026 IPython's I/O operations to pass through Term.
2031 IPython's I/O operations to pass through Term.
2027
2032
2028 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2033 * IPython/Prompts.py (Prompt2._str_other): Added functionality in
2029 the secondary prompt to correctly match the length of the primary
2034 the secondary prompt to correctly match the length of the primary
2030 one for any prompt. Now multi-line code will properly line up
2035 one for any prompt. Now multi-line code will properly line up
2031 even for path dependent prompts, such as the new ones available
2036 even for path dependent prompts, such as the new ones available
2032 via the prompt_specials.
2037 via the prompt_specials.
2033
2038
2034 2004-06-06 Fernando Perez <fperez@colorado.edu>
2039 2004-06-06 Fernando Perez <fperez@colorado.edu>
2035
2040
2036 * IPython/Prompts.py (prompt_specials): Added the ability to have
2041 * IPython/Prompts.py (prompt_specials): Added the ability to have
2037 bash-like special sequences in the prompts, which get
2042 bash-like special sequences in the prompts, which get
2038 automatically expanded. Things like hostname, current working
2043 automatically expanded. Things like hostname, current working
2039 directory and username are implemented already, but it's easy to
2044 directory and username are implemented already, but it's easy to
2040 add more in the future. Thanks to a patch by W.J. van der Laan
2045 add more in the future. Thanks to a patch by W.J. van der Laan
2041 <gnufnork-AT-hetdigitalegat.nl>
2046 <gnufnork-AT-hetdigitalegat.nl>
2042 (prompt_specials): Added color support for prompt strings, so
2047 (prompt_specials): Added color support for prompt strings, so
2043 users can define arbitrary color setups for their prompts.
2048 users can define arbitrary color setups for their prompts.
2044
2049
2045 2004-06-05 Fernando Perez <fperez@colorado.edu>
2050 2004-06-05 Fernando Perez <fperez@colorado.edu>
2046
2051
2047 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
2052 * IPython/genutils.py (Term.reopen_all): Added Windows-specific
2048 code to load Gary Bishop's readline and configure it
2053 code to load Gary Bishop's readline and configure it
2049 automatically. Thanks to Gary for help on this.
2054 automatically. Thanks to Gary for help on this.
2050
2055
2051 2004-06-01 Fernando Perez <fperez@colorado.edu>
2056 2004-06-01 Fernando Perez <fperez@colorado.edu>
2052
2057
2053 * IPython/Logger.py (Logger.create_log): fix bug for logging
2058 * IPython/Logger.py (Logger.create_log): fix bug for logging
2054 with no filename (previous fix was incomplete).
2059 with no filename (previous fix was incomplete).
2055
2060
2056 2004-05-25 Fernando Perez <fperez@colorado.edu>
2061 2004-05-25 Fernando Perez <fperez@colorado.edu>
2057
2062
2058 * IPython/Magic.py (Magic.parse_options): fix bug where naked
2063 * IPython/Magic.py (Magic.parse_options): fix bug where naked
2059 parens would get passed to the shell.
2064 parens would get passed to the shell.
2060
2065
2061 2004-05-20 Fernando Perez <fperez@colorado.edu>
2066 2004-05-20 Fernando Perez <fperez@colorado.edu>
2062
2067
2063 * IPython/Magic.py (Magic.magic_prun): changed default profile
2068 * IPython/Magic.py (Magic.magic_prun): changed default profile
2064 sort order to 'time' (the more common profiling need).
2069 sort order to 'time' (the more common profiling need).
2065
2070
2066 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
2071 * IPython/OInspect.py (Inspector.pinfo): flush the inspect cache
2067 so that source code shown is guaranteed in sync with the file on
2072 so that source code shown is guaranteed in sync with the file on
2068 disk (also changed in psource). Similar fix to the one for
2073 disk (also changed in psource). Similar fix to the one for
2069 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2074 ultraTB on 2004-05-06. Thanks to a bug report by Yann Le Du
2070 <yann.ledu-AT-noos.fr>.
2075 <yann.ledu-AT-noos.fr>.
2071
2076
2072 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2077 * IPython/Magic.py (Magic.parse_options): Fixed bug where commands
2073 with a single option would not be correctly parsed. Closes
2078 with a single option would not be correctly parsed. Closes
2074 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2079 http://www.scipy.net/roundup/ipython/issue14. This bug had been
2075 introduced in 0.6.0 (on 2004-05-06).
2080 introduced in 0.6.0 (on 2004-05-06).
2076
2081
2077 2004-05-13 *** Released version 0.6.0
2082 2004-05-13 *** Released version 0.6.0
2078
2083
2079 2004-05-13 Fernando Perez <fperez@colorado.edu>
2084 2004-05-13 Fernando Perez <fperez@colorado.edu>
2080
2085
2081 * debian/: Added debian/ directory to CVS, so that debian support
2086 * debian/: Added debian/ directory to CVS, so that debian support
2082 is publicly accessible. The debian package is maintained by Jack
2087 is publicly accessible. The debian package is maintained by Jack
2083 Moffit <jack-AT-xiph.org>.
2088 Moffit <jack-AT-xiph.org>.
2084
2089
2085 * Documentation: included the notes about an ipython-based system
2090 * Documentation: included the notes about an ipython-based system
2086 shell (the hypothetical 'pysh') into the new_design.pdf document,
2091 shell (the hypothetical 'pysh') into the new_design.pdf document,
2087 so that these ideas get distributed to users along with the
2092 so that these ideas get distributed to users along with the
2088 official documentation.
2093 official documentation.
2089
2094
2090 2004-05-10 Fernando Perez <fperez@colorado.edu>
2095 2004-05-10 Fernando Perez <fperez@colorado.edu>
2091
2096
2092 * IPython/Logger.py (Logger.create_log): fix recently introduced
2097 * IPython/Logger.py (Logger.create_log): fix recently introduced
2093 bug (misindented line) where logstart would fail when not given an
2098 bug (misindented line) where logstart would fail when not given an
2094 explicit filename.
2099 explicit filename.
2095
2100
2096 2004-05-09 Fernando Perez <fperez@colorado.edu>
2101 2004-05-09 Fernando Perez <fperez@colorado.edu>
2097
2102
2098 * IPython/Magic.py (Magic.parse_options): skip system call when
2103 * IPython/Magic.py (Magic.parse_options): skip system call when
2099 there are no options to look for. Faster, cleaner for the common
2104 there are no options to look for. Faster, cleaner for the common
2100 case.
2105 case.
2101
2106
2102 * Documentation: many updates to the manual: describing Windows
2107 * Documentation: many updates to the manual: describing Windows
2103 support better, Gnuplot updates, credits, misc small stuff. Also
2108 support better, Gnuplot updates, credits, misc small stuff. Also
2104 updated the new_design doc a bit.
2109 updated the new_design doc a bit.
2105
2110
2106 2004-05-06 *** Released version 0.6.0.rc1
2111 2004-05-06 *** Released version 0.6.0.rc1
2107
2112
2108 2004-05-06 Fernando Perez <fperez@colorado.edu>
2113 2004-05-06 Fernando Perez <fperez@colorado.edu>
2109
2114
2110 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2115 * IPython/ultraTB.py (ListTB.text): modified a ton of string +=
2111 operations to use the vastly more efficient list/''.join() method.
2116 operations to use the vastly more efficient list/''.join() method.
2112 (FormattedTB.text): Fix
2117 (FormattedTB.text): Fix
2113 http://www.scipy.net/roundup/ipython/issue12 - exception source
2118 http://www.scipy.net/roundup/ipython/issue12 - exception source
2114 extract not updated after reload. Thanks to Mike Salib
2119 extract not updated after reload. Thanks to Mike Salib
2115 <msalib-AT-mit.edu> for pinning the source of the problem.
2120 <msalib-AT-mit.edu> for pinning the source of the problem.
2116 Fortunately, the solution works inside ipython and doesn't require
2121 Fortunately, the solution works inside ipython and doesn't require
2117 any changes to python proper.
2122 any changes to python proper.
2118
2123
2119 * IPython/Magic.py (Magic.parse_options): Improved to process the
2124 * IPython/Magic.py (Magic.parse_options): Improved to process the
2120 argument list as a true shell would (by actually using the
2125 argument list as a true shell would (by actually using the
2121 underlying system shell). This way, all @magics automatically get
2126 underlying system shell). This way, all @magics automatically get
2122 shell expansion for variables. Thanks to a comment by Alex
2127 shell expansion for variables. Thanks to a comment by Alex
2123 Schmolck.
2128 Schmolck.
2124
2129
2125 2004-04-04 Fernando Perez <fperez@colorado.edu>
2130 2004-04-04 Fernando Perez <fperez@colorado.edu>
2126
2131
2127 * IPython/iplib.py (InteractiveShell.interact): Added a special
2132 * IPython/iplib.py (InteractiveShell.interact): Added a special
2128 trap for a debugger quit exception, which is basically impossible
2133 trap for a debugger quit exception, which is basically impossible
2129 to handle by normal mechanisms, given what pdb does to the stack.
2134 to handle by normal mechanisms, given what pdb does to the stack.
2130 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2135 This fixes a crash reported by <fgibbons-AT-llama.med.harvard.edu>.
2131
2136
2132 2004-04-03 Fernando Perez <fperez@colorado.edu>
2137 2004-04-03 Fernando Perez <fperez@colorado.edu>
2133
2138
2134 * IPython/genutils.py (Term): Standardized the names of the Term
2139 * IPython/genutils.py (Term): Standardized the names of the Term
2135 class streams to cin/cout/cerr, following C++ naming conventions
2140 class streams to cin/cout/cerr, following C++ naming conventions
2136 (I can't use in/out/err because 'in' is not a valid attribute
2141 (I can't use in/out/err because 'in' is not a valid attribute
2137 name).
2142 name).
2138
2143
2139 * IPython/iplib.py (InteractiveShell.interact): don't increment
2144 * IPython/iplib.py (InteractiveShell.interact): don't increment
2140 the prompt if there's no user input. By Daniel 'Dang' Griffith
2145 the prompt if there's no user input. By Daniel 'Dang' Griffith
2141 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2146 <pythondev-dang-AT-lazytwinacres.net>, after a suggestion from
2142 Francois Pinard.
2147 Francois Pinard.
2143
2148
2144 2004-04-02 Fernando Perez <fperez@colorado.edu>
2149 2004-04-02 Fernando Perez <fperez@colorado.edu>
2145
2150
2146 * IPython/genutils.py (Stream.__init__): Modified to survive at
2151 * IPython/genutils.py (Stream.__init__): Modified to survive at
2147 least importing in contexts where stdin/out/err aren't true file
2152 least importing in contexts where stdin/out/err aren't true file
2148 objects, such as PyCrust (they lack fileno() and mode). However,
2153 objects, such as PyCrust (they lack fileno() and mode). However,
2149 the recovery facilities which rely on these things existing will
2154 the recovery facilities which rely on these things existing will
2150 not work.
2155 not work.
2151
2156
2152 2004-04-01 Fernando Perez <fperez@colorado.edu>
2157 2004-04-01 Fernando Perez <fperez@colorado.edu>
2153
2158
2154 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2159 * IPython/Magic.py (Magic.magic_sx): modified (as well as @sc) to
2155 use the new getoutputerror() function, so it properly
2160 use the new getoutputerror() function, so it properly
2156 distinguishes stdout/err.
2161 distinguishes stdout/err.
2157
2162
2158 * IPython/genutils.py (getoutputerror): added a function to
2163 * IPython/genutils.py (getoutputerror): added a function to
2159 capture separately the standard output and error of a command.
2164 capture separately the standard output and error of a command.
2160 After a comment from dang on the mailing lists. This code is
2165 After a comment from dang on the mailing lists. This code is
2161 basically a modified version of commands.getstatusoutput(), from
2166 basically a modified version of commands.getstatusoutput(), from
2162 the standard library.
2167 the standard library.
2163
2168
2164 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2169 * IPython/iplib.py (InteractiveShell.handle_shell_escape): added
2165 '!!' as a special syntax (shorthand) to access @sx.
2170 '!!' as a special syntax (shorthand) to access @sx.
2166
2171
2167 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2172 * IPython/Magic.py (Magic.magic_sx): new magic, to execute a shell
2168 command and return its output as a list split on '\n'.
2173 command and return its output as a list split on '\n'.
2169
2174
2170 2004-03-31 Fernando Perez <fperez@colorado.edu>
2175 2004-03-31 Fernando Perez <fperez@colorado.edu>
2171
2176
2172 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2177 * IPython/FakeModule.py (FakeModule.__init__): added __nonzero__
2173 method to dictionaries used as FakeModule instances if they lack
2178 method to dictionaries used as FakeModule instances if they lack
2174 it. At least pydoc in python2.3 breaks for runtime-defined
2179 it. At least pydoc in python2.3 breaks for runtime-defined
2175 functions without this hack. At some point I need to _really_
2180 functions without this hack. At some point I need to _really_
2176 understand what FakeModule is doing, because it's a gross hack.
2181 understand what FakeModule is doing, because it's a gross hack.
2177 But it solves Arnd's problem for now...
2182 But it solves Arnd's problem for now...
2178
2183
2179 2004-02-27 Fernando Perez <fperez@colorado.edu>
2184 2004-02-27 Fernando Perez <fperez@colorado.edu>
2180
2185
2181 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2186 * IPython/Logger.py (Logger.create_log): Fix bug where 'rotate'
2182 mode would behave erratically. Also increased the number of
2187 mode would behave erratically. Also increased the number of
2183 possible logs in rotate mod to 999. Thanks to Rod Holland
2188 possible logs in rotate mod to 999. Thanks to Rod Holland
2184 <rhh@StructureLABS.com> for the report and fixes.
2189 <rhh@StructureLABS.com> for the report and fixes.
2185
2190
2186 2004-02-26 Fernando Perez <fperez@colorado.edu>
2191 2004-02-26 Fernando Perez <fperez@colorado.edu>
2187
2192
2188 * IPython/genutils.py (page): Check that the curses module really
2193 * IPython/genutils.py (page): Check that the curses module really
2189 has the initscr attribute before trying to use it. For some
2194 has the initscr attribute before trying to use it. For some
2190 reason, the Solaris curses module is missing this. I think this
2195 reason, the Solaris curses module is missing this. I think this
2191 should be considered a Solaris python bug, but I'm not sure.
2196 should be considered a Solaris python bug, but I'm not sure.
2192
2197
2193 2004-01-17 Fernando Perez <fperez@colorado.edu>
2198 2004-01-17 Fernando Perez <fperez@colorado.edu>
2194
2199
2195 * IPython/genutils.py (Stream.__init__): Changes to try to make
2200 * IPython/genutils.py (Stream.__init__): Changes to try to make
2196 ipython robust against stdin/out/err being closed by the user.
2201 ipython robust against stdin/out/err being closed by the user.
2197 This is 'user error' (and blocks a normal python session, at least
2202 This is 'user error' (and blocks a normal python session, at least
2198 the stdout case). However, Ipython should be able to survive such
2203 the stdout case). However, Ipython should be able to survive such
2199 instances of abuse as gracefully as possible. To simplify the
2204 instances of abuse as gracefully as possible. To simplify the
2200 coding and maintain compatibility with Gary Bishop's Term
2205 coding and maintain compatibility with Gary Bishop's Term
2201 contributions, I've made use of classmethods for this. I think
2206 contributions, I've made use of classmethods for this. I think
2202 this introduces a dependency on python 2.2.
2207 this introduces a dependency on python 2.2.
2203
2208
2204 2004-01-13 Fernando Perez <fperez@colorado.edu>
2209 2004-01-13 Fernando Perez <fperez@colorado.edu>
2205
2210
2206 * IPython/numutils.py (exp_safe): simplified the code a bit and
2211 * IPython/numutils.py (exp_safe): simplified the code a bit and
2207 removed the need for importing the kinds module altogether.
2212 removed the need for importing the kinds module altogether.
2208
2213
2209 2004-01-06 Fernando Perez <fperez@colorado.edu>
2214 2004-01-06 Fernando Perez <fperez@colorado.edu>
2210
2215
2211 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2216 * IPython/Magic.py (Magic.magic_sc): Made the shell capture system
2212 a magic function instead, after some community feedback. No
2217 a magic function instead, after some community feedback. No
2213 special syntax will exist for it, but its name is deliberately
2218 special syntax will exist for it, but its name is deliberately
2214 very short.
2219 very short.
2215
2220
2216 2003-12-20 Fernando Perez <fperez@colorado.edu>
2221 2003-12-20 Fernando Perez <fperez@colorado.edu>
2217
2222
2218 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2223 * IPython/iplib.py (InteractiveShell.handle_shell_assign): Added
2219 new functionality, to automagically assign the result of a shell
2224 new functionality, to automagically assign the result of a shell
2220 command to a variable. I'll solicit some community feedback on
2225 command to a variable. I'll solicit some community feedback on
2221 this before making it permanent.
2226 this before making it permanent.
2222
2227
2223 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2228 * IPython/OInspect.py (Inspector.pinfo): Fix crash when info was
2224 requested about callables for which inspect couldn't obtain a
2229 requested about callables for which inspect couldn't obtain a
2225 proper argspec. Thanks to a crash report sent by Etienne
2230 proper argspec. Thanks to a crash report sent by Etienne
2226 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2231 Posthumus <etienne-AT-apple01.cs.vu.nl>.
2227
2232
2228 2003-12-09 Fernando Perez <fperez@colorado.edu>
2233 2003-12-09 Fernando Perez <fperez@colorado.edu>
2229
2234
2230 * IPython/genutils.py (page): patch for the pager to work across
2235 * IPython/genutils.py (page): patch for the pager to work across
2231 various versions of Windows. By Gary Bishop.
2236 various versions of Windows. By Gary Bishop.
2232
2237
2233 2003-12-04 Fernando Perez <fperez@colorado.edu>
2238 2003-12-04 Fernando Perez <fperez@colorado.edu>
2234
2239
2235 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2240 * IPython/Gnuplot2.py (PlotItems): Fixes for working with
2236 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2241 Gnuplot.py version 1.7, whose internal names changed quite a bit.
2237 While I tested this and it looks ok, there may still be corner
2242 While I tested this and it looks ok, there may still be corner
2238 cases I've missed.
2243 cases I've missed.
2239
2244
2240 2003-12-01 Fernando Perez <fperez@colorado.edu>
2245 2003-12-01 Fernando Perez <fperez@colorado.edu>
2241
2246
2242 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2247 * IPython/iplib.py (InteractiveShell._prefilter): Fixed a bug
2243 where a line like 'p,q=1,2' would fail because the automagic
2248 where a line like 'p,q=1,2' would fail because the automagic
2244 system would be triggered for @p.
2249 system would be triggered for @p.
2245
2250
2246 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2251 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): Tab-related
2247 cleanups, code unmodified.
2252 cleanups, code unmodified.
2248
2253
2249 * IPython/genutils.py (Term): added a class for IPython to handle
2254 * IPython/genutils.py (Term): added a class for IPython to handle
2250 output. In most cases it will just be a proxy for stdout/err, but
2255 output. In most cases it will just be a proxy for stdout/err, but
2251 having this allows modifications to be made for some platforms,
2256 having this allows modifications to be made for some platforms,
2252 such as handling color escapes under Windows. All of this code
2257 such as handling color escapes under Windows. All of this code
2253 was contributed by Gary Bishop, with minor modifications by me.
2258 was contributed by Gary Bishop, with minor modifications by me.
2254 The actual changes affect many files.
2259 The actual changes affect many files.
2255
2260
2256 2003-11-30 Fernando Perez <fperez@colorado.edu>
2261 2003-11-30 Fernando Perez <fperez@colorado.edu>
2257
2262
2258 * IPython/iplib.py (file_matches): new completion code, courtesy
2263 * IPython/iplib.py (file_matches): new completion code, courtesy
2259 of Jeff Collins. This enables filename completion again under
2264 of Jeff Collins. This enables filename completion again under
2260 python 2.3, which disabled it at the C level.
2265 python 2.3, which disabled it at the C level.
2261
2266
2262 2003-11-11 Fernando Perez <fperez@colorado.edu>
2267 2003-11-11 Fernando Perez <fperez@colorado.edu>
2263
2268
2264 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2269 * IPython/numutils.py (amap): Added amap() fn. Simple shorthand
2265 for Numeric.array(map(...)), but often convenient.
2270 for Numeric.array(map(...)), but often convenient.
2266
2271
2267 2003-11-05 Fernando Perez <fperez@colorado.edu>
2272 2003-11-05 Fernando Perez <fperez@colorado.edu>
2268
2273
2269 * IPython/numutils.py (frange): Changed a call from int() to
2274 * IPython/numutils.py (frange): Changed a call from int() to
2270 int(round()) to prevent a problem reported with arange() in the
2275 int(round()) to prevent a problem reported with arange() in the
2271 numpy list.
2276 numpy list.
2272
2277
2273 2003-10-06 Fernando Perez <fperez@colorado.edu>
2278 2003-10-06 Fernando Perez <fperez@colorado.edu>
2274
2279
2275 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2280 * IPython/DPyGetOpt.py (DPyGetOpt.processArguments): changed to
2276 prevent crashes if sys lacks an argv attribute (it happens with
2281 prevent crashes if sys lacks an argv attribute (it happens with
2277 embedded interpreters which build a bare-bones sys module).
2282 embedded interpreters which build a bare-bones sys module).
2278 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2283 Thanks to a report/bugfix by Adam Hupp <hupp-AT-cs.wisc.edu>.
2279
2284
2280 2003-09-24 Fernando Perez <fperez@colorado.edu>
2285 2003-09-24 Fernando Perez <fperez@colorado.edu>
2281
2286
2282 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2287 * IPython/Magic.py (Magic._ofind): blanket except around getattr()
2283 to protect against poorly written user objects where __getattr__
2288 to protect against poorly written user objects where __getattr__
2284 raises exceptions other than AttributeError. Thanks to a bug
2289 raises exceptions other than AttributeError. Thanks to a bug
2285 report by Oliver Sander <osander-AT-gmx.de>.
2290 report by Oliver Sander <osander-AT-gmx.de>.
2286
2291
2287 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2292 * IPython/FakeModule.py (FakeModule.__repr__): this method was
2288 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2293 missing. Thanks to bug report by Ralf Schmitt <ralf-AT-brainbot.com>.
2289
2294
2290 2003-09-09 Fernando Perez <fperez@colorado.edu>
2295 2003-09-09 Fernando Perez <fperez@colorado.edu>
2291
2296
2292 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2297 * IPython/iplib.py (InteractiveShell._prefilter): fix bug where
2293 unpacking a list whith a callable as first element would
2298 unpacking a list whith a callable as first element would
2294 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2299 mistakenly trigger autocalling. Thanks to a bug report by Jeffery
2295 Collins.
2300 Collins.
2296
2301
2297 2003-08-25 *** Released version 0.5.0
2302 2003-08-25 *** Released version 0.5.0
2298
2303
2299 2003-08-22 Fernando Perez <fperez@colorado.edu>
2304 2003-08-22 Fernando Perez <fperez@colorado.edu>
2300
2305
2301 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2306 * IPython/ultraTB.py (VerboseTB.linereader): Improved handling of
2302 improperly defined user exceptions. Thanks to feedback from Mark
2307 improperly defined user exceptions. Thanks to feedback from Mark
2303 Russell <mrussell-AT-verio.net>.
2308 Russell <mrussell-AT-verio.net>.
2304
2309
2305 2003-08-20 Fernando Perez <fperez@colorado.edu>
2310 2003-08-20 Fernando Perez <fperez@colorado.edu>
2306
2311
2307 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2312 * IPython/OInspect.py (Inspector.pinfo): changed String Form
2308 printing so that it would print multi-line string forms starting
2313 printing so that it would print multi-line string forms starting
2309 with a new line. This way the formatting is better respected for
2314 with a new line. This way the formatting is better respected for
2310 objects which work hard to make nice string forms.
2315 objects which work hard to make nice string forms.
2311
2316
2312 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2317 * IPython/iplib.py (InteractiveShell.handle_auto): Fix bug where
2313 autocall would overtake data access for objects with both
2318 autocall would overtake data access for objects with both
2314 __getitem__ and __call__.
2319 __getitem__ and __call__.
2315
2320
2316 2003-08-19 *** Released version 0.5.0-rc1
2321 2003-08-19 *** Released version 0.5.0-rc1
2317
2322
2318 2003-08-19 Fernando Perez <fperez@colorado.edu>
2323 2003-08-19 Fernando Perez <fperez@colorado.edu>
2319
2324
2320 * IPython/deep_reload.py (load_tail): single tiny change here
2325 * IPython/deep_reload.py (load_tail): single tiny change here
2321 seems to fix the long-standing bug of dreload() failing to work
2326 seems to fix the long-standing bug of dreload() failing to work
2322 for dotted names. But this module is pretty tricky, so I may have
2327 for dotted names. But this module is pretty tricky, so I may have
2323 missed some subtlety. Needs more testing!.
2328 missed some subtlety. Needs more testing!.
2324
2329
2325 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2330 * IPython/ultraTB.py (VerboseTB.linereader): harden against user
2326 exceptions which have badly implemented __str__ methods.
2331 exceptions which have badly implemented __str__ methods.
2327 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2332 (VerboseTB.text): harden against inspect.getinnerframes crashing,
2328 which I've been getting reports about from Python 2.3 users. I
2333 which I've been getting reports about from Python 2.3 users. I
2329 wish I had a simple test case to reproduce the problem, so I could
2334 wish I had a simple test case to reproduce the problem, so I could
2330 either write a cleaner workaround or file a bug report if
2335 either write a cleaner workaround or file a bug report if
2331 necessary.
2336 necessary.
2332
2337
2333 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2338 * IPython/Magic.py (Magic.magic_edit): fixed bug where after
2334 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2339 making a class 'foo', file 'foo.py' couldn't be edited. Thanks to
2335 a bug report by Tjabo Kloppenburg.
2340 a bug report by Tjabo Kloppenburg.
2336
2341
2337 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2342 * IPython/ultraTB.py (VerboseTB.debugger): hardened against pdb
2338 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2343 crashes. Wrapped the pdb call in a blanket try/except, since pdb
2339 seems rather unstable. Thanks to a bug report by Tjabo
2344 seems rather unstable. Thanks to a bug report by Tjabo
2340 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2345 Kloppenburg <tjabo.kloppenburg-AT-unix-ag.uni-siegen.de>.
2341
2346
2342 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2347 * IPython/Release.py (version): release 0.5.0-rc1. I want to put
2343 this out soon because of the critical fixes in the inner loop for
2348 this out soon because of the critical fixes in the inner loop for
2344 generators.
2349 generators.
2345
2350
2346 * IPython/Magic.py (Magic.getargspec): removed. This (and
2351 * IPython/Magic.py (Magic.getargspec): removed. This (and
2347 _get_def) have been obsoleted by OInspect for a long time, I
2352 _get_def) have been obsoleted by OInspect for a long time, I
2348 hadn't noticed that they were dead code.
2353 hadn't noticed that they were dead code.
2349 (Magic._ofind): restored _ofind functionality for a few literals
2354 (Magic._ofind): restored _ofind functionality for a few literals
2350 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2355 (those in ["''",'""','[]','{}','()']). But it won't work anymore
2351 for things like "hello".capitalize?, since that would require a
2356 for things like "hello".capitalize?, since that would require a
2352 potentially dangerous eval() again.
2357 potentially dangerous eval() again.
2353
2358
2354 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2359 * IPython/iplib.py (InteractiveShell._prefilter): reorganized the
2355 logic a bit more to clean up the escapes handling and minimize the
2360 logic a bit more to clean up the escapes handling and minimize the
2356 use of _ofind to only necessary cases. The interactive 'feel' of
2361 use of _ofind to only necessary cases. The interactive 'feel' of
2357 IPython should have improved quite a bit with the changes in
2362 IPython should have improved quite a bit with the changes in
2358 _prefilter and _ofind (besides being far safer than before).
2363 _prefilter and _ofind (besides being far safer than before).
2359
2364
2360 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2365 * IPython/Magic.py (Magic.magic_edit): Fixed old bug (but rather
2361 obscure, never reported). Edit would fail to find the object to
2366 obscure, never reported). Edit would fail to find the object to
2362 edit under some circumstances.
2367 edit under some circumstances.
2363 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2368 (Magic._ofind): CRITICAL FIX. Finally removed the eval() calls
2364 which were causing double-calling of generators. Those eval calls
2369 which were causing double-calling of generators. Those eval calls
2365 were _very_ dangerous, since code with side effects could be
2370 were _very_ dangerous, since code with side effects could be
2366 triggered. As they say, 'eval is evil'... These were the
2371 triggered. As they say, 'eval is evil'... These were the
2367 nastiest evals in IPython. Besides, _ofind is now far simpler,
2372 nastiest evals in IPython. Besides, _ofind is now far simpler,
2368 and it should also be quite a bit faster. Its use of inspect is
2373 and it should also be quite a bit faster. Its use of inspect is
2369 also safer, so perhaps some of the inspect-related crashes I've
2374 also safer, so perhaps some of the inspect-related crashes I've
2370 seen lately with Python 2.3 might be taken care of. That will
2375 seen lately with Python 2.3 might be taken care of. That will
2371 need more testing.
2376 need more testing.
2372
2377
2373 2003-08-17 Fernando Perez <fperez@colorado.edu>
2378 2003-08-17 Fernando Perez <fperez@colorado.edu>
2374
2379
2375 * IPython/iplib.py (InteractiveShell._prefilter): significant
2380 * IPython/iplib.py (InteractiveShell._prefilter): significant
2376 simplifications to the logic for handling user escapes. Faster
2381 simplifications to the logic for handling user escapes. Faster
2377 and simpler code.
2382 and simpler code.
2378
2383
2379 2003-08-14 Fernando Perez <fperez@colorado.edu>
2384 2003-08-14 Fernando Perez <fperez@colorado.edu>
2380
2385
2381 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2386 * IPython/numutils.py (sum_flat): rewrote to be non-recursive.
2382 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2387 Now it requires O(N) storage (N=size(a)) for non-contiguous input,
2383 but it should be quite a bit faster. And the recursive version
2388 but it should be quite a bit faster. And the recursive version
2384 generated O(log N) intermediate storage for all rank>1 arrays,
2389 generated O(log N) intermediate storage for all rank>1 arrays,
2385 even if they were contiguous.
2390 even if they were contiguous.
2386 (l1norm): Added this function.
2391 (l1norm): Added this function.
2387 (norm): Added this function for arbitrary norms (including
2392 (norm): Added this function for arbitrary norms (including
2388 l-infinity). l1 and l2 are still special cases for convenience
2393 l-infinity). l1 and l2 are still special cases for convenience
2389 and speed.
2394 and speed.
2390
2395
2391 2003-08-03 Fernando Perez <fperez@colorado.edu>
2396 2003-08-03 Fernando Perez <fperez@colorado.edu>
2392
2397
2393 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2398 * IPython/Magic.py (Magic.magic_edit): Removed all remaining string
2394 exceptions, which now raise PendingDeprecationWarnings in Python
2399 exceptions, which now raise PendingDeprecationWarnings in Python
2395 2.3. There were some in Magic and some in Gnuplot2.
2400 2.3. There were some in Magic and some in Gnuplot2.
2396
2401
2397 2003-06-30 Fernando Perez <fperez@colorado.edu>
2402 2003-06-30 Fernando Perez <fperez@colorado.edu>
2398
2403
2399 * IPython/genutils.py (page): modified to call curses only for
2404 * IPython/genutils.py (page): modified to call curses only for
2400 terminals where TERM=='xterm'. After problems under many other
2405 terminals where TERM=='xterm'. After problems under many other
2401 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2406 terminals were reported by Keith Beattie <KSBeattie-AT-lbl.gov>.
2402
2407
2403 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2408 * IPython/iplib.py (complete): removed spurious 'print "IE"' which
2404 would be triggered when readline was absent. This was just an old
2409 would be triggered when readline was absent. This was just an old
2405 debugging statement I'd forgotten to take out.
2410 debugging statement I'd forgotten to take out.
2406
2411
2407 2003-06-20 Fernando Perez <fperez@colorado.edu>
2412 2003-06-20 Fernando Perez <fperez@colorado.edu>
2408
2413
2409 * IPython/genutils.py (clock): modified to return only user time
2414 * IPython/genutils.py (clock): modified to return only user time
2410 (not counting system time), after a discussion on scipy. While
2415 (not counting system time), after a discussion on scipy. While
2411 system time may be a useful quantity occasionally, it may much
2416 system time may be a useful quantity occasionally, it may much
2412 more easily be skewed by occasional swapping or other similar
2417 more easily be skewed by occasional swapping or other similar
2413 activity.
2418 activity.
2414
2419
2415 2003-06-05 Fernando Perez <fperez@colorado.edu>
2420 2003-06-05 Fernando Perez <fperez@colorado.edu>
2416
2421
2417 * IPython/numutils.py (identity): new function, for building
2422 * IPython/numutils.py (identity): new function, for building
2418 arbitrary rank Kronecker deltas (mostly backwards compatible with
2423 arbitrary rank Kronecker deltas (mostly backwards compatible with
2419 Numeric.identity)
2424 Numeric.identity)
2420
2425
2421 2003-06-03 Fernando Perez <fperez@colorado.edu>
2426 2003-06-03 Fernando Perez <fperez@colorado.edu>
2422
2427
2423 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2428 * IPython/iplib.py (InteractiveShell.handle_magic): protect
2424 arguments passed to magics with spaces, to allow trailing '\' to
2429 arguments passed to magics with spaces, to allow trailing '\' to
2425 work normally (mainly for Windows users).
2430 work normally (mainly for Windows users).
2426
2431
2427 2003-05-29 Fernando Perez <fperez@colorado.edu>
2432 2003-05-29 Fernando Perez <fperez@colorado.edu>
2428
2433
2429 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2434 * IPython/ipmaker.py (make_IPython): Load site._Helper() as help
2430 instead of pydoc.help. This fixes a bizarre behavior where
2435 instead of pydoc.help. This fixes a bizarre behavior where
2431 printing '%s' % locals() would trigger the help system. Now
2436 printing '%s' % locals() would trigger the help system. Now
2432 ipython behaves like normal python does.
2437 ipython behaves like normal python does.
2433
2438
2434 Note that if one does 'from pydoc import help', the bizarre
2439 Note that if one does 'from pydoc import help', the bizarre
2435 behavior returns, but this will also happen in normal python, so
2440 behavior returns, but this will also happen in normal python, so
2436 it's not an ipython bug anymore (it has to do with how pydoc.help
2441 it's not an ipython bug anymore (it has to do with how pydoc.help
2437 is implemented).
2442 is implemented).
2438
2443
2439 2003-05-22 Fernando Perez <fperez@colorado.edu>
2444 2003-05-22 Fernando Perez <fperez@colorado.edu>
2440
2445
2441 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2446 * IPython/FlexCompleter.py (Completer.attr_matches): fixed to
2442 return [] instead of None when nothing matches, also match to end
2447 return [] instead of None when nothing matches, also match to end
2443 of line. Patch by Gary Bishop.
2448 of line. Patch by Gary Bishop.
2444
2449
2445 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2450 * IPython/ipmaker.py (make_IPython): Added same sys.excepthook
2446 protection as before, for files passed on the command line. This
2451 protection as before, for files passed on the command line. This
2447 prevents the CrashHandler from kicking in if user files call into
2452 prevents the CrashHandler from kicking in if user files call into
2448 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2453 sys.excepthook (such as PyQt and WxWindows have a nasty habit of
2449 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2454 doing). After a report by Kasper Souren <Kasper.Souren-AT-ircam.fr>
2450
2455
2451 2003-05-20 *** Released version 0.4.0
2456 2003-05-20 *** Released version 0.4.0
2452
2457
2453 2003-05-20 Fernando Perez <fperez@colorado.edu>
2458 2003-05-20 Fernando Perez <fperez@colorado.edu>
2454
2459
2455 * setup.py: added support for manpages. It's a bit hackish b/c of
2460 * setup.py: added support for manpages. It's a bit hackish b/c of
2456 a bug in the way the bdist_rpm distutils target handles gzipped
2461 a bug in the way the bdist_rpm distutils target handles gzipped
2457 manpages, but it works. After a patch by Jack.
2462 manpages, but it works. After a patch by Jack.
2458
2463
2459 2003-05-19 Fernando Perez <fperez@colorado.edu>
2464 2003-05-19 Fernando Perez <fperez@colorado.edu>
2460
2465
2461 * IPython/numutils.py: added a mockup of the kinds module, since
2466 * IPython/numutils.py: added a mockup of the kinds module, since
2462 it was recently removed from Numeric. This way, numutils will
2467 it was recently removed from Numeric. This way, numutils will
2463 work for all users even if they are missing kinds.
2468 work for all users even if they are missing kinds.
2464
2469
2465 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2470 * IPython/Magic.py (Magic._ofind): Harden against an inspect
2466 failure, which can occur with SWIG-wrapped extensions. After a
2471 failure, which can occur with SWIG-wrapped extensions. After a
2467 crash report from Prabhu.
2472 crash report from Prabhu.
2468
2473
2469 2003-05-16 Fernando Perez <fperez@colorado.edu>
2474 2003-05-16 Fernando Perez <fperez@colorado.edu>
2470
2475
2471 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2476 * IPython/iplib.py (InteractiveShell.excepthook): New method to
2472 protect ipython from user code which may call directly
2477 protect ipython from user code which may call directly
2473 sys.excepthook (this looks like an ipython crash to the user, even
2478 sys.excepthook (this looks like an ipython crash to the user, even
2474 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2479 when it isn't). After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2475 This is especially important to help users of WxWindows, but may
2480 This is especially important to help users of WxWindows, but may
2476 also be useful in other cases.
2481 also be useful in other cases.
2477
2482
2478 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2483 * IPython/ultraTB.py (AutoFormattedTB.__call__): Changed to allow
2479 an optional tb_offset to be specified, and to preserve exception
2484 an optional tb_offset to be specified, and to preserve exception
2480 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2485 info if given. After a patch by Gary Bishop <gb-AT-cs.unc.edu>.
2481
2486
2482 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2487 * ipython.1 (Default): Thanks to Jack's work, we now have manpages!
2483
2488
2484 2003-05-15 Fernando Perez <fperez@colorado.edu>
2489 2003-05-15 Fernando Perez <fperez@colorado.edu>
2485
2490
2486 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2491 * IPython/iplib.py (InteractiveShell.user_setup): Fix crash when
2487 installing for a new user under Windows.
2492 installing for a new user under Windows.
2488
2493
2489 2003-05-12 Fernando Perez <fperez@colorado.edu>
2494 2003-05-12 Fernando Perez <fperez@colorado.edu>
2490
2495
2491 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2496 * IPython/iplib.py (InteractiveShell.handle_emacs): New line
2492 handler for Emacs comint-based lines. Currently it doesn't do
2497 handler for Emacs comint-based lines. Currently it doesn't do
2493 much (but importantly, it doesn't update the history cache). In
2498 much (but importantly, it doesn't update the history cache). In
2494 the future it may be expanded if Alex needs more functionality
2499 the future it may be expanded if Alex needs more functionality
2495 there.
2500 there.
2496
2501
2497 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2502 * IPython/CrashHandler.py (CrashHandler.__call__): Added platform
2498 info to crash reports.
2503 info to crash reports.
2499
2504
2500 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2505 * IPython/iplib.py (InteractiveShell.mainloop): Added -c option,
2501 just like Python's -c. Also fixed crash with invalid -color
2506 just like Python's -c. Also fixed crash with invalid -color
2502 option value at startup. Thanks to Will French
2507 option value at startup. Thanks to Will French
2503 <wfrench-AT-bestweb.net> for the bug report.
2508 <wfrench-AT-bestweb.net> for the bug report.
2504
2509
2505 2003-05-09 Fernando Perez <fperez@colorado.edu>
2510 2003-05-09 Fernando Perez <fperez@colorado.edu>
2506
2511
2507 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2512 * IPython/genutils.py (EvalDict.__getitem__): Renamed EvalString
2508 to EvalDict (it's a mapping, after all) and simplified its code
2513 to EvalDict (it's a mapping, after all) and simplified its code
2509 quite a bit, after a nice discussion on c.l.py where Gustavo
2514 quite a bit, after a nice discussion on c.l.py where Gustavo
2510 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
2515 CΓ³rdova <gcordova-AT-sismex.com> suggested the new version.
2511
2516
2512 2003-04-30 Fernando Perez <fperez@colorado.edu>
2517 2003-04-30 Fernando Perez <fperez@colorado.edu>
2513
2518
2514 * IPython/genutils.py (timings_out): modified it to reduce its
2519 * IPython/genutils.py (timings_out): modified it to reduce its
2515 overhead in the common reps==1 case.
2520 overhead in the common reps==1 case.
2516
2521
2517 2003-04-29 Fernando Perez <fperez@colorado.edu>
2522 2003-04-29 Fernando Perez <fperez@colorado.edu>
2518
2523
2519 * IPython/genutils.py (timings_out): Modified to use the resource
2524 * IPython/genutils.py (timings_out): Modified to use the resource
2520 module, which avoids the wraparound problems of time.clock().
2525 module, which avoids the wraparound problems of time.clock().
2521
2526
2522 2003-04-17 *** Released version 0.2.15pre4
2527 2003-04-17 *** Released version 0.2.15pre4
2523
2528
2524 2003-04-17 Fernando Perez <fperez@colorado.edu>
2529 2003-04-17 Fernando Perez <fperez@colorado.edu>
2525
2530
2526 * setup.py (scriptfiles): Split windows-specific stuff over to a
2531 * setup.py (scriptfiles): Split windows-specific stuff over to a
2527 separate file, in an attempt to have a Windows GUI installer.
2532 separate file, in an attempt to have a Windows GUI installer.
2528 That didn't work, but part of the groundwork is done.
2533 That didn't work, but part of the groundwork is done.
2529
2534
2530 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
2535 * IPython/UserConfig/ipythonrc: Added M-i, M-o and M-I for
2531 indent/unindent with 4 spaces. Particularly useful in combination
2536 indent/unindent with 4 spaces. Particularly useful in combination
2532 with the new auto-indent option.
2537 with the new auto-indent option.
2533
2538
2534 2003-04-16 Fernando Perez <fperez@colorado.edu>
2539 2003-04-16 Fernando Perez <fperez@colorado.edu>
2535
2540
2536 * IPython/Magic.py: various replacements of self.rc for
2541 * IPython/Magic.py: various replacements of self.rc for
2537 self.shell.rc. A lot more remains to be done to fully disentangle
2542 self.shell.rc. A lot more remains to be done to fully disentangle
2538 this class from the main Shell class.
2543 this class from the main Shell class.
2539
2544
2540 * IPython/GnuplotRuntime.py: added checks for mouse support so
2545 * IPython/GnuplotRuntime.py: added checks for mouse support so
2541 that we don't try to enable it if the current gnuplot doesn't
2546 that we don't try to enable it if the current gnuplot doesn't
2542 really support it. Also added checks so that we don't try to
2547 really support it. Also added checks so that we don't try to
2543 enable persist under Windows (where Gnuplot doesn't recognize the
2548 enable persist under Windows (where Gnuplot doesn't recognize the
2544 option).
2549 option).
2545
2550
2546 * IPython/iplib.py (InteractiveShell.interact): Added optional
2551 * IPython/iplib.py (InteractiveShell.interact): Added optional
2547 auto-indenting code, after a patch by King C. Shu
2552 auto-indenting code, after a patch by King C. Shu
2548 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
2553 <kingshu-AT-myrealbox.com>. It's off by default because it doesn't
2549 get along well with pasting indented code. If I ever figure out
2554 get along well with pasting indented code. If I ever figure out
2550 how to make that part go well, it will become on by default.
2555 how to make that part go well, it will become on by default.
2551
2556
2552 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
2557 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixed bug which would
2553 crash ipython if there was an unmatched '%' in the user's prompt
2558 crash ipython if there was an unmatched '%' in the user's prompt
2554 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2559 string. Reported by Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2555
2560
2556 * IPython/iplib.py (InteractiveShell.interact): removed the
2561 * IPython/iplib.py (InteractiveShell.interact): removed the
2557 ability to ask the user whether he wants to crash or not at the
2562 ability to ask the user whether he wants to crash or not at the
2558 'last line' exception handler. Calling functions at that point
2563 'last line' exception handler. Calling functions at that point
2559 changes the stack, and the error reports would have incorrect
2564 changes the stack, and the error reports would have incorrect
2560 tracebacks.
2565 tracebacks.
2561
2566
2562 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
2567 * IPython/Magic.py (Magic.magic_page): Added new @page magic, to
2563 pass through a peger a pretty-printed form of any object. After a
2568 pass through a peger a pretty-printed form of any object. After a
2564 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
2569 contribution by Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr>
2565
2570
2566 2003-04-14 Fernando Perez <fperez@colorado.edu>
2571 2003-04-14 Fernando Perez <fperez@colorado.edu>
2567
2572
2568 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
2573 * IPython/iplib.py (InteractiveShell.user_setup): Fixed bug where
2569 all files in ~ would be modified at first install (instead of
2574 all files in ~ would be modified at first install (instead of
2570 ~/.ipython). This could be potentially disastrous, as the
2575 ~/.ipython). This could be potentially disastrous, as the
2571 modification (make line-endings native) could damage binary files.
2576 modification (make line-endings native) could damage binary files.
2572
2577
2573 2003-04-10 Fernando Perez <fperez@colorado.edu>
2578 2003-04-10 Fernando Perez <fperez@colorado.edu>
2574
2579
2575 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
2580 * IPython/iplib.py (InteractiveShell.handle_help): Modified to
2576 handle only lines which are invalid python. This now means that
2581 handle only lines which are invalid python. This now means that
2577 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
2582 lines like 'x=1 #?' execute properly. Thanks to Jeffery Collins
2578 for the bug report.
2583 for the bug report.
2579
2584
2580 2003-04-01 Fernando Perez <fperez@colorado.edu>
2585 2003-04-01 Fernando Perez <fperez@colorado.edu>
2581
2586
2582 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
2587 * IPython/iplib.py (InteractiveShell.showtraceback): Fixed bug
2583 where failing to set sys.last_traceback would crash pdb.pm().
2588 where failing to set sys.last_traceback would crash pdb.pm().
2584 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
2589 Thanks to Jeffery D. Collins <Jeff.Collins-AT-vexcel.com> for the bug
2585 report.
2590 report.
2586
2591
2587 2003-03-25 Fernando Perez <fperez@colorado.edu>
2592 2003-03-25 Fernando Perez <fperez@colorado.edu>
2588
2593
2589 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
2594 * IPython/Magic.py (Magic.magic_prun): rstrip() output of profiler
2590 before printing it (it had a lot of spurious blank lines at the
2595 before printing it (it had a lot of spurious blank lines at the
2591 end).
2596 end).
2592
2597
2593 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
2598 * IPython/Gnuplot2.py (Gnuplot.hardcopy): fixed bug where lpr
2594 output would be sent 21 times! Obviously people don't use this
2599 output would be sent 21 times! Obviously people don't use this
2595 too often, or I would have heard about it.
2600 too often, or I would have heard about it.
2596
2601
2597 2003-03-24 Fernando Perez <fperez@colorado.edu>
2602 2003-03-24 Fernando Perez <fperez@colorado.edu>
2598
2603
2599 * setup.py (scriptfiles): renamed the data_files parameter from
2604 * setup.py (scriptfiles): renamed the data_files parameter from
2600 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
2605 'base' to 'data' to fix rpm build issues. Thanks to Ralf Ahlbrink
2601 for the patch.
2606 for the patch.
2602
2607
2603 2003-03-20 Fernando Perez <fperez@colorado.edu>
2608 2003-03-20 Fernando Perez <fperez@colorado.edu>
2604
2609
2605 * IPython/genutils.py (error): added error() and fatal()
2610 * IPython/genutils.py (error): added error() and fatal()
2606 functions.
2611 functions.
2607
2612
2608 2003-03-18 *** Released version 0.2.15pre3
2613 2003-03-18 *** Released version 0.2.15pre3
2609
2614
2610 2003-03-18 Fernando Perez <fperez@colorado.edu>
2615 2003-03-18 Fernando Perez <fperez@colorado.edu>
2611
2616
2612 * setupext/install_data_ext.py
2617 * setupext/install_data_ext.py
2613 (install_data_ext.initialize_options): Class contributed by Jack
2618 (install_data_ext.initialize_options): Class contributed by Jack
2614 Moffit for fixing the old distutils hack. He is sending this to
2619 Moffit for fixing the old distutils hack. He is sending this to
2615 the distutils folks so in the future we may not need it as a
2620 the distutils folks so in the future we may not need it as a
2616 private fix.
2621 private fix.
2617
2622
2618 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
2623 * MANIFEST.in: Extensive reorganization, based on Jack Moffit's
2619 changes for Debian packaging. See his patch for full details.
2624 changes for Debian packaging. See his patch for full details.
2620 The old distutils hack of making the ipythonrc* files carry a
2625 The old distutils hack of making the ipythonrc* files carry a
2621 bogus .py extension is gone, at last. Examples were moved to a
2626 bogus .py extension is gone, at last. Examples were moved to a
2622 separate subdir under doc/, and the separate executable scripts
2627 separate subdir under doc/, and the separate executable scripts
2623 now live in their own directory. Overall a great cleanup. The
2628 now live in their own directory. Overall a great cleanup. The
2624 manual was updated to use the new files, and setup.py has been
2629 manual was updated to use the new files, and setup.py has been
2625 fixed for this setup.
2630 fixed for this setup.
2626
2631
2627 * IPython/PyColorize.py (Parser.usage): made non-executable and
2632 * IPython/PyColorize.py (Parser.usage): made non-executable and
2628 created a pycolor wrapper around it to be included as a script.
2633 created a pycolor wrapper around it to be included as a script.
2629
2634
2630 2003-03-12 *** Released version 0.2.15pre2
2635 2003-03-12 *** Released version 0.2.15pre2
2631
2636
2632 2003-03-12 Fernando Perez <fperez@colorado.edu>
2637 2003-03-12 Fernando Perez <fperez@colorado.edu>
2633
2638
2634 * IPython/ColorANSI.py (make_color_table): Finally fixed the
2639 * IPython/ColorANSI.py (make_color_table): Finally fixed the
2635 long-standing problem with garbage characters in some terminals.
2640 long-standing problem with garbage characters in some terminals.
2636 The issue was really that the \001 and \002 escapes must _only_ be
2641 The issue was really that the \001 and \002 escapes must _only_ be
2637 passed to input prompts (which call readline), but _never_ to
2642 passed to input prompts (which call readline), but _never_ to
2638 normal text to be printed on screen. I changed ColorANSI to have
2643 normal text to be printed on screen. I changed ColorANSI to have
2639 two classes: TermColors and InputTermColors, each with the
2644 two classes: TermColors and InputTermColors, each with the
2640 appropriate escapes for input prompts or normal text. The code in
2645 appropriate escapes for input prompts or normal text. The code in
2641 Prompts.py got slightly more complicated, but this very old and
2646 Prompts.py got slightly more complicated, but this very old and
2642 annoying bug is finally fixed.
2647 annoying bug is finally fixed.
2643
2648
2644 All the credit for nailing down the real origin of this problem
2649 All the credit for nailing down the real origin of this problem
2645 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
2650 and the correct solution goes to Jack Moffit <jack-AT-xiph.org>.
2646 *Many* thanks to him for spending quite a bit of effort on this.
2651 *Many* thanks to him for spending quite a bit of effort on this.
2647
2652
2648 2003-03-05 *** Released version 0.2.15pre1
2653 2003-03-05 *** Released version 0.2.15pre1
2649
2654
2650 2003-03-03 Fernando Perez <fperez@colorado.edu>
2655 2003-03-03 Fernando Perez <fperez@colorado.edu>
2651
2656
2652 * IPython/FakeModule.py: Moved the former _FakeModule to a
2657 * IPython/FakeModule.py: Moved the former _FakeModule to a
2653 separate file, because it's also needed by Magic (to fix a similar
2658 separate file, because it's also needed by Magic (to fix a similar
2654 pickle-related issue in @run).
2659 pickle-related issue in @run).
2655
2660
2656 2003-03-02 Fernando Perez <fperez@colorado.edu>
2661 2003-03-02 Fernando Perez <fperez@colorado.edu>
2657
2662
2658 * IPython/Magic.py (Magic.magic_autocall): new magic to control
2663 * IPython/Magic.py (Magic.magic_autocall): new magic to control
2659 the autocall option at runtime.
2664 the autocall option at runtime.
2660 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
2665 (Magic.magic_dhist): changed self.user_ns to self.shell.user_ns
2661 across Magic.py to start separating Magic from InteractiveShell.
2666 across Magic.py to start separating Magic from InteractiveShell.
2662 (Magic._ofind): Fixed to return proper namespace for dotted
2667 (Magic._ofind): Fixed to return proper namespace for dotted
2663 names. Before, a dotted name would always return 'not currently
2668 names. Before, a dotted name would always return 'not currently
2664 defined', because it would find the 'parent'. s.x would be found,
2669 defined', because it would find the 'parent'. s.x would be found,
2665 but since 'x' isn't defined by itself, it would get confused.
2670 but since 'x' isn't defined by itself, it would get confused.
2666 (Magic.magic_run): Fixed pickling problems reported by Ralf
2671 (Magic.magic_run): Fixed pickling problems reported by Ralf
2667 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
2672 Ahlbrink <RAhlbrink-AT-RosenInspection.net>. The fix was similar to
2668 that I'd used when Mike Heeter reported similar issues at the
2673 that I'd used when Mike Heeter reported similar issues at the
2669 top-level, but now for @run. It boils down to injecting the
2674 top-level, but now for @run. It boils down to injecting the
2670 namespace where code is being executed with something that looks
2675 namespace where code is being executed with something that looks
2671 enough like a module to fool pickle.dump(). Since a pickle stores
2676 enough like a module to fool pickle.dump(). Since a pickle stores
2672 a named reference to the importing module, we need this for
2677 a named reference to the importing module, we need this for
2673 pickles to save something sensible.
2678 pickles to save something sensible.
2674
2679
2675 * IPython/ipmaker.py (make_IPython): added an autocall option.
2680 * IPython/ipmaker.py (make_IPython): added an autocall option.
2676
2681
2677 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
2682 * IPython/iplib.py (InteractiveShell._prefilter): reordered all of
2678 the auto-eval code. Now autocalling is an option, and the code is
2683 the auto-eval code. Now autocalling is an option, and the code is
2679 also vastly safer. There is no more eval() involved at all.
2684 also vastly safer. There is no more eval() involved at all.
2680
2685
2681 2003-03-01 Fernando Perez <fperez@colorado.edu>
2686 2003-03-01 Fernando Perez <fperez@colorado.edu>
2682
2687
2683 * IPython/Magic.py (Magic._ofind): Changed interface to return a
2688 * IPython/Magic.py (Magic._ofind): Changed interface to return a
2684 dict with named keys instead of a tuple.
2689 dict with named keys instead of a tuple.
2685
2690
2686 * IPython: Started using CVS for IPython as of 0.2.15pre1.
2691 * IPython: Started using CVS for IPython as of 0.2.15pre1.
2687
2692
2688 * setup.py (make_shortcut): Fixed message about directories
2693 * setup.py (make_shortcut): Fixed message about directories
2689 created during Windows installation (the directories were ok, just
2694 created during Windows installation (the directories were ok, just
2690 the printed message was misleading). Thanks to Chris Liechti
2695 the printed message was misleading). Thanks to Chris Liechti
2691 <cliechti-AT-gmx.net> for the heads up.
2696 <cliechti-AT-gmx.net> for the heads up.
2692
2697
2693 2003-02-21 Fernando Perez <fperez@colorado.edu>
2698 2003-02-21 Fernando Perez <fperez@colorado.edu>
2694
2699
2695 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
2700 * IPython/iplib.py (InteractiveShell._prefilter): Fixed catching
2696 of ValueError exception when checking for auto-execution. This
2701 of ValueError exception when checking for auto-execution. This
2697 one is raised by things like Numeric arrays arr.flat when the
2702 one is raised by things like Numeric arrays arr.flat when the
2698 array is non-contiguous.
2703 array is non-contiguous.
2699
2704
2700 2003-01-31 Fernando Perez <fperez@colorado.edu>
2705 2003-01-31 Fernando Perez <fperez@colorado.edu>
2701
2706
2702 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
2707 * IPython/genutils.py (SystemExec.bq): Fixed bug where bq would
2703 not return any value at all (even though the command would get
2708 not return any value at all (even though the command would get
2704 executed).
2709 executed).
2705 (xsys): Flush stdout right after printing the command to ensure
2710 (xsys): Flush stdout right after printing the command to ensure
2706 proper ordering of commands and command output in the total
2711 proper ordering of commands and command output in the total
2707 output.
2712 output.
2708 (SystemExec/xsys/bq): Switched the names of xsys/bq and
2713 (SystemExec/xsys/bq): Switched the names of xsys/bq and
2709 system/getoutput as defaults. The old ones are kept for
2714 system/getoutput as defaults. The old ones are kept for
2710 compatibility reasons, so no code which uses this library needs
2715 compatibility reasons, so no code which uses this library needs
2711 changing.
2716 changing.
2712
2717
2713 2003-01-27 *** Released version 0.2.14
2718 2003-01-27 *** Released version 0.2.14
2714
2719
2715 2003-01-25 Fernando Perez <fperez@colorado.edu>
2720 2003-01-25 Fernando Perez <fperez@colorado.edu>
2716
2721
2717 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
2722 * IPython/Magic.py (Magic.magic_edit): Fixed problem where
2718 functions defined in previous edit sessions could not be re-edited
2723 functions defined in previous edit sessions could not be re-edited
2719 (because the temp files were immediately removed). Now temp files
2724 (because the temp files were immediately removed). Now temp files
2720 are removed only at IPython's exit.
2725 are removed only at IPython's exit.
2721 (Magic.magic_run): Improved @run to perform shell-like expansions
2726 (Magic.magic_run): Improved @run to perform shell-like expansions
2722 on its arguments (~users and $VARS). With this, @run becomes more
2727 on its arguments (~users and $VARS). With this, @run becomes more
2723 like a normal command-line.
2728 like a normal command-line.
2724
2729
2725 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
2730 * IPython/Shell.py (IPShellEmbed.__call__): Fixed a bunch of small
2726 bugs related to embedding and cleaned up that code. A fairly
2731 bugs related to embedding and cleaned up that code. A fairly
2727 important one was the impossibility to access the global namespace
2732 important one was the impossibility to access the global namespace
2728 through the embedded IPython (only local variables were visible).
2733 through the embedded IPython (only local variables were visible).
2729
2734
2730 2003-01-14 Fernando Perez <fperez@colorado.edu>
2735 2003-01-14 Fernando Perez <fperez@colorado.edu>
2731
2736
2732 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
2737 * IPython/iplib.py (InteractiveShell._prefilter): Fixed
2733 auto-calling to be a bit more conservative. Now it doesn't get
2738 auto-calling to be a bit more conservative. Now it doesn't get
2734 triggered if any of '!=()<>' are in the rest of the input line, to
2739 triggered if any of '!=()<>' are in the rest of the input line, to
2735 allow comparing callables. Thanks to Alex for the heads up.
2740 allow comparing callables. Thanks to Alex for the heads up.
2736
2741
2737 2003-01-07 Fernando Perez <fperez@colorado.edu>
2742 2003-01-07 Fernando Perez <fperez@colorado.edu>
2738
2743
2739 * IPython/genutils.py (page): fixed estimation of the number of
2744 * IPython/genutils.py (page): fixed estimation of the number of
2740 lines in a string to be paged to simply count newlines. This
2745 lines in a string to be paged to simply count newlines. This
2741 prevents over-guessing due to embedded escape sequences. A better
2746 prevents over-guessing due to embedded escape sequences. A better
2742 long-term solution would involve stripping out the control chars
2747 long-term solution would involve stripping out the control chars
2743 for the count, but it's potentially so expensive I just don't
2748 for the count, but it's potentially so expensive I just don't
2744 think it's worth doing.
2749 think it's worth doing.
2745
2750
2746 2002-12-19 *** Released version 0.2.14pre50
2751 2002-12-19 *** Released version 0.2.14pre50
2747
2752
2748 2002-12-19 Fernando Perez <fperez@colorado.edu>
2753 2002-12-19 Fernando Perez <fperez@colorado.edu>
2749
2754
2750 * tools/release (version): Changed release scripts to inform
2755 * tools/release (version): Changed release scripts to inform
2751 Andrea and build a NEWS file with a list of recent changes.
2756 Andrea and build a NEWS file with a list of recent changes.
2752
2757
2753 * IPython/ColorANSI.py (__all__): changed terminal detection
2758 * IPython/ColorANSI.py (__all__): changed terminal detection
2754 code. Seems to work better for xterms without breaking
2759 code. Seems to work better for xterms without breaking
2755 konsole. Will need more testing to determine if WinXP and Mac OSX
2760 konsole. Will need more testing to determine if WinXP and Mac OSX
2756 also work ok.
2761 also work ok.
2757
2762
2758 2002-12-18 *** Released version 0.2.14pre49
2763 2002-12-18 *** Released version 0.2.14pre49
2759
2764
2760 2002-12-18 Fernando Perez <fperez@colorado.edu>
2765 2002-12-18 Fernando Perez <fperez@colorado.edu>
2761
2766
2762 * Docs: added new info about Mac OSX, from Andrea.
2767 * Docs: added new info about Mac OSX, from Andrea.
2763
2768
2764 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
2769 * IPython/Gnuplot2.py (String): Added a String PlotItem class to
2765 allow direct plotting of python strings whose format is the same
2770 allow direct plotting of python strings whose format is the same
2766 of gnuplot data files.
2771 of gnuplot data files.
2767
2772
2768 2002-12-16 Fernando Perez <fperez@colorado.edu>
2773 2002-12-16 Fernando Perez <fperez@colorado.edu>
2769
2774
2770 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
2775 * IPython/iplib.py (InteractiveShell.interact): fixed default (y)
2771 value of exit question to be acknowledged.
2776 value of exit question to be acknowledged.
2772
2777
2773 2002-12-03 Fernando Perez <fperez@colorado.edu>
2778 2002-12-03 Fernando Perez <fperez@colorado.edu>
2774
2779
2775 * IPython/ipmaker.py: removed generators, which had been added
2780 * IPython/ipmaker.py: removed generators, which had been added
2776 by mistake in an earlier debugging run. This was causing trouble
2781 by mistake in an earlier debugging run. This was causing trouble
2777 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
2782 to users of python 2.1.x. Thanks to Abel Daniel <abli-AT-freemail.hu>
2778 for pointing this out.
2783 for pointing this out.
2779
2784
2780 2002-11-17 Fernando Perez <fperez@colorado.edu>
2785 2002-11-17 Fernando Perez <fperez@colorado.edu>
2781
2786
2782 * Manual: updated the Gnuplot section.
2787 * Manual: updated the Gnuplot section.
2783
2788
2784 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
2789 * IPython/GnuplotRuntime.py: refactored a lot all this code, with
2785 a much better split of what goes in Runtime and what goes in
2790 a much better split of what goes in Runtime and what goes in
2786 Interactive.
2791 Interactive.
2787
2792
2788 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
2793 * IPython/ipmaker.py: fixed bug where import_fail_info wasn't
2789 being imported from iplib.
2794 being imported from iplib.
2790
2795
2791 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
2796 * IPython/GnuplotInteractive.py (magic_gpc): renamed @gp to @gpc
2792 for command-passing. Now the global Gnuplot instance is called
2797 for command-passing. Now the global Gnuplot instance is called
2793 'gp' instead of 'g', which was really a far too fragile and
2798 'gp' instead of 'g', which was really a far too fragile and
2794 common name.
2799 common name.
2795
2800
2796 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
2801 * IPython/Gnuplot2.py (eps_fix_bbox): added this to fix broken
2797 bounding boxes generated by Gnuplot for square plots.
2802 bounding boxes generated by Gnuplot for square plots.
2798
2803
2799 * IPython/genutils.py (popkey): new function added. I should
2804 * IPython/genutils.py (popkey): new function added. I should
2800 suggest this on c.l.py as a dict method, it seems useful.
2805 suggest this on c.l.py as a dict method, it seems useful.
2801
2806
2802 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
2807 * IPython/Gnuplot2.py (Gnuplot.plot): Overhauled plot and replot
2803 to transparently handle PostScript generation. MUCH better than
2808 to transparently handle PostScript generation. MUCH better than
2804 the previous plot_eps/replot_eps (which I removed now). The code
2809 the previous plot_eps/replot_eps (which I removed now). The code
2805 is also fairly clean and well documented now (including
2810 is also fairly clean and well documented now (including
2806 docstrings).
2811 docstrings).
2807
2812
2808 2002-11-13 Fernando Perez <fperez@colorado.edu>
2813 2002-11-13 Fernando Perez <fperez@colorado.edu>
2809
2814
2810 * IPython/Magic.py (Magic.magic_edit): fixed docstring
2815 * IPython/Magic.py (Magic.magic_edit): fixed docstring
2811 (inconsistent with options).
2816 (inconsistent with options).
2812
2817
2813 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
2818 * IPython/Gnuplot2.py (Gnuplot.hardcopy): hardcopy had been
2814 manually disabled, I don't know why. Fixed it.
2819 manually disabled, I don't know why. Fixed it.
2815 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
2820 (Gnuplot._plot_eps): added new plot_eps/replot_eps to get directly
2816 eps output.
2821 eps output.
2817
2822
2818 2002-11-12 Fernando Perez <fperez@colorado.edu>
2823 2002-11-12 Fernando Perez <fperez@colorado.edu>
2819
2824
2820 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
2825 * IPython/genutils.py (ask_yes_no): trap EOF and ^C so that they
2821 don't propagate up to caller. Fixes crash reported by François
2826 don't propagate up to caller. Fixes crash reported by François
2822 Pinard.
2827 Pinard.
2823
2828
2824 2002-11-09 Fernando Perez <fperez@colorado.edu>
2829 2002-11-09 Fernando Perez <fperez@colorado.edu>
2825
2830
2826 * IPython/ipmaker.py (make_IPython): fixed problem with writing
2831 * IPython/ipmaker.py (make_IPython): fixed problem with writing
2827 history file for new users.
2832 history file for new users.
2828 (make_IPython): fixed bug where initial install would leave the
2833 (make_IPython): fixed bug where initial install would leave the
2829 user running in the .ipython dir.
2834 user running in the .ipython dir.
2830 (make_IPython): fixed bug where config dir .ipython would be
2835 (make_IPython): fixed bug where config dir .ipython would be
2831 created regardless of the given -ipythondir option. Thanks to Cory
2836 created regardless of the given -ipythondir option. Thanks to Cory
2832 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
2837 Dodt <cdodt-AT-fcoe.k12.ca.us> for the bug report.
2833
2838
2834 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
2839 * IPython/genutils.py (ask_yes_no): new function for asking yes/no
2835 type confirmations. Will need to use it in all of IPython's code
2840 type confirmations. Will need to use it in all of IPython's code
2836 consistently.
2841 consistently.
2837
2842
2838 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
2843 * IPython/CrashHandler.py (CrashHandler.__call__): changed the
2839 context to print 31 lines instead of the default 5. This will make
2844 context to print 31 lines instead of the default 5. This will make
2840 the crash reports extremely detailed in case the problem is in
2845 the crash reports extremely detailed in case the problem is in
2841 libraries I don't have access to.
2846 libraries I don't have access to.
2842
2847
2843 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
2848 * IPython/iplib.py (InteractiveShell.interact): changed the 'last
2844 line of defense' code to still crash, but giving users fair
2849 line of defense' code to still crash, but giving users fair
2845 warning. I don't want internal errors to go unreported: if there's
2850 warning. I don't want internal errors to go unreported: if there's
2846 an internal problem, IPython should crash and generate a full
2851 an internal problem, IPython should crash and generate a full
2847 report.
2852 report.
2848
2853
2849 2002-11-08 Fernando Perez <fperez@colorado.edu>
2854 2002-11-08 Fernando Perez <fperez@colorado.edu>
2850
2855
2851 * IPython/iplib.py (InteractiveShell.interact): added code to trap
2856 * IPython/iplib.py (InteractiveShell.interact): added code to trap
2852 otherwise uncaught exceptions which can appear if people set
2857 otherwise uncaught exceptions which can appear if people set
2853 sys.stdout to something badly broken. Thanks to a crash report
2858 sys.stdout to something badly broken. Thanks to a crash report
2854 from henni-AT-mail.brainbot.com.
2859 from henni-AT-mail.brainbot.com.
2855
2860
2856 2002-11-04 Fernando Perez <fperez@colorado.edu>
2861 2002-11-04 Fernando Perez <fperez@colorado.edu>
2857
2862
2858 * IPython/iplib.py (InteractiveShell.interact): added
2863 * IPython/iplib.py (InteractiveShell.interact): added
2859 __IPYTHON__active to the builtins. It's a flag which goes on when
2864 __IPYTHON__active to the builtins. It's a flag which goes on when
2860 the interaction starts and goes off again when it stops. This
2865 the interaction starts and goes off again when it stops. This
2861 allows embedding code to detect being inside IPython. Before this
2866 allows embedding code to detect being inside IPython. Before this
2862 was done via __IPYTHON__, but that only shows that an IPython
2867 was done via __IPYTHON__, but that only shows that an IPython
2863 instance has been created.
2868 instance has been created.
2864
2869
2865 * IPython/Magic.py (Magic.magic_env): I realized that in a
2870 * IPython/Magic.py (Magic.magic_env): I realized that in a
2866 UserDict, instance.data holds the data as a normal dict. So I
2871 UserDict, instance.data holds the data as a normal dict. So I
2867 modified @env to return os.environ.data instead of rebuilding a
2872 modified @env to return os.environ.data instead of rebuilding a
2868 dict by hand.
2873 dict by hand.
2869
2874
2870 2002-11-02 Fernando Perez <fperez@colorado.edu>
2875 2002-11-02 Fernando Perez <fperez@colorado.edu>
2871
2876
2872 * IPython/genutils.py (warn): changed so that level 1 prints no
2877 * IPython/genutils.py (warn): changed so that level 1 prints no
2873 header. Level 2 is now the default (with 'WARNING' header, as
2878 header. Level 2 is now the default (with 'WARNING' header, as
2874 before). I think I tracked all places where changes were needed in
2879 before). I think I tracked all places where changes were needed in
2875 IPython, but outside code using the old level numbering may have
2880 IPython, but outside code using the old level numbering may have
2876 broken.
2881 broken.
2877
2882
2878 * IPython/iplib.py (InteractiveShell.runcode): added this to
2883 * IPython/iplib.py (InteractiveShell.runcode): added this to
2879 handle the tracebacks in SystemExit traps correctly. The previous
2884 handle the tracebacks in SystemExit traps correctly. The previous
2880 code (through interact) was printing more of the stack than
2885 code (through interact) was printing more of the stack than
2881 necessary, showing IPython internal code to the user.
2886 necessary, showing IPython internal code to the user.
2882
2887
2883 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
2888 * IPython/UserConfig/ipythonrc.py: Made confirm_exit 1 by
2884 default. Now that the default at the confirmation prompt is yes,
2889 default. Now that the default at the confirmation prompt is yes,
2885 it's not so intrusive. François' argument that ipython sessions
2890 it's not so intrusive. François' argument that ipython sessions
2886 tend to be complex enough not to lose them from an accidental C-d,
2891 tend to be complex enough not to lose them from an accidental C-d,
2887 is a valid one.
2892 is a valid one.
2888
2893
2889 * IPython/iplib.py (InteractiveShell.interact): added a
2894 * IPython/iplib.py (InteractiveShell.interact): added a
2890 showtraceback() call to the SystemExit trap, and modified the exit
2895 showtraceback() call to the SystemExit trap, and modified the exit
2891 confirmation to have yes as the default.
2896 confirmation to have yes as the default.
2892
2897
2893 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
2898 * IPython/UserConfig/ipythonrc.py: removed 'session' option from
2894 this file. It's been gone from the code for a long time, this was
2899 this file. It's been gone from the code for a long time, this was
2895 simply leftover junk.
2900 simply leftover junk.
2896
2901
2897 2002-11-01 Fernando Perez <fperez@colorado.edu>
2902 2002-11-01 Fernando Perez <fperez@colorado.edu>
2898
2903
2899 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
2904 * IPython/UserConfig/ipythonrc.py: new confirm_exit option
2900 added. If set, IPython now traps EOF and asks for
2905 added. If set, IPython now traps EOF and asks for
2901 confirmation. After a request by François Pinard.
2906 confirmation. After a request by François Pinard.
2902
2907
2903 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
2908 * IPython/Magic.py (Magic.magic_Exit): New @Exit and @Quit instead
2904 of @abort, and with a new (better) mechanism for handling the
2909 of @abort, and with a new (better) mechanism for handling the
2905 exceptions.
2910 exceptions.
2906
2911
2907 2002-10-27 Fernando Perez <fperez@colorado.edu>
2912 2002-10-27 Fernando Perez <fperez@colorado.edu>
2908
2913
2909 * IPython/usage.py (__doc__): updated the --help information and
2914 * IPython/usage.py (__doc__): updated the --help information and
2910 the ipythonrc file to indicate that -log generates
2915 the ipythonrc file to indicate that -log generates
2911 ./ipython.log. Also fixed the corresponding info in @logstart.
2916 ./ipython.log. Also fixed the corresponding info in @logstart.
2912 This and several other fixes in the manuals thanks to reports by
2917 This and several other fixes in the manuals thanks to reports by
2913 François Pinard <pinard-AT-iro.umontreal.ca>.
2918 François Pinard <pinard-AT-iro.umontreal.ca>.
2914
2919
2915 * IPython/Logger.py (Logger.switch_log): Fixed error message to
2920 * IPython/Logger.py (Logger.switch_log): Fixed error message to
2916 refer to @logstart (instead of @log, which doesn't exist).
2921 refer to @logstart (instead of @log, which doesn't exist).
2917
2922
2918 * IPython/iplib.py (InteractiveShell._prefilter): fixed
2923 * IPython/iplib.py (InteractiveShell._prefilter): fixed
2919 AttributeError crash. Thanks to Christopher Armstrong
2924 AttributeError crash. Thanks to Christopher Armstrong
2920 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
2925 <radix-AT-twistedmatrix.com> for the report/fix. This bug had been
2921 introduced recently (in 0.2.14pre37) with the fix to the eval
2926 introduced recently (in 0.2.14pre37) with the fix to the eval
2922 problem mentioned below.
2927 problem mentioned below.
2923
2928
2924 2002-10-17 Fernando Perez <fperez@colorado.edu>
2929 2002-10-17 Fernando Perez <fperez@colorado.edu>
2925
2930
2926 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
2931 * IPython/ConfigLoader.py (ConfigLoader.load): Fixes for Windows
2927 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
2932 installation. Thanks to Leonardo Santagada <retype-AT-terra.com.br>.
2928
2933
2929 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
2934 * IPython/iplib.py (InteractiveShell._prefilter): Many changes to
2930 this function to fix a problem reported by Alex Schmolck. He saw
2935 this function to fix a problem reported by Alex Schmolck. He saw
2931 it with list comprehensions and generators, which were getting
2936 it with list comprehensions and generators, which were getting
2932 called twice. The real problem was an 'eval' call in testing for
2937 called twice. The real problem was an 'eval' call in testing for
2933 automagic which was evaluating the input line silently.
2938 automagic which was evaluating the input line silently.
2934
2939
2935 This is a potentially very nasty bug, if the input has side
2940 This is a potentially very nasty bug, if the input has side
2936 effects which must not be repeated. The code is much cleaner now,
2941 effects which must not be repeated. The code is much cleaner now,
2937 without any blanket 'except' left and with a regexp test for
2942 without any blanket 'except' left and with a regexp test for
2938 actual function names.
2943 actual function names.
2939
2944
2940 But an eval remains, which I'm not fully comfortable with. I just
2945 But an eval remains, which I'm not fully comfortable with. I just
2941 don't know how to find out if an expression could be a callable in
2946 don't know how to find out if an expression could be a callable in
2942 the user's namespace without doing an eval on the string. However
2947 the user's namespace without doing an eval on the string. However
2943 that string is now much more strictly checked so that no code
2948 that string is now much more strictly checked so that no code
2944 slips by, so the eval should only happen for things that can
2949 slips by, so the eval should only happen for things that can
2945 really be only function/method names.
2950 really be only function/method names.
2946
2951
2947 2002-10-15 Fernando Perez <fperez@colorado.edu>
2952 2002-10-15 Fernando Perez <fperez@colorado.edu>
2948
2953
2949 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
2954 * Updated LyX to 1.2.1 so I can work on the docs again. Added Mac
2950 OSX information to main manual, removed README_Mac_OSX file from
2955 OSX information to main manual, removed README_Mac_OSX file from
2951 distribution. Also updated credits for recent additions.
2956 distribution. Also updated credits for recent additions.
2952
2957
2953 2002-10-10 Fernando Perez <fperez@colorado.edu>
2958 2002-10-10 Fernando Perez <fperez@colorado.edu>
2954
2959
2955 * README_Mac_OSX: Added a README for Mac OSX users for fixing
2960 * README_Mac_OSX: Added a README for Mac OSX users for fixing
2956 terminal-related issues. Many thanks to Andrea Riciputi
2961 terminal-related issues. Many thanks to Andrea Riciputi
2957 <andrea.riciputi-AT-libero.it> for writing it.
2962 <andrea.riciputi-AT-libero.it> for writing it.
2958
2963
2959 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
2964 * IPython/UserConfig/ipythonrc.py: Fixes to various small issues,
2960 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2965 thanks to Thorsten Kampe <thorsten-AT-thorstenkampe.de>.
2961
2966
2962 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
2967 * setup.py (make_shortcut): Fixes for Windows installation. Thanks
2963 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
2968 to Fredrik Kant <fredrik.kant-AT-front.com> and Syver Enstad
2964 <syver-en-AT-online.no> who both submitted patches for this problem.
2969 <syver-en-AT-online.no> who both submitted patches for this problem.
2965
2970
2966 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
2971 * IPython/iplib.py (InteractiveShell.embed_mainloop): Patch for
2967 global embedding to make sure that things don't overwrite user
2972 global embedding to make sure that things don't overwrite user
2968 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
2973 globals accidentally. Thanks to Richard <rxe-AT-renre-europe.com>
2969
2974
2970 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
2975 * IPython/Gnuplot2.py (gp): Patch for Gnuplot.py 1.6
2971 compatibility. Thanks to Hayden Callow
2976 compatibility. Thanks to Hayden Callow
2972 <h.callow-AT-elec.canterbury.ac.nz>
2977 <h.callow-AT-elec.canterbury.ac.nz>
2973
2978
2974 2002-10-04 Fernando Perez <fperez@colorado.edu>
2979 2002-10-04 Fernando Perez <fperez@colorado.edu>
2975
2980
2976 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
2981 * IPython/Gnuplot2.py (PlotItem): Added 'index' option for
2977 Gnuplot.File objects.
2982 Gnuplot.File objects.
2978
2983
2979 2002-07-23 Fernando Perez <fperez@colorado.edu>
2984 2002-07-23 Fernando Perez <fperez@colorado.edu>
2980
2985
2981 * IPython/genutils.py (timing): Added timings() and timing() for
2986 * IPython/genutils.py (timing): Added timings() and timing() for
2982 quick access to the most commonly needed data, the execution
2987 quick access to the most commonly needed data, the execution
2983 times. Old timing() renamed to timings_out().
2988 times. Old timing() renamed to timings_out().
2984
2989
2985 2002-07-18 Fernando Perez <fperez@colorado.edu>
2990 2002-07-18 Fernando Perez <fperez@colorado.edu>
2986
2991
2987 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
2992 * IPython/Shell.py (IPShellEmbed.restore_system_completer): fixed
2988 bug with nested instances disrupting the parent's tab completion.
2993 bug with nested instances disrupting the parent's tab completion.
2989
2994
2990 * IPython/iplib.py (all_completions): Added Alex Schmolck's
2995 * IPython/iplib.py (all_completions): Added Alex Schmolck's
2991 all_completions code to begin the emacs integration.
2996 all_completions code to begin the emacs integration.
2992
2997
2993 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
2998 * IPython/Gnuplot2.py (zip_items): Added optional 'titles'
2994 argument to allow titling individual arrays when plotting.
2999 argument to allow titling individual arrays when plotting.
2995
3000
2996 2002-07-15 Fernando Perez <fperez@colorado.edu>
3001 2002-07-15 Fernando Perez <fperez@colorado.edu>
2997
3002
2998 * setup.py (make_shortcut): changed to retrieve the value of
3003 * setup.py (make_shortcut): changed to retrieve the value of
2999 'Program Files' directory from the registry (this value changes in
3004 'Program Files' directory from the registry (this value changes in
3000 non-english versions of Windows). Thanks to Thomas Fanslau
3005 non-english versions of Windows). Thanks to Thomas Fanslau
3001 <tfanslau-AT-gmx.de> for the report.
3006 <tfanslau-AT-gmx.de> for the report.
3002
3007
3003 2002-07-10 Fernando Perez <fperez@colorado.edu>
3008 2002-07-10 Fernando Perez <fperez@colorado.edu>
3004
3009
3005 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3010 * IPython/ultraTB.py (VerboseTB.debugger): enabled workaround for
3006 a bug in pdb, which crashes if a line with only whitespace is
3011 a bug in pdb, which crashes if a line with only whitespace is
3007 entered. Bug report submitted to sourceforge.
3012 entered. Bug report submitted to sourceforge.
3008
3013
3009 2002-07-09 Fernando Perez <fperez@colorado.edu>
3014 2002-07-09 Fernando Perez <fperez@colorado.edu>
3010
3015
3011 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3016 * IPython/ultraTB.py (VerboseTB.nullrepr): fixed rare crash when
3012 reporting exceptions (it's a bug in inspect.py, I just set a
3017 reporting exceptions (it's a bug in inspect.py, I just set a
3013 workaround).
3018 workaround).
3014
3019
3015 2002-07-08 Fernando Perez <fperez@colorado.edu>
3020 2002-07-08 Fernando Perez <fperez@colorado.edu>
3016
3021
3017 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3022 * IPython/iplib.py (InteractiveShell.__init__): fixed reference to
3018 __IPYTHON__ in __builtins__ to show up in user_ns.
3023 __IPYTHON__ in __builtins__ to show up in user_ns.
3019
3024
3020 2002-07-03 Fernando Perez <fperez@colorado.edu>
3025 2002-07-03 Fernando Perez <fperez@colorado.edu>
3021
3026
3022 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3027 * IPython/GnuplotInteractive.py (magic_gp_set_default): changed
3023 name from @gp_set_instance to @gp_set_default.
3028 name from @gp_set_instance to @gp_set_default.
3024
3029
3025 * IPython/ipmaker.py (make_IPython): default editor value set to
3030 * IPython/ipmaker.py (make_IPython): default editor value set to
3026 '0' (a string), to match the rc file. Otherwise will crash when
3031 '0' (a string), to match the rc file. Otherwise will crash when
3027 .strip() is called on it.
3032 .strip() is called on it.
3028
3033
3029
3034
3030 2002-06-28 Fernando Perez <fperez@colorado.edu>
3035 2002-06-28 Fernando Perez <fperez@colorado.edu>
3031
3036
3032 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3037 * IPython/iplib.py (InteractiveShell.safe_execfile): fix importing
3033 of files in current directory when a file is executed via
3038 of files in current directory when a file is executed via
3034 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3039 @run. Patch also by RA <ralf_ahlbrink-AT-web.de>.
3035
3040
3036 * setup.py (manfiles): fix for rpm builds, submitted by RA
3041 * setup.py (manfiles): fix for rpm builds, submitted by RA
3037 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3042 <ralf_ahlbrink-AT-web.de>. Now we have RPMs!
3038
3043
3039 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3044 * IPython/ipmaker.py (make_IPython): fixed lookup of default
3040 editor when set to '0'. Problem was, '0' evaluates to True (it's a
3045 editor when set to '0'. Problem was, '0' evaluates to True (it's a
3041 string!). A. Schmolck caught this one.
3046 string!). A. Schmolck caught this one.
3042
3047
3043 2002-06-27 Fernando Perez <fperez@colorado.edu>
3048 2002-06-27 Fernando Perez <fperez@colorado.edu>
3044
3049
3045 * IPython/ipmaker.py (make_IPython): fixed bug when running user
3050 * IPython/ipmaker.py (make_IPython): fixed bug when running user
3046 defined files at the cmd line. __name__ wasn't being set to
3051 defined files at the cmd line. __name__ wasn't being set to
3047 __main__.
3052 __main__.
3048
3053
3049 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
3054 * IPython/Gnuplot2.py (zip_items): improved it so it can plot also
3050 regular lists and tuples besides Numeric arrays.
3055 regular lists and tuples besides Numeric arrays.
3051
3056
3052 * IPython/Prompts.py (CachedOutput.__call__): Added output
3057 * IPython/Prompts.py (CachedOutput.__call__): Added output
3053 supression for input ending with ';'. Similar to Mathematica and
3058 supression for input ending with ';'. Similar to Mathematica and
3054 Matlab. The _* vars and Out[] list are still updated, just like
3059 Matlab. The _* vars and Out[] list are still updated, just like
3055 Mathematica behaves.
3060 Mathematica behaves.
3056
3061
3057 2002-06-25 Fernando Perez <fperez@colorado.edu>
3062 2002-06-25 Fernando Perez <fperez@colorado.edu>
3058
3063
3059 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
3064 * IPython/ConfigLoader.py (ConfigLoader.load): fixed checking of
3060 .ini extensions for profiels under Windows.
3065 .ini extensions for profiels under Windows.
3061
3066
3062 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
3067 * IPython/OInspect.py (Inspector.pinfo): improved alignment of
3063 string form. Fix contributed by Alexander Schmolck
3068 string form. Fix contributed by Alexander Schmolck
3064 <a.schmolck-AT-gmx.net>
3069 <a.schmolck-AT-gmx.net>
3065
3070
3066 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
3071 * IPython/GnuplotRuntime.py (gp_new): new function. Returns a
3067 pre-configured Gnuplot instance.
3072 pre-configured Gnuplot instance.
3068
3073
3069 2002-06-21 Fernando Perez <fperez@colorado.edu>
3074 2002-06-21 Fernando Perez <fperez@colorado.edu>
3070
3075
3071 * IPython/numutils.py (exp_safe): new function, works around the
3076 * IPython/numutils.py (exp_safe): new function, works around the
3072 underflow problems in Numeric.
3077 underflow problems in Numeric.
3073 (log2): New fn. Safe log in base 2: returns exact integer answer
3078 (log2): New fn. Safe log in base 2: returns exact integer answer
3074 for exact integer powers of 2.
3079 for exact integer powers of 2.
3075
3080
3076 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3081 * IPython/Magic.py (get_py_filename): fixed it not expanding '~'
3077 properly.
3082 properly.
3078
3083
3079 2002-06-20 Fernando Perez <fperez@colorado.edu>
3084 2002-06-20 Fernando Perez <fperez@colorado.edu>
3080
3085
3081 * IPython/genutils.py (timing): new function like
3086 * IPython/genutils.py (timing): new function like
3082 Mathematica's. Similar to time_test, but returns more info.
3087 Mathematica's. Similar to time_test, but returns more info.
3083
3088
3084 2002-06-18 Fernando Perez <fperez@colorado.edu>
3089 2002-06-18 Fernando Perez <fperez@colorado.edu>
3085
3090
3086 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3091 * IPython/Magic.py (Magic.magic_save): modified @save and @r
3087 according to Mike Heeter's suggestions.
3092 according to Mike Heeter's suggestions.
3088
3093
3089 2002-06-16 Fernando Perez <fperez@colorado.edu>
3094 2002-06-16 Fernando Perez <fperez@colorado.edu>
3090
3095
3091 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3096 * IPython/GnuplotRuntime.py: Massive overhaul to the Gnuplot
3092 system. GnuplotMagic is gone as a user-directory option. New files
3097 system. GnuplotMagic is gone as a user-directory option. New files
3093 make it easier to use all the gnuplot stuff both from external
3098 make it easier to use all the gnuplot stuff both from external
3094 programs as well as from IPython. Had to rewrite part of
3099 programs as well as from IPython. Had to rewrite part of
3095 hardcopy() b/c of a strange bug: often the ps files simply don't
3100 hardcopy() b/c of a strange bug: often the ps files simply don't
3096 get created, and require a repeat of the command (often several
3101 get created, and require a repeat of the command (often several
3097 times).
3102 times).
3098
3103
3099 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3104 * IPython/ultraTB.py (AutoFormattedTB.__call__): changed to
3100 resolve output channel at call time, so that if sys.stderr has
3105 resolve output channel at call time, so that if sys.stderr has
3101 been redirected by user this gets honored.
3106 been redirected by user this gets honored.
3102
3107
3103 2002-06-13 Fernando Perez <fperez@colorado.edu>
3108 2002-06-13 Fernando Perez <fperez@colorado.edu>
3104
3109
3105 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3110 * IPython/Shell.py (IPShell.__init__): Changed IPythonShell to
3106 IPShell. Kept a copy with the old names to avoid breaking people's
3111 IPShell. Kept a copy with the old names to avoid breaking people's
3107 embedded code.
3112 embedded code.
3108
3113
3109 * IPython/ipython: simplified it to the bare minimum after
3114 * IPython/ipython: simplified it to the bare minimum after
3110 Holger's suggestions. Added info about how to use it in
3115 Holger's suggestions. Added info about how to use it in
3111 PYTHONSTARTUP.
3116 PYTHONSTARTUP.
3112
3117
3113 * IPython/Shell.py (IPythonShell): changed the options passing
3118 * IPython/Shell.py (IPythonShell): changed the options passing
3114 from a string with funky %s replacements to a straight list. Maybe
3119 from a string with funky %s replacements to a straight list. Maybe
3115 a bit more typing, but it follows sys.argv conventions, so there's
3120 a bit more typing, but it follows sys.argv conventions, so there's
3116 less special-casing to remember.
3121 less special-casing to remember.
3117
3122
3118 2002-06-12 Fernando Perez <fperez@colorado.edu>
3123 2002-06-12 Fernando Perez <fperez@colorado.edu>
3119
3124
3120 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3125 * IPython/Magic.py (Magic.magic_r): new magic auto-repeat
3121 command. Thanks to a suggestion by Mike Heeter.
3126 command. Thanks to a suggestion by Mike Heeter.
3122 (Magic.magic_pfile): added behavior to look at filenames if given
3127 (Magic.magic_pfile): added behavior to look at filenames if given
3123 arg is not a defined object.
3128 arg is not a defined object.
3124 (Magic.magic_save): New @save function to save code snippets. Also
3129 (Magic.magic_save): New @save function to save code snippets. Also
3125 a Mike Heeter idea.
3130 a Mike Heeter idea.
3126
3131
3127 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3132 * IPython/UserConfig/GnuplotMagic.py (plot): Improvements to
3128 plot() and replot(). Much more convenient now, especially for
3133 plot() and replot(). Much more convenient now, especially for
3129 interactive use.
3134 interactive use.
3130
3135
3131 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3136 * IPython/Magic.py (Magic.magic_run): Added .py automatically to
3132 filenames.
3137 filenames.
3133
3138
3134 2002-06-02 Fernando Perez <fperez@colorado.edu>
3139 2002-06-02 Fernando Perez <fperez@colorado.edu>
3135
3140
3136 * IPython/Struct.py (Struct.__init__): modified to admit
3141 * IPython/Struct.py (Struct.__init__): modified to admit
3137 initialization via another struct.
3142 initialization via another struct.
3138
3143
3139 * IPython/genutils.py (SystemExec.__init__): New stateful
3144 * IPython/genutils.py (SystemExec.__init__): New stateful
3140 interface to xsys and bq. Useful for writing system scripts.
3145 interface to xsys and bq. Useful for writing system scripts.
3141
3146
3142 2002-05-30 Fernando Perez <fperez@colorado.edu>
3147 2002-05-30 Fernando Perez <fperez@colorado.edu>
3143
3148
3144 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3149 * MANIFEST.in: Changed docfile selection to exclude all the lyx
3145 documents. This will make the user download smaller (it's getting
3150 documents. This will make the user download smaller (it's getting
3146 too big).
3151 too big).
3147
3152
3148 2002-05-29 Fernando Perez <fperez@colorado.edu>
3153 2002-05-29 Fernando Perez <fperez@colorado.edu>
3149
3154
3150 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3155 * IPython/iplib.py (_FakeModule.__init__): New class introduced to
3151 fix problems with shelve and pickle. Seems to work, but I don't
3156 fix problems with shelve and pickle. Seems to work, but I don't
3152 know if corner cases break it. Thanks to Mike Heeter
3157 know if corner cases break it. Thanks to Mike Heeter
3153 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3158 <korora-AT-SDF.LONESTAR.ORG> for the bug reports and test cases.
3154
3159
3155 2002-05-24 Fernando Perez <fperez@colorado.edu>
3160 2002-05-24 Fernando Perez <fperez@colorado.edu>
3156
3161
3157 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3162 * IPython/Magic.py (Macro.__init__): fixed magics embedded in
3158 macros having broken.
3163 macros having broken.
3159
3164
3160 2002-05-21 Fernando Perez <fperez@colorado.edu>
3165 2002-05-21 Fernando Perez <fperez@colorado.edu>
3161
3166
3162 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3167 * IPython/Magic.py (Magic.magic_logstart): fixed recently
3163 introduced logging bug: all history before logging started was
3168 introduced logging bug: all history before logging started was
3164 being written one character per line! This came from the redesign
3169 being written one character per line! This came from the redesign
3165 of the input history as a special list which slices to strings,
3170 of the input history as a special list which slices to strings,
3166 not to lists.
3171 not to lists.
3167
3172
3168 2002-05-20 Fernando Perez <fperez@colorado.edu>
3173 2002-05-20 Fernando Perez <fperez@colorado.edu>
3169
3174
3170 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3175 * IPython/Prompts.py (CachedOutput.__init__): made the color table
3171 be an attribute of all classes in this module. The design of these
3176 be an attribute of all classes in this module. The design of these
3172 classes needs some serious overhauling.
3177 classes needs some serious overhauling.
3173
3178
3174 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3179 * IPython/DPyGetOpt.py (DPyGetOpt.setPosixCompliance): fixed bug
3175 which was ignoring '_' in option names.
3180 which was ignoring '_' in option names.
3176
3181
3177 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3182 * IPython/ultraTB.py (FormattedTB.__init__): Changed
3178 'Verbose_novars' to 'Context' and made it the new default. It's a
3183 'Verbose_novars' to 'Context' and made it the new default. It's a
3179 bit more readable and also safer than verbose.
3184 bit more readable and also safer than verbose.
3180
3185
3181 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3186 * IPython/PyColorize.py (Parser.__call__): Fixed coloring of
3182 triple-quoted strings.
3187 triple-quoted strings.
3183
3188
3184 * IPython/OInspect.py (__all__): new module exposing the object
3189 * IPython/OInspect.py (__all__): new module exposing the object
3185 introspection facilities. Now the corresponding magics are dummy
3190 introspection facilities. Now the corresponding magics are dummy
3186 wrappers around this. Having this module will make it much easier
3191 wrappers around this. Having this module will make it much easier
3187 to put these functions into our modified pdb.
3192 to put these functions into our modified pdb.
3188 This new object inspector system uses the new colorizing module,
3193 This new object inspector system uses the new colorizing module,
3189 so source code and other things are nicely syntax highlighted.
3194 so source code and other things are nicely syntax highlighted.
3190
3195
3191 2002-05-18 Fernando Perez <fperez@colorado.edu>
3196 2002-05-18 Fernando Perez <fperez@colorado.edu>
3192
3197
3193 * IPython/ColorANSI.py: Split the coloring tools into a separate
3198 * IPython/ColorANSI.py: Split the coloring tools into a separate
3194 module so I can use them in other code easier (they were part of
3199 module so I can use them in other code easier (they were part of
3195 ultraTB).
3200 ultraTB).
3196
3201
3197 2002-05-17 Fernando Perez <fperez@colorado.edu>
3202 2002-05-17 Fernando Perez <fperez@colorado.edu>
3198
3203
3199 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3204 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3200 fixed it to set the global 'g' also to the called instance, as
3205 fixed it to set the global 'g' also to the called instance, as
3201 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3206 long as 'g' was still a gnuplot instance (so it doesn't overwrite
3202 user's 'g' variables).
3207 user's 'g' variables).
3203
3208
3204 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3209 * IPython/iplib.py (InteractiveShell.__init__): Added In/Out
3205 global variables (aliases to _ih,_oh) so that users which expect
3210 global variables (aliases to _ih,_oh) so that users which expect
3206 In[5] or Out[7] to work aren't unpleasantly surprised.
3211 In[5] or Out[7] to work aren't unpleasantly surprised.
3207 (InputList.__getslice__): new class to allow executing slices of
3212 (InputList.__getslice__): new class to allow executing slices of
3208 input history directly. Very simple class, complements the use of
3213 input history directly. Very simple class, complements the use of
3209 macros.
3214 macros.
3210
3215
3211 2002-05-16 Fernando Perez <fperez@colorado.edu>
3216 2002-05-16 Fernando Perez <fperez@colorado.edu>
3212
3217
3213 * setup.py (docdirbase): make doc directory be just doc/IPython
3218 * setup.py (docdirbase): make doc directory be just doc/IPython
3214 without version numbers, it will reduce clutter for users.
3219 without version numbers, it will reduce clutter for users.
3215
3220
3216 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3221 * IPython/Magic.py (Magic.magic_run): Add explicit local dict to
3217 execfile call to prevent possible memory leak. See for details:
3222 execfile call to prevent possible memory leak. See for details:
3218 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3223 http://mail.python.org/pipermail/python-list/2002-February/088476.html
3219
3224
3220 2002-05-15 Fernando Perez <fperez@colorado.edu>
3225 2002-05-15 Fernando Perez <fperez@colorado.edu>
3221
3226
3222 * IPython/Magic.py (Magic.magic_psource): made the object
3227 * IPython/Magic.py (Magic.magic_psource): made the object
3223 introspection names be more standard: pdoc, pdef, pfile and
3228 introspection names be more standard: pdoc, pdef, pfile and
3224 psource. They all print/page their output, and it makes
3229 psource. They all print/page their output, and it makes
3225 remembering them easier. Kept old names for compatibility as
3230 remembering them easier. Kept old names for compatibility as
3226 aliases.
3231 aliases.
3227
3232
3228 2002-05-14 Fernando Perez <fperez@colorado.edu>
3233 2002-05-14 Fernando Perez <fperez@colorado.edu>
3229
3234
3230 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3235 * IPython/UserConfig/GnuplotMagic.py: I think I finally understood
3231 what the mouse problem was. The trick is to use gnuplot with temp
3236 what the mouse problem was. The trick is to use gnuplot with temp
3232 files and NOT with pipes (for data communication), because having
3237 files and NOT with pipes (for data communication), because having
3233 both pipes and the mouse on is bad news.
3238 both pipes and the mouse on is bad news.
3234
3239
3235 2002-05-13 Fernando Perez <fperez@colorado.edu>
3240 2002-05-13 Fernando Perez <fperez@colorado.edu>
3236
3241
3237 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3242 * IPython/Magic.py (Magic._ofind): fixed namespace order search
3238 bug. Information would be reported about builtins even when
3243 bug. Information would be reported about builtins even when
3239 user-defined functions overrode them.
3244 user-defined functions overrode them.
3240
3245
3241 2002-05-11 Fernando Perez <fperez@colorado.edu>
3246 2002-05-11 Fernando Perez <fperez@colorado.edu>
3242
3247
3243 * IPython/__init__.py (__all__): removed FlexCompleter from
3248 * IPython/__init__.py (__all__): removed FlexCompleter from
3244 __all__ so that things don't fail in platforms without readline.
3249 __all__ so that things don't fail in platforms without readline.
3245
3250
3246 2002-05-10 Fernando Perez <fperez@colorado.edu>
3251 2002-05-10 Fernando Perez <fperez@colorado.edu>
3247
3252
3248 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3253 * IPython/__init__.py (__all__): removed numutils from __all__ b/c
3249 it requires Numeric, effectively making Numeric a dependency for
3254 it requires Numeric, effectively making Numeric a dependency for
3250 IPython.
3255 IPython.
3251
3256
3252 * Released 0.2.13
3257 * Released 0.2.13
3253
3258
3254 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3259 * IPython/Magic.py (Magic.magic_prun): big overhaul to the
3255 profiler interface. Now all the major options from the profiler
3260 profiler interface. Now all the major options from the profiler
3256 module are directly supported in IPython, both for single
3261 module are directly supported in IPython, both for single
3257 expressions (@prun) and for full programs (@run -p).
3262 expressions (@prun) and for full programs (@run -p).
3258
3263
3259 2002-05-09 Fernando Perez <fperez@colorado.edu>
3264 2002-05-09 Fernando Perez <fperez@colorado.edu>
3260
3265
3261 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3266 * IPython/Magic.py (Magic.magic_doc): fixed to show docstrings of
3262 magic properly formatted for screen.
3267 magic properly formatted for screen.
3263
3268
3264 * setup.py (make_shortcut): Changed things to put pdf version in
3269 * setup.py (make_shortcut): Changed things to put pdf version in
3265 doc/ instead of doc/manual (had to change lyxport a bit).
3270 doc/ instead of doc/manual (had to change lyxport a bit).
3266
3271
3267 * IPython/Magic.py (Profile.string_stats): made profile runs go
3272 * IPython/Magic.py (Profile.string_stats): made profile runs go
3268 through pager (they are long and a pager allows searching, saving,
3273 through pager (they are long and a pager allows searching, saving,
3269 etc.)
3274 etc.)
3270
3275
3271 2002-05-08 Fernando Perez <fperez@colorado.edu>
3276 2002-05-08 Fernando Perez <fperez@colorado.edu>
3272
3277
3273 * Released 0.2.12
3278 * Released 0.2.12
3274
3279
3275 2002-05-06 Fernando Perez <fperez@colorado.edu>
3280 2002-05-06 Fernando Perez <fperez@colorado.edu>
3276
3281
3277 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3282 * IPython/Magic.py (Magic.magic_hist): small bug fixed (recently
3278 introduced); 'hist n1 n2' was broken.
3283 introduced); 'hist n1 n2' was broken.
3279 (Magic.magic_pdb): added optional on/off arguments to @pdb
3284 (Magic.magic_pdb): added optional on/off arguments to @pdb
3280 (Magic.magic_run): added option -i to @run, which executes code in
3285 (Magic.magic_run): added option -i to @run, which executes code in
3281 the IPython namespace instead of a clean one. Also added @irun as
3286 the IPython namespace instead of a clean one. Also added @irun as
3282 an alias to @run -i.
3287 an alias to @run -i.
3283
3288
3284 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3289 * IPython/UserConfig/GnuplotMagic.py (magic_gp_set_instance):
3285 fixed (it didn't really do anything, the namespaces were wrong).
3290 fixed (it didn't really do anything, the namespaces were wrong).
3286
3291
3287 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3292 * IPython/Debugger.py (__init__): Added workaround for python 2.1
3288
3293
3289 * IPython/__init__.py (__all__): Fixed package namespace, now
3294 * IPython/__init__.py (__all__): Fixed package namespace, now
3290 'import IPython' does give access to IPython.<all> as
3295 'import IPython' does give access to IPython.<all> as
3291 expected. Also renamed __release__ to Release.
3296 expected. Also renamed __release__ to Release.
3292
3297
3293 * IPython/Debugger.py (__license__): created new Pdb class which
3298 * IPython/Debugger.py (__license__): created new Pdb class which
3294 functions like a drop-in for the normal pdb.Pdb but does NOT
3299 functions like a drop-in for the normal pdb.Pdb but does NOT
3295 import readline by default. This way it doesn't muck up IPython's
3300 import readline by default. This way it doesn't muck up IPython's
3296 readline handling, and now tab-completion finally works in the
3301 readline handling, and now tab-completion finally works in the
3297 debugger -- sort of. It completes things globally visible, but the
3302 debugger -- sort of. It completes things globally visible, but the
3298 completer doesn't track the stack as pdb walks it. That's a bit
3303 completer doesn't track the stack as pdb walks it. That's a bit
3299 tricky, and I'll have to implement it later.
3304 tricky, and I'll have to implement it later.
3300
3305
3301 2002-05-05 Fernando Perez <fperez@colorado.edu>
3306 2002-05-05 Fernando Perez <fperez@colorado.edu>
3302
3307
3303 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3308 * IPython/Magic.py (Magic.magic_oinfo): fixed formatting bug for
3304 magic docstrings when printed via ? (explicit \'s were being
3309 magic docstrings when printed via ? (explicit \'s were being
3305 printed).
3310 printed).
3306
3311
3307 * IPython/ipmaker.py (make_IPython): fixed namespace
3312 * IPython/ipmaker.py (make_IPython): fixed namespace
3308 identification bug. Now variables loaded via logs or command-line
3313 identification bug. Now variables loaded via logs or command-line
3309 files are recognized in the interactive namespace by @who.
3314 files are recognized in the interactive namespace by @who.
3310
3315
3311 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3316 * IPython/iplib.py (InteractiveShell.safe_execfile): Fixed bug in
3312 log replay system stemming from the string form of Structs.
3317 log replay system stemming from the string form of Structs.
3313
3318
3314 * IPython/Magic.py (Macro.__init__): improved macros to properly
3319 * IPython/Magic.py (Macro.__init__): improved macros to properly
3315 handle magic commands in them.
3320 handle magic commands in them.
3316 (Magic.magic_logstart): usernames are now expanded so 'logstart
3321 (Magic.magic_logstart): usernames are now expanded so 'logstart
3317 ~/mylog' now works.
3322 ~/mylog' now works.
3318
3323
3319 * IPython/iplib.py (complete): fixed bug where paths starting with
3324 * IPython/iplib.py (complete): fixed bug where paths starting with
3320 '/' would be completed as magic names.
3325 '/' would be completed as magic names.
3321
3326
3322 2002-05-04 Fernando Perez <fperez@colorado.edu>
3327 2002-05-04 Fernando Perez <fperez@colorado.edu>
3323
3328
3324 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3329 * IPython/Magic.py (Magic.magic_run): added options -p and -f to
3325 allow running full programs under the profiler's control.
3330 allow running full programs under the profiler's control.
3326
3331
3327 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3332 * IPython/ultraTB.py (FormattedTB.__init__): Added Verbose_novars
3328 mode to report exceptions verbosely but without formatting
3333 mode to report exceptions verbosely but without formatting
3329 variables. This addresses the issue of ipython 'freezing' (it's
3334 variables. This addresses the issue of ipython 'freezing' (it's
3330 not frozen, but caught in an expensive formatting loop) when huge
3335 not frozen, but caught in an expensive formatting loop) when huge
3331 variables are in the context of an exception.
3336 variables are in the context of an exception.
3332 (VerboseTB.text): Added '--->' markers at line where exception was
3337 (VerboseTB.text): Added '--->' markers at line where exception was
3333 triggered. Much clearer to read, especially in NoColor modes.
3338 triggered. Much clearer to read, especially in NoColor modes.
3334
3339
3335 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3340 * IPython/Magic.py (Magic.magic_run): bugfix: -n option had been
3336 implemented in reverse when changing to the new parse_options().
3341 implemented in reverse when changing to the new parse_options().
3337
3342
3338 2002-05-03 Fernando Perez <fperez@colorado.edu>
3343 2002-05-03 Fernando Perez <fperez@colorado.edu>
3339
3344
3340 * IPython/Magic.py (Magic.parse_options): new function so that
3345 * IPython/Magic.py (Magic.parse_options): new function so that
3341 magics can parse options easier.
3346 magics can parse options easier.
3342 (Magic.magic_prun): new function similar to profile.run(),
3347 (Magic.magic_prun): new function similar to profile.run(),
3343 suggested by Chris Hart.
3348 suggested by Chris Hart.
3344 (Magic.magic_cd): fixed behavior so that it only changes if
3349 (Magic.magic_cd): fixed behavior so that it only changes if
3345 directory actually is in history.
3350 directory actually is in history.
3346
3351
3347 * IPython/usage.py (__doc__): added information about potential
3352 * IPython/usage.py (__doc__): added information about potential
3348 slowness of Verbose exception mode when there are huge data
3353 slowness of Verbose exception mode when there are huge data
3349 structures to be formatted (thanks to Archie Paulson).
3354 structures to be formatted (thanks to Archie Paulson).
3350
3355
3351 * IPython/ipmaker.py (make_IPython): Changed default logging
3356 * IPython/ipmaker.py (make_IPython): Changed default logging
3352 (when simply called with -log) to use curr_dir/ipython.log in
3357 (when simply called with -log) to use curr_dir/ipython.log in
3353 rotate mode. Fixed crash which was occuring with -log before
3358 rotate mode. Fixed crash which was occuring with -log before
3354 (thanks to Jim Boyle).
3359 (thanks to Jim Boyle).
3355
3360
3356 2002-05-01 Fernando Perez <fperez@colorado.edu>
3361 2002-05-01 Fernando Perez <fperez@colorado.edu>
3357
3362
3358 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3363 * Released 0.2.11 for these fixes (mainly the ultraTB one which
3359 was nasty -- though somewhat of a corner case).
3364 was nasty -- though somewhat of a corner case).
3360
3365
3361 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3366 * IPython/ultraTB.py (AutoFormattedTB.text): renamed __text to
3362 text (was a bug).
3367 text (was a bug).
3363
3368
3364 2002-04-30 Fernando Perez <fperez@colorado.edu>
3369 2002-04-30 Fernando Perez <fperez@colorado.edu>
3365
3370
3366 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3371 * IPython/UserConfig/GnuplotMagic.py (magic_gp): Minor fix to add
3367 a print after ^D or ^C from the user so that the In[] prompt
3372 a print after ^D or ^C from the user so that the In[] prompt
3368 doesn't over-run the gnuplot one.
3373 doesn't over-run the gnuplot one.
3369
3374
3370 2002-04-29 Fernando Perez <fperez@colorado.edu>
3375 2002-04-29 Fernando Perez <fperez@colorado.edu>
3371
3376
3372 * Released 0.2.10
3377 * Released 0.2.10
3373
3378
3374 * IPython/__release__.py (version): get date dynamically.
3379 * IPython/__release__.py (version): get date dynamically.
3375
3380
3376 * Misc. documentation updates thanks to Arnd's comments. Also ran
3381 * Misc. documentation updates thanks to Arnd's comments. Also ran
3377 a full spellcheck on the manual (hadn't been done in a while).
3382 a full spellcheck on the manual (hadn't been done in a while).
3378
3383
3379 2002-04-27 Fernando Perez <fperez@colorado.edu>
3384 2002-04-27 Fernando Perez <fperez@colorado.edu>
3380
3385
3381 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3386 * IPython/Magic.py (Magic.magic_logstart): Fixed bug where
3382 starting a log in mid-session would reset the input history list.
3387 starting a log in mid-session would reset the input history list.
3383
3388
3384 2002-04-26 Fernando Perez <fperez@colorado.edu>
3389 2002-04-26 Fernando Perez <fperez@colorado.edu>
3385
3390
3386 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3391 * IPython/iplib.py (InteractiveShell.wait): Fixed bug where not
3387 all files were being included in an update. Now anything in
3392 all files were being included in an update. Now anything in
3388 UserConfig that matches [A-Za-z]*.py will go (this excludes
3393 UserConfig that matches [A-Za-z]*.py will go (this excludes
3389 __init__.py)
3394 __init__.py)
3390
3395
3391 2002-04-25 Fernando Perez <fperez@colorado.edu>
3396 2002-04-25 Fernando Perez <fperez@colorado.edu>
3392
3397
3393 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3398 * IPython/iplib.py (InteractiveShell.__init__): Added __IPYTHON__
3394 to __builtins__ so that any form of embedded or imported code can
3399 to __builtins__ so that any form of embedded or imported code can
3395 test for being inside IPython.
3400 test for being inside IPython.
3396
3401
3397 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3402 * IPython/UserConfig/GnuplotMagic.py: (magic_gp_set_instance):
3398 changed to GnuplotMagic because it's now an importable module,
3403 changed to GnuplotMagic because it's now an importable module,
3399 this makes the name follow that of the standard Gnuplot module.
3404 this makes the name follow that of the standard Gnuplot module.
3400 GnuplotMagic can now be loaded at any time in mid-session.
3405 GnuplotMagic can now be loaded at any time in mid-session.
3401
3406
3402 2002-04-24 Fernando Perez <fperez@colorado.edu>
3407 2002-04-24 Fernando Perez <fperez@colorado.edu>
3403
3408
3404 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3409 * IPython/numutils.py: removed SIUnits. It doesn't properly set
3405 the globals (IPython has its own namespace) and the
3410 the globals (IPython has its own namespace) and the
3406 PhysicalQuantity stuff is much better anyway.
3411 PhysicalQuantity stuff is much better anyway.
3407
3412
3408 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3413 * IPython/UserConfig/example-gnuplot.py (g2): Added gnuplot
3409 embedding example to standard user directory for
3414 embedding example to standard user directory for
3410 distribution. Also put it in the manual.
3415 distribution. Also put it in the manual.
3411
3416
3412 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3417 * IPython/numutils.py (gnuplot_exec): Changed to take a gnuplot
3413 instance as first argument (so it doesn't rely on some obscure
3418 instance as first argument (so it doesn't rely on some obscure
3414 hidden global).
3419 hidden global).
3415
3420
3416 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3421 * IPython/UserConfig/ipythonrc.py: put () back in accepted
3417 delimiters. While it prevents ().TAB from working, it allows
3422 delimiters. While it prevents ().TAB from working, it allows
3418 completions in open (... expressions. This is by far a more common
3423 completions in open (... expressions. This is by far a more common
3419 case.
3424 case.
3420
3425
3421 2002-04-23 Fernando Perez <fperez@colorado.edu>
3426 2002-04-23 Fernando Perez <fperez@colorado.edu>
3422
3427
3423 * IPython/Extensions/InterpreterPasteInput.py: new
3428 * IPython/Extensions/InterpreterPasteInput.py: new
3424 syntax-processing module for pasting lines with >>> or ... at the
3429 syntax-processing module for pasting lines with >>> or ... at the
3425 start.
3430 start.
3426
3431
3427 * IPython/Extensions/PhysicalQ_Interactive.py
3432 * IPython/Extensions/PhysicalQ_Interactive.py
3428 (PhysicalQuantityInteractive.__int__): fixed to work with either
3433 (PhysicalQuantityInteractive.__int__): fixed to work with either
3429 Numeric or math.
3434 Numeric or math.
3430
3435
3431 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3436 * IPython/UserConfig/ipythonrc-numeric.py: reorganized the
3432 provided profiles. Now we have:
3437 provided profiles. Now we have:
3433 -math -> math module as * and cmath with its own namespace.
3438 -math -> math module as * and cmath with its own namespace.
3434 -numeric -> Numeric as *, plus gnuplot & grace
3439 -numeric -> Numeric as *, plus gnuplot & grace
3435 -physics -> same as before
3440 -physics -> same as before
3436
3441
3437 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3442 * IPython/Magic.py (Magic.magic_magic): Fixed bug where
3438 user-defined magics wouldn't be found by @magic if they were
3443 user-defined magics wouldn't be found by @magic if they were
3439 defined as class methods. Also cleaned up the namespace search
3444 defined as class methods. Also cleaned up the namespace search
3440 logic and the string building (to use %s instead of many repeated
3445 logic and the string building (to use %s instead of many repeated
3441 string adds).
3446 string adds).
3442
3447
3443 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3448 * IPython/UserConfig/example-magic.py (magic_foo): updated example
3444 of user-defined magics to operate with class methods (cleaner, in
3449 of user-defined magics to operate with class methods (cleaner, in
3445 line with the gnuplot code).
3450 line with the gnuplot code).
3446
3451
3447 2002-04-22 Fernando Perez <fperez@colorado.edu>
3452 2002-04-22 Fernando Perez <fperez@colorado.edu>
3448
3453
3449 * setup.py: updated dependency list so that manual is updated when
3454 * setup.py: updated dependency list so that manual is updated when
3450 all included files change.
3455 all included files change.
3451
3456
3452 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3457 * IPython/ipmaker.py (make_IPython): Fixed bug which was ignoring
3453 the delimiter removal option (the fix is ugly right now).
3458 the delimiter removal option (the fix is ugly right now).
3454
3459
3455 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3460 * IPython/UserConfig/ipythonrc-physics.py: simplified not to load
3456 all of the math profile (quicker loading, no conflict between
3461 all of the math profile (quicker loading, no conflict between
3457 g-9.8 and g-gnuplot).
3462 g-9.8 and g-gnuplot).
3458
3463
3459 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3464 * IPython/CrashHandler.py (CrashHandler.__call__): changed default
3460 name of post-mortem files to IPython_crash_report.txt.
3465 name of post-mortem files to IPython_crash_report.txt.
3461
3466
3462 * Cleanup/update of the docs. Added all the new readline info and
3467 * Cleanup/update of the docs. Added all the new readline info and
3463 formatted all lists as 'real lists'.
3468 formatted all lists as 'real lists'.
3464
3469
3465 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3470 * IPython/ipmaker.py (make_IPython): removed now-obsolete
3466 tab-completion options, since the full readline parse_and_bind is
3471 tab-completion options, since the full readline parse_and_bind is
3467 now accessible.
3472 now accessible.
3468
3473
3469 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3474 * IPython/iplib.py (InteractiveShell.init_readline): Changed
3470 handling of readline options. Now users can specify any string to
3475 handling of readline options. Now users can specify any string to
3471 be passed to parse_and_bind(), as well as the delimiters to be
3476 be passed to parse_and_bind(), as well as the delimiters to be
3472 removed.
3477 removed.
3473 (InteractiveShell.__init__): Added __name__ to the global
3478 (InteractiveShell.__init__): Added __name__ to the global
3474 namespace so that things like Itpl which rely on its existence
3479 namespace so that things like Itpl which rely on its existence
3475 don't crash.
3480 don't crash.
3476 (InteractiveShell._prefilter): Defined the default with a _ so
3481 (InteractiveShell._prefilter): Defined the default with a _ so
3477 that prefilter() is easier to override, while the default one
3482 that prefilter() is easier to override, while the default one
3478 remains available.
3483 remains available.
3479
3484
3480 2002-04-18 Fernando Perez <fperez@colorado.edu>
3485 2002-04-18 Fernando Perez <fperez@colorado.edu>
3481
3486
3482 * Added information about pdb in the docs.
3487 * Added information about pdb in the docs.
3483
3488
3484 2002-04-17 Fernando Perez <fperez@colorado.edu>
3489 2002-04-17 Fernando Perez <fperez@colorado.edu>
3485
3490
3486 * IPython/ipmaker.py (make_IPython): added rc_override option to
3491 * IPython/ipmaker.py (make_IPython): added rc_override option to
3487 allow passing config options at creation time which may override
3492 allow passing config options at creation time which may override
3488 anything set in the config files or command line. This is
3493 anything set in the config files or command line. This is
3489 particularly useful for configuring embedded instances.
3494 particularly useful for configuring embedded instances.
3490
3495
3491 2002-04-15 Fernando Perez <fperez@colorado.edu>
3496 2002-04-15 Fernando Perez <fperez@colorado.edu>
3492
3497
3493 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3498 * IPython/Logger.py (Logger.log): Fixed a nasty bug which could
3494 crash embedded instances because of the input cache falling out of
3499 crash embedded instances because of the input cache falling out of
3495 sync with the output counter.
3500 sync with the output counter.
3496
3501
3497 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3502 * IPython/Shell.py (IPythonShellEmbed.__init__): added a debug
3498 mode which calls pdb after an uncaught exception in IPython itself.
3503 mode which calls pdb after an uncaught exception in IPython itself.
3499
3504
3500 2002-04-14 Fernando Perez <fperez@colorado.edu>
3505 2002-04-14 Fernando Perez <fperez@colorado.edu>
3501
3506
3502 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3507 * IPython/iplib.py (InteractiveShell.showtraceback): pdb mucks up
3503 readline, fix it back after each call.
3508 readline, fix it back after each call.
3504
3509
3505 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3510 * IPython/ultraTB.py (AutoFormattedTB.__text): made text a private
3506 method to force all access via __call__(), which guarantees that
3511 method to force all access via __call__(), which guarantees that
3507 traceback references are properly deleted.
3512 traceback references are properly deleted.
3508
3513
3509 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3514 * IPython/Prompts.py (CachedOutput._display): minor fixes to
3510 improve printing when pprint is in use.
3515 improve printing when pprint is in use.
3511
3516
3512 2002-04-13 Fernando Perez <fperez@colorado.edu>
3517 2002-04-13 Fernando Perez <fperez@colorado.edu>
3513
3518
3514 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3519 * IPython/Shell.py (IPythonShellEmbed.__call__): SystemExit
3515 exceptions aren't caught anymore. If the user triggers one, he
3520 exceptions aren't caught anymore. If the user triggers one, he
3516 should know why he's doing it and it should go all the way up,
3521 should know why he's doing it and it should go all the way up,
3517 just like any other exception. So now @abort will fully kill the
3522 just like any other exception. So now @abort will fully kill the
3518 embedded interpreter and the embedding code (unless that happens
3523 embedded interpreter and the embedding code (unless that happens
3519 to catch SystemExit).
3524 to catch SystemExit).
3520
3525
3521 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
3526 * IPython/ultraTB.py (VerboseTB.__init__): added a call_pdb flag
3522 and a debugger() method to invoke the interactive pdb debugger
3527 and a debugger() method to invoke the interactive pdb debugger
3523 after printing exception information. Also added the corresponding
3528 after printing exception information. Also added the corresponding
3524 -pdb option and @pdb magic to control this feature, and updated
3529 -pdb option and @pdb magic to control this feature, and updated
3525 the docs. After a suggestion from Christopher Hart
3530 the docs. After a suggestion from Christopher Hart
3526 (hart-AT-caltech.edu).
3531 (hart-AT-caltech.edu).
3527
3532
3528 2002-04-12 Fernando Perez <fperez@colorado.edu>
3533 2002-04-12 Fernando Perez <fperez@colorado.edu>
3529
3534
3530 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
3535 * IPython/Shell.py (IPythonShellEmbed.__init__): modified to use
3531 the exception handlers defined by the user (not the CrashHandler)
3536 the exception handlers defined by the user (not the CrashHandler)
3532 so that user exceptions don't trigger an ipython bug report.
3537 so that user exceptions don't trigger an ipython bug report.
3533
3538
3534 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
3539 * IPython/ultraTB.py (ColorTB.__init__): made the color scheme
3535 configurable (it should have always been so).
3540 configurable (it should have always been so).
3536
3541
3537 2002-03-26 Fernando Perez <fperez@colorado.edu>
3542 2002-03-26 Fernando Perez <fperez@colorado.edu>
3538
3543
3539 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
3544 * IPython/Shell.py (IPythonShellEmbed.__call__): many changes here
3540 and there to fix embedding namespace issues. This should all be
3545 and there to fix embedding namespace issues. This should all be
3541 done in a more elegant way.
3546 done in a more elegant way.
3542
3547
3543 2002-03-25 Fernando Perez <fperez@colorado.edu>
3548 2002-03-25 Fernando Perez <fperez@colorado.edu>
3544
3549
3545 * IPython/genutils.py (get_home_dir): Try to make it work under
3550 * IPython/genutils.py (get_home_dir): Try to make it work under
3546 win9x also.
3551 win9x also.
3547
3552
3548 2002-03-20 Fernando Perez <fperez@colorado.edu>
3553 2002-03-20 Fernando Perez <fperez@colorado.edu>
3549
3554
3550 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
3555 * IPython/Shell.py (IPythonShellEmbed.__init__): leave
3551 sys.displayhook untouched upon __init__.
3556 sys.displayhook untouched upon __init__.
3552
3557
3553 2002-03-19 Fernando Perez <fperez@colorado.edu>
3558 2002-03-19 Fernando Perez <fperez@colorado.edu>
3554
3559
3555 * Released 0.2.9 (for embedding bug, basically).
3560 * Released 0.2.9 (for embedding bug, basically).
3556
3561
3557 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
3562 * IPython/Shell.py (IPythonShellEmbed.__call__): Trap SystemExit
3558 exceptions so that enclosing shell's state can be restored.
3563 exceptions so that enclosing shell's state can be restored.
3559
3564
3560 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
3565 * Changed magic_gnuplot.py to magic-gnuplot.py to standardize
3561 naming conventions in the .ipython/ dir.
3566 naming conventions in the .ipython/ dir.
3562
3567
3563 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
3568 * IPython/iplib.py (InteractiveShell.init_readline): removed '-'
3564 from delimiters list so filenames with - in them get expanded.
3569 from delimiters list so filenames with - in them get expanded.
3565
3570
3566 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
3571 * IPython/Shell.py (IPythonShellEmbed.__call__): fixed bug with
3567 sys.displayhook not being properly restored after an embedded call.
3572 sys.displayhook not being properly restored after an embedded call.
3568
3573
3569 2002-03-18 Fernando Perez <fperez@colorado.edu>
3574 2002-03-18 Fernando Perez <fperez@colorado.edu>
3570
3575
3571 * Released 0.2.8
3576 * Released 0.2.8
3572
3577
3573 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
3578 * IPython/iplib.py (InteractiveShell.user_setup): fixed bug where
3574 some files weren't being included in a -upgrade.
3579 some files weren't being included in a -upgrade.
3575 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
3580 (InteractiveShell.init_readline): Added 'set show-all-if-ambiguous
3576 on' so that the first tab completes.
3581 on' so that the first tab completes.
3577 (InteractiveShell.handle_magic): fixed bug with spaces around
3582 (InteractiveShell.handle_magic): fixed bug with spaces around
3578 quotes breaking many magic commands.
3583 quotes breaking many magic commands.
3579
3584
3580 * setup.py: added note about ignoring the syntax error messages at
3585 * setup.py: added note about ignoring the syntax error messages at
3581 installation.
3586 installation.
3582
3587
3583 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
3588 * IPython/UserConfig/magic_gnuplot.py (magic_gp): finished
3584 streamlining the gnuplot interface, now there's only one magic @gp.
3589 streamlining the gnuplot interface, now there's only one magic @gp.
3585
3590
3586 2002-03-17 Fernando Perez <fperez@colorado.edu>
3591 2002-03-17 Fernando Perez <fperez@colorado.edu>
3587
3592
3588 * IPython/UserConfig/magic_gnuplot.py: new name for the
3593 * IPython/UserConfig/magic_gnuplot.py: new name for the
3589 example-magic_pm.py file. Much enhanced system, now with a shell
3594 example-magic_pm.py file. Much enhanced system, now with a shell
3590 for communicating directly with gnuplot, one command at a time.
3595 for communicating directly with gnuplot, one command at a time.
3591
3596
3592 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
3597 * IPython/Magic.py (Magic.magic_run): added option -n to prevent
3593 setting __name__=='__main__'.
3598 setting __name__=='__main__'.
3594
3599
3595 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
3600 * IPython/UserConfig/example-magic_pm.py (magic_pm): Added
3596 mini-shell for accessing gnuplot from inside ipython. Should
3601 mini-shell for accessing gnuplot from inside ipython. Should
3597 extend it later for grace access too. Inspired by Arnd's
3602 extend it later for grace access too. Inspired by Arnd's
3598 suggestion.
3603 suggestion.
3599
3604
3600 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
3605 * IPython/iplib.py (InteractiveShell.handle_magic): fixed bug when
3601 calling magic functions with () in their arguments. Thanks to Arnd
3606 calling magic functions with () in their arguments. Thanks to Arnd
3602 Baecker for pointing this to me.
3607 Baecker for pointing this to me.
3603
3608
3604 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
3609 * IPython/numutils.py (sum_flat): fixed bug. Would recurse
3605 infinitely for integer or complex arrays (only worked with floats).
3610 infinitely for integer or complex arrays (only worked with floats).
3606
3611
3607 2002-03-16 Fernando Perez <fperez@colorado.edu>
3612 2002-03-16 Fernando Perez <fperez@colorado.edu>
3608
3613
3609 * setup.py: Merged setup and setup_windows into a single script
3614 * setup.py: Merged setup and setup_windows into a single script
3610 which properly handles things for windows users.
3615 which properly handles things for windows users.
3611
3616
3612 2002-03-15 Fernando Perez <fperez@colorado.edu>
3617 2002-03-15 Fernando Perez <fperez@colorado.edu>
3613
3618
3614 * Big change to the manual: now the magics are all automatically
3619 * Big change to the manual: now the magics are all automatically
3615 documented. This information is generated from their docstrings
3620 documented. This information is generated from their docstrings
3616 and put in a latex file included by the manual lyx file. This way
3621 and put in a latex file included by the manual lyx file. This way
3617 we get always up to date information for the magics. The manual
3622 we get always up to date information for the magics. The manual
3618 now also has proper version information, also auto-synced.
3623 now also has proper version information, also auto-synced.
3619
3624
3620 For this to work, an undocumented --magic_docstrings option was added.
3625 For this to work, an undocumented --magic_docstrings option was added.
3621
3626
3622 2002-03-13 Fernando Perez <fperez@colorado.edu>
3627 2002-03-13 Fernando Perez <fperez@colorado.edu>
3623
3628
3624 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
3629 * IPython/ultraTB.py (TermColors): fixed problem with dark colors
3625 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
3630 under CDE terminals. An explicit ;2 color reset is needed in the escapes.
3626
3631
3627 2002-03-12 Fernando Perez <fperez@colorado.edu>
3632 2002-03-12 Fernando Perez <fperez@colorado.edu>
3628
3633
3629 * IPython/ultraTB.py (TermColors): changed color escapes again to
3634 * IPython/ultraTB.py (TermColors): changed color escapes again to
3630 fix the (old, reintroduced) line-wrapping bug. Basically, if
3635 fix the (old, reintroduced) line-wrapping bug. Basically, if
3631 \001..\002 aren't given in the color escapes, lines get wrapped
3636 \001..\002 aren't given in the color escapes, lines get wrapped
3632 weirdly. But giving those screws up old xterms and emacs terms. So
3637 weirdly. But giving those screws up old xterms and emacs terms. So
3633 I added some logic for emacs terms to be ok, but I can't identify old
3638 I added some logic for emacs terms to be ok, but I can't identify old
3634 xterms separately ($TERM=='xterm' for many terminals, like konsole).
3639 xterms separately ($TERM=='xterm' for many terminals, like konsole).
3635
3640
3636 2002-03-10 Fernando Perez <fperez@colorado.edu>
3641 2002-03-10 Fernando Perez <fperez@colorado.edu>
3637
3642
3638 * IPython/usage.py (__doc__): Various documentation cleanups and
3643 * IPython/usage.py (__doc__): Various documentation cleanups and
3639 updates, both in usage docstrings and in the manual.
3644 updates, both in usage docstrings and in the manual.
3640
3645
3641 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
3646 * IPython/Prompts.py (CachedOutput.set_colors): cleanups for
3642 handling of caching. Set minimum acceptabe value for having a
3647 handling of caching. Set minimum acceptabe value for having a
3643 cache at 20 values.
3648 cache at 20 values.
3644
3649
3645 * IPython/iplib.py (InteractiveShell.user_setup): moved the
3650 * IPython/iplib.py (InteractiveShell.user_setup): moved the
3646 install_first_time function to a method, renamed it and added an
3651 install_first_time function to a method, renamed it and added an
3647 'upgrade' mode. Now people can update their config directory with
3652 'upgrade' mode. Now people can update their config directory with
3648 a simple command line switch (-upgrade, also new).
3653 a simple command line switch (-upgrade, also new).
3649
3654
3650 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
3655 * IPython/Magic.py (Magic.magic_pfile): Made @pfile an alias to
3651 @file (convenient for automagic users under Python >= 2.2).
3656 @file (convenient for automagic users under Python >= 2.2).
3652 Removed @files (it seemed more like a plural than an abbrev. of
3657 Removed @files (it seemed more like a plural than an abbrev. of
3653 'file show').
3658 'file show').
3654
3659
3655 * IPython/iplib.py (install_first_time): Fixed crash if there were
3660 * IPython/iplib.py (install_first_time): Fixed crash if there were
3656 backup files ('~') in .ipython/ install directory.
3661 backup files ('~') in .ipython/ install directory.
3657
3662
3658 * IPython/ipmaker.py (make_IPython): fixes for new prompt
3663 * IPython/ipmaker.py (make_IPython): fixes for new prompt
3659 system. Things look fine, but these changes are fairly
3664 system. Things look fine, but these changes are fairly
3660 intrusive. Test them for a few days.
3665 intrusive. Test them for a few days.
3661
3666
3662 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
3667 * IPython/Prompts.py (CachedOutput.__init__): Massive rewrite of
3663 the prompts system. Now all in/out prompt strings are user
3668 the prompts system. Now all in/out prompt strings are user
3664 controllable. This is particularly useful for embedding, as one
3669 controllable. This is particularly useful for embedding, as one
3665 can tag embedded instances with particular prompts.
3670 can tag embedded instances with particular prompts.
3666
3671
3667 Also removed global use of sys.ps1/2, which now allows nested
3672 Also removed global use of sys.ps1/2, which now allows nested
3668 embeddings without any problems. Added command-line options for
3673 embeddings without any problems. Added command-line options for
3669 the prompt strings.
3674 the prompt strings.
3670
3675
3671 2002-03-08 Fernando Perez <fperez@colorado.edu>
3676 2002-03-08 Fernando Perez <fperez@colorado.edu>
3672
3677
3673 * IPython/UserConfig/example-embed-short.py (ipshell): added
3678 * IPython/UserConfig/example-embed-short.py (ipshell): added
3674 example file with the bare minimum code for embedding.
3679 example file with the bare minimum code for embedding.
3675
3680
3676 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
3681 * IPython/Shell.py (IPythonShellEmbed.set_dummy_mode): added
3677 functionality for the embeddable shell to be activated/deactivated
3682 functionality for the embeddable shell to be activated/deactivated
3678 either globally or at each call.
3683 either globally or at each call.
3679
3684
3680 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
3685 * IPython/Prompts.py (Prompt1.auto_rewrite): Fixes the problem of
3681 rewriting the prompt with '--->' for auto-inputs with proper
3686 rewriting the prompt with '--->' for auto-inputs with proper
3682 coloring. Now the previous UGLY hack in handle_auto() is gone, and
3687 coloring. Now the previous UGLY hack in handle_auto() is gone, and
3683 this is handled by the prompts class itself, as it should.
3688 this is handled by the prompts class itself, as it should.
3684
3689
3685 2002-03-05 Fernando Perez <fperez@colorado.edu>
3690 2002-03-05 Fernando Perez <fperez@colorado.edu>
3686
3691
3687 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
3692 * IPython/Magic.py (Magic.magic_logstart): Changed @log to
3688 @logstart to avoid name clashes with the math log function.
3693 @logstart to avoid name clashes with the math log function.
3689
3694
3690 * Big updates to X/Emacs section of the manual.
3695 * Big updates to X/Emacs section of the manual.
3691
3696
3692 * Removed ipython_emacs. Milan explained to me how to pass
3697 * Removed ipython_emacs. Milan explained to me how to pass
3693 arguments to ipython through Emacs. Some day I'm going to end up
3698 arguments to ipython through Emacs. Some day I'm going to end up
3694 learning some lisp...
3699 learning some lisp...
3695
3700
3696 2002-03-04 Fernando Perez <fperez@colorado.edu>
3701 2002-03-04 Fernando Perez <fperez@colorado.edu>
3697
3702
3698 * IPython/ipython_emacs: Created script to be used as the
3703 * IPython/ipython_emacs: Created script to be used as the
3699 py-python-command Emacs variable so we can pass IPython
3704 py-python-command Emacs variable so we can pass IPython
3700 parameters. I can't figure out how to tell Emacs directly to pass
3705 parameters. I can't figure out how to tell Emacs directly to pass
3701 parameters to IPython, so a dummy shell script will do it.
3706 parameters to IPython, so a dummy shell script will do it.
3702
3707
3703 Other enhancements made for things to work better under Emacs'
3708 Other enhancements made for things to work better under Emacs'
3704 various types of terminals. Many thanks to Milan Zamazal
3709 various types of terminals. Many thanks to Milan Zamazal
3705 <pdm-AT-zamazal.org> for all the suggestions and pointers.
3710 <pdm-AT-zamazal.org> for all the suggestions and pointers.
3706
3711
3707 2002-03-01 Fernando Perez <fperez@colorado.edu>
3712 2002-03-01 Fernando Perez <fperez@colorado.edu>
3708
3713
3709 * IPython/ipmaker.py (make_IPython): added a --readline! option so
3714 * IPython/ipmaker.py (make_IPython): added a --readline! option so
3710 that loading of readline is now optional. This gives better
3715 that loading of readline is now optional. This gives better
3711 control to emacs users.
3716 control to emacs users.
3712
3717
3713 * IPython/ultraTB.py (__date__): Modified color escape sequences
3718 * IPython/ultraTB.py (__date__): Modified color escape sequences
3714 and now things work fine under xterm and in Emacs' term buffers
3719 and now things work fine under xterm and in Emacs' term buffers
3715 (though not shell ones). Well, in emacs you get colors, but all
3720 (though not shell ones). Well, in emacs you get colors, but all
3716 seem to be 'light' colors (no difference between dark and light
3721 seem to be 'light' colors (no difference between dark and light
3717 ones). But the garbage chars are gone, and also in xterms. It
3722 ones). But the garbage chars are gone, and also in xterms. It
3718 seems that now I'm using 'cleaner' ansi sequences.
3723 seems that now I'm using 'cleaner' ansi sequences.
3719
3724
3720 2002-02-21 Fernando Perez <fperez@colorado.edu>
3725 2002-02-21 Fernando Perez <fperez@colorado.edu>
3721
3726
3722 * Released 0.2.7 (mainly to publish the scoping fix).
3727 * Released 0.2.7 (mainly to publish the scoping fix).
3723
3728
3724 * IPython/Logger.py (Logger.logstate): added. A corresponding
3729 * IPython/Logger.py (Logger.logstate): added. A corresponding
3725 @logstate magic was created.
3730 @logstate magic was created.
3726
3731
3727 * IPython/Magic.py: fixed nested scoping problem under Python
3732 * IPython/Magic.py: fixed nested scoping problem under Python
3728 2.1.x (automagic wasn't working).
3733 2.1.x (automagic wasn't working).
3729
3734
3730 2002-02-20 Fernando Perez <fperez@colorado.edu>
3735 2002-02-20 Fernando Perez <fperez@colorado.edu>
3731
3736
3732 * Released 0.2.6.
3737 * Released 0.2.6.
3733
3738
3734 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
3739 * IPython/OutputTrap.py (OutputTrap.__init__): added a 'quiet'
3735 option so that logs can come out without any headers at all.
3740 option so that logs can come out without any headers at all.
3736
3741
3737 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
3742 * IPython/UserConfig/ipythonrc-scipy.py: created a profile for
3738 SciPy.
3743 SciPy.
3739
3744
3740 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
3745 * IPython/iplib.py (InteractiveShell.embed_mainloop): Changed so
3741 that embedded IPython calls don't require vars() to be explicitly
3746 that embedded IPython calls don't require vars() to be explicitly
3742 passed. Now they are extracted from the caller's frame (code
3747 passed. Now they are extracted from the caller's frame (code
3743 snatched from Eric Jones' weave). Added better documentation to
3748 snatched from Eric Jones' weave). Added better documentation to
3744 the section on embedding and the example file.
3749 the section on embedding and the example file.
3745
3750
3746 * IPython/genutils.py (page): Changed so that under emacs, it just
3751 * IPython/genutils.py (page): Changed so that under emacs, it just
3747 prints the string. You can then page up and down in the emacs
3752 prints the string. You can then page up and down in the emacs
3748 buffer itself. This is how the builtin help() works.
3753 buffer itself. This is how the builtin help() works.
3749
3754
3750 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
3755 * IPython/Prompts.py (CachedOutput.__call__): Fixed issue with
3751 macro scoping: macros need to be executed in the user's namespace
3756 macro scoping: macros need to be executed in the user's namespace
3752 to work as if they had been typed by the user.
3757 to work as if they had been typed by the user.
3753
3758
3754 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
3759 * IPython/Magic.py (Magic.magic_macro): Changed macros so they
3755 execute automatically (no need to type 'exec...'). They then
3760 execute automatically (no need to type 'exec...'). They then
3756 behave like 'true macros'. The printing system was also modified
3761 behave like 'true macros'. The printing system was also modified
3757 for this to work.
3762 for this to work.
3758
3763
3759 2002-02-19 Fernando Perez <fperez@colorado.edu>
3764 2002-02-19 Fernando Perez <fperez@colorado.edu>
3760
3765
3761 * IPython/genutils.py (page_file): new function for paging files
3766 * IPython/genutils.py (page_file): new function for paging files
3762 in an OS-independent way. Also necessary for file viewing to work
3767 in an OS-independent way. Also necessary for file viewing to work
3763 well inside Emacs buffers.
3768 well inside Emacs buffers.
3764 (page): Added checks for being in an emacs buffer.
3769 (page): Added checks for being in an emacs buffer.
3765 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
3770 (page): fixed bug for Windows ($TERM isn't set in Windows). Fixed
3766 same bug in iplib.
3771 same bug in iplib.
3767
3772
3768 2002-02-18 Fernando Perez <fperez@colorado.edu>
3773 2002-02-18 Fernando Perez <fperez@colorado.edu>
3769
3774
3770 * IPython/iplib.py (InteractiveShell.init_readline): modified use
3775 * IPython/iplib.py (InteractiveShell.init_readline): modified use
3771 of readline so that IPython can work inside an Emacs buffer.
3776 of readline so that IPython can work inside an Emacs buffer.
3772
3777
3773 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
3778 * IPython/ultraTB.py (AutoFormattedTB.__call__): some fixes to
3774 method signatures (they weren't really bugs, but it looks cleaner
3779 method signatures (they weren't really bugs, but it looks cleaner
3775 and keeps PyChecker happy).
3780 and keeps PyChecker happy).
3776
3781
3777 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
3782 * IPython/ipmaker.py (make_IPython): added hooks Struct to __IP
3778 for implementing various user-defined hooks. Currently only
3783 for implementing various user-defined hooks. Currently only
3779 display is done.
3784 display is done.
3780
3785
3781 * IPython/Prompts.py (CachedOutput._display): changed display
3786 * IPython/Prompts.py (CachedOutput._display): changed display
3782 functions so that they can be dynamically changed by users easily.
3787 functions so that they can be dynamically changed by users easily.
3783
3788
3784 * IPython/Extensions/numeric_formats.py (num_display): added an
3789 * IPython/Extensions/numeric_formats.py (num_display): added an
3785 extension for printing NumPy arrays in flexible manners. It
3790 extension for printing NumPy arrays in flexible manners. It
3786 doesn't do anything yet, but all the structure is in
3791 doesn't do anything yet, but all the structure is in
3787 place. Ultimately the plan is to implement output format control
3792 place. Ultimately the plan is to implement output format control
3788 like in Octave.
3793 like in Octave.
3789
3794
3790 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
3795 * IPython/Magic.py (Magic.lsmagic): changed so that bound magic
3791 methods are found at run-time by all the automatic machinery.
3796 methods are found at run-time by all the automatic machinery.
3792
3797
3793 2002-02-17 Fernando Perez <fperez@colorado.edu>
3798 2002-02-17 Fernando Perez <fperez@colorado.edu>
3794
3799
3795 * setup_Windows.py (make_shortcut): documented. Cleaned up the
3800 * setup_Windows.py (make_shortcut): documented. Cleaned up the
3796 whole file a little.
3801 whole file a little.
3797
3802
3798 * ToDo: closed this document. Now there's a new_design.lyx
3803 * ToDo: closed this document. Now there's a new_design.lyx
3799 document for all new ideas. Added making a pdf of it for the
3804 document for all new ideas. Added making a pdf of it for the
3800 end-user distro.
3805 end-user distro.
3801
3806
3802 * IPython/Logger.py (Logger.switch_log): Created this to replace
3807 * IPython/Logger.py (Logger.switch_log): Created this to replace
3803 logon() and logoff(). It also fixes a nasty crash reported by
3808 logon() and logoff(). It also fixes a nasty crash reported by
3804 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
3809 Philip Hisley <compsys-AT-starpower.net>. Many thanks to him.
3805
3810
3806 * IPython/iplib.py (complete): got auto-completion to work with
3811 * IPython/iplib.py (complete): got auto-completion to work with
3807 automagic (I had wanted this for a long time).
3812 automagic (I had wanted this for a long time).
3808
3813
3809 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
3814 * IPython/Magic.py (Magic.magic_files): Added @files as an alias
3810 to @file, since file() is now a builtin and clashes with automagic
3815 to @file, since file() is now a builtin and clashes with automagic
3811 for @file.
3816 for @file.
3812
3817
3813 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
3818 * Made some new files: Prompts, CrashHandler, Magic, Logger. All
3814 of this was previously in iplib, which had grown to more than 2000
3819 of this was previously in iplib, which had grown to more than 2000
3815 lines, way too long. No new functionality, but it makes managing
3820 lines, way too long. No new functionality, but it makes managing
3816 the code a bit easier.
3821 the code a bit easier.
3817
3822
3818 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
3823 * IPython/iplib.py (IPythonCrashHandler.__call__): Added version
3819 information to crash reports.
3824 information to crash reports.
3820
3825
3821 2002-02-12 Fernando Perez <fperez@colorado.edu>
3826 2002-02-12 Fernando Perez <fperez@colorado.edu>
3822
3827
3823 * Released 0.2.5.
3828 * Released 0.2.5.
3824
3829
3825 2002-02-11 Fernando Perez <fperez@colorado.edu>
3830 2002-02-11 Fernando Perez <fperez@colorado.edu>
3826
3831
3827 * Wrote a relatively complete Windows installer. It puts
3832 * Wrote a relatively complete Windows installer. It puts
3828 everything in place, creates Start Menu entries and fixes the
3833 everything in place, creates Start Menu entries and fixes the
3829 color issues. Nothing fancy, but it works.
3834 color issues. Nothing fancy, but it works.
3830
3835
3831 2002-02-10 Fernando Perez <fperez@colorado.edu>
3836 2002-02-10 Fernando Perez <fperez@colorado.edu>
3832
3837
3833 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
3838 * IPython/iplib.py (InteractiveShell.safe_execfile): added an
3834 os.path.expanduser() call so that we can type @run ~/myfile.py and
3839 os.path.expanduser() call so that we can type @run ~/myfile.py and
3835 have thigs work as expected.
3840 have thigs work as expected.
3836
3841
3837 * IPython/genutils.py (page): fixed exception handling so things
3842 * IPython/genutils.py (page): fixed exception handling so things
3838 work both in Unix and Windows correctly. Quitting a pager triggers
3843 work both in Unix and Windows correctly. Quitting a pager triggers
3839 an IOError/broken pipe in Unix, and in windows not finding a pager
3844 an IOError/broken pipe in Unix, and in windows not finding a pager
3840 is also an IOError, so I had to actually look at the return value
3845 is also an IOError, so I had to actually look at the return value
3841 of the exception, not just the exception itself. Should be ok now.
3846 of the exception, not just the exception itself. Should be ok now.
3842
3847
3843 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
3848 * IPython/ultraTB.py (ColorSchemeTable.set_active_scheme):
3844 modified to allow case-insensitive color scheme changes.
3849 modified to allow case-insensitive color scheme changes.
3845
3850
3846 2002-02-09 Fernando Perez <fperez@colorado.edu>
3851 2002-02-09 Fernando Perez <fperez@colorado.edu>
3847
3852
3848 * IPython/genutils.py (native_line_ends): new function to leave
3853 * IPython/genutils.py (native_line_ends): new function to leave
3849 user config files with os-native line-endings.
3854 user config files with os-native line-endings.
3850
3855
3851 * README and manual updates.
3856 * README and manual updates.
3852
3857
3853 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
3858 * IPython/genutils.py: fixed unicode bug: use types.StringTypes
3854 instead of StringType to catch Unicode strings.
3859 instead of StringType to catch Unicode strings.
3855
3860
3856 * IPython/genutils.py (filefind): fixed bug for paths with
3861 * IPython/genutils.py (filefind): fixed bug for paths with
3857 embedded spaces (very common in Windows).
3862 embedded spaces (very common in Windows).
3858
3863
3859 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
3864 * IPython/ipmaker.py (make_IPython): added a '.ini' to the rc
3860 files under Windows, so that they get automatically associated
3865 files under Windows, so that they get automatically associated
3861 with a text editor. Windows makes it a pain to handle
3866 with a text editor. Windows makes it a pain to handle
3862 extension-less files.
3867 extension-less files.
3863
3868
3864 * IPython/iplib.py (InteractiveShell.init_readline): Made the
3869 * IPython/iplib.py (InteractiveShell.init_readline): Made the
3865 warning about readline only occur for Posix. In Windows there's no
3870 warning about readline only occur for Posix. In Windows there's no
3866 way to get readline, so why bother with the warning.
3871 way to get readline, so why bother with the warning.
3867
3872
3868 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
3873 * IPython/Struct.py (Struct.__str__): fixed to use self.__dict__
3869 for __str__ instead of dir(self), since dir() changed in 2.2.
3874 for __str__ instead of dir(self), since dir() changed in 2.2.
3870
3875
3871 * Ported to Windows! Tested on XP, I suspect it should work fine
3876 * Ported to Windows! Tested on XP, I suspect it should work fine
3872 on NT/2000, but I don't think it will work on 98 et al. That
3877 on NT/2000, but I don't think it will work on 98 et al. That
3873 series of Windows is such a piece of junk anyway that I won't try
3878 series of Windows is such a piece of junk anyway that I won't try
3874 porting it there. The XP port was straightforward, showed a few
3879 porting it there. The XP port was straightforward, showed a few
3875 bugs here and there (fixed all), in particular some string
3880 bugs here and there (fixed all), in particular some string
3876 handling stuff which required considering Unicode strings (which
3881 handling stuff which required considering Unicode strings (which
3877 Windows uses). This is good, but hasn't been too tested :) No
3882 Windows uses). This is good, but hasn't been too tested :) No
3878 fancy installer yet, I'll put a note in the manual so people at
3883 fancy installer yet, I'll put a note in the manual so people at
3879 least make manually a shortcut.
3884 least make manually a shortcut.
3880
3885
3881 * IPython/iplib.py (Magic.magic_colors): Unified the color options
3886 * IPython/iplib.py (Magic.magic_colors): Unified the color options
3882 into a single one, "colors". This now controls both prompt and
3887 into a single one, "colors". This now controls both prompt and
3883 exception color schemes, and can be changed both at startup
3888 exception color schemes, and can be changed both at startup
3884 (either via command-line switches or via ipythonrc files) and at
3889 (either via command-line switches or via ipythonrc files) and at
3885 runtime, with @colors.
3890 runtime, with @colors.
3886 (Magic.magic_run): renamed @prun to @run and removed the old
3891 (Magic.magic_run): renamed @prun to @run and removed the old
3887 @run. The two were too similar to warrant keeping both.
3892 @run. The two were too similar to warrant keeping both.
3888
3893
3889 2002-02-03 Fernando Perez <fperez@colorado.edu>
3894 2002-02-03 Fernando Perez <fperez@colorado.edu>
3890
3895
3891 * IPython/iplib.py (install_first_time): Added comment on how to
3896 * IPython/iplib.py (install_first_time): Added comment on how to
3892 configure the color options for first-time users. Put a <return>
3897 configure the color options for first-time users. Put a <return>
3893 request at the end so that small-terminal users get a chance to
3898 request at the end so that small-terminal users get a chance to
3894 read the startup info.
3899 read the startup info.
3895
3900
3896 2002-01-23 Fernando Perez <fperez@colorado.edu>
3901 2002-01-23 Fernando Perez <fperez@colorado.edu>
3897
3902
3898 * IPython/iplib.py (CachedOutput.update): Changed output memory
3903 * IPython/iplib.py (CachedOutput.update): Changed output memory
3899 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
3904 variable names from _o,_oo,_ooo,_o<n> to simply _,__,___,_<n>. For
3900 input history we still use _i. Did this b/c these variable are
3905 input history we still use _i. Did this b/c these variable are
3901 very commonly used in interactive work, so the less we need to
3906 very commonly used in interactive work, so the less we need to
3902 type the better off we are.
3907 type the better off we are.
3903 (Magic.magic_prun): updated @prun to better handle the namespaces
3908 (Magic.magic_prun): updated @prun to better handle the namespaces
3904 the file will run in, including a fix for __name__ not being set
3909 the file will run in, including a fix for __name__ not being set
3905 before.
3910 before.
3906
3911
3907 2002-01-20 Fernando Perez <fperez@colorado.edu>
3912 2002-01-20 Fernando Perez <fperez@colorado.edu>
3908
3913
3909 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
3914 * IPython/ultraTB.py (VerboseTB.linereader): Fixed printing of
3910 extra garbage for Python 2.2. Need to look more carefully into
3915 extra garbage for Python 2.2. Need to look more carefully into
3911 this later.
3916 this later.
3912
3917
3913 2002-01-19 Fernando Perez <fperez@colorado.edu>
3918 2002-01-19 Fernando Perez <fperez@colorado.edu>
3914
3919
3915 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
3920 * IPython/iplib.py (InteractiveShell.showtraceback): fixed to
3916 display SyntaxError exceptions properly formatted when they occur
3921 display SyntaxError exceptions properly formatted when they occur
3917 (they can be triggered by imported code).
3922 (they can be triggered by imported code).
3918
3923
3919 2002-01-18 Fernando Perez <fperez@colorado.edu>
3924 2002-01-18 Fernando Perez <fperez@colorado.edu>
3920
3925
3921 * IPython/iplib.py (InteractiveShell.safe_execfile): now
3926 * IPython/iplib.py (InteractiveShell.safe_execfile): now
3922 SyntaxError exceptions are reported nicely formatted, instead of
3927 SyntaxError exceptions are reported nicely formatted, instead of
3923 spitting out only offset information as before.
3928 spitting out only offset information as before.
3924 (Magic.magic_prun): Added the @prun function for executing
3929 (Magic.magic_prun): Added the @prun function for executing
3925 programs with command line args inside IPython.
3930 programs with command line args inside IPython.
3926
3931
3927 2002-01-16 Fernando Perez <fperez@colorado.edu>
3932 2002-01-16 Fernando Perez <fperez@colorado.edu>
3928
3933
3929 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
3934 * IPython/iplib.py (Magic.magic_hist): Changed @hist and @dhist
3930 to *not* include the last item given in a range. This brings their
3935 to *not* include the last item given in a range. This brings their
3931 behavior in line with Python's slicing:
3936 behavior in line with Python's slicing:
3932 a[n1:n2] -> a[n1]...a[n2-1]
3937 a[n1:n2] -> a[n1]...a[n2-1]
3933 It may be a bit less convenient, but I prefer to stick to Python's
3938 It may be a bit less convenient, but I prefer to stick to Python's
3934 conventions *everywhere*, so users never have to wonder.
3939 conventions *everywhere*, so users never have to wonder.
3935 (Magic.magic_macro): Added @macro function to ease the creation of
3940 (Magic.magic_macro): Added @macro function to ease the creation of
3936 macros.
3941 macros.
3937
3942
3938 2002-01-05 Fernando Perez <fperez@colorado.edu>
3943 2002-01-05 Fernando Perez <fperez@colorado.edu>
3939
3944
3940 * Released 0.2.4.
3945 * Released 0.2.4.
3941
3946
3942 * IPython/iplib.py (Magic.magic_pdef):
3947 * IPython/iplib.py (Magic.magic_pdef):
3943 (InteractiveShell.safe_execfile): report magic lines and error
3948 (InteractiveShell.safe_execfile): report magic lines and error
3944 lines without line numbers so one can easily copy/paste them for
3949 lines without line numbers so one can easily copy/paste them for
3945 re-execution.
3950 re-execution.
3946
3951
3947 * Updated manual with recent changes.
3952 * Updated manual with recent changes.
3948
3953
3949 * IPython/iplib.py (Magic.magic_oinfo): added constructor
3954 * IPython/iplib.py (Magic.magic_oinfo): added constructor
3950 docstring printing when class? is called. Very handy for knowing
3955 docstring printing when class? is called. Very handy for knowing
3951 how to create class instances (as long as __init__ is well
3956 how to create class instances (as long as __init__ is well
3952 documented, of course :)
3957 documented, of course :)
3953 (Magic.magic_doc): print both class and constructor docstrings.
3958 (Magic.magic_doc): print both class and constructor docstrings.
3954 (Magic.magic_pdef): give constructor info if passed a class and
3959 (Magic.magic_pdef): give constructor info if passed a class and
3955 __call__ info for callable object instances.
3960 __call__ info for callable object instances.
3956
3961
3957 2002-01-04 Fernando Perez <fperez@colorado.edu>
3962 2002-01-04 Fernando Perez <fperez@colorado.edu>
3958
3963
3959 * Made deep_reload() off by default. It doesn't always work
3964 * Made deep_reload() off by default. It doesn't always work
3960 exactly as intended, so it's probably safer to have it off. It's
3965 exactly as intended, so it's probably safer to have it off. It's
3961 still available as dreload() anyway, so nothing is lost.
3966 still available as dreload() anyway, so nothing is lost.
3962
3967
3963 2002-01-02 Fernando Perez <fperez@colorado.edu>
3968 2002-01-02 Fernando Perez <fperez@colorado.edu>
3964
3969
3965 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
3970 * Released 0.2.3 (contacted R.Singh at CU about biopython course,
3966 so I wanted an updated release).
3971 so I wanted an updated release).
3967
3972
3968 2001-12-27 Fernando Perez <fperez@colorado.edu>
3973 2001-12-27 Fernando Perez <fperez@colorado.edu>
3969
3974
3970 * IPython/iplib.py (InteractiveShell.interact): Added the original
3975 * IPython/iplib.py (InteractiveShell.interact): Added the original
3971 code from 'code.py' for this module in order to change the
3976 code from 'code.py' for this module in order to change the
3972 handling of a KeyboardInterrupt. This was necessary b/c otherwise
3977 handling of a KeyboardInterrupt. This was necessary b/c otherwise
3973 the history cache would break when the user hit Ctrl-C, and
3978 the history cache would break when the user hit Ctrl-C, and
3974 interact() offers no way to add any hooks to it.
3979 interact() offers no way to add any hooks to it.
3975
3980
3976 2001-12-23 Fernando Perez <fperez@colorado.edu>
3981 2001-12-23 Fernando Perez <fperez@colorado.edu>
3977
3982
3978 * setup.py: added check for 'MANIFEST' before trying to remove
3983 * setup.py: added check for 'MANIFEST' before trying to remove
3979 it. Thanks to Sean Reifschneider.
3984 it. Thanks to Sean Reifschneider.
3980
3985
3981 2001-12-22 Fernando Perez <fperez@colorado.edu>
3986 2001-12-22 Fernando Perez <fperez@colorado.edu>
3982
3987
3983 * Released 0.2.2.
3988 * Released 0.2.2.
3984
3989
3985 * Finished (reasonably) writing the manual. Later will add the
3990 * Finished (reasonably) writing the manual. Later will add the
3986 python-standard navigation stylesheets, but for the time being
3991 python-standard navigation stylesheets, but for the time being
3987 it's fairly complete. Distribution will include html and pdf
3992 it's fairly complete. Distribution will include html and pdf
3988 versions.
3993 versions.
3989
3994
3990 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
3995 * Bugfix: '.' wasn't being added to sys.path. Thanks to Prabhu
3991 (MayaVi author).
3996 (MayaVi author).
3992
3997
3993 2001-12-21 Fernando Perez <fperez@colorado.edu>
3998 2001-12-21 Fernando Perez <fperez@colorado.edu>
3994
3999
3995 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
4000 * Released 0.2.1. Barring any nasty bugs, this is it as far as a
3996 good public release, I think (with the manual and the distutils
4001 good public release, I think (with the manual and the distutils
3997 installer). The manual can use some work, but that can go
4002 installer). The manual can use some work, but that can go
3998 slowly. Otherwise I think it's quite nice for end users. Next
4003 slowly. Otherwise I think it's quite nice for end users. Next
3999 summer, rewrite the guts of it...
4004 summer, rewrite the guts of it...
4000
4005
4001 * Changed format of ipythonrc files to use whitespace as the
4006 * Changed format of ipythonrc files to use whitespace as the
4002 separator instead of an explicit '='. Cleaner.
4007 separator instead of an explicit '='. Cleaner.
4003
4008
4004 2001-12-20 Fernando Perez <fperez@colorado.edu>
4009 2001-12-20 Fernando Perez <fperez@colorado.edu>
4005
4010
4006 * Started a manual in LyX. For now it's just a quick merge of the
4011 * Started a manual in LyX. For now it's just a quick merge of the
4007 various internal docstrings and READMEs. Later it may grow into a
4012 various internal docstrings and READMEs. Later it may grow into a
4008 nice, full-blown manual.
4013 nice, full-blown manual.
4009
4014
4010 * Set up a distutils based installer. Installation should now be
4015 * Set up a distutils based installer. Installation should now be
4011 trivially simple for end-users.
4016 trivially simple for end-users.
4012
4017
4013 2001-12-11 Fernando Perez <fperez@colorado.edu>
4018 2001-12-11 Fernando Perez <fperez@colorado.edu>
4014
4019
4015 * Released 0.2.0. First public release, announced it at
4020 * Released 0.2.0. First public release, announced it at
4016 comp.lang.python. From now on, just bugfixes...
4021 comp.lang.python. From now on, just bugfixes...
4017
4022
4018 * Went through all the files, set copyright/license notices and
4023 * Went through all the files, set copyright/license notices and
4019 cleaned up things. Ready for release.
4024 cleaned up things. Ready for release.
4020
4025
4021 2001-12-10 Fernando Perez <fperez@colorado.edu>
4026 2001-12-10 Fernando Perez <fperez@colorado.edu>
4022
4027
4023 * Changed the first-time installer not to use tarfiles. It's more
4028 * Changed the first-time installer not to use tarfiles. It's more
4024 robust now and less unix-dependent. Also makes it easier for
4029 robust now and less unix-dependent. Also makes it easier for
4025 people to later upgrade versions.
4030 people to later upgrade versions.
4026
4031
4027 * Changed @exit to @abort to reflect the fact that it's pretty
4032 * Changed @exit to @abort to reflect the fact that it's pretty
4028 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4033 brutal (a sys.exit()). The difference between @abort and Ctrl-D
4029 becomes significant only when IPyhton is embedded: in that case,
4034 becomes significant only when IPyhton is embedded: in that case,
4030 C-D closes IPython only, but @abort kills the enclosing program
4035 C-D closes IPython only, but @abort kills the enclosing program
4031 too (unless it had called IPython inside a try catching
4036 too (unless it had called IPython inside a try catching
4032 SystemExit).
4037 SystemExit).
4033
4038
4034 * Created Shell module which exposes the actuall IPython Shell
4039 * Created Shell module which exposes the actuall IPython Shell
4035 classes, currently the normal and the embeddable one. This at
4040 classes, currently the normal and the embeddable one. This at
4036 least offers a stable interface we won't need to change when
4041 least offers a stable interface we won't need to change when
4037 (later) the internals are rewritten. That rewrite will be confined
4042 (later) the internals are rewritten. That rewrite will be confined
4038 to iplib and ipmaker, but the Shell interface should remain as is.
4043 to iplib and ipmaker, but the Shell interface should remain as is.
4039
4044
4040 * Added embed module which offers an embeddable IPShell object,
4045 * Added embed module which offers an embeddable IPShell object,
4041 useful to fire up IPython *inside* a running program. Great for
4046 useful to fire up IPython *inside* a running program. Great for
4042 debugging or dynamical data analysis.
4047 debugging or dynamical data analysis.
4043
4048
4044 2001-12-08 Fernando Perez <fperez@colorado.edu>
4049 2001-12-08 Fernando Perez <fperez@colorado.edu>
4045
4050
4046 * Fixed small bug preventing seeing info from methods of defined
4051 * Fixed small bug preventing seeing info from methods of defined
4047 objects (incorrect namespace in _ofind()).
4052 objects (incorrect namespace in _ofind()).
4048
4053
4049 * Documentation cleanup. Moved the main usage docstrings to a
4054 * Documentation cleanup. Moved the main usage docstrings to a
4050 separate file, usage.py (cleaner to maintain, and hopefully in the
4055 separate file, usage.py (cleaner to maintain, and hopefully in the
4051 future some perlpod-like way of producing interactive, man and
4056 future some perlpod-like way of producing interactive, man and
4052 html docs out of it will be found).
4057 html docs out of it will be found).
4053
4058
4054 * Added @profile to see your profile at any time.
4059 * Added @profile to see your profile at any time.
4055
4060
4056 * Added @p as an alias for 'print'. It's especially convenient if
4061 * Added @p as an alias for 'print'. It's especially convenient if
4057 using automagic ('p x' prints x).
4062 using automagic ('p x' prints x).
4058
4063
4059 * Small cleanups and fixes after a pychecker run.
4064 * Small cleanups and fixes after a pychecker run.
4060
4065
4061 * Changed the @cd command to handle @cd - and @cd -<n> for
4066 * Changed the @cd command to handle @cd - and @cd -<n> for
4062 visiting any directory in _dh.
4067 visiting any directory in _dh.
4063
4068
4064 * Introduced _dh, a history of visited directories. @dhist prints
4069 * Introduced _dh, a history of visited directories. @dhist prints
4065 it out with numbers.
4070 it out with numbers.
4066
4071
4067 2001-12-07 Fernando Perez <fperez@colorado.edu>
4072 2001-12-07 Fernando Perez <fperez@colorado.edu>
4068
4073
4069 * Released 0.1.22
4074 * Released 0.1.22
4070
4075
4071 * Made initialization a bit more robust against invalid color
4076 * Made initialization a bit more robust against invalid color
4072 options in user input (exit, not traceback-crash).
4077 options in user input (exit, not traceback-crash).
4073
4078
4074 * Changed the bug crash reporter to write the report only in the
4079 * Changed the bug crash reporter to write the report only in the
4075 user's .ipython directory. That way IPython won't litter people's
4080 user's .ipython directory. That way IPython won't litter people's
4076 hard disks with crash files all over the place. Also print on
4081 hard disks with crash files all over the place. Also print on
4077 screen the necessary mail command.
4082 screen the necessary mail command.
4078
4083
4079 * With the new ultraTB, implemented LightBG color scheme for light
4084 * With the new ultraTB, implemented LightBG color scheme for light
4080 background terminals. A lot of people like white backgrounds, so I
4085 background terminals. A lot of people like white backgrounds, so I
4081 guess we should at least give them something readable.
4086 guess we should at least give them something readable.
4082
4087
4083 2001-12-06 Fernando Perez <fperez@colorado.edu>
4088 2001-12-06 Fernando Perez <fperez@colorado.edu>
4084
4089
4085 * Modified the structure of ultraTB. Now there's a proper class
4090 * Modified the structure of ultraTB. Now there's a proper class
4086 for tables of color schemes which allow adding schemes easily and
4091 for tables of color schemes which allow adding schemes easily and
4087 switching the active scheme without creating a new instance every
4092 switching the active scheme without creating a new instance every
4088 time (which was ridiculous). The syntax for creating new schemes
4093 time (which was ridiculous). The syntax for creating new schemes
4089 is also cleaner. I think ultraTB is finally done, with a clean
4094 is also cleaner. I think ultraTB is finally done, with a clean
4090 class structure. Names are also much cleaner (now there's proper
4095 class structure. Names are also much cleaner (now there's proper
4091 color tables, no need for every variable to also have 'color' in
4096 color tables, no need for every variable to also have 'color' in
4092 its name).
4097 its name).
4093
4098
4094 * Broke down genutils into separate files. Now genutils only
4099 * Broke down genutils into separate files. Now genutils only
4095 contains utility functions, and classes have been moved to their
4100 contains utility functions, and classes have been moved to their
4096 own files (they had enough independent functionality to warrant
4101 own files (they had enough independent functionality to warrant
4097 it): ConfigLoader, OutputTrap, Struct.
4102 it): ConfigLoader, OutputTrap, Struct.
4098
4103
4099 2001-12-05 Fernando Perez <fperez@colorado.edu>
4104 2001-12-05 Fernando Perez <fperez@colorado.edu>
4100
4105
4101 * IPython turns 21! Released version 0.1.21, as a candidate for
4106 * IPython turns 21! Released version 0.1.21, as a candidate for
4102 public consumption. If all goes well, release in a few days.
4107 public consumption. If all goes well, release in a few days.
4103
4108
4104 * Fixed path bug (files in Extensions/ directory wouldn't be found
4109 * Fixed path bug (files in Extensions/ directory wouldn't be found
4105 unless IPython/ was explicitly in sys.path).
4110 unless IPython/ was explicitly in sys.path).
4106
4111
4107 * Extended the FlexCompleter class as MagicCompleter to allow
4112 * Extended the FlexCompleter class as MagicCompleter to allow
4108 completion of @-starting lines.
4113 completion of @-starting lines.
4109
4114
4110 * Created __release__.py file as a central repository for release
4115 * Created __release__.py file as a central repository for release
4111 info that other files can read from.
4116 info that other files can read from.
4112
4117
4113 * Fixed small bug in logging: when logging was turned on in
4118 * Fixed small bug in logging: when logging was turned on in
4114 mid-session, old lines with special meanings (!@?) were being
4119 mid-session, old lines with special meanings (!@?) were being
4115 logged without the prepended comment, which is necessary since
4120 logged without the prepended comment, which is necessary since
4116 they are not truly valid python syntax. This should make session
4121 they are not truly valid python syntax. This should make session
4117 restores produce less errors.
4122 restores produce less errors.
4118
4123
4119 * The namespace cleanup forced me to make a FlexCompleter class
4124 * The namespace cleanup forced me to make a FlexCompleter class
4120 which is nothing but a ripoff of rlcompleter, but with selectable
4125 which is nothing but a ripoff of rlcompleter, but with selectable
4121 namespace (rlcompleter only works in __main__.__dict__). I'll try
4126 namespace (rlcompleter only works in __main__.__dict__). I'll try
4122 to submit a note to the authors to see if this change can be
4127 to submit a note to the authors to see if this change can be
4123 incorporated in future rlcompleter releases (Dec.6: done)
4128 incorporated in future rlcompleter releases (Dec.6: done)
4124
4129
4125 * More fixes to namespace handling. It was a mess! Now all
4130 * More fixes to namespace handling. It was a mess! Now all
4126 explicit references to __main__.__dict__ are gone (except when
4131 explicit references to __main__.__dict__ are gone (except when
4127 really needed) and everything is handled through the namespace
4132 really needed) and everything is handled through the namespace
4128 dicts in the IPython instance. We seem to be getting somewhere
4133 dicts in the IPython instance. We seem to be getting somewhere
4129 with this, finally...
4134 with this, finally...
4130
4135
4131 * Small documentation updates.
4136 * Small documentation updates.
4132
4137
4133 * Created the Extensions directory under IPython (with an
4138 * Created the Extensions directory under IPython (with an
4134 __init__.py). Put the PhysicalQ stuff there. This directory should
4139 __init__.py). Put the PhysicalQ stuff there. This directory should
4135 be used for all special-purpose extensions.
4140 be used for all special-purpose extensions.
4136
4141
4137 * File renaming:
4142 * File renaming:
4138 ipythonlib --> ipmaker
4143 ipythonlib --> ipmaker
4139 ipplib --> iplib
4144 ipplib --> iplib
4140 This makes a bit more sense in terms of what these files actually do.
4145 This makes a bit more sense in terms of what these files actually do.
4141
4146
4142 * Moved all the classes and functions in ipythonlib to ipplib, so
4147 * Moved all the classes and functions in ipythonlib to ipplib, so
4143 now ipythonlib only has make_IPython(). This will ease up its
4148 now ipythonlib only has make_IPython(). This will ease up its
4144 splitting in smaller functional chunks later.
4149 splitting in smaller functional chunks later.
4145
4150
4146 * Cleaned up (done, I think) output of @whos. Better column
4151 * Cleaned up (done, I think) output of @whos. Better column
4147 formatting, and now shows str(var) for as much as it can, which is
4152 formatting, and now shows str(var) for as much as it can, which is
4148 typically what one gets with a 'print var'.
4153 typically what one gets with a 'print var'.
4149
4154
4150 2001-12-04 Fernando Perez <fperez@colorado.edu>
4155 2001-12-04 Fernando Perez <fperez@colorado.edu>
4151
4156
4152 * Fixed namespace problems. Now builtin/IPyhton/user names get
4157 * Fixed namespace problems. Now builtin/IPyhton/user names get
4153 properly reported in their namespace. Internal namespace handling
4158 properly reported in their namespace. Internal namespace handling
4154 is finally getting decent (not perfect yet, but much better than
4159 is finally getting decent (not perfect yet, but much better than
4155 the ad-hoc mess we had).
4160 the ad-hoc mess we had).
4156
4161
4157 * Removed -exit option. If people just want to run a python
4162 * Removed -exit option. If people just want to run a python
4158 script, that's what the normal interpreter is for. Less
4163 script, that's what the normal interpreter is for. Less
4159 unnecessary options, less chances for bugs.
4164 unnecessary options, less chances for bugs.
4160
4165
4161 * Added a crash handler which generates a complete post-mortem if
4166 * Added a crash handler which generates a complete post-mortem if
4162 IPython crashes. This will help a lot in tracking bugs down the
4167 IPython crashes. This will help a lot in tracking bugs down the
4163 road.
4168 road.
4164
4169
4165 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4170 * Fixed nasty bug in auto-evaluation part of prefilter(). Names
4166 which were boud to functions being reassigned would bypass the
4171 which were boud to functions being reassigned would bypass the
4167 logger, breaking the sync of _il with the prompt counter. This
4172 logger, breaking the sync of _il with the prompt counter. This
4168 would then crash IPython later when a new line was logged.
4173 would then crash IPython later when a new line was logged.
4169
4174
4170 2001-12-02 Fernando Perez <fperez@colorado.edu>
4175 2001-12-02 Fernando Perez <fperez@colorado.edu>
4171
4176
4172 * Made IPython a package. This means people don't have to clutter
4177 * Made IPython a package. This means people don't have to clutter
4173 their sys.path with yet another directory. Changed the INSTALL
4178 their sys.path with yet another directory. Changed the INSTALL
4174 file accordingly.
4179 file accordingly.
4175
4180
4176 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4181 * Cleaned up the output of @who_ls, @who and @whos. @who_ls now
4177 sorts its output (so @who shows it sorted) and @whos formats the
4182 sorts its output (so @who shows it sorted) and @whos formats the
4178 table according to the width of the first column. Nicer, easier to
4183 table according to the width of the first column. Nicer, easier to
4179 read. Todo: write a generic table_format() which takes a list of
4184 read. Todo: write a generic table_format() which takes a list of
4180 lists and prints it nicely formatted, with optional row/column
4185 lists and prints it nicely formatted, with optional row/column
4181 separators and proper padding and justification.
4186 separators and proper padding and justification.
4182
4187
4183 * Released 0.1.20
4188 * Released 0.1.20
4184
4189
4185 * Fixed bug in @log which would reverse the inputcache list (a
4190 * Fixed bug in @log which would reverse the inputcache list (a
4186 copy operation was missing).
4191 copy operation was missing).
4187
4192
4188 * Code cleanup. @config was changed to use page(). Better, since
4193 * Code cleanup. @config was changed to use page(). Better, since
4189 its output is always quite long.
4194 its output is always quite long.
4190
4195
4191 * Itpl is back as a dependency. I was having too many problems
4196 * Itpl is back as a dependency. I was having too many problems
4192 getting the parametric aliases to work reliably, and it's just
4197 getting the parametric aliases to work reliably, and it's just
4193 easier to code weird string operations with it than playing %()s
4198 easier to code weird string operations with it than playing %()s
4194 games. It's only ~6k, so I don't think it's too big a deal.
4199 games. It's only ~6k, so I don't think it's too big a deal.
4195
4200
4196 * Found (and fixed) a very nasty bug with history. !lines weren't
4201 * Found (and fixed) a very nasty bug with history. !lines weren't
4197 getting cached, and the out of sync caches would crash
4202 getting cached, and the out of sync caches would crash
4198 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4203 IPython. Fixed it by reorganizing the prefilter/handlers/logger
4199 division of labor a bit better. Bug fixed, cleaner structure.
4204 division of labor a bit better. Bug fixed, cleaner structure.
4200
4205
4201 2001-12-01 Fernando Perez <fperez@colorado.edu>
4206 2001-12-01 Fernando Perez <fperez@colorado.edu>
4202
4207
4203 * Released 0.1.19
4208 * Released 0.1.19
4204
4209
4205 * Added option -n to @hist to prevent line number printing. Much
4210 * Added option -n to @hist to prevent line number printing. Much
4206 easier to copy/paste code this way.
4211 easier to copy/paste code this way.
4207
4212
4208 * Created global _il to hold the input list. Allows easy
4213 * Created global _il to hold the input list. Allows easy
4209 re-execution of blocks of code by slicing it (inspired by Janko's
4214 re-execution of blocks of code by slicing it (inspired by Janko's
4210 comment on 'macros').
4215 comment on 'macros').
4211
4216
4212 * Small fixes and doc updates.
4217 * Small fixes and doc updates.
4213
4218
4214 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4219 * Rewrote @history function (was @h). Renamed it to @hist, @h is
4215 much too fragile with automagic. Handles properly multi-line
4220 much too fragile with automagic. Handles properly multi-line
4216 statements and takes parameters.
4221 statements and takes parameters.
4217
4222
4218 2001-11-30 Fernando Perez <fperez@colorado.edu>
4223 2001-11-30 Fernando Perez <fperez@colorado.edu>
4219
4224
4220 * Version 0.1.18 released.
4225 * Version 0.1.18 released.
4221
4226
4222 * Fixed nasty namespace bug in initial module imports.
4227 * Fixed nasty namespace bug in initial module imports.
4223
4228
4224 * Added copyright/license notes to all code files (except
4229 * Added copyright/license notes to all code files (except
4225 DPyGetOpt). For the time being, LGPL. That could change.
4230 DPyGetOpt). For the time being, LGPL. That could change.
4226
4231
4227 * Rewrote a much nicer README, updated INSTALL, cleaned up
4232 * Rewrote a much nicer README, updated INSTALL, cleaned up
4228 ipythonrc-* samples.
4233 ipythonrc-* samples.
4229
4234
4230 * Overall code/documentation cleanup. Basically ready for
4235 * Overall code/documentation cleanup. Basically ready for
4231 release. Only remaining thing: licence decision (LGPL?).
4236 release. Only remaining thing: licence decision (LGPL?).
4232
4237
4233 * Converted load_config to a class, ConfigLoader. Now recursion
4238 * Converted load_config to a class, ConfigLoader. Now recursion
4234 control is better organized. Doesn't include the same file twice.
4239 control is better organized. Doesn't include the same file twice.
4235
4240
4236 2001-11-29 Fernando Perez <fperez@colorado.edu>
4241 2001-11-29 Fernando Perez <fperez@colorado.edu>
4237
4242
4238 * Got input history working. Changed output history variables from
4243 * Got input history working. Changed output history variables from
4239 _p to _o so that _i is for input and _o for output. Just cleaner
4244 _p to _o so that _i is for input and _o for output. Just cleaner
4240 convention.
4245 convention.
4241
4246
4242 * Implemented parametric aliases. This pretty much allows the
4247 * Implemented parametric aliases. This pretty much allows the
4243 alias system to offer full-blown shell convenience, I think.
4248 alias system to offer full-blown shell convenience, I think.
4244
4249
4245 * Version 0.1.17 released, 0.1.18 opened.
4250 * Version 0.1.17 released, 0.1.18 opened.
4246
4251
4247 * dot_ipython/ipythonrc (alias): added documentation.
4252 * dot_ipython/ipythonrc (alias): added documentation.
4248 (xcolor): Fixed small bug (xcolors -> xcolor)
4253 (xcolor): Fixed small bug (xcolors -> xcolor)
4249
4254
4250 * Changed the alias system. Now alias is a magic command to define
4255 * Changed the alias system. Now alias is a magic command to define
4251 aliases just like the shell. Rationale: the builtin magics should
4256 aliases just like the shell. Rationale: the builtin magics should
4252 be there for things deeply connected to IPython's
4257 be there for things deeply connected to IPython's
4253 architecture. And this is a much lighter system for what I think
4258 architecture. And this is a much lighter system for what I think
4254 is the really important feature: allowing users to define quickly
4259 is the really important feature: allowing users to define quickly
4255 magics that will do shell things for them, so they can customize
4260 magics that will do shell things for them, so they can customize
4256 IPython easily to match their work habits. If someone is really
4261 IPython easily to match their work habits. If someone is really
4257 desperate to have another name for a builtin alias, they can
4262 desperate to have another name for a builtin alias, they can
4258 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4263 always use __IP.magic_newname = __IP.magic_oldname. Hackish but
4259 works.
4264 works.
4260
4265
4261 2001-11-28 Fernando Perez <fperez@colorado.edu>
4266 2001-11-28 Fernando Perez <fperez@colorado.edu>
4262
4267
4263 * Changed @file so that it opens the source file at the proper
4268 * Changed @file so that it opens the source file at the proper
4264 line. Since it uses less, if your EDITOR environment is
4269 line. Since it uses less, if your EDITOR environment is
4265 configured, typing v will immediately open your editor of choice
4270 configured, typing v will immediately open your editor of choice
4266 right at the line where the object is defined. Not as quick as
4271 right at the line where the object is defined. Not as quick as
4267 having a direct @edit command, but for all intents and purposes it
4272 having a direct @edit command, but for all intents and purposes it
4268 works. And I don't have to worry about writing @edit to deal with
4273 works. And I don't have to worry about writing @edit to deal with
4269 all the editors, less does that.
4274 all the editors, less does that.
4270
4275
4271 * Version 0.1.16 released, 0.1.17 opened.
4276 * Version 0.1.16 released, 0.1.17 opened.
4272
4277
4273 * Fixed some nasty bugs in the page/page_dumb combo that could
4278 * Fixed some nasty bugs in the page/page_dumb combo that could
4274 crash IPython.
4279 crash IPython.
4275
4280
4276 2001-11-27 Fernando Perez <fperez@colorado.edu>
4281 2001-11-27 Fernando Perez <fperez@colorado.edu>
4277
4282
4278 * Version 0.1.15 released, 0.1.16 opened.
4283 * Version 0.1.15 released, 0.1.16 opened.
4279
4284
4280 * Finally got ? and ?? to work for undefined things: now it's
4285 * Finally got ? and ?? to work for undefined things: now it's
4281 possible to type {}.get? and get information about the get method
4286 possible to type {}.get? and get information about the get method
4282 of dicts, or os.path? even if only os is defined (so technically
4287 of dicts, or os.path? even if only os is defined (so technically
4283 os.path isn't). Works at any level. For example, after import os,
4288 os.path isn't). Works at any level. For example, after import os,
4284 os?, os.path?, os.path.abspath? all work. This is great, took some
4289 os?, os.path?, os.path.abspath? all work. This is great, took some
4285 work in _ofind.
4290 work in _ofind.
4286
4291
4287 * Fixed more bugs with logging. The sanest way to do it was to add
4292 * Fixed more bugs with logging. The sanest way to do it was to add
4288 to @log a 'mode' parameter. Killed two in one shot (this mode
4293 to @log a 'mode' parameter. Killed two in one shot (this mode
4289 option was a request of Janko's). I think it's finally clean
4294 option was a request of Janko's). I think it's finally clean
4290 (famous last words).
4295 (famous last words).
4291
4296
4292 * Added a page_dumb() pager which does a decent job of paging on
4297 * Added a page_dumb() pager which does a decent job of paging on
4293 screen, if better things (like less) aren't available. One less
4298 screen, if better things (like less) aren't available. One less
4294 unix dependency (someday maybe somebody will port this to
4299 unix dependency (someday maybe somebody will port this to
4295 windows).
4300 windows).
4296
4301
4297 * Fixed problem in magic_log: would lock of logging out if log
4302 * Fixed problem in magic_log: would lock of logging out if log
4298 creation failed (because it would still think it had succeeded).
4303 creation failed (because it would still think it had succeeded).
4299
4304
4300 * Improved the page() function using curses to auto-detect screen
4305 * Improved the page() function using curses to auto-detect screen
4301 size. Now it can make a much better decision on whether to print
4306 size. Now it can make a much better decision on whether to print
4302 or page a string. Option screen_length was modified: a value 0
4307 or page a string. Option screen_length was modified: a value 0
4303 means auto-detect, and that's the default now.
4308 means auto-detect, and that's the default now.
4304
4309
4305 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4310 * Version 0.1.14 released, 0.1.15 opened. I think this is ready to
4306 go out. I'll test it for a few days, then talk to Janko about
4311 go out. I'll test it for a few days, then talk to Janko about
4307 licences and announce it.
4312 licences and announce it.
4308
4313
4309 * Fixed the length of the auto-generated ---> prompt which appears
4314 * Fixed the length of the auto-generated ---> prompt which appears
4310 for auto-parens and auto-quotes. Getting this right isn't trivial,
4315 for auto-parens and auto-quotes. Getting this right isn't trivial,
4311 with all the color escapes, different prompt types and optional
4316 with all the color escapes, different prompt types and optional
4312 separators. But it seems to be working in all the combinations.
4317 separators. But it seems to be working in all the combinations.
4313
4318
4314 2001-11-26 Fernando Perez <fperez@colorado.edu>
4319 2001-11-26 Fernando Perez <fperez@colorado.edu>
4315
4320
4316 * Wrote a regexp filter to get option types from the option names
4321 * Wrote a regexp filter to get option types from the option names
4317 string. This eliminates the need to manually keep two duplicate
4322 string. This eliminates the need to manually keep two duplicate
4318 lists.
4323 lists.
4319
4324
4320 * Removed the unneeded check_option_names. Now options are handled
4325 * Removed the unneeded check_option_names. Now options are handled
4321 in a much saner manner and it's easy to visually check that things
4326 in a much saner manner and it's easy to visually check that things
4322 are ok.
4327 are ok.
4323
4328
4324 * Updated version numbers on all files I modified to carry a
4329 * Updated version numbers on all files I modified to carry a
4325 notice so Janko and Nathan have clear version markers.
4330 notice so Janko and Nathan have clear version markers.
4326
4331
4327 * Updated docstring for ultraTB with my changes. I should send
4332 * Updated docstring for ultraTB with my changes. I should send
4328 this to Nathan.
4333 this to Nathan.
4329
4334
4330 * Lots of small fixes. Ran everything through pychecker again.
4335 * Lots of small fixes. Ran everything through pychecker again.
4331
4336
4332 * Made loading of deep_reload an cmd line option. If it's not too
4337 * Made loading of deep_reload an cmd line option. If it's not too
4333 kosher, now people can just disable it. With -nodeep_reload it's
4338 kosher, now people can just disable it. With -nodeep_reload it's
4334 still available as dreload(), it just won't overwrite reload().
4339 still available as dreload(), it just won't overwrite reload().
4335
4340
4336 * Moved many options to the no| form (-opt and -noopt
4341 * Moved many options to the no| form (-opt and -noopt
4337 accepted). Cleaner.
4342 accepted). Cleaner.
4338
4343
4339 * Changed magic_log so that if called with no parameters, it uses
4344 * Changed magic_log so that if called with no parameters, it uses
4340 'rotate' mode. That way auto-generated logs aren't automatically
4345 'rotate' mode. That way auto-generated logs aren't automatically
4341 over-written. For normal logs, now a backup is made if it exists
4346 over-written. For normal logs, now a backup is made if it exists
4342 (only 1 level of backups). A new 'backup' mode was added to the
4347 (only 1 level of backups). A new 'backup' mode was added to the
4343 Logger class to support this. This was a request by Janko.
4348 Logger class to support this. This was a request by Janko.
4344
4349
4345 * Added @logoff/@logon to stop/restart an active log.
4350 * Added @logoff/@logon to stop/restart an active log.
4346
4351
4347 * Fixed a lot of bugs in log saving/replay. It was pretty
4352 * Fixed a lot of bugs in log saving/replay. It was pretty
4348 broken. Now special lines (!@,/) appear properly in the command
4353 broken. Now special lines (!@,/) appear properly in the command
4349 history after a log replay.
4354 history after a log replay.
4350
4355
4351 * Tried and failed to implement full session saving via pickle. My
4356 * Tried and failed to implement full session saving via pickle. My
4352 idea was to pickle __main__.__dict__, but modules can't be
4357 idea was to pickle __main__.__dict__, but modules can't be
4353 pickled. This would be a better alternative to replaying logs, but
4358 pickled. This would be a better alternative to replaying logs, but
4354 seems quite tricky to get to work. Changed -session to be called
4359 seems quite tricky to get to work. Changed -session to be called
4355 -logplay, which more accurately reflects what it does. And if we
4360 -logplay, which more accurately reflects what it does. And if we
4356 ever get real session saving working, -session is now available.
4361 ever get real session saving working, -session is now available.
4357
4362
4358 * Implemented color schemes for prompts also. As for tracebacks,
4363 * Implemented color schemes for prompts also. As for tracebacks,
4359 currently only NoColor and Linux are supported. But now the
4364 currently only NoColor and Linux are supported. But now the
4360 infrastructure is in place, based on a generic ColorScheme
4365 infrastructure is in place, based on a generic ColorScheme
4361 class. So writing and activating new schemes both for the prompts
4366 class. So writing and activating new schemes both for the prompts
4362 and the tracebacks should be straightforward.
4367 and the tracebacks should be straightforward.
4363
4368
4364 * Version 0.1.13 released, 0.1.14 opened.
4369 * Version 0.1.13 released, 0.1.14 opened.
4365
4370
4366 * Changed handling of options for output cache. Now counter is
4371 * Changed handling of options for output cache. Now counter is
4367 hardwired starting at 1 and one specifies the maximum number of
4372 hardwired starting at 1 and one specifies the maximum number of
4368 entries *in the outcache* (not the max prompt counter). This is
4373 entries *in the outcache* (not the max prompt counter). This is
4369 much better, since many statements won't increase the cache
4374 much better, since many statements won't increase the cache
4370 count. It also eliminated some confusing options, now there's only
4375 count. It also eliminated some confusing options, now there's only
4371 one: cache_size.
4376 one: cache_size.
4372
4377
4373 * Added 'alias' magic function and magic_alias option in the
4378 * Added 'alias' magic function and magic_alias option in the
4374 ipythonrc file. Now the user can easily define whatever names he
4379 ipythonrc file. Now the user can easily define whatever names he
4375 wants for the magic functions without having to play weird
4380 wants for the magic functions without having to play weird
4376 namespace games. This gives IPython a real shell-like feel.
4381 namespace games. This gives IPython a real shell-like feel.
4377
4382
4378 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4383 * Fixed doc/?/?? for magics. Now all work, in all forms (explicit
4379 @ or not).
4384 @ or not).
4380
4385
4381 This was one of the last remaining 'visible' bugs (that I know
4386 This was one of the last remaining 'visible' bugs (that I know
4382 of). I think if I can clean up the session loading so it works
4387 of). I think if I can clean up the session loading so it works
4383 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4388 100% I'll release a 0.2.0 version on c.p.l (talk to Janko first
4384 about licensing).
4389 about licensing).
4385
4390
4386 2001-11-25 Fernando Perez <fperez@colorado.edu>
4391 2001-11-25 Fernando Perez <fperez@colorado.edu>
4387
4392
4388 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4393 * Rewrote somewhat oinfo (?/??). Nicer, now uses page() and
4389 there's a cleaner distinction between what ? and ?? show.
4394 there's a cleaner distinction between what ? and ?? show.
4390
4395
4391 * Added screen_length option. Now the user can define his own
4396 * Added screen_length option. Now the user can define his own
4392 screen size for page() operations.
4397 screen size for page() operations.
4393
4398
4394 * Implemented magic shell-like functions with automatic code
4399 * Implemented magic shell-like functions with automatic code
4395 generation. Now adding another function is just a matter of adding
4400 generation. Now adding another function is just a matter of adding
4396 an entry to a dict, and the function is dynamically generated at
4401 an entry to a dict, and the function is dynamically generated at
4397 run-time. Python has some really cool features!
4402 run-time. Python has some really cool features!
4398
4403
4399 * Renamed many options to cleanup conventions a little. Now all
4404 * Renamed many options to cleanup conventions a little. Now all
4400 are lowercase, and only underscores where needed. Also in the code
4405 are lowercase, and only underscores where needed. Also in the code
4401 option name tables are clearer.
4406 option name tables are clearer.
4402
4407
4403 * Changed prompts a little. Now input is 'In [n]:' instead of
4408 * Changed prompts a little. Now input is 'In [n]:' instead of
4404 'In[n]:='. This allows it the numbers to be aligned with the
4409 'In[n]:='. This allows it the numbers to be aligned with the
4405 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4410 Out[n] numbers, and removes usage of ':=' which doesn't exist in
4406 Python (it was a Mathematica thing). The '...' continuation prompt
4411 Python (it was a Mathematica thing). The '...' continuation prompt
4407 was also changed a little to align better.
4412 was also changed a little to align better.
4408
4413
4409 * Fixed bug when flushing output cache. Not all _p<n> variables
4414 * Fixed bug when flushing output cache. Not all _p<n> variables
4410 exist, so their deletion needs to be wrapped in a try:
4415 exist, so their deletion needs to be wrapped in a try:
4411
4416
4412 * Figured out how to properly use inspect.formatargspec() (it
4417 * Figured out how to properly use inspect.formatargspec() (it
4413 requires the args preceded by *). So I removed all the code from
4418 requires the args preceded by *). So I removed all the code from
4414 _get_pdef in Magic, which was just replicating that.
4419 _get_pdef in Magic, which was just replicating that.
4415
4420
4416 * Added test to prefilter to allow redefining magic function names
4421 * Added test to prefilter to allow redefining magic function names
4417 as variables. This is ok, since the @ form is always available,
4422 as variables. This is ok, since the @ form is always available,
4418 but whe should allow the user to define a variable called 'ls' if
4423 but whe should allow the user to define a variable called 'ls' if
4419 he needs it.
4424 he needs it.
4420
4425
4421 * Moved the ToDo information from README into a separate ToDo.
4426 * Moved the ToDo information from README into a separate ToDo.
4422
4427
4423 * General code cleanup and small bugfixes. I think it's close to a
4428 * General code cleanup and small bugfixes. I think it's close to a
4424 state where it can be released, obviously with a big 'beta'
4429 state where it can be released, obviously with a big 'beta'
4425 warning on it.
4430 warning on it.
4426
4431
4427 * Got the magic function split to work. Now all magics are defined
4432 * Got the magic function split to work. Now all magics are defined
4428 in a separate class. It just organizes things a bit, and now
4433 in a separate class. It just organizes things a bit, and now
4429 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4434 Xemacs behaves nicer (it was choking on InteractiveShell b/c it
4430 was too long).
4435 was too long).
4431
4436
4432 * Changed @clear to @reset to avoid potential confusions with
4437 * Changed @clear to @reset to avoid potential confusions with
4433 the shell command clear. Also renamed @cl to @clear, which does
4438 the shell command clear. Also renamed @cl to @clear, which does
4434 exactly what people expect it to from their shell experience.
4439 exactly what people expect it to from their shell experience.
4435
4440
4436 Added a check to the @reset command (since it's so
4441 Added a check to the @reset command (since it's so
4437 destructive, it's probably a good idea to ask for confirmation).
4442 destructive, it's probably a good idea to ask for confirmation).
4438 But now reset only works for full namespace resetting. Since the
4443 But now reset only works for full namespace resetting. Since the
4439 del keyword is already there for deleting a few specific
4444 del keyword is already there for deleting a few specific
4440 variables, I don't see the point of having a redundant magic
4445 variables, I don't see the point of having a redundant magic
4441 function for the same task.
4446 function for the same task.
4442
4447
4443 2001-11-24 Fernando Perez <fperez@colorado.edu>
4448 2001-11-24 Fernando Perez <fperez@colorado.edu>
4444
4449
4445 * Updated the builtin docs (esp. the ? ones).
4450 * Updated the builtin docs (esp. the ? ones).
4446
4451
4447 * Ran all the code through pychecker. Not terribly impressed with
4452 * Ran all the code through pychecker. Not terribly impressed with
4448 it: lots of spurious warnings and didn't really find anything of
4453 it: lots of spurious warnings and didn't really find anything of
4449 substance (just a few modules being imported and not used).
4454 substance (just a few modules being imported and not used).
4450
4455
4451 * Implemented the new ultraTB functionality into IPython. New
4456 * Implemented the new ultraTB functionality into IPython. New
4452 option: xcolors. This chooses color scheme. xmode now only selects
4457 option: xcolors. This chooses color scheme. xmode now only selects
4453 between Plain and Verbose. Better orthogonality.
4458 between Plain and Verbose. Better orthogonality.
4454
4459
4455 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4460 * Large rewrite of ultraTB. Much cleaner now, with a separation of
4456 mode and color scheme for the exception handlers. Now it's
4461 mode and color scheme for the exception handlers. Now it's
4457 possible to have the verbose traceback with no coloring.
4462 possible to have the verbose traceback with no coloring.
4458
4463
4459 2001-11-23 Fernando Perez <fperez@colorado.edu>
4464 2001-11-23 Fernando Perez <fperez@colorado.edu>
4460
4465
4461 * Version 0.1.12 released, 0.1.13 opened.
4466 * Version 0.1.12 released, 0.1.13 opened.
4462
4467
4463 * Removed option to set auto-quote and auto-paren escapes by
4468 * Removed option to set auto-quote and auto-paren escapes by
4464 user. The chances of breaking valid syntax are just too high. If
4469 user. The chances of breaking valid syntax are just too high. If
4465 someone *really* wants, they can always dig into the code.
4470 someone *really* wants, they can always dig into the code.
4466
4471
4467 * Made prompt separators configurable.
4472 * Made prompt separators configurable.
4468
4473
4469 2001-11-22 Fernando Perez <fperez@colorado.edu>
4474 2001-11-22 Fernando Perez <fperez@colorado.edu>
4470
4475
4471 * Small bugfixes in many places.
4476 * Small bugfixes in many places.
4472
4477
4473 * Removed the MyCompleter class from ipplib. It seemed redundant
4478 * Removed the MyCompleter class from ipplib. It seemed redundant
4474 with the C-p,C-n history search functionality. Less code to
4479 with the C-p,C-n history search functionality. Less code to
4475 maintain.
4480 maintain.
4476
4481
4477 * Moved all the original ipython.py code into ipythonlib.py. Right
4482 * Moved all the original ipython.py code into ipythonlib.py. Right
4478 now it's just one big dump into a function called make_IPython, so
4483 now it's just one big dump into a function called make_IPython, so
4479 no real modularity has been gained. But at least it makes the
4484 no real modularity has been gained. But at least it makes the
4480 wrapper script tiny, and since ipythonlib is a module, it gets
4485 wrapper script tiny, and since ipythonlib is a module, it gets
4481 compiled and startup is much faster.
4486 compiled and startup is much faster.
4482
4487
4483 This is a reasobably 'deep' change, so we should test it for a
4488 This is a reasobably 'deep' change, so we should test it for a
4484 while without messing too much more with the code.
4489 while without messing too much more with the code.
4485
4490
4486 2001-11-21 Fernando Perez <fperez@colorado.edu>
4491 2001-11-21 Fernando Perez <fperez@colorado.edu>
4487
4492
4488 * Version 0.1.11 released, 0.1.12 opened for further work.
4493 * Version 0.1.11 released, 0.1.12 opened for further work.
4489
4494
4490 * Removed dependency on Itpl. It was only needed in one place. It
4495 * Removed dependency on Itpl. It was only needed in one place. It
4491 would be nice if this became part of python, though. It makes life
4496 would be nice if this became part of python, though. It makes life
4492 *a lot* easier in some cases.
4497 *a lot* easier in some cases.
4493
4498
4494 * Simplified the prefilter code a bit. Now all handlers are
4499 * Simplified the prefilter code a bit. Now all handlers are
4495 expected to explicitly return a value (at least a blank string).
4500 expected to explicitly return a value (at least a blank string).
4496
4501
4497 * Heavy edits in ipplib. Removed the help system altogether. Now
4502 * Heavy edits in ipplib. Removed the help system altogether. Now
4498 obj?/?? is used for inspecting objects, a magic @doc prints
4503 obj?/?? is used for inspecting objects, a magic @doc prints
4499 docstrings, and full-blown Python help is accessed via the 'help'
4504 docstrings, and full-blown Python help is accessed via the 'help'
4500 keyword. This cleans up a lot of code (less to maintain) and does
4505 keyword. This cleans up a lot of code (less to maintain) and does
4501 the job. Since 'help' is now a standard Python component, might as
4506 the job. Since 'help' is now a standard Python component, might as
4502 well use it and remove duplicate functionality.
4507 well use it and remove duplicate functionality.
4503
4508
4504 Also removed the option to use ipplib as a standalone program. By
4509 Also removed the option to use ipplib as a standalone program. By
4505 now it's too dependent on other parts of IPython to function alone.
4510 now it's too dependent on other parts of IPython to function alone.
4506
4511
4507 * Fixed bug in genutils.pager. It would crash if the pager was
4512 * Fixed bug in genutils.pager. It would crash if the pager was
4508 exited immediately after opening (broken pipe).
4513 exited immediately after opening (broken pipe).
4509
4514
4510 * Trimmed down the VerboseTB reporting a little. The header is
4515 * Trimmed down the VerboseTB reporting a little. The header is
4511 much shorter now and the repeated exception arguments at the end
4516 much shorter now and the repeated exception arguments at the end
4512 have been removed. For interactive use the old header seemed a bit
4517 have been removed. For interactive use the old header seemed a bit
4513 excessive.
4518 excessive.
4514
4519
4515 * Fixed small bug in output of @whos for variables with multi-word
4520 * Fixed small bug in output of @whos for variables with multi-word
4516 types (only first word was displayed).
4521 types (only first word was displayed).
4517
4522
4518 2001-11-17 Fernando Perez <fperez@colorado.edu>
4523 2001-11-17 Fernando Perez <fperez@colorado.edu>
4519
4524
4520 * Version 0.1.10 released, 0.1.11 opened for further work.
4525 * Version 0.1.10 released, 0.1.11 opened for further work.
4521
4526
4522 * Modified dirs and friends. dirs now *returns* the stack (not
4527 * Modified dirs and friends. dirs now *returns* the stack (not
4523 prints), so one can manipulate it as a variable. Convenient to
4528 prints), so one can manipulate it as a variable. Convenient to
4524 travel along many directories.
4529 travel along many directories.
4525
4530
4526 * Fixed bug in magic_pdef: would only work with functions with
4531 * Fixed bug in magic_pdef: would only work with functions with
4527 arguments with default values.
4532 arguments with default values.
4528
4533
4529 2001-11-14 Fernando Perez <fperez@colorado.edu>
4534 2001-11-14 Fernando Perez <fperez@colorado.edu>
4530
4535
4531 * Added the PhysicsInput stuff to dot_ipython so it ships as an
4536 * Added the PhysicsInput stuff to dot_ipython so it ships as an
4532 example with IPython. Various other minor fixes and cleanups.
4537 example with IPython. Various other minor fixes and cleanups.
4533
4538
4534 * Version 0.1.9 released, 0.1.10 opened for further work.
4539 * Version 0.1.9 released, 0.1.10 opened for further work.
4535
4540
4536 * Added sys.path to the list of directories searched in the
4541 * Added sys.path to the list of directories searched in the
4537 execfile= option. It used to be the current directory and the
4542 execfile= option. It used to be the current directory and the
4538 user's IPYTHONDIR only.
4543 user's IPYTHONDIR only.
4539
4544
4540 2001-11-13 Fernando Perez <fperez@colorado.edu>
4545 2001-11-13 Fernando Perez <fperez@colorado.edu>
4541
4546
4542 * Reinstated the raw_input/prefilter separation that Janko had
4547 * Reinstated the raw_input/prefilter separation that Janko had
4543 initially. This gives a more convenient setup for extending the
4548 initially. This gives a more convenient setup for extending the
4544 pre-processor from the outside: raw_input always gets a string,
4549 pre-processor from the outside: raw_input always gets a string,
4545 and prefilter has to process it. We can then redefine prefilter
4550 and prefilter has to process it. We can then redefine prefilter
4546 from the outside and implement extensions for special
4551 from the outside and implement extensions for special
4547 purposes.
4552 purposes.
4548
4553
4549 Today I got one for inputting PhysicalQuantity objects
4554 Today I got one for inputting PhysicalQuantity objects
4550 (from Scientific) without needing any function calls at
4555 (from Scientific) without needing any function calls at
4551 all. Extremely convenient, and it's all done as a user-level
4556 all. Extremely convenient, and it's all done as a user-level
4552 extension (no IPython code was touched). Now instead of:
4557 extension (no IPython code was touched). Now instead of:
4553 a = PhysicalQuantity(4.2,'m/s**2')
4558 a = PhysicalQuantity(4.2,'m/s**2')
4554 one can simply say
4559 one can simply say
4555 a = 4.2 m/s**2
4560 a = 4.2 m/s**2
4556 or even
4561 or even
4557 a = 4.2 m/s^2
4562 a = 4.2 m/s^2
4558
4563
4559 I use this, but it's also a proof of concept: IPython really is
4564 I use this, but it's also a proof of concept: IPython really is
4560 fully user-extensible, even at the level of the parsing of the
4565 fully user-extensible, even at the level of the parsing of the
4561 command line. It's not trivial, but it's perfectly doable.
4566 command line. It's not trivial, but it's perfectly doable.
4562
4567
4563 * Added 'add_flip' method to inclusion conflict resolver. Fixes
4568 * Added 'add_flip' method to inclusion conflict resolver. Fixes
4564 the problem of modules being loaded in the inverse order in which
4569 the problem of modules being loaded in the inverse order in which
4565 they were defined in
4570 they were defined in
4566
4571
4567 * Version 0.1.8 released, 0.1.9 opened for further work.
4572 * Version 0.1.8 released, 0.1.9 opened for further work.
4568
4573
4569 * Added magics pdef, source and file. They respectively show the
4574 * Added magics pdef, source and file. They respectively show the
4570 definition line ('prototype' in C), source code and full python
4575 definition line ('prototype' in C), source code and full python
4571 file for any callable object. The object inspector oinfo uses
4576 file for any callable object. The object inspector oinfo uses
4572 these to show the same information.
4577 these to show the same information.
4573
4578
4574 * Version 0.1.7 released, 0.1.8 opened for further work.
4579 * Version 0.1.7 released, 0.1.8 opened for further work.
4575
4580
4576 * Separated all the magic functions into a class called Magic. The
4581 * Separated all the magic functions into a class called Magic. The
4577 InteractiveShell class was becoming too big for Xemacs to handle
4582 InteractiveShell class was becoming too big for Xemacs to handle
4578 (de-indenting a line would lock it up for 10 seconds while it
4583 (de-indenting a line would lock it up for 10 seconds while it
4579 backtracked on the whole class!)
4584 backtracked on the whole class!)
4580
4585
4581 FIXME: didn't work. It can be done, but right now namespaces are
4586 FIXME: didn't work. It can be done, but right now namespaces are
4582 all messed up. Do it later (reverted it for now, so at least
4587 all messed up. Do it later (reverted it for now, so at least
4583 everything works as before).
4588 everything works as before).
4584
4589
4585 * Got the object introspection system (magic_oinfo) working! I
4590 * Got the object introspection system (magic_oinfo) working! I
4586 think this is pretty much ready for release to Janko, so he can
4591 think this is pretty much ready for release to Janko, so he can
4587 test it for a while and then announce it. Pretty much 100% of what
4592 test it for a while and then announce it. Pretty much 100% of what
4588 I wanted for the 'phase 1' release is ready. Happy, tired.
4593 I wanted for the 'phase 1' release is ready. Happy, tired.
4589
4594
4590 2001-11-12 Fernando Perez <fperez@colorado.edu>
4595 2001-11-12 Fernando Perez <fperez@colorado.edu>
4591
4596
4592 * Version 0.1.6 released, 0.1.7 opened for further work.
4597 * Version 0.1.6 released, 0.1.7 opened for further work.
4593
4598
4594 * Fixed bug in printing: it used to test for truth before
4599 * Fixed bug in printing: it used to test for truth before
4595 printing, so 0 wouldn't print. Now checks for None.
4600 printing, so 0 wouldn't print. Now checks for None.
4596
4601
4597 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
4602 * Fixed bug where auto-execs increase the prompt counter by 2 (b/c
4598 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
4603 they have to call len(str(sys.ps1)) ). But the fix is ugly, it
4599 reaches by hand into the outputcache. Think of a better way to do
4604 reaches by hand into the outputcache. Think of a better way to do
4600 this later.
4605 this later.
4601
4606
4602 * Various small fixes thanks to Nathan's comments.
4607 * Various small fixes thanks to Nathan's comments.
4603
4608
4604 * Changed magic_pprint to magic_Pprint. This way it doesn't
4609 * Changed magic_pprint to magic_Pprint. This way it doesn't
4605 collide with pprint() and the name is consistent with the command
4610 collide with pprint() and the name is consistent with the command
4606 line option.
4611 line option.
4607
4612
4608 * Changed prompt counter behavior to be fully like
4613 * Changed prompt counter behavior to be fully like
4609 Mathematica's. That is, even input that doesn't return a result
4614 Mathematica's. That is, even input that doesn't return a result
4610 raises the prompt counter. The old behavior was kind of confusing
4615 raises the prompt counter. The old behavior was kind of confusing
4611 (getting the same prompt number several times if the operation
4616 (getting the same prompt number several times if the operation
4612 didn't return a result).
4617 didn't return a result).
4613
4618
4614 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
4619 * Fixed Nathan's last name in a couple of places (Gray, not Graham).
4615
4620
4616 * Fixed -Classic mode (wasn't working anymore).
4621 * Fixed -Classic mode (wasn't working anymore).
4617
4622
4618 * Added colored prompts using Nathan's new code. Colors are
4623 * Added colored prompts using Nathan's new code. Colors are
4619 currently hardwired, they can be user-configurable. For
4624 currently hardwired, they can be user-configurable. For
4620 developers, they can be chosen in file ipythonlib.py, at the
4625 developers, they can be chosen in file ipythonlib.py, at the
4621 beginning of the CachedOutput class def.
4626 beginning of the CachedOutput class def.
4622
4627
4623 2001-11-11 Fernando Perez <fperez@colorado.edu>
4628 2001-11-11 Fernando Perez <fperez@colorado.edu>
4624
4629
4625 * Version 0.1.5 released, 0.1.6 opened for further work.
4630 * Version 0.1.5 released, 0.1.6 opened for further work.
4626
4631
4627 * Changed magic_env to *return* the environment as a dict (not to
4632 * Changed magic_env to *return* the environment as a dict (not to
4628 print it). This way it prints, but it can also be processed.
4633 print it). This way it prints, but it can also be processed.
4629
4634
4630 * Added Verbose exception reporting to interactive
4635 * Added Verbose exception reporting to interactive
4631 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
4636 exceptions. Very nice, now even 1/0 at the prompt gives a verbose
4632 traceback. Had to make some changes to the ultraTB file. This is
4637 traceback. Had to make some changes to the ultraTB file. This is
4633 probably the last 'big' thing in my mental todo list. This ties
4638 probably the last 'big' thing in my mental todo list. This ties
4634 in with the next entry:
4639 in with the next entry:
4635
4640
4636 * Changed -Xi and -Xf to a single -xmode option. Now all the user
4641 * Changed -Xi and -Xf to a single -xmode option. Now all the user
4637 has to specify is Plain, Color or Verbose for all exception
4642 has to specify is Plain, Color or Verbose for all exception
4638 handling.
4643 handling.
4639
4644
4640 * Removed ShellServices option. All this can really be done via
4645 * Removed ShellServices option. All this can really be done via
4641 the magic system. It's easier to extend, cleaner and has automatic
4646 the magic system. It's easier to extend, cleaner and has automatic
4642 namespace protection and documentation.
4647 namespace protection and documentation.
4643
4648
4644 2001-11-09 Fernando Perez <fperez@colorado.edu>
4649 2001-11-09 Fernando Perez <fperez@colorado.edu>
4645
4650
4646 * Fixed bug in output cache flushing (missing parameter to
4651 * Fixed bug in output cache flushing (missing parameter to
4647 __init__). Other small bugs fixed (found using pychecker).
4652 __init__). Other small bugs fixed (found using pychecker).
4648
4653
4649 * Version 0.1.4 opened for bugfixing.
4654 * Version 0.1.4 opened for bugfixing.
4650
4655
4651 2001-11-07 Fernando Perez <fperez@colorado.edu>
4656 2001-11-07 Fernando Perez <fperez@colorado.edu>
4652
4657
4653 * Version 0.1.3 released, mainly because of the raw_input bug.
4658 * Version 0.1.3 released, mainly because of the raw_input bug.
4654
4659
4655 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
4660 * Fixed NASTY bug in raw_input: input line wasn't properly parsed
4656 and when testing for whether things were callable, a call could
4661 and when testing for whether things were callable, a call could
4657 actually be made to certain functions. They would get called again
4662 actually be made to certain functions. They would get called again
4658 once 'really' executed, with a resulting double call. A disaster
4663 once 'really' executed, with a resulting double call. A disaster
4659 in many cases (list.reverse() would never work!).
4664 in many cases (list.reverse() would never work!).
4660
4665
4661 * Removed prefilter() function, moved its code to raw_input (which
4666 * Removed prefilter() function, moved its code to raw_input (which
4662 after all was just a near-empty caller for prefilter). This saves
4667 after all was just a near-empty caller for prefilter). This saves
4663 a function call on every prompt, and simplifies the class a tiny bit.
4668 a function call on every prompt, and simplifies the class a tiny bit.
4664
4669
4665 * Fix _ip to __ip name in magic example file.
4670 * Fix _ip to __ip name in magic example file.
4666
4671
4667 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
4672 * Changed 'tar -x -f' to 'tar xvf' in auto-installer. This should
4668 work with non-gnu versions of tar.
4673 work with non-gnu versions of tar.
4669
4674
4670 2001-11-06 Fernando Perez <fperez@colorado.edu>
4675 2001-11-06 Fernando Perez <fperez@colorado.edu>
4671
4676
4672 * Version 0.1.2. Just to keep track of the recent changes.
4677 * Version 0.1.2. Just to keep track of the recent changes.
4673
4678
4674 * Fixed nasty bug in output prompt routine. It used to check 'if
4679 * Fixed nasty bug in output prompt routine. It used to check 'if
4675 arg != None...'. Problem is, this fails if arg implements a
4680 arg != None...'. Problem is, this fails if arg implements a
4676 special comparison (__cmp__) which disallows comparing to
4681 special comparison (__cmp__) which disallows comparing to
4677 None. Found it when trying to use the PhysicalQuantity module from
4682 None. Found it when trying to use the PhysicalQuantity module from
4678 ScientificPython.
4683 ScientificPython.
4679
4684
4680 2001-11-05 Fernando Perez <fperez@colorado.edu>
4685 2001-11-05 Fernando Perez <fperez@colorado.edu>
4681
4686
4682 * Also added dirs. Now the pushd/popd/dirs family functions
4687 * Also added dirs. Now the pushd/popd/dirs family functions
4683 basically like the shell, with the added convenience of going home
4688 basically like the shell, with the added convenience of going home
4684 when called with no args.
4689 when called with no args.
4685
4690
4686 * pushd/popd slightly modified to mimic shell behavior more
4691 * pushd/popd slightly modified to mimic shell behavior more
4687 closely.
4692 closely.
4688
4693
4689 * Added env,pushd,popd from ShellServices as magic functions. I
4694 * Added env,pushd,popd from ShellServices as magic functions. I
4690 think the cleanest will be to port all desired functions from
4695 think the cleanest will be to port all desired functions from
4691 ShellServices as magics and remove ShellServices altogether. This
4696 ShellServices as magics and remove ShellServices altogether. This
4692 will provide a single, clean way of adding functionality
4697 will provide a single, clean way of adding functionality
4693 (shell-type or otherwise) to IP.
4698 (shell-type or otherwise) to IP.
4694
4699
4695 2001-11-04 Fernando Perez <fperez@colorado.edu>
4700 2001-11-04 Fernando Perez <fperez@colorado.edu>
4696
4701
4697 * Added .ipython/ directory to sys.path. This way users can keep
4702 * Added .ipython/ directory to sys.path. This way users can keep
4698 customizations there and access them via import.
4703 customizations there and access them via import.
4699
4704
4700 2001-11-03 Fernando Perez <fperez@colorado.edu>
4705 2001-11-03 Fernando Perez <fperez@colorado.edu>
4701
4706
4702 * Opened version 0.1.1 for new changes.
4707 * Opened version 0.1.1 for new changes.
4703
4708
4704 * Changed version number to 0.1.0: first 'public' release, sent to
4709 * Changed version number to 0.1.0: first 'public' release, sent to
4705 Nathan and Janko.
4710 Nathan and Janko.
4706
4711
4707 * Lots of small fixes and tweaks.
4712 * Lots of small fixes and tweaks.
4708
4713
4709 * Minor changes to whos format. Now strings are shown, snipped if
4714 * Minor changes to whos format. Now strings are shown, snipped if
4710 too long.
4715 too long.
4711
4716
4712 * Changed ShellServices to work on __main__ so they show up in @who
4717 * Changed ShellServices to work on __main__ so they show up in @who
4713
4718
4714 * Help also works with ? at the end of a line:
4719 * Help also works with ? at the end of a line:
4715 ?sin and sin?
4720 ?sin and sin?
4716 both produce the same effect. This is nice, as often I use the
4721 both produce the same effect. This is nice, as often I use the
4717 tab-complete to find the name of a method, but I used to then have
4722 tab-complete to find the name of a method, but I used to then have
4718 to go to the beginning of the line to put a ? if I wanted more
4723 to go to the beginning of the line to put a ? if I wanted more
4719 info. Now I can just add the ? and hit return. Convenient.
4724 info. Now I can just add the ? and hit return. Convenient.
4720
4725
4721 2001-11-02 Fernando Perez <fperez@colorado.edu>
4726 2001-11-02 Fernando Perez <fperez@colorado.edu>
4722
4727
4723 * Python version check (>=2.1) added.
4728 * Python version check (>=2.1) added.
4724
4729
4725 * Added LazyPython documentation. At this point the docs are quite
4730 * Added LazyPython documentation. At this point the docs are quite
4726 a mess. A cleanup is in order.
4731 a mess. A cleanup is in order.
4727
4732
4728 * Auto-installer created. For some bizarre reason, the zipfiles
4733 * Auto-installer created. For some bizarre reason, the zipfiles
4729 module isn't working on my system. So I made a tar version
4734 module isn't working on my system. So I made a tar version
4730 (hopefully the command line options in various systems won't kill
4735 (hopefully the command line options in various systems won't kill
4731 me).
4736 me).
4732
4737
4733 * Fixes to Struct in genutils. Now all dictionary-like methods are
4738 * Fixes to Struct in genutils. Now all dictionary-like methods are
4734 protected (reasonably).
4739 protected (reasonably).
4735
4740
4736 * Added pager function to genutils and changed ? to print usage
4741 * Added pager function to genutils and changed ? to print usage
4737 note through it (it was too long).
4742 note through it (it was too long).
4738
4743
4739 * Added the LazyPython functionality. Works great! I changed the
4744 * Added the LazyPython functionality. Works great! I changed the
4740 auto-quote escape to ';', it's on home row and next to '. But
4745 auto-quote escape to ';', it's on home row and next to '. But
4741 both auto-quote and auto-paren (still /) escapes are command-line
4746 both auto-quote and auto-paren (still /) escapes are command-line
4742 parameters.
4747 parameters.
4743
4748
4744
4749
4745 2001-11-01 Fernando Perez <fperez@colorado.edu>
4750 2001-11-01 Fernando Perez <fperez@colorado.edu>
4746
4751
4747 * Version changed to 0.0.7. Fairly large change: configuration now
4752 * Version changed to 0.0.7. Fairly large change: configuration now
4748 is all stored in a directory, by default .ipython. There, all
4753 is all stored in a directory, by default .ipython. There, all
4749 config files have normal looking names (not .names)
4754 config files have normal looking names (not .names)
4750
4755
4751 * Version 0.0.6 Released first to Lucas and Archie as a test
4756 * Version 0.0.6 Released first to Lucas and Archie as a test
4752 run. Since it's the first 'semi-public' release, change version to
4757 run. Since it's the first 'semi-public' release, change version to
4753 > 0.0.6 for any changes now.
4758 > 0.0.6 for any changes now.
4754
4759
4755 * Stuff I had put in the ipplib.py changelog:
4760 * Stuff I had put in the ipplib.py changelog:
4756
4761
4757 Changes to InteractiveShell:
4762 Changes to InteractiveShell:
4758
4763
4759 - Made the usage message a parameter.
4764 - Made the usage message a parameter.
4760
4765
4761 - Require the name of the shell variable to be given. It's a bit
4766 - Require the name of the shell variable to be given. It's a bit
4762 of a hack, but allows the name 'shell' not to be hardwire in the
4767 of a hack, but allows the name 'shell' not to be hardwire in the
4763 magic (@) handler, which is problematic b/c it requires
4768 magic (@) handler, which is problematic b/c it requires
4764 polluting the global namespace with 'shell'. This in turn is
4769 polluting the global namespace with 'shell'. This in turn is
4765 fragile: if a user redefines a variable called shell, things
4770 fragile: if a user redefines a variable called shell, things
4766 break.
4771 break.
4767
4772
4768 - magic @: all functions available through @ need to be defined
4773 - magic @: all functions available through @ need to be defined
4769 as magic_<name>, even though they can be called simply as
4774 as magic_<name>, even though they can be called simply as
4770 @<name>. This allows the special command @magic to gather
4775 @<name>. This allows the special command @magic to gather
4771 information automatically about all existing magic functions,
4776 information automatically about all existing magic functions,
4772 even if they are run-time user extensions, by parsing the shell
4777 even if they are run-time user extensions, by parsing the shell
4773 instance __dict__ looking for special magic_ names.
4778 instance __dict__ looking for special magic_ names.
4774
4779
4775 - mainloop: added *two* local namespace parameters. This allows
4780 - mainloop: added *two* local namespace parameters. This allows
4776 the class to differentiate between parameters which were there
4781 the class to differentiate between parameters which were there
4777 before and after command line initialization was processed. This
4782 before and after command line initialization was processed. This
4778 way, later @who can show things loaded at startup by the
4783 way, later @who can show things loaded at startup by the
4779 user. This trick was necessary to make session saving/reloading
4784 user. This trick was necessary to make session saving/reloading
4780 really work: ideally after saving/exiting/reloading a session,
4785 really work: ideally after saving/exiting/reloading a session,
4781 *everythin* should look the same, including the output of @who. I
4786 *everythin* should look the same, including the output of @who. I
4782 was only able to make this work with this double namespace
4787 was only able to make this work with this double namespace
4783 trick.
4788 trick.
4784
4789
4785 - added a header to the logfile which allows (almost) full
4790 - added a header to the logfile which allows (almost) full
4786 session restoring.
4791 session restoring.
4787
4792
4788 - prepend lines beginning with @ or !, with a and log
4793 - prepend lines beginning with @ or !, with a and log
4789 them. Why? !lines: may be useful to know what you did @lines:
4794 them. Why? !lines: may be useful to know what you did @lines:
4790 they may affect session state. So when restoring a session, at
4795 they may affect session state. So when restoring a session, at
4791 least inform the user of their presence. I couldn't quite get
4796 least inform the user of their presence. I couldn't quite get
4792 them to properly re-execute, but at least the user is warned.
4797 them to properly re-execute, but at least the user is warned.
4793
4798
4794 * Started ChangeLog.
4799 * Started ChangeLog.
@@ -1,395 +1,406 b''
1 .\" Hey, EMACS: -*- nroff -*-
1 .\" Hey, EMACS: -*- nroff -*-
2 .\" First parameter, NAME, should be all caps
2 .\" First parameter, NAME, should be all caps
3 .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
3 .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
4 .\" other parameters are allowed: see man(7), man(1)
4 .\" other parameters are allowed: see man(7), man(1)
5 .TH IPYTHON 1 "November 30, 2004"
5 .TH IPYTHON 1 "November 30, 2004"
6 .\" Please adjust this date whenever revising the manpage.
6 .\" Please adjust this date whenever revising the manpage.
7 .\"
7 .\"
8 .\" Some roff macros, for reference:
8 .\" Some roff macros, for reference:
9 .\" .nh disable hyphenation
9 .\" .nh disable hyphenation
10 .\" .hy enable hyphenation
10 .\" .hy enable hyphenation
11 .\" .ad l left justify
11 .\" .ad l left justify
12 .\" .ad b justify to both left and right margins
12 .\" .ad b justify to both left and right margins
13 .\" .nf disable filling
13 .\" .nf disable filling
14 .\" .fi enable filling
14 .\" .fi enable filling
15 .\" .br insert line break
15 .\" .br insert line break
16 .\" .sp <n> insert n+1 empty lines
16 .\" .sp <n> insert n+1 empty lines
17 .\" for manpage-specific macros, see man(7) and groff_man(7)
17 .\" for manpage-specific macros, see man(7) and groff_man(7)
18 .\" .SH section heading
18 .\" .SH section heading
19 .\" .SS secondary section heading
19 .\" .SS secondary section heading
20 .\"
20 .\"
21 .\"
21 .\"
22 .\" To preview this page as plain text: nroff -man ipython.1
22 .\" To preview this page as plain text: nroff -man ipython.1
23 .\"
23 .\"
24 .SH NAME
24 .SH NAME
25 ipython \- An Enhanced Interactive Python
25 ipython \- An Enhanced Interactive Python
26 .SH SYNOPSIS
26 .SH SYNOPSIS
27 .B ipython
27 .B ipython
28 .RI [ options ] " files" ...
28 .RI [ options ] " files" ...
29 .SH DESCRIPTION
29 .SH DESCRIPTION
30 An interactive Python shell with automatic history (input and output),
30 An interactive Python shell with automatic history (input and output),
31 dynamic object introspection, easier configuration, command
31 dynamic object introspection, easier configuration, command
32 completion, access to the system shell, integration with numerical and
32 completion, access to the system shell, integration with numerical and
33 scientific computing tools, and more.
33 scientific computing tools, and more.
34 .SH SPECIAL THREADING OPTIONS
34 .SH SPECIAL THREADING OPTIONS
35 The following special options are ONLY valid at the beginning of the command
35 The following special options are ONLY valid at the beginning of the command
36 line, and not later. This is because they control the initialization of
36 line, and not later. This is because they control the initialization of
37 ipython itself, before the normal option-handling mechanism is active.
37 ipython itself, before the normal option-handling mechanism is active.
38 .TP
38 .TP
39 .B \-gthread, \-qthread, \-wthread, \-pylab
39 .B \-gthread, \-qthread, \-wthread, \-pylab
40 Only ONE of these can be given, and it can only be given as the first option
40 Only ONE of these can be given, and it can only be given as the first option
41 passed to IPython (it will have no effect in any other position). They
41 passed to IPython (it will have no effect in any other position). They
42 provide threading support for the GTK, QT and WXWidgets toolkits, and for the
42 provide threading support for the GTK, QT and WXWidgets toolkits, and for the
43 matplotlib library.
43 matplotlib library.
44 .br
44 .br
45 .sp 1
45 .sp 1
46 With any of the first three options, IPython starts running a separate thread
46 With any of the first three options, IPython starts running a separate thread
47 for the graphical toolkit's operation, so that you can open and control
47 for the graphical toolkit's operation, so that you can open and control
48 graphical elements from within an IPython command line, without blocking. All
48 graphical elements from within an IPython command line, without blocking. All
49 three provide essentially the same functionality, respectively for GTK, QT and
49 three provide essentially the same functionality, respectively for GTK, QT and
50 WXWidgets (via their Python interfaces).
50 WXWidgets (via their Python interfaces).
51 .br
51 .br
52 .sp 1
52 .sp 1
53 Note that with \-wthread, you can additionally use the \-wxversion option to
54 request a specific version of wx to be used. This requires that you have the
55 'wxversion' Python module installed, which is part of recent wxPython
56 distributions.
57 .br
58 .sp 1
53 If \-pylab is given, IPython loads special support for the matplotlib library
59 If \-pylab is given, IPython loads special support for the matplotlib library
54 (http://matplotlib.sourceforge.net), allowing interactive usage of any of its
60 (http://matplotlib.sourceforge.net), allowing interactive usage of any of its
55 backends as defined in the user's .matplotlibrc file. It automatically
61 backends as defined in the user's .matplotlibrc file. It automatically
56 activates GTK, QT or WX threading for IPyhton if the choice of matplotlib
62 activates GTK, QT or WX threading for IPyhton if the choice of matplotlib
57 backend requires it. It also modifies the %run command to correctly execute
63 backend requires it. It also modifies the %run command to correctly execute
58 (without blocking) any matplotlib-based script which calls show() at the end.
64 (without blocking) any matplotlib-based script which calls show() at the end.
59 .TP
65 .TP
60 .B \-tk
66 .B \-tk
61 The \-g/q/wthread options, and \-pylab (if matplotlib is configured to use
67 The \-g/q/wthread options, and \-pylab (if matplotlib is configured to use
62 GTK, QT or WX), will normally block Tk graphical interfaces. This means that
68 GTK, QT or WX), will normally block Tk graphical interfaces. This means that
63 when GTK, QT or WX threading is active, any attempt to open a Tk GUI will
69 when GTK, QT or WX threading is active, any attempt to open a Tk GUI will
64 result in a dead window, and possibly cause the Python interpreter to crash.
70 result in a dead window, and possibly cause the Python interpreter to crash.
65 An extra option, \-tk, is available to address this issue. It can ONLY be
71 An extra option, \-tk, is available to address this issue. It can ONLY be
66 given as a SECOND option after any of the above (\-gthread, \-qthread,
72 given as a SECOND option after any of the above (\-gthread, \-qthread,
67 \-wthread or \-pylab).
73 \-wthread or \-pylab).
68 .br
74 .br
69 .sp 1
75 .sp 1
70 If \-tk is given, IPython will try to coordinate Tk threading with GTK, QT or
76 If \-tk is given, IPython will try to coordinate Tk threading with GTK, QT or
71 WX. This is however potentially unreliable, and you will have to test on your
77 WX. This is however potentially unreliable, and you will have to test on your
72 platform and Python configuration to determine whether it works for you.
78 platform and Python configuration to determine whether it works for you.
73 Debian users have reported success, apparently due to the fact that Debian
79 Debian users have reported success, apparently due to the fact that Debian
74 builds all of Tcl, Tk, Tkinter and Python with pthreads support. Under other
80 builds all of Tcl, Tk, Tkinter and Python with pthreads support. Under other
75 Linux environments (such as Fedora Core 2), this option has caused random
81 Linux environments (such as Fedora Core 2), this option has caused random
76 crashes and lockups of the Python interpreter. Under other operating systems
82 crashes and lockups of the Python interpreter. Under other operating systems
77 (Mac OSX and Windows), you'll need to try it to find out, since currently no
83 (Mac OSX and Windows), you'll need to try it to find out, since currently no
78 user reports are available.
84 user reports are available.
79 .br
85 .br
80 .sp 1
86 .sp 1
81 There is unfortunately no way for IPython to determine at runtime whether \-tk
87 There is unfortunately no way for IPython to determine at runtime whether \-tk
82 will work reliably or not, so you will need to do some experiments before
88 will work reliably or not, so you will need to do some experiments before
83 relying on it for regular work.
89 relying on it for regular work.
84 .
90 .
85 .SS A WARNING ABOUT SIGNALS AND THREADS
91 .SS A WARNING ABOUT SIGNALS AND THREADS
86 When any of the thread systems (GTK, QT or WX) are active, either directly or
92 When any of the thread systems (GTK, QT or WX) are active, either directly or
87 via \-pylab with a threaded backend, it is impossible to interrupt
93 via \-pylab with a threaded backend, it is impossible to interrupt
88 long-running Python code via Ctrl\-C. IPython can not pass the
94 long-running Python code via Ctrl\-C. IPython can not pass the
89 KeyboardInterrupt exception (or the underlying SIGINT) across threads, so any
95 KeyboardInterrupt exception (or the underlying SIGINT) across threads, so any
90 long-running process started from IPython will run to completion, or will have
96 long-running process started from IPython will run to completion, or will have
91 to be killed via an external (OS-based) mechanism.
97 to be killed via an external (OS-based) mechanism.
92 .br
98 .br
93 .sp 1
99 .sp 1
94 To the best of my knowledge, this limitation is imposed by the Python
100 To the best of my knowledge, this limitation is imposed by the Python
95 interpreter itself, and it comes from the difficulty of writing portable
101 interpreter itself, and it comes from the difficulty of writing portable
96 signal/threaded code. If any user is an expert on this topic and can suggest
102 signal/threaded code. If any user is an expert on this topic and can suggest
97 a better solution, I would love to hear about it. In the IPython sources,
103 a better solution, I would love to hear about it. In the IPython sources,
98 look at the Shell.py module, and in particular at the runcode() method.
104 look at the Shell.py module, and in particular at the runcode() method.
99 .
105 .
100 .SH REGULAR OPTIONS
106 .SH REGULAR OPTIONS
101 After the above threading options have been given, regular options can follow
107 After the above threading options have been given, regular options can follow
102 in any order. All options can be abbreviated to their shortest non-ambiguous
108 in any order. All options can be abbreviated to their shortest non-ambiguous
103 form and are case-sensitive. One or two dashes can be used. Some options
109 form and are case-sensitive. One or two dashes can be used. Some options
104 have an alternate short form, indicated after a |.
110 have an alternate short form, indicated after a |.
105 .br
111 .br
106 .sp 1
112 .sp 1
107 Most options can also be set from your ipythonrc configuration file.
113 Most options can also be set from your ipythonrc configuration file.
108 See the provided examples for assistance. Options given on the
114 See the provided examples for assistance. Options given on the
109 commandline override the values set in the ipythonrc file.
115 commandline override the values set in the ipythonrc file.
110 .br
116 .br
111 .sp 1
117 .sp 1
112 All options with a [no] prepended can be specified in negated form
118 All options with a [no] prepended can be specified in negated form
113 (\-nooption instead of \-option) to turn the feature off.
119 (\-nooption instead of \-option) to turn the feature off.
114 .TP
120 .TP
115 .B \-h, \-\-help
121 .B \-h, \-\-help
116 Show summary of options.
122 Show summary of options.
117 .TP
123 .TP
118 .B \-autocall <val>
124 .B \-autocall <val>
119 Make IPython automatically call any callable object even if you didn't type
125 Make IPython automatically call any callable object even if you didn't type
120 explicit parentheses. For example, 'str 43' becomes
126 explicit parentheses. For example, 'str 43' becomes
121 'str(43)' automatically. The value can be '0' to disable the
127 'str(43)' automatically. The value can be '0' to disable the
122 feature, '1' for 'smart' autocall, where it is not applied if
128 feature, '1' for 'smart' autocall, where it is not applied if
123 there are no more arguments on the line, and '2' for 'full'
129 there are no more arguments on the line, and '2' for 'full'
124 autocall, where all callable objects are automatically called
130 autocall, where all callable objects are automatically called
125 (even if no arguments are present). The default is '1'.
131 (even if no arguments are present). The default is '1'.
126 .TP
132 .TP
127 .B \-[no]autoindent
133 .B \-[no]autoindent
128 Turn automatic indentation on/off.
134 Turn automatic indentation on/off.
129 .TP
135 .TP
130 .B \-[no]automagic
136 .B \-[no]automagic
131 Make magic commands automatic (without needing their first character
137 Make magic commands automatic (without needing their first character
132 to be %). Type %magic at the IPython prompt for more information.
138 to be %). Type %magic at the IPython prompt for more information.
133 .TP
139 .TP
134 .B \-[no]autoedit_syntax
140 .B \-[no]autoedit_syntax
135 When a syntax error occurs after editing a file, automatically open the file
141 When a syntax error occurs after editing a file, automatically open the file
136 to the trouble causing line for convenient fixing.
142 to the trouble causing line for convenient fixing.
137 .TP
143 .TP
138 .B \-[no]banner
144 .B \-[no]banner
139 Print the intial information banner (default on).
145 Print the intial information banner (default on).
140 .TP
146 .TP
141 .B \-c <command>
147 .B \-c <command>
142 Execute the given command string, and set sys.argv to ['c']. This is similar
148 Execute the given command string, and set sys.argv to ['c']. This is similar
143 to the \-c option in the normal Python interpreter.
149 to the \-c option in the normal Python interpreter.
144 .TP
150 .TP
145 .B \-cache_size|cs <n>
151 .B \-cache_size|cs <n>
146 Size of the output cache (maximum number of entries to hold in
152 Size of the output cache (maximum number of entries to hold in
147 memory). The default is 1000, you can change it permanently in your
153 memory). The default is 1000, you can change it permanently in your
148 config file. Setting it to 0 completely disables the caching system,
154 config file. Setting it to 0 completely disables the caching system,
149 and the minimum value accepted is 20 (if you provide a value less than
155 and the minimum value accepted is 20 (if you provide a value less than
150 20, it is reset to 0 and a warning is issued). This limit is defined
156 20, it is reset to 0 and a warning is issued). This limit is defined
151 because otherwise you'll spend more time re-flushing a too small cache
157 because otherwise you'll spend more time re-flushing a too small cache
152 than working.
158 than working.
153 .TP
159 .TP
154 .B \-classic|cl
160 .B \-classic|cl
155 Gives IPython a similar feel to the classic Python prompt.
161 Gives IPython a similar feel to the classic Python prompt.
156 .TP
162 .TP
157 .B \-colors <scheme>
163 .B \-colors <scheme>
158 Color scheme for prompts and exception reporting. Currently
164 Color scheme for prompts and exception reporting. Currently
159 implemented: NoColor, Linux, and LightBG.
165 implemented: NoColor, Linux, and LightBG.
160 .TP
166 .TP
161 .B \-[no]color_info
167 .B \-[no]color_info
162 IPython can display information about objects via a set of functions,
168 IPython can display information about objects via a set of functions,
163 and optionally can use colors for this, syntax highlighting source
169 and optionally can use colors for this, syntax highlighting source
164 code and various other elements. However, because this information is
170 code and various other elements. However, because this information is
165 passed through a pager (like 'less') and many pagers get confused with
171 passed through a pager (like 'less') and many pagers get confused with
166 color codes, this option is off by default. You can test it and turn
172 color codes, this option is off by default. You can test it and turn
167 it on permanently in your ipythonrc file if it works for you. As a
173 it on permanently in your ipythonrc file if it works for you. As a
168 reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
174 reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
169 that in RedHat 7.2 doesn't.
175 that in RedHat 7.2 doesn't.
170 .br
176 .br
171 .sp 1
177 .sp 1
172 Test it and turn it on permanently if it works with your system. The
178 Test it and turn it on permanently if it works with your system. The
173 magic function @color_info allows you to toggle this interactively for
179 magic function @color_info allows you to toggle this interactively for
174 testing.
180 testing.
175 .TP
181 .TP
176 .B \-[no]confirm_exit
182 .B \-[no]confirm_exit
177 Set to confirm when you try to exit IPython with an EOF (Control-D in
183 Set to confirm when you try to exit IPython with an EOF (Control-D in
178 Unix, Control-Z/Enter in Windows). Note that using the magic functions
184 Unix, Control-Z/Enter in Windows). Note that using the magic functions
179 @Exit or @Quit you can force a direct exit, bypassing any
185 @Exit or @Quit you can force a direct exit, bypassing any
180 confirmation.
186 confirmation.
181 .TP
187 .TP
182 .B \-[no]debug
188 .B \-[no]debug
183 Show information about the loading process. Very useful to pin down
189 Show information about the loading process. Very useful to pin down
184 problems with your configuration files or to get details about session
190 problems with your configuration files or to get details about session
185 restores.
191 restores.
186 .TP
192 .TP
187 .B \-[no]deep_reload
193 .B \-[no]deep_reload
188 IPython can use the deep_reload module which reloads changes in
194 IPython can use the deep_reload module which reloads changes in
189 modules recursively (it replaces the reload() function, so you don't
195 modules recursively (it replaces the reload() function, so you don't
190 need to change anything to use it). deep_reload() forces a full reload
196 need to change anything to use it). deep_reload() forces a full reload
191 of modules whose code may have changed, which the default reload()
197 of modules whose code may have changed, which the default reload()
192 function does not.
198 function does not.
193 .br
199 .br
194 .sp 1
200 .sp 1
195 When deep_reload is off, IPython will use the normal reload(), but
201 When deep_reload is off, IPython will use the normal reload(), but
196 deep_reload will still be available as dreload(). This feature is off
202 deep_reload will still be available as dreload(). This feature is off
197 by default [which means that you have both normal reload() and
203 by default [which means that you have both normal reload() and
198 dreload()].
204 dreload()].
199 .TP
205 .TP
200 .B \-editor <name>
206 .B \-editor <name>
201 Which editor to use with the @edit command. By default, IPython will
207 Which editor to use with the @edit command. By default, IPython will
202 honor your EDITOR environment variable (if not set, vi is the Unix
208 honor your EDITOR environment variable (if not set, vi is the Unix
203 default and notepad the Windows one). Since this editor is invoked on
209 default and notepad the Windows one). Since this editor is invoked on
204 the fly by IPython and is meant for editing small code snippets, you
210 the fly by IPython and is meant for editing small code snippets, you
205 may want to use a small, lightweight editor here (in case your default
211 may want to use a small, lightweight editor here (in case your default
206 EDITOR is something like Emacs).
212 EDITOR is something like Emacs).
207 .TP
213 .TP
208 .B \-ipythondir <name>
214 .B \-ipythondir <name>
209 The name of your IPython configuration directory IPYTHONDIR. This can
215 The name of your IPython configuration directory IPYTHONDIR. This can
210 also be specified through the environment variable IPYTHONDIR.
216 also be specified through the environment variable IPYTHONDIR.
211 .TP
217 .TP
212 .B \-log|l
218 .B \-log|l
213 Generate a log file of all input. The file is named ipython_log.py in your
219 Generate a log file of all input. The file is named ipython_log.py in your
214 current directory (which prevents logs from multiple IPython sessions from
220 current directory (which prevents logs from multiple IPython sessions from
215 trampling each other). You can use this to later restore a session by loading
221 trampling each other). You can use this to later restore a session by loading
216 your logfile as a file to be executed with option -logplay (see below).
222 your logfile as a file to be executed with option -logplay (see below).
217 .TP
223 .TP
218 .B \-logfile|lf
224 .B \-logfile|lf
219 Specify the name of your logfile.
225 Specify the name of your logfile.
220 .TP
226 .TP
221 .B \-logplay|lp
227 .B \-logplay|lp
222 Replay a previous log. For restoring a session as close as possible to
228 Replay a previous log. For restoring a session as close as possible to
223 the state you left it in, use this option (don't just run the
229 the state you left it in, use this option (don't just run the
224 logfile). With \-logplay, IPython will try to reconstruct the previous
230 logfile). With \-logplay, IPython will try to reconstruct the previous
225 working environment in full, not just execute the commands in the
231 working environment in full, not just execute the commands in the
226 logfile.
232 logfile.
227 .br
233 .br
228 .sh 1
234 .sh 1
229 When a session is restored, logging is automatically turned on again
235 When a session is restored, logging is automatically turned on again
230 with the name of the logfile it was invoked with (it is read from the
236 with the name of the logfile it was invoked with (it is read from the
231 log header). So once you've turned logging on for a session, you can
237 log header). So once you've turned logging on for a session, you can
232 quit IPython and reload it as many times as you want and it will
238 quit IPython and reload it as many times as you want and it will
233 continue to log its history and restore from the beginning every time.
239 continue to log its history and restore from the beginning every time.
234 .br
240 .br
235 .sp 1
241 .sp 1
236 Caveats: there are limitations in this option. The history variables
242 Caveats: there are limitations in this option. The history variables
237 _i*,_* and _dh don't get restored properly. In the future we will try
243 _i*,_* and _dh don't get restored properly. In the future we will try
238 to implement full session saving by writing and retrieving a
244 to implement full session saving by writing and retrieving a
239 'snapshot' of the memory state of IPython. But our first attempts
245 'snapshot' of the memory state of IPython. But our first attempts
240 failed because of inherent limitations of Python's Pickle module, so
246 failed because of inherent limitations of Python's Pickle module, so
241 this may have to wait.
247 this may have to wait.
242 .TP
248 .TP
243 .B \-[no]messages
249 .B \-[no]messages
244 Print messages which IPython collects about its startup process
250 Print messages which IPython collects about its startup process
245 (default on).
251 (default on).
246 .TP
252 .TP
247 .B \-[no]pdb
253 .B \-[no]pdb
248 Automatically call the pdb debugger after every uncaught exception. If
254 Automatically call the pdb debugger after every uncaught exception. If
249 you are used to debugging using pdb, this puts you automatically
255 you are used to debugging using pdb, this puts you automatically
250 inside of it after any call (either in IPython or in code called by
256 inside of it after any call (either in IPython or in code called by
251 it) which triggers an exception which goes uncaught.
257 it) which triggers an exception which goes uncaught.
252 .TP
258 .TP
253 .B \-[no]pprint
259 .B \-[no]pprint
254 IPython can optionally use the pprint (pretty printer) module for
260 IPython can optionally use the pprint (pretty printer) module for
255 displaying results. pprint tends to give a nicer display of nested
261 displaying results. pprint tends to give a nicer display of nested
256 data structures. If you like it, you can turn it on permanently in
262 data structures. If you like it, you can turn it on permanently in
257 your config file (default off).
263 your config file (default off).
258 .TP
264 .TP
259 .B \-profile|p <name>
265 .B \-profile|p <name>
260 Assume that your config file is ipythonrc-<name> (looks in current dir
266 Assume that your config file is ipythonrc-<name> (looks in current dir
261 first, then in IPYTHONDIR). This is a quick way to keep and load
267 first, then in IPYTHONDIR). This is a quick way to keep and load
262 multiple config files for different tasks, especially if you use the
268 multiple config files for different tasks, especially if you use the
263 include option of config files. You can keep a basic
269 include option of config files. You can keep a basic
264 IPYTHONDIR/ipythonrc file and then have other 'profiles' which include
270 IPYTHONDIR/ipythonrc file and then have other 'profiles' which include
265 this one and load extra things for particular tasks. For example:
271 this one and load extra things for particular tasks. For example:
266 .br
272 .br
267 .sp 1
273 .sp 1
268 1) $HOME/.ipython/ipythonrc : load basic things you always want.
274 1) $HOME/.ipython/ipythonrc : load basic things you always want.
269 .br
275 .br
270 2) $HOME/.ipython/ipythonrc-math : load (1) and basic math-related
276 2) $HOME/.ipython/ipythonrc-math : load (1) and basic math-related
271 modules.
277 modules.
272 .br
278 .br
273 3) $HOME/.ipython/ipythonrc-numeric : load (1) and Numeric and
279 3) $HOME/.ipython/ipythonrc-numeric : load (1) and Numeric and
274 plotting modules.
280 plotting modules.
275 .br
281 .br
276 .sp 1
282 .sp 1
277 Since it is possible to create an endless loop by having circular file
283 Since it is possible to create an endless loop by having circular file
278 inclusions, IPython will stop if it reaches 15 recursive inclusions.
284 inclusions, IPython will stop if it reaches 15 recursive inclusions.
279 .TP
285 .TP
280 .B \-prompt_in1|pi1 <string>
286 .B \-prompt_in1|pi1 <string>
281 Specify the string used for input prompts. Note that if you are using
287 Specify the string used for input prompts. Note that if you are using
282 numbered prompts, the number is represented with a '\\#' in the
288 numbered prompts, the number is represented with a '\\#' in the
283 string. Don't forget to quote strings with spaces embedded in
289 string. Don't forget to quote strings with spaces embedded in
284 them. Default: 'In [\\#]:'.
290 them. Default: 'In [\\#]:'.
285 .br
291 .br
286 .sp 1
292 .sp 1
287 Most bash-like escapes can be used to customize IPython's prompts, as well as
293 Most bash-like escapes can be used to customize IPython's prompts, as well as
288 a few additional ones which are IPython-specific. All valid prompt escapes
294 a few additional ones which are IPython-specific. All valid prompt escapes
289 are described in detail in the Customization section of the IPython HTML/PDF
295 are described in detail in the Customization section of the IPython HTML/PDF
290 manual.
296 manual.
291 .TP
297 .TP
292 .B \-prompt_in2|pi2 <string>
298 .B \-prompt_in2|pi2 <string>
293 Similar to the previous option, but used for the continuation prompts. The
299 Similar to the previous option, but used for the continuation prompts. The
294 special sequence '\\D' is similar to '\\#', but with all digits replaced dots
300 special sequence '\\D' is similar to '\\#', but with all digits replaced dots
295 (so you can have your continuation prompt aligned with your input
301 (so you can have your continuation prompt aligned with your input
296 prompt). Default: ' .\\D.:' (note three spaces at the start for alignment
302 prompt). Default: ' .\\D.:' (note three spaces at the start for alignment
297 with 'In [\\#]').
303 with 'In [\\#]').
298 .TP
304 .TP
299 .B \-prompt_out|po <string>
305 .B \-prompt_out|po <string>
300 String used for output prompts, also uses numbers like prompt_in1.
306 String used for output prompts, also uses numbers like prompt_in1.
301 Default: 'Out[\\#]:'.
307 Default: 'Out[\\#]:'.
302 .TP
308 .TP
303 .B \-quick
309 .B \-quick
304 Start in bare bones mode (no config file loaded).
310 Start in bare bones mode (no config file loaded).
305 .TP
311 .TP
306 .B \-rcfile <name>
312 .B \-rcfile <name>
307 Name of your IPython resource configuration file. normally IPython
313 Name of your IPython resource configuration file. normally IPython
308 loads ipythonrc (from current directory) or IPYTHONDIR/ipythonrc. If
314 loads ipythonrc (from current directory) or IPYTHONDIR/ipythonrc. If
309 the loading of your config file fails, IPython starts with a bare
315 the loading of your config file fails, IPython starts with a bare
310 bones configuration (no modules loaded at all).
316 bones configuration (no modules loaded at all).
311 .TP
317 .TP
312 .B \-[no]readline
318 .B \-[no]readline
313 Use the readline library, which is needed to support name completion
319 Use the readline library, which is needed to support name completion
314 and command history, among other things. It is enabled by default, but
320 and command history, among other things. It is enabled by default, but
315 may cause problems for users of X/Emacs in Python comint or shell
321 may cause problems for users of X/Emacs in Python comint or shell
316 buffers.
322 buffers.
317 .br
323 .br
318 .sp 1
324 .sp 1
319 Note that emacs 'eterm' buffers (opened with M-x term) support
325 Note that emacs 'eterm' buffers (opened with M-x term) support
320 IPython's readline and syntax coloring fine, only 'emacs' (M-x shell
326 IPython's readline and syntax coloring fine, only 'emacs' (M-x shell
321 and C-c !) buffers do not.
327 and C-c !) buffers do not.
322 .TP
328 .TP
323 .B \-screen_length|sl <n>
329 .B \-screen_length|sl <n>
324 Number of lines of your screen. This is used to control printing of
330 Number of lines of your screen. This is used to control printing of
325 very long strings. Strings longer than this number of lines will be
331 very long strings. Strings longer than this number of lines will be
326 sent through a pager instead of directly printed.
332 sent through a pager instead of directly printed.
327 .br
333 .br
328 .sp 1
334 .sp 1
329 The default value for this is 0, which means IPython will auto-detect
335 The default value for this is 0, which means IPython will auto-detect
330 your screen size every time it needs to print certain potentially long
336 your screen size every time it needs to print certain potentially long
331 strings (this doesn't change the behavior of the 'print' keyword, it's
337 strings (this doesn't change the behavior of the 'print' keyword, it's
332 only triggered internally). If for some reason this isn't working well
338 only triggered internally). If for some reason this isn't working well
333 (it needs curses support), specify it yourself. Otherwise don't change
339 (it needs curses support), specify it yourself. Otherwise don't change
334 the default.
340 the default.
335 .TP
341 .TP
336 .B \-separate_in|si <string>
342 .B \-separate_in|si <string>
337 Separator before input prompts. Default '\n'.
343 Separator before input prompts. Default '\n'.
338 .TP
344 .TP
339 .B \-separate_out|so <string>
345 .B \-separate_out|so <string>
340 Separator before output prompts. Default: 0 (nothing).
346 Separator before output prompts. Default: 0 (nothing).
341 .TP
347 .TP
342 .B \-separate_out2|so2 <string>
348 .B \-separate_out2|so2 <string>
343 Separator after output prompts. Default: 0 (nothing).
349 Separator after output prompts. Default: 0 (nothing).
344 .TP
350 .TP
345 .B \-nosep
351 .B \-nosep
346 Shorthand for '\-separate_in 0 \-separate_out 0 \-separate_out2 0'.
352 Shorthand for '\-separate_in 0 \-separate_out 0 \-separate_out2 0'.
347 Simply removes all input/output separators.
353 Simply removes all input/output separators.
348 .TP
354 .TP
349 .B \-upgrade
355 .B \-upgrade
350 Allows you to upgrade your IPYTHONDIR configuration when you install a
356 Allows you to upgrade your IPYTHONDIR configuration when you install a
351 new version of IPython. Since new versions may include new command
357 new version of IPython. Since new versions may include new command
352 lines options or example files, this copies updated ipythonrc-type
358 lines options or example files, this copies updated ipythonrc-type
353 files. However, it backs up (with a .old extension) all files which
359 files. However, it backs up (with a .old extension) all files which
354 it overwrites so that you can merge back any custimizations you might
360 it overwrites so that you can merge back any custimizations you might
355 have in your personal files.
361 have in your personal files.
356 .TP
362 .TP
357 .B \-Version
363 .B \-Version
358 Print version information and exit.
364 Print version information and exit.
359 .TP
365 .TP
366 .B -wxversion <string>
367 Select a specific version of wxPython (used in conjunction with
368 \-wthread). Requires the wxversion module, part of recent wxPython
369 distributions.
370 .TP
360 .B \-xmode <modename>
371 .B \-xmode <modename>
361 Mode for exception reporting. The valid modes are Plain, Context, and
372 Mode for exception reporting. The valid modes are Plain, Context, and
362 Verbose.
373 Verbose.
363 .br
374 .br
364 .sp 1
375 .sp 1
365 \- Plain: similar to python's normal traceback printing.
376 \- Plain: similar to python's normal traceback printing.
366 .br
377 .br
367 .sp 1
378 .sp 1
368 \- Context: prints 5 lines of context source code around each line in the
379 \- Context: prints 5 lines of context source code around each line in the
369 traceback.
380 traceback.
370 .br
381 .br
371 .sp 1
382 .sp 1
372 \- Verbose: similar to Context, but additionally prints the variables
383 \- Verbose: similar to Context, but additionally prints the variables
373 currently visible where the exception happened (shortening their strings if
384 currently visible where the exception happened (shortening their strings if
374 too long). This can potentially be very slow, if you happen to have a huge
385 too long). This can potentially be very slow, if you happen to have a huge
375 data structure whose string representation is complex to compute. Your
386 data structure whose string representation is complex to compute. Your
376 computer may appear to freeze for a while with cpu usage at 100%. If this
387 computer may appear to freeze for a while with cpu usage at 100%. If this
377 occurs, you can cancel the traceback with Ctrl-C (maybe hitting it more than
388 occurs, you can cancel the traceback with Ctrl-C (maybe hitting it more than
378 once).
389 once).
379 .
390 .
380 .SH EMBEDDING
391 .SH EMBEDDING
381 It is possible to start an IPython instance inside your own Python
392 It is possible to start an IPython instance inside your own Python
382 programs. In the documentation example files there are some
393 programs. In the documentation example files there are some
383 illustrations on how to do this.
394 illustrations on how to do this.
384 .br
395 .br
385 .sp 1
396 .sp 1
386 This feature allows you to evalutate dynamically the state of your
397 This feature allows you to evalutate dynamically the state of your
387 code, operate with your variables, analyze them, etc. Note however
398 code, operate with your variables, analyze them, etc. Note however
388 that any changes you make to values while in the shell do NOT
399 that any changes you make to values while in the shell do NOT
389 propagate back to the running code, so it is safe to modify your
400 propagate back to the running code, so it is safe to modify your
390 values because you won't break your code in bizarre ways by doing so.
401 values because you won't break your code in bizarre ways by doing so.
391 .SH AUTHOR
402 .SH AUTHOR
392 IPython was written by Fernando Perez <fperez@colorado.edu>, based on earlier
403 IPython was written by Fernando Perez <fperez@colorado.edu>, based on earlier
393 code by Janko Hauser <jh@comunit.de> and Nathaniel Gray
404 code by Janko Hauser <jh@comunit.de> and Nathaniel Gray
394 <n8gray@caltech.edu>. This manual page was written by Jack Moffitt
405 <n8gray@caltech.edu>. This manual page was written by Jack Moffitt
395 <jack@xiph.org>, for the Debian project (but may be used by others).
406 <jack@xiph.org>, for the Debian project (but may be used by others).
@@ -1,9173 +1,9259 b''
1 #LyX 1.3 created this file. For more info see http://www.lyx.org/
1 #LyX 1.3 created this file. For more info see http://www.lyx.org/
2 \lyxformat 221
2 \lyxformat 221
3 \textclass article
3 \textclass article
4 \begin_preamble
4 \begin_preamble
5 %\usepackage{ae,aecompl}
5 %\usepackage{ae,aecompl}
6 \usepackage{color}
6 \usepackage{color}
7
7
8 % A few colors to replace the defaults for certain link types
8 % A few colors to replace the defaults for certain link types
9 \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
9 \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
10 \definecolor{darkorange}{rgb}{.71,0.21,0.01}
10 \definecolor{darkorange}{rgb}{.71,0.21,0.01}
11 \definecolor{darkred}{rgb}{.52,0.08,0.01}
11 \definecolor{darkred}{rgb}{.52,0.08,0.01}
12 \definecolor{darkgreen}{rgb}{.12,.54,.11}
12 \definecolor{darkgreen}{rgb}{.12,.54,.11}
13
13
14 % Use and configure listings package for nicely formatted code
14 % Use and configure listings package for nicely formatted code
15 \usepackage{listings}
15 \usepackage{listings}
16 \lstset{
16 \lstset{
17 language=Python,
17 language=Python,
18 basicstyle=\small\ttfamily,
18 basicstyle=\small\ttfamily,
19 commentstyle=\ttfamily\color{blue},
19 commentstyle=\ttfamily\color{blue},
20 stringstyle=\ttfamily\color{darkorange},
20 stringstyle=\ttfamily\color{darkorange},
21 showstringspaces=false,
21 showstringspaces=false,
22 breaklines=true,
22 breaklines=true,
23 postbreak = \space\dots
23 postbreak = \space\dots
24 }
24 }
25
25
26 \usepackage[%pdftex, % needed for pdflatex
26 \usepackage[%pdftex, % needed for pdflatex
27 breaklinks=true, % so long urls are correctly broken across lines
27 breaklinks=true, % so long urls are correctly broken across lines
28 colorlinks=true,
28 colorlinks=true,
29 urlcolor=blue,
29 urlcolor=blue,
30 linkcolor=darkred,
30 linkcolor=darkred,
31 citecolor=darkgreen,
31 citecolor=darkgreen,
32 ]{hyperref}
32 ]{hyperref}
33
33
34 \usepackage{html}
34 \usepackage{html}
35
35
36 % This helps prevent overly long lines that stretch beyond the margins
36 % This helps prevent overly long lines that stretch beyond the margins
37 \sloppy
37 \sloppy
38
38
39 % Define a \codelist command which either uses listings for latex, or
39 % Define a \codelist command which either uses listings for latex, or
40 % plain verbatim for html (since latex2html doesn't understand the
40 % plain verbatim for html (since latex2html doesn't understand the
41 % listings package).
41 % listings package).
42 \usepackage{verbatim}
42 \usepackage{verbatim}
43 \newcommand{\codelist}[1] {
43 \newcommand{\codelist}[1] {
44 \latex{\lstinputlisting{#1}}
44 \latex{\lstinputlisting{#1}}
45 \html{\verbatiminput{#1}}
45 \html{\verbatiminput{#1}}
46 }
46 }
47 \end_preamble
47 \end_preamble
48 \language english
48 \language english
49 \inputencoding latin1
49 \inputencoding latin1
50 \fontscheme palatino
50 \fontscheme palatino
51 \graphics default
51 \graphics default
52 \paperfontsize 10
52 \paperfontsize 10
53 \spacing single
53 \spacing single
54 \papersize Default
54 \papersize Default
55 \paperpackage a4
55 \paperpackage a4
56 \use_geometry 1
56 \use_geometry 1
57 \use_amsmath 0
57 \use_amsmath 0
58 \use_natbib 0
58 \use_natbib 0
59 \use_numerical_citations 0
59 \use_numerical_citations 0
60 \paperorientation portrait
60 \paperorientation portrait
61 \leftmargin 1.1in
61 \leftmargin 1.1in
62 \topmargin 1in
62 \topmargin 1in
63 \rightmargin 1.1in
63 \rightmargin 1.1in
64 \bottommargin 1in
64 \bottommargin 1in
65 \secnumdepth 3
65 \secnumdepth 3
66 \tocdepth 3
66 \tocdepth 3
67 \paragraph_separation skip
67 \paragraph_separation skip
68 \defskip medskip
68 \defskip medskip
69 \quotes_language english
69 \quotes_language english
70 \quotes_times 2
70 \quotes_times 2
71 \papercolumns 1
71 \papercolumns 1
72 \papersides 1
72 \papersides 1
73 \paperpagestyle fancy
73 \paperpagestyle fancy
74
74
75 \layout Title
75 \layout Title
76
76
77 IPython
77 IPython
78 \newline
78 \newline
79
79
80 \size larger
80 \size larger
81 An enhanced Interactive Python
81 An enhanced Interactive Python
82 \size large
82 \size large
83
83
84 \newline
84 \newline
85 User Manual, v.
85 User Manual, v.
86 __version__
86 __version__
87 \layout Author
87 \layout Author
88
88
89 Fernando PοΏ½rez
89 Fernando PοΏ½rez
90 \layout Standard
90 \layout Standard
91
91
92
92
93 \begin_inset ERT
93 \begin_inset ERT
94 status Collapsed
94 status Collapsed
95
95
96 \layout Standard
96 \layout Standard
97
97
98 \backslash
98 \backslash
99 latex{
99 latex{
100 \end_inset
100 \end_inset
101
101
102
102
103 \begin_inset LatexCommand \tableofcontents{}
103 \begin_inset LatexCommand \tableofcontents{}
104
104
105 \end_inset
105 \end_inset
106
106
107
107
108 \begin_inset ERT
108 \begin_inset ERT
109 status Collapsed
109 status Collapsed
110
110
111 \layout Standard
111 \layout Standard
112 }
112 }
113 \end_inset
113 \end_inset
114
114
115
115
116 \layout Standard
116 \layout Standard
117
117
118
118
119 \begin_inset ERT
119 \begin_inset ERT
120 status Open
120 status Open
121
121
122 \layout Standard
122 \layout Standard
123
123
124 \backslash
124 \backslash
125 html{
125 html{
126 \backslash
126 \backslash
127 bodytext{bgcolor=#ffffff}}
127 bodytext{bgcolor=#ffffff}}
128 \end_inset
128 \end_inset
129
129
130
130
131 \layout Section
131 \layout Section
132 \pagebreak_top
132 \pagebreak_top
133 Overview
133 Overview
134 \layout Standard
134 \layout Standard
135
135
136 One of Python's most useful features is its interactive interpreter.
136 One of Python's most useful features is its interactive interpreter.
137 This system allows very fast testing of ideas without the overhead of creating
137 This system allows very fast testing of ideas without the overhead of creating
138 test files as is typical in most programming languages.
138 test files as is typical in most programming languages.
139 However, the interpreter supplied with the standard Python distribution
139 However, the interpreter supplied with the standard Python distribution
140 is somewhat limited for extended interactive use.
140 is somewhat limited for extended interactive use.
141 \layout Standard
141 \layout Standard
142
142
143 IPython is a free software project (released under the BSD license) which
143 IPython is a free software project (released under the BSD license) which
144 tries to:
144 tries to:
145 \layout Enumerate
145 \layout Enumerate
146
146
147 Provide an interactive shell superior to Python's default.
147 Provide an interactive shell superior to Python's default.
148 IPython has many features for object introspection, system shell access,
148 IPython has many features for object introspection, system shell access,
149 and its own special command system for adding functionality when working
149 and its own special command system for adding functionality when working
150 interactively.
150 interactively.
151 It tries to be a very efficient environment both for Python code development
151 It tries to be a very efficient environment both for Python code development
152 and for exploration of problems using Python objects (in situations like
152 and for exploration of problems using Python objects (in situations like
153 data analysis).
153 data analysis).
154 \layout Enumerate
154 \layout Enumerate
155
155
156 Serve as an embeddable, ready to use interpreter for your own programs.
156 Serve as an embeddable, ready to use interpreter for your own programs.
157 IPython can be started with a single call from inside another program,
157 IPython can be started with a single call from inside another program,
158 providing access to the current namespace.
158 providing access to the current namespace.
159 This can be very useful both for debugging purposes and for situations
159 This can be very useful both for debugging purposes and for situations
160 where a blend of batch-processing and interactive exploration are needed.
160 where a blend of batch-processing and interactive exploration are needed.
161 \layout Enumerate
161 \layout Enumerate
162
162
163 Offer a flexible framework which can be used as the base environment for
163 Offer a flexible framework which can be used as the base environment for
164 other systems with Python as the underlying language.
164 other systems with Python as the underlying language.
165 Specifically scientific environments like Mathematica, IDL and Matlab inspired
165 Specifically scientific environments like Mathematica, IDL and Matlab inspired
166 its design, but similar ideas can be useful in many fields.
166 its design, but similar ideas can be useful in many fields.
167 \layout Enumerate
168
169 Allow interactive testing of threaded graphical toolkits.
170 IPython has support for interactive, non-blocking control of GTK, Qt and
171 WX applications via special threading flags.
172 The normal Python shell can only do this for Tkinter applications.
167 \layout Subsection
173 \layout Subsection
168
174
169 Main features
175 Main features
170 \layout Itemize
176 \layout Itemize
171
177
172 Dynamic object introspection.
178 Dynamic object introspection.
173 One can access docstrings, function definition prototypes, source code,
179 One can access docstrings, function definition prototypes, source code,
174 source files and other details of any object accessible to the interpreter
180 source files and other details of any object accessible to the interpreter
175 with a single keystroke (`
181 with a single keystroke (`
176 \family typewriter
182 \family typewriter
177 ?
183 ?
178 \family default
184 \family default
179 ').
185 ', and using `
186 \family typewriter
187 ??
188 \family default
189 ' provides additional detail).
190 \layout Itemize
191
192 Searching through modules and namespaces with `
193 \family typewriter
194 *
195 \family default
196 ' wildcards, both when using the `
197 \family typewriter
198 ?
199 \family default
200 ' system and via the
201 \family typewriter
202 %psearch
203 \family default
204 command.
180 \layout Itemize
205 \layout Itemize
181
206
182 Completion in the local namespace, by typing TAB at the prompt.
207 Completion in the local namespace, by typing TAB at the prompt.
183 This works for keywords, methods, variables and files in the current directory.
208 This works for keywords, methods, variables and files in the current directory.
184 This is supported via the readline library, and full access to configuring
209 This is supported via the readline library, and full access to configuring
185 readline's behavior is provided.
210 readline's behavior is provided.
186 \layout Itemize
211 \layout Itemize
187
212
188 Numbered input/output prompts with command history (persistent across sessions
213 Numbered input/output prompts with command history (persistent across sessions
189 and tied to each profile), full searching in this history and caching of
214 and tied to each profile), full searching in this history and caching of
190 all input and output.
215 all input and output.
191 \layout Itemize
216 \layout Itemize
192
217
193 User-extensible `magic' commands.
218 User-extensible `magic' commands.
194 A set of commands prefixed with
219 A set of commands prefixed with
195 \family typewriter
220 \family typewriter
196 %
221 %
197 \family default
222 \family default
198 is available for controlling IPython itself and provides directory control,
223 is available for controlling IPython itself and provides directory control,
199 namespace information and many aliases to common system shell commands.
224 namespace information and many aliases to common system shell commands.
200 \layout Itemize
225 \layout Itemize
201
226
202 Alias facility for defining your own system aliases.
227 Alias facility for defining your own system aliases.
203 \layout Itemize
228 \layout Itemize
204
229
205 Complete system shell access.
230 Complete system shell access.
206 Lines starting with ! are passed directly to the system shell, and using
231 Lines starting with ! are passed directly to the system shell, and using
207 !! captures shell output into python variables for further use.
232 !! captures shell output into python variables for further use.
208 \layout Itemize
233 \layout Itemize
209
234
210 All calls to the system (via aliases or via !) have their standard output/error
211 automatically stored as strings, and also available as lists.
212 \layout Itemize
213
214 Background execution of Python commands in a separate thread.
235 Background execution of Python commands in a separate thread.
215 IPython has an internal job manager called
236 IPython has an internal job manager called
216 \family typewriter
237 \family typewriter
217 jobs
238 jobs
218 \family default
239 \family default
219 , and a conveninence backgrounding magic function called
240 , and a conveninence backgrounding magic function called
220 \family typewriter
241 \family typewriter
221 %bg
242 %bg
222 \family default
243 \family default
223 .
244 .
224 \layout Itemize
245 \layout Itemize
225
246
226 The ability to expand python variables when calling the system shell.
247 The ability to expand python variables when calling the system shell.
227 In a shell command, any python variable prefixed with
248 In a shell command, any python variable prefixed with
228 \family typewriter
249 \family typewriter
229 $
250 $
230 \family default
251 \family default
231 is expanded.
252 is expanded.
232 A double
253 A double
233 \family typewriter
254 \family typewriter
234 $$
255 $$
235 \family default
256 \family default
236 allows passing a literal
257 allows passing a literal
237 \family typewriter
258 \family typewriter
238 $
259 $
239 \family default
260 \family default
240 to the shell (for access to shell and environment variables like
261 to the shell (for access to shell and environment variables like
241 \family typewriter
262 \family typewriter
242 $PATH
263 $PATH
243 \family default
264 \family default
244 ).
265 ).
245 \layout Itemize
266 \layout Itemize
246
267
247 Filesystem navigation, via a magic
268 Filesystem navigation, via a magic
248 \family typewriter
269 \family typewriter
249 %cd
270 %cd
250 \family default
271 \family default
251 command, along with a persistent bookmark system (using
272 command, along with a persistent bookmark system (using
252 \family typewriter
273 \family typewriter
253 %bookmark
274 %bookmark
254 \family default
275 \family default
255 ) for fast access to frequently visited directories.
276 ) for fast access to frequently visited directories.
256 \layout Itemize
277 \layout Itemize
257
278
279 A lightweight persistence framework via the
280 \family typewriter
281 %store
282 \family default
283 command, which allows you to save arbitrary Python variables.
284 These get restored automatically when your session restarts.
285 \layout Itemize
286
258 Automatic indentation (optional) of code as you type (through the readline
287 Automatic indentation (optional) of code as you type (through the readline
259 library).
288 library).
260 \layout Itemize
289 \layout Itemize
261
290
262 Macro system for quickly re-executing multiple lines of previous input with
291 Macro system for quickly re-executing multiple lines of previous input with
263 a single name.
292 a single name.
293 Macros can be stored persistently via
294 \family typewriter
295 %store
296 \family default
297 and edited via
298 \family typewriter
299 %edit
300 \family default
301 .
302
264 \layout Itemize
303 \layout Itemize
265
304
266 Session logging (you can then later use these logs as code in your programs).
305 Session logging (you can then later use these logs as code in your programs).
306 Logs can optionally timestamp all input, and also store session output
307 (marked as comments, so the log remains valid Python source code).
267 \layout Itemize
308 \layout Itemize
268
309
269 Session restoring: logs can be replayed to restore a previous session to
310 Session restoring: logs can be replayed to restore a previous session to
270 the state where you left it.
311 the state where you left it.
271 \layout Itemize
312 \layout Itemize
272
313
273 Verbose and colored exception traceback printouts.
314 Verbose and colored exception traceback printouts.
274 Easier to parse visually, and in verbose mode they produce a lot of useful
315 Easier to parse visually, and in verbose mode they produce a lot of useful
275 debugging information (basically a terminal version of the cgitb module).
316 debugging information (basically a terminal version of the cgitb module).
276 \layout Itemize
317 \layout Itemize
277
318
278 Auto-parentheses: callable objects can be executed without parentheses:
319 Auto-parentheses: callable objects can be executed without parentheses:
279
320
280 \family typewriter
321 \family typewriter
281 `sin 3'
322 `sin 3'
282 \family default
323 \family default
283 is automatically converted to
324 is automatically converted to
284 \family typewriter
325 \family typewriter
285 `sin(3)
326 `sin(3)
286 \family default
327 \family default
287 '.
328 '.
288 \layout Itemize
329 \layout Itemize
289
330
290 Auto-quoting: using `
331 Auto-quoting: using `
291 \family typewriter
332 \family typewriter
292 ,
333 ,
293 \family default
334 \family default
294 ' or `
335 ' or `
295 \family typewriter
336 \family typewriter
296 ;
337 ;
297 \family default
338 \family default
298 ' as the first character forces auto-quoting of the rest of the line:
339 ' as the first character forces auto-quoting of the rest of the line:
299 \family typewriter
340 \family typewriter
300 `,my_function a\SpecialChar ~
341 `,my_function a\SpecialChar ~
301 b'
342 b'
302 \family default
343 \family default
303 becomes automatically
344 becomes automatically
304 \family typewriter
345 \family typewriter
305 `my_function("a","b")'
346 `my_function("a","b")'
306 \family default
347 \family default
307 , while
348 , while
308 \family typewriter
349 \family typewriter
309 `;my_function a\SpecialChar ~
350 `;my_function a\SpecialChar ~
310 b'
351 b'
311 \family default
352 \family default
312 becomes
353 becomes
313 \family typewriter
354 \family typewriter
314 `my_function("a b")'
355 `my_function("a b")'
315 \family default
356 \family default
316 .
357 .
317 \layout Itemize
358 \layout Itemize
318
359
319 Extensible input syntax.
360 Extensible input syntax.
320 You can define filters that pre-process user input to simplify input in
361 You can define filters that pre-process user input to simplify input in
321 special situations.
362 special situations.
322 This allows for example pasting multi-line code fragments which start with
363 This allows for example pasting multi-line code fragments which start with
323
364
324 \family typewriter
365 \family typewriter
325 `>>>'
366 `>>>'
326 \family default
367 \family default
327 or
368 or
328 \family typewriter
369 \family typewriter
329 `...'
370 `...'
330 \family default
371 \family default
331 such as those from other python sessions or the standard Python documentation.
372 such as those from other python sessions or the standard Python documentation.
332 \layout Itemize
373 \layout Itemize
333
374
334 Flexible configuration system.
375 Flexible configuration system.
335 It uses a configuration file which allows permanent setting of all command-line
376 It uses a configuration file which allows permanent setting of all command-line
336 options, module loading, code and file execution.
377 options, module loading, code and file execution.
337 The system allows recursive file inclusion, so you can have a base file
378 The system allows recursive file inclusion, so you can have a base file
338 with defaults and layers which load other customizations for particular
379 with defaults and layers which load other customizations for particular
339 projects.
380 projects.
340 \layout Itemize
381 \layout Itemize
341
382
342 Embeddable.
383 Embeddable.
343 You can call IPython as a python shell inside your own python programs.
384 You can call IPython as a python shell inside your own python programs.
344 This can be used both for debugging code or for providing interactive abilities
385 This can be used both for debugging code or for providing interactive abilities
345 to your programs with knowledge about the local namespaces (very useful
386 to your programs with knowledge about the local namespaces (very useful
346 in debugging and data analysis situations).
387 in debugging and data analysis situations).
347 \layout Itemize
388 \layout Itemize
348
389
349 Easy debugger access.
390 Easy debugger access.
350 You can set IPython to call up an enhanced version of the Python debugger
391 You can set IPython to call up an enhanced version of the Python debugger
351 (
392 (
352 \family typewriter
393 \family typewriter
353 pdb
394 pdb
354 \family default
395 \family default
355 ) every time there is an uncaught exception.
396 ) every time there is an uncaught exception.
356 This drops you inside the code which triggered the exception with all the
397 This drops you inside the code which triggered the exception with all the
357 data live and it is possible to navigate the stack to rapidly isolate the
398 data live and it is possible to navigate the stack to rapidly isolate the
358 source of a bug.
399 source of a bug.
359 The
400 The
360 \family typewriter
401 \family typewriter
361 %run
402 %run
362 \family default
403 \family default
363 magic command --with the
404 magic command --with the
364 \family typewriter
405 \family typewriter
365 -d
406 -d
366 \family default
407 \family default
367 option-- can run any script under
408 option-- can run any script under
368 \family typewriter
409 \family typewriter
369 pdb
410 pdb
370 \family default
411 \family default
371 's control, automatically setting initial breakpoints for you.
412 's control, automatically setting initial breakpoints for you.
372 This version of
413 This version of
373 \family typewriter
414 \family typewriter
374 pdb
415 pdb
375 \family default
416 \family default
376 has IPython-specific improvements, including tab-completion and traceback
417 has IPython-specific improvements, including tab-completion and traceback
377 coloring support.
418 coloring support.
378 \layout Itemize
419 \layout Itemize
379
420
380 Profiler support.
421 Profiler support.
381 You can run single statements (similar to
422 You can run single statements (similar to
382 \family typewriter
423 \family typewriter
383 profile.run()
424 profile.run()
384 \family default
425 \family default
385 ) or complete programs under the profiler's control.
426 ) or complete programs under the profiler's control.
386 While this is possible with the standard
427 While this is possible with the standard
387 \family typewriter
428 \family typewriter
388 profile
429 profile
389 \family default
430 \family default
390 module, IPython wraps this functionality with magic commands (see
431 module, IPython wraps this functionality with magic commands (see
391 \family typewriter
432 \family typewriter
392 `%prun'
433 `%prun'
393 \family default
434 \family default
394 and
435 and
395 \family typewriter
436 \family typewriter
396 `%run -p
437 `%run -p
397 \family default
438 \family default
398 ') convenient for rapid interactive work.
439 ') convenient for rapid interactive work.
399 \layout Subsection
440 \layout Subsection
400
441
401 Portability and Python requirements
442 Portability and Python requirements
402 \layout Standard
443 \layout Standard
403
444
404
445
405 \series bold
446 \series bold
406 Python requirements:
447 Python requirements:
407 \series default
448 \series default
408 IPython works with Python version 2.2 or newer.
449 IPython requires with Python version 2.3 or newer.
409 It has been tested with Python 2.4 and no problems have been reported.
450 If you are still using Python 2.2 and can not upgrade, the last version
410 Support for Python 2.1 hasn't been recently tested, since I don't have access
451 of IPython which worked with Python 2.2 was 0.6.15, so you will have to use
411 to it on any of my systems.
452 that.
412 But I suspect there may be some problems with Python 2.1, because some of
413 the newer code may use 2.2 features.
414 \layout Standard
453 \layout Standard
415
454
416 IPython is developed under
455 IPython is developed under
417 \series bold
456 \series bold
418 Linux
457 Linux
419 \series default
458 \series default
420 , but it should work in any reasonable Unix-type system (tested OK under
459 , but it should work in any reasonable Unix-type system (tested OK under
421 Solaris and the *BSD family, for which a port exists thanks to Dryice Liu).
460 Solaris and the *BSD family, for which a port exists thanks to Dryice Liu).
422 \layout Standard
461 \layout Standard
423
462
424
463
425 \series bold
464 \series bold
426 Mac OS X
465 Mac OS X
427 \series default
466 \series default
428 : it works, apparently without any problems (thanks to Jim Boyle at Lawrence
467 : it works, apparently without any problems (thanks to Jim Boyle at Lawrence
429 Livermore for the information).
468 Livermore for the information).
430 Thanks to Andrea Riciputi, Fink support is available.
469 Thanks to Andrea Riciputi, Fink support is available.
431 \layout Standard
470 \layout Standard
432
471
433
472
434 \series bold
473 \series bold
435 CygWin
474 CygWin
436 \series default
475 \series default
437 : it works mostly OK, though some users have reported problems with prompt
476 : it works mostly OK, though some users have reported problems with prompt
438 coloring.
477 coloring.
439 No satisfactory solution to this has been found so far, you may want to
478 No satisfactory solution to this has been found so far, you may want to
440 disable colors permanently in the
479 disable colors permanently in the
441 \family typewriter
480 \family typewriter
442 ipythonrc
481 ipythonrc
443 \family default
482 \family default
444 configuration file if you experience problems.
483 configuration file if you experience problems.
445 If you have proper color support under cygwin, please post to the IPython
484 If you have proper color support under cygwin, please post to the IPython
446 mailing list so this issue can be resolved for all users.
485 mailing list so this issue can be resolved for all users.
447 \layout Standard
486 \layout Standard
448
487
449
488
450 \series bold
489 \series bold
451 Windows
490 Windows
452 \series default
491 \series default
453 : it works well under Windows XP/2k, and I suspect NT should behave similarly.
492 : it works well under Windows XP/2k, and I suspect NT should behave similarly.
454 Section\SpecialChar ~
493 Section\SpecialChar ~
455
494
456 \begin_inset LatexCommand \ref{sub:Under-Windows}
495 \begin_inset LatexCommand \ref{sub:Under-Windows}
457
496
458 \end_inset
497 \end_inset
459
498
460 describes installation details for Windows, including some additional tools
499 describes installation details for Windows, including some additional tools
461 needed on this platform.
500 needed on this platform.
462 \layout Standard
501 \layout Standard
463
502
464 Windows 9x support is present, and has been reported to work fine (at least
503 Windows 9x support is present, and has been reported to work fine (at least
465 on WinME).
504 on WinME).
466 \layout Standard
505 \layout Standard
467
506
468 Please note, however, that I have very little access to and experience with
507 Note, that I have very little access to and experience with Windows development.
469 Windows development.
508 However, an excellent group of Win32 users (led by Ville Vainio), consistenly
470 For this reason, Windows-specific bugs tend to linger far longer than I
509 contribute bugfixes and platform-specific enhancements, so they more than
471 would like, and often I just can't find a satisfactory solution.
510 make up for my deficiencies on that front.
472 If any Windows user wants to join in with development help, all hands are
511 In fact, Win32 users report using IPython as a system shell (see Sec.\SpecialChar ~
473 always welcome.
512
513 \begin_inset LatexCommand \ref{sec:IPython-as-shell}
514
515 \end_inset
516
517 for details), as it offers a level of control and features which the default
518
519 \family typewriter
520 cmd.exe
521 \family default
522 doesn't provide.
474 \layout Subsection
523 \layout Subsection
475
524
476 Location
525 Location
477 \layout Standard
526 \layout Standard
478
527
479 IPython is generously hosted at
528 IPython is generously hosted at
480 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
529 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
481
530
482 \end_inset
531 \end_inset
483
532
484 by the SciPy project.
533 by the Enthought, Inc and the SciPy project.
485 This site offers downloads, subversion access, mailing lists and a bug
534 This site offers downloads, subversion access, mailing lists and a bug
486 tracking system.
535 tracking system.
487 I am very grateful to Enthought (
536 I am very grateful to Enthought (
488 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
537 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
489
538
490 \end_inset
539 \end_inset
491
540
492 ) and all of the SciPy team for their contribution.
541 ) and all of the SciPy team for their contribution.
493 \layout Section
542 \layout Section
494
543
495
544
496 \begin_inset LatexCommand \label{sec:install}
545 \begin_inset LatexCommand \label{sec:install}
497
546
498 \end_inset
547 \end_inset
499
548
500 Installation
549 Installation
501 \layout Subsection
550 \layout Subsection
502
551
503 Instant instructions
552 Instant instructions
504 \layout Standard
553 \layout Standard
505
554
506 If you are of the impatient kind, under Linux/Unix simply untar/unzip the
555 If you are of the impatient kind, under Linux/Unix simply untar/unzip the
507 download, then install with
556 download, then install with
508 \family typewriter
557 \family typewriter
509 `python setup.py install'
558 `python setup.py install'
510 \family default
559 \family default
511 .
560 .
512 Under Windows, double-click on the provided
561 Under Windows, double-click on the provided
513 \family typewriter
562 \family typewriter
514 .exe
563 .exe
515 \family default
564 \family default
516 binary installer.
565 binary installer.
517 \layout Standard
566 \layout Standard
518
567
519 Then, take a look at Sections
568 Then, take a look at Sections
520 \begin_inset LatexCommand \ref{sec:good_config}
569 \begin_inset LatexCommand \ref{sec:good_config}
521
570
522 \end_inset
571 \end_inset
523
572
524 for configuring things optimally and
573 for configuring things optimally and
525 \begin_inset LatexCommand \ref{sec:quick_tips}
574 \begin_inset LatexCommand \ref{sec:quick_tips}
526
575
527 \end_inset
576 \end_inset
528
577
529 for quick tips on efficient use of IPython.
578 for quick tips on efficient use of IPython.
530 You can later refer to the rest of the manual for all the gory details.
579 You can later refer to the rest of the manual for all the gory details.
531 \layout Standard
580 \layout Standard
532
581
533 See the notes in sec.
582 See the notes in sec.
534
583
535 \begin_inset LatexCommand \ref{sec:upgrade}
584 \begin_inset LatexCommand \ref{sec:upgrade}
536
585
537 \end_inset
586 \end_inset
538
587
539 for upgrading IPython versions.
588 for upgrading IPython versions.
540 \layout Subsection
589 \layout Subsection
541
590
542 Detailed Unix instructions (Linux, Mac OS X, etc.)
591 Detailed Unix instructions (Linux, Mac OS X, etc.)
543 \layout Standard
592 \layout Standard
544
593
545 For RPM based systems, simply install the supplied package in the usual
594 For RPM based systems, simply install the supplied package in the usual
546 manner.
595 manner.
547 If you download the tar archive, the process is:
596 If you download the tar archive, the process is:
548 \layout Enumerate
597 \layout Enumerate
549
598
550 Unzip/untar the
599 Unzip/untar the
551 \family typewriter
600 \family typewriter
552 ipython-XXX.tar.gz
601 ipython-XXX.tar.gz
553 \family default
602 \family default
554 file wherever you want (
603 file wherever you want (
555 \family typewriter
604 \family typewriter
556 XXX
605 XXX
557 \family default
606 \family default
558 is the version number).
607 is the version number).
559 It will make a directory called
608 It will make a directory called
560 \family typewriter
609 \family typewriter
561 ipython-XXX.
610 ipython-XXX.
562
611
563 \family default
612 \family default
564 Change into that directory where you will find the files
613 Change into that directory where you will find the files
565 \family typewriter
614 \family typewriter
566 README
615 README
567 \family default
616 \family default
568 and
617 and
569 \family typewriter
618 \family typewriter
570 setup.py
619 setup.py
571 \family default
620 \family default
572 .
621 .
573
622
574 \family typewriter
623 \family typewriter
575 O
624 O
576 \family default
625 \family default
577 nce you've completed the installation, you can safely remove this directory.
626 nce you've completed the installation, you can safely remove this directory.
578
627
579 \layout Enumerate
628 \layout Enumerate
580
629
581 If you are installing over a previous installation of version 0.2.0 or earlier,
630 If you are installing over a previous installation of version 0.2.0 or earlier,
582 first remove your
631 first remove your
583 \family typewriter
632 \family typewriter
584 $HOME/.ipython
633 $HOME/.ipython
585 \family default
634 \family default
586 directory, since the configuration file format has changed somewhat (the
635 directory, since the configuration file format has changed somewhat (the
587 '=' were removed from all option specifications).
636 '=' were removed from all option specifications).
588 Or you can call ipython with the
637 Or you can call ipython with the
589 \family typewriter
638 \family typewriter
590 -upgrade
639 -upgrade
591 \family default
640 \family default
592 option and it will do this automatically for you.
641 option and it will do this automatically for you.
593 \layout Enumerate
642 \layout Enumerate
594
643
595 IPython uses distutils, so you can install it by simply typing at the system
644 IPython uses distutils, so you can install it by simply typing at the system
596 prompt (don't type the
645 prompt (don't type the
597 \family typewriter
646 \family typewriter
598 $
647 $
599 \family default
648 \family default
600 )
649 )
601 \newline
650 \newline
602
651
603 \family typewriter
652 \family typewriter
604 $ python setup.py install
653 $ python setup.py install
605 \family default
654 \family default
606
655
607 \newline
656 \newline
608 Note that this assumes you have root access to your machine.
657 Note that this assumes you have root access to your machine.
609 If you don't have root access or don't want IPython to go in the default
658 If you don't have root access or don't want IPython to go in the default
610 python directories, you'll need to use the
659 python directories, you'll need to use the
611 \begin_inset ERT
660 \begin_inset ERT
612 status Collapsed
661 status Collapsed
613
662
614 \layout Standard
663 \layout Standard
615
664
616 \backslash
665 \backslash
617 verb|--home|
666 verb|--home|
618 \end_inset
667 \end_inset
619
668
620 option (or
669 option (or
621 \begin_inset ERT
670 \begin_inset ERT
622 status Collapsed
671 status Collapsed
623
672
624 \layout Standard
673 \layout Standard
625
674
626 \backslash
675 \backslash
627 verb|--prefix|
676 verb|--prefix|
628 \end_inset
677 \end_inset
629
678
630 ).
679 ).
631 For example:
680 For example:
632 \newline
681 \newline
633
682
634 \begin_inset ERT
683 \begin_inset ERT
635 status Collapsed
684 status Collapsed
636
685
637 \layout Standard
686 \layout Standard
638
687
639 \backslash
688 \backslash
640 verb|$ python setup.py install --home $HOME/local|
689 verb|$ python setup.py install --home $HOME/local|
641 \end_inset
690 \end_inset
642
691
643
692
644 \newline
693 \newline
645 will install IPython into
694 will install IPython into
646 \family typewriter
695 \family typewriter
647 $HOME/local
696 $HOME/local
648 \family default
697 \family default
649 and its subdirectories (creating them if necessary).
698 and its subdirectories (creating them if necessary).
650 \newline
699 \newline
651 You can type
700 You can type
652 \newline
701 \newline
653
702
654 \begin_inset ERT
703 \begin_inset ERT
655 status Collapsed
704 status Collapsed
656
705
657 \layout Standard
706 \layout Standard
658
707
659 \backslash
708 \backslash
660 verb|$ python setup.py --help|
709 verb|$ python setup.py --help|
661 \end_inset
710 \end_inset
662
711
663
712
664 \newline
713 \newline
665 for more details.
714 for more details.
666 \newline
715 \newline
667 Note that if you change the default location for
716 Note that if you change the default location for
668 \begin_inset ERT
717 \begin_inset ERT
669 status Collapsed
718 status Collapsed
670
719
671 \layout Standard
720 \layout Standard
672
721
673 \backslash
722 \backslash
674 verb|--home|
723 verb|--home|
675 \end_inset
724 \end_inset
676
725
677 at installation, IPython may end up installed at a location which is not
726 at installation, IPython may end up installed at a location which is not
678 part of your
727 part of your
679 \family typewriter
728 \family typewriter
680 $PYTHONPATH
729 $PYTHONPATH
681 \family default
730 \family default
682 environment variable.
731 environment variable.
683 In this case, you'll need to configure this variable to include the actual
732 In this case, you'll need to configure this variable to include the actual
684 directory where the
733 directory where the
685 \family typewriter
734 \family typewriter
686 IPython/
735 IPython/
687 \family default
736 \family default
688 directory ended (typically the value you give to
737 directory ended (typically the value you give to
689 \begin_inset ERT
738 \begin_inset ERT
690 status Collapsed
739 status Collapsed
691
740
692 \layout Standard
741 \layout Standard
693
742
694 \backslash
743 \backslash
695 verb|--home|
744 verb|--home|
696 \end_inset
745 \end_inset
697
746
698 plus
747 plus
699 \family typewriter
748 \family typewriter
700 /lib/python
749 /lib/python
701 \family default
750 \family default
702 ).
751 ).
703 \layout Subsubsection
752 \layout Subsubsection
704
753
705 Mac OSX information
754 Mac OSX information
706 \layout Standard
755 \layout Standard
707
756
708 Under OSX, there is a choice you need to make.
757 Under OSX, there is a choice you need to make.
709 Apple ships its own build of Python, which lives in the core OSX filesystem
758 Apple ships its own build of Python, which lives in the core OSX filesystem
710 hierarchy.
759 hierarchy.
711 You can also manually install a separate Python, either purely by hand
760 You can also manually install a separate Python, either purely by hand
712 (typically in
761 (typically in
713 \family typewriter
762 \family typewriter
714 /usr/local
763 /usr/local
715 \family default
764 \family default
716 ) or by using Fink, which puts everything under
765 ) or by using Fink, which puts everything under
717 \family typewriter
766 \family typewriter
718 /sw
767 /sw
719 \family default
768 \family default
720 .
769 .
721 Which route to follow is a matter of personal preference, as I've seen
770 Which route to follow is a matter of personal preference, as I've seen
722 users who favor each of the approaches.
771 users who favor each of the approaches.
723 Here I will simply list the known installation issues under OSX, along
772 Here I will simply list the known installation issues under OSX, along
724 with their solutions.
773 with their solutions.
725 \layout Standard
774 \layout Standard
726
775
727 This page:
776 This page:
728 \begin_inset LatexCommand \htmlurl{http://geosci.uchicago.edu/~tobis/pylab.html}
777 \begin_inset LatexCommand \htmlurl{http://geosci.uchicago.edu/~tobis/pylab.html}
729
778
730 \end_inset
779 \end_inset
731
780
732 contains information on this topic, with additional details on how to make
781 contains information on this topic, with additional details on how to make
733 IPython and matplotlib play nicely under OSX.
782 IPython and matplotlib play nicely under OSX.
734 \layout Subsubsection*
783 \layout Subsubsection*
735
784
736 GUI problems
785 GUI problems
737 \layout Standard
786 \layout Standard
738
787
739 The following instructions apply to an install of IPython under OSX from
788 The following instructions apply to an install of IPython under OSX from
740 unpacking the
789 unpacking the
741 \family typewriter
790 \family typewriter
742 .tar.gz
791 .tar.gz
743 \family default
792 \family default
744 distribution and installing it for the default Python interpreter shipped
793 distribution and installing it for the default Python interpreter shipped
745 by Apple.
794 by Apple.
746 If you are using a fink install, fink will take care of these details for
795 If you are using a fink install, fink will take care of these details for
747 you, by installing IPython against fink's Python.
796 you, by installing IPython against fink's Python.
748 \layout Standard
797 \layout Standard
749
798
750 IPython offers various forms of support for interacting with graphical applicati
799 IPython offers various forms of support for interacting with graphical applicati
751 ons from the command line, from simple Tk apps (which are in principle always
800 ons from the command line, from simple Tk apps (which are in principle always
752 supported by Python) to interactive control of WX, Qt and GTK apps.
801 supported by Python) to interactive control of WX, Qt and GTK apps.
753 Under OSX, however, this requires that ipython is installed by calling
802 Under OSX, however, this requires that ipython is installed by calling
754 the special
803 the special
755 \family typewriter
804 \family typewriter
756 pythonw
805 pythonw
757 \family default
806 \family default
758 script at installation time, which takes care of coordinating things with
807 script at installation time, which takes care of coordinating things with
759 Apple's graphical environment.
808 Apple's graphical environment.
760 \layout Standard
809 \layout Standard
761
810
762 So when installing under OSX, it is best to use the following command:
811 So when installing under OSX, it is best to use the following command:
763 \family typewriter
812 \family typewriter
764
813
765 \newline
814 \newline
766
815
767 \family default
816 \family default
768
817
769 \begin_inset ERT
818 \begin_inset ERT
770 status Collapsed
819 status Collapsed
771
820
772 \layout Standard
821 \layout Standard
773
822
774 \backslash
823 \backslash
775 verb| $ sudo pythonw setup.py install --install-scripts=/usr/local/bin|
824 verb| $ sudo pythonw setup.py install --install-scripts=/usr/local/bin|
776 \end_inset
825 \end_inset
777
826
778
827
779 \newline
828 \newline
780 or
829 or
781 \newline
830 \newline
782
831
783 \begin_inset ERT
832 \begin_inset ERT
784 status Open
833 status Open
785
834
786 \layout Standard
835 \layout Standard
787
836
788 \backslash
837 \backslash
789 verb| $ sudo pythonw setup.py install --install-scripts=/usr/bin|
838 verb| $ sudo pythonw setup.py install --install-scripts=/usr/bin|
790 \end_inset
839 \end_inset
791
840
792
841
793 \newline
842 \newline
794 depending on where you like to keep hand-installed executables.
843 depending on where you like to keep hand-installed executables.
795 \layout Standard
844 \layout Standard
796
845
797 The resulting script will have an appropriate shebang line (the first line
846 The resulting script will have an appropriate shebang line (the first line
798 in the script whic begins with
847 in the script whic begins with
799 \family typewriter
848 \family typewriter
800 #!...
849 #!...
801 \family default
850 \family default
802 ) such that the ipython interpreter can interact with the OS X GUI.
851 ) such that the ipython interpreter can interact with the OS X GUI.
803 If the installed version does not work and has a shebang line that points
852 If the installed version does not work and has a shebang line that points
804 to, for example, just
853 to, for example, just
805 \family typewriter
854 \family typewriter
806 /usr/bin/python
855 /usr/bin/python
807 \family default
856 \family default
808 , then you might have a stale, cached version in your
857 , then you might have a stale, cached version in your
809 \family typewriter
858 \family typewriter
810 build/scripts-<python-version>
859 build/scripts-<python-version>
811 \family default
860 \family default
812 directory.
861 directory.
813 Delete that directory and rerun the
862 Delete that directory and rerun the
814 \family typewriter
863 \family typewriter
815 setup.py
864 setup.py
816 \family default
865 \family default
817 .
866 .
818
867
819 \layout Standard
868 \layout Standard
820
869
821 It is also a good idea to use the special flag
870 It is also a good idea to use the special flag
822 \begin_inset ERT
871 \begin_inset ERT
823 status Collapsed
872 status Collapsed
824
873
825 \layout Standard
874 \layout Standard
826
875
827 \backslash
876 \backslash
828 verb|--install-scripts|
877 verb|--install-scripts|
829 \end_inset
878 \end_inset
830
879
831 as indicated above, to ensure that the ipython scripts end up in a location
880 as indicated above, to ensure that the ipython scripts end up in a location
832 which is part of your
881 which is part of your
833 \family typewriter
882 \family typewriter
834 $PATH
883 $PATH
835 \family default
884 \family default
836 .
885 .
837 Otherwise Apple's Python will put the scripts in an internal directory
886 Otherwise Apple's Python will put the scripts in an internal directory
838 not available by default at the command line (if you use
887 not available by default at the command line (if you use
839 \family typewriter
888 \family typewriter
840 /usr/local/bin
889 /usr/local/bin
841 \family default
890 \family default
842 , you need to make sure this is in your
891 , you need to make sure this is in your
843 \family typewriter
892 \family typewriter
844 $PATH
893 $PATH
845 \family default
894 \family default
846 , which may not be true by default).
895 , which may not be true by default).
847 \layout Subsubsection*
896 \layout Subsubsection*
848
897
849 Readline problems
898 Readline problems
850 \layout Standard
899 \layout Standard
851
900
852 By default, the Python version shipped by Apple does
901 By default, the Python version shipped by Apple does
853 \emph on
902 \emph on
854 not
903 not
855 \emph default
904 \emph default
856 include the readline library, so central to IPython's behavior.
905 include the readline library, so central to IPython's behavior.
857 If you install IPython against Apple's Python, you will not have arrow
906 If you install IPython against Apple's Python, you will not have arrow
858 keys, tab completion, etc.
907 keys, tab completion, etc.
859 For Mac OSX 10.3 (Panther), you can find a prebuilt readline library here:
908 For Mac OSX 10.3 (Panther), you can find a prebuilt readline library here:
860 \newline
909 \newline
861
910
862 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip}
911 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip}
863
912
864 \end_inset
913 \end_inset
865
914
866
915
867 \layout Standard
916 \layout Standard
868
917
869 If you are using OSX 10.4 (Tiger), after installing this package you need
918 If you are using OSX 10.4 (Tiger), after installing this package you need
870 to either:
919 to either:
871 \layout Enumerate
920 \layout Enumerate
872
921
873 move
922 move
874 \family typewriter
923 \family typewriter
875 readline.so
924 readline.so
876 \family default
925 \family default
877 from
926 from
878 \family typewriter
927 \family typewriter
879 /Library/Python/2.3
928 /Library/Python/2.3
880 \family default
929 \family default
881 to
930 to
882 \family typewriter
931 \family typewriter
883 /Library/Python/2.3/site-packages
932 /Library/Python/2.3/site-packages
884 \family default
933 \family default
885 , or
934 , or
886 \layout Enumerate
935 \layout Enumerate
887
936
888 install
937 install
889 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/TigerPython23Compat.pkg.zip}
938 \begin_inset LatexCommand \htmlurl{http://pythonmac.org/packages/TigerPython23Compat.pkg.zip}
890
939
891 \end_inset
940 \end_inset
892
941
893
942
894 \layout Standard
943 \layout Standard
895
944
896 Users installing against Fink's Python or a properly hand-built one should
945 Users installing against Fink's Python or a properly hand-built one should
897 not have this problem.
946 not have this problem.
898 \layout Subsubsection*
947 \layout Subsubsection*
899
948
900 DarwinPorts
949 DarwinPorts
901 \layout Standard
950 \layout Standard
902
951
903 I report here a message from an OSX user, who suggests an alternative means
952 I report here a message from an OSX user, who suggests an alternative means
904 of using IPython under this operating system with good results.
953 of using IPython under this operating system with good results.
905 Please let me know of any updates that may be useful for this section.
954 Please let me know of any updates that may be useful for this section.
906 His message is reproduced verbatim below:
955 His message is reproduced verbatim below:
907 \layout Quote
956 \layout Quote
908
957
909 From: Markus Banfi
958 From: Markus Banfi
910 \family typewriter
959 \family typewriter
911 <markus.banfi-AT-mospheira.net>
960 <markus.banfi-AT-mospheira.net>
912 \layout Quote
961 \layout Quote
913
962
914 As a MacOS X (10.4.2) user I prefer to install software using DawinPorts instead
963 As a MacOS X (10.4.2) user I prefer to install software using DawinPorts instead
915 of Fink.
964 of Fink.
916 I had no problems installing ipython with DarwinPorts.
965 I had no problems installing ipython with DarwinPorts.
917 It's just:
966 It's just:
918 \layout Quote
967 \layout Quote
919
968
920
969
921 \family typewriter
970 \family typewriter
922 sudo port install py-ipython
971 sudo port install py-ipython
923 \layout Quote
972 \layout Quote
924
973
925 It automatically resolved all dependencies (python24, readline, py-readline).
974 It automatically resolved all dependencies (python24, readline, py-readline).
926 So far I did not encounter any problems with the DarwinPorts port of ipython.
975 So far I did not encounter any problems with the DarwinPorts port of ipython.
927
976
928 \layout Subsection
977 \layout Subsection
929
978
930
979
931 \begin_inset LatexCommand \label{sub:Under-Windows}
980 \begin_inset LatexCommand \label{sub:Under-Windows}
932
981
933 \end_inset
982 \end_inset
934
983
935 Windows instructions
984 Windows instructions
936 \layout Standard
985 \layout Standard
937
986
938 Some of IPython's very useful features are:
987 Some of IPython's very useful features are:
939 \layout Itemize
988 \layout Itemize
940
989
941 Integrated readline support (Tab-based file, object and attribute completion,
990 Integrated readline support (Tab-based file, object and attribute completion,
942 input history across sessions, editable command line, etc.)
991 input history across sessions, editable command line, etc.)
943 \layout Itemize
992 \layout Itemize
944
993
945 Coloring of prompts, code and tracebacks.
994 Coloring of prompts, code and tracebacks.
946 \layout Standard
995 \layout Standard
947
996
948 These, by default, are only available under Unix-like operating systems.
997 These, by default, are only available under Unix-like operating systems.
949 However, thanks to Gary Bishop's work, Windows XP/2k users can also benefit
998 However, thanks to Gary Bishop's work, Windows XP/2k users can also benefit
950 from them.
999 from them.
951 His readline library implements both GNU readline functionality and color
1000 His readline library implements both GNU readline functionality and color
952 support, so that IPython under Windows XP/2k can be as friendly and powerful
1001 support, so that IPython under Windows XP/2k can be as friendly and powerful
953 as under Unix-like environments.
1002 as under Unix-like environments.
954 \layout Standard
1003 \layout Standard
955
1004
956 The
1005 The
957 \family typewriter
1006 \family typewriter
958 readline
1007 readline
959 \family default
1008 \family default
960 extension needs two other libraries to work, so in all you need:
1009 extension needs two other libraries to work, so in all you need:
961 \layout Enumerate
1010 \layout Enumerate
962
1011
963
1012
964 \family typewriter
1013 \family typewriter
965 PyWin32
1014 PyWin32
966 \family default
1015 \family default
967 from
1016 from
968 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/mhammond}
1017 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/mhammond}
969
1018
970 \end_inset
1019 \end_inset
971
1020
972 .
1021 .
973 \layout Enumerate
1022 \layout Enumerate
974
1023
975
1024
976 \family typewriter
1025 \family typewriter
977 CTypes
1026 CTypes
978 \family default
1027 \family default
979 from
1028 from
980 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/theller/ctypes}
1029 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/theller/ctypes}
981
1030
982 \end_inset
1031 \end_inset
983
1032
984 (you
1033 (you
985 \emph on
1034 \emph on
986 must
1035 must
987 \emph default
1036 \emph default
988 use version 0.9.1 or newer).
1037 use version 0.9.1 or newer).
989 \layout Enumerate
1038 \layout Enumerate
990
1039
991
1040
992 \family typewriter
1041 \family typewriter
993 Readline
1042 Readline
994 \family default
1043 \family default
995 for Windows from
1044 for Windows from
996 \begin_inset LatexCommand \htmlurl{http://sourceforge.net/projects/uncpythontools}
1045 \begin_inset LatexCommand \htmlurl{http://sourceforge.net/projects/uncpythontools}
997
1046
998 \end_inset
1047 \end_inset
999
1048
1000 .
1049 .
1001 \layout Standard
1050 \layout Standard
1002
1051
1003
1052
1004 \series bold
1053 \series bold
1005 Warning about a broken readline-like library:
1054 Warning about a broken readline-like library:
1006 \series default
1055 \series default
1007 several users have reported problems stemming from using the pseudo-readline
1056 several users have reported problems stemming from using the pseudo-readline
1008 library at
1057 library at
1009 \begin_inset LatexCommand \htmlurl{http://newcenturycomputers.net/projects/readline.html}
1058 \begin_inset LatexCommand \htmlurl{http://newcenturycomputers.net/projects/readline.html}
1010
1059
1011 \end_inset
1060 \end_inset
1012
1061
1013 .
1062 .
1014 This is a broken library which, while called readline, only implements
1063 This is a broken library which, while called readline, only implements
1015 an incomplete subset of the readline API.
1064 an incomplete subset of the readline API.
1016 Since it is still called readline, it fools IPython's detection mechanisms
1065 Since it is still called readline, it fools IPython's detection mechanisms
1017 and causes unpredictable crashes later.
1066 and causes unpredictable crashes later.
1018 If you wish to use IPython under Windows, you must NOT use this library,
1067 If you wish to use IPython under Windows, you must NOT use this library,
1019 which for all purposes is (at least as of version 1.6) terminally broken.
1068 which for all purposes is (at least as of version 1.6) terminally broken.
1020 \layout Subsubsection
1069 \layout Subsubsection
1021
1070
1022 Installation procedure
1071 Installation procedure
1023 \layout Standard
1072 \layout Standard
1024
1073
1025 Once you have the above installed, from the IPython download directory grab
1074 Once you have the above installed, from the IPython download directory grab
1026 the
1075 the
1027 \family typewriter
1076 \family typewriter
1028 ipython-XXX.win32.exe
1077 ipython-XXX.win32.exe
1029 \family default
1078 \family default
1030 file, where
1079 file, where
1031 \family typewriter
1080 \family typewriter
1032 XXX
1081 XXX
1033 \family default
1082 \family default
1034 represents the version number.
1083 represents the version number.
1035 This is a regular windows executable installer, which you can simply double-cli
1084 This is a regular windows executable installer, which you can simply double-cli
1036 ck to install.
1085 ck to install.
1037 It will add an entry for IPython to your Start Menu, as well as registering
1086 It will add an entry for IPython to your Start Menu, as well as registering
1038 IPython in the Windows list of applications, so you can later uninstall
1087 IPython in the Windows list of applications, so you can later uninstall
1039 it from the Control Panel.
1088 it from the Control Panel.
1040
1089
1041 \layout Standard
1090 \layout Standard
1042
1091
1043 IPython tries to install the configuration information in a directory named
1092 IPython tries to install the configuration information in a directory named
1044
1093
1045 \family typewriter
1094 \family typewriter
1046 .ipython
1095 .ipython
1047 \family default
1096 \family default
1048 (
1097 (
1049 \family typewriter
1098 \family typewriter
1050 _ipython
1099 _ipython
1051 \family default
1100 \family default
1052 under Windows) located in your `home' directory.
1101 under Windows) located in your `home' directory.
1053 IPython sets this directory by looking for a
1102 IPython sets this directory by looking for a
1054 \family typewriter
1103 \family typewriter
1055 HOME
1104 HOME
1056 \family default
1105 \family default
1057 environment variable; if such a variable does not exist, it uses
1106 environment variable; if such a variable does not exist, it uses
1058 \family typewriter
1107 \family typewriter
1059 HOMEDRIVE
1108 HOMEDRIVE
1060 \backslash
1109 \backslash
1061 HOMEPATH
1110 HOMEPATH
1062 \family default
1111 \family default
1063 (these are always defined by Windows).
1112 (these are always defined by Windows).
1064 This typically gives something like
1113 This typically gives something like
1065 \family typewriter
1114 \family typewriter
1066 C:
1115 C:
1067 \backslash
1116 \backslash
1068 Documents and Settings
1117 Documents and Settings
1069 \backslash
1118 \backslash
1070 YourUserName
1119 YourUserName
1071 \family default
1120 \family default
1072 , but your local details may vary.
1121 , but your local details may vary.
1073 In this directory you will find all the files that configure IPython's
1122 In this directory you will find all the files that configure IPython's
1074 defaults, and you can put there your profiles and extensions.
1123 defaults, and you can put there your profiles and extensions.
1075 This directory is automatically added by IPython to
1124 This directory is automatically added by IPython to
1076 \family typewriter
1125 \family typewriter
1077 sys.path
1126 sys.path
1078 \family default
1127 \family default
1079 , so anything you place there can be found by
1128 , so anything you place there can be found by
1080 \family typewriter
1129 \family typewriter
1081 import
1130 import
1082 \family default
1131 \family default
1083 statements.
1132 statements.
1084 \layout Paragraph
1133 \layout Paragraph
1085
1134
1086 Upgrading
1135 Upgrading
1087 \layout Standard
1136 \layout Standard
1088
1137
1089 For an IPython upgrade, you should first uninstall the previous version.
1138 For an IPython upgrade, you should first uninstall the previous version.
1090 This will ensure that all files and directories (such as the documentation)
1139 This will ensure that all files and directories (such as the documentation)
1091 which carry embedded version strings in their names are properly removed.
1140 which carry embedded version strings in their names are properly removed.
1092 \layout Paragraph
1141 \layout Paragraph
1093
1142
1094 Manual installation under Win32
1143 Manual installation under Win32
1095 \layout Standard
1144 \layout Standard
1096
1145
1097 In case the automatic installer does not work for some reason, you can download
1146 In case the automatic installer does not work for some reason, you can download
1098 the
1147 the
1099 \family typewriter
1148 \family typewriter
1100 ipython-XXX.tar.gz
1149 ipython-XXX.tar.gz
1101 \family default
1150 \family default
1102 file, which contains the full IPython source distribution (the popular
1151 file, which contains the full IPython source distribution (the popular
1103 WinZip can read
1152 WinZip can read
1104 \family typewriter
1153 \family typewriter
1105 .tar.gz
1154 .tar.gz
1106 \family default
1155 \family default
1107 files).
1156 files).
1108 After uncompressing the archive, you can install it at a command terminal
1157 After uncompressing the archive, you can install it at a command terminal
1109 just like any other Python module, by using
1158 just like any other Python module, by using
1110 \family typewriter
1159 \family typewriter
1111 `python setup.py install'
1160 `python setup.py install'
1112 \family default
1161 \family default
1113 .
1162 .
1114
1163
1115 \layout Standard
1164 \layout Standard
1116
1165
1117 After the installation, run the supplied
1166 After the installation, run the supplied
1118 \family typewriter
1167 \family typewriter
1119 win32_manual_post_install.py
1168 win32_manual_post_install.py
1120 \family default
1169 \family default
1121 script, which creates the necessary Start Menu shortcuts for you.
1170 script, which creates the necessary Start Menu shortcuts for you.
1122 \layout Subsection
1171 \layout Subsection
1123
1172
1124
1173
1125 \begin_inset LatexCommand \label{sec:upgrade}
1174 \begin_inset LatexCommand \label{sec:upgrade}
1126
1175
1127 \end_inset
1176 \end_inset
1128
1177
1129 Upgrading from a previous version
1178 Upgrading from a previous version
1130 \layout Standard
1179 \layout Standard
1131
1180
1132 If you are upgrading from a previous version of IPython, after doing the
1181 If you are upgrading from a previous version of IPython, after doing the
1133 routine installation described above, you should call IPython with the
1182 routine installation described above, you should call IPython with the
1134
1183
1135 \family typewriter
1184 \family typewriter
1136 -upgrade
1185 -upgrade
1137 \family default
1186 \family default
1138 option the first time you run your new copy.
1187 option the first time you run your new copy.
1139 This will automatically update your configuration directory while preserving
1188 This will automatically update your configuration directory while preserving
1140 copies of your old files.
1189 copies of your old files.
1141 You can then later merge back any personal customizations you may have
1190 You can then later merge back any personal customizations you may have
1142 made into the new files.
1191 made into the new files.
1143 It is a good idea to do this as there may be new options available in the
1192 It is a good idea to do this as there may be new options available in the
1144 new configuration files which you will not have.
1193 new configuration files which you will not have.
1145 \layout Standard
1194 \layout Standard
1146
1195
1147 Under Windows, if you don't know how to call python scripts with arguments
1196 Under Windows, if you don't know how to call python scripts with arguments
1148 from a command line, simply delete the old config directory and IPython
1197 from a command line, simply delete the old config directory and IPython
1149 will make a new one.
1198 will make a new one.
1150 Win2k and WinXP users will find it in
1199 Win2k and WinXP users will find it in
1151 \family typewriter
1200 \family typewriter
1152 C:
1201 C:
1153 \backslash
1202 \backslash
1154 Documents and Settings
1203 Documents and Settings
1155 \backslash
1204 \backslash
1156 YourUserName
1205 YourUserName
1157 \backslash
1206 \backslash
1158 _ipython
1207 _ipython
1159 \family default
1208 \family default
1160 , and Win 9x users under
1209 , and Win 9x users under
1161 \family typewriter
1210 \family typewriter
1162 C:
1211 C:
1163 \backslash
1212 \backslash
1164 Program Files
1213 Program Files
1165 \backslash
1214 \backslash
1166 IPython
1215 IPython
1167 \backslash
1216 \backslash
1168 _ipython.
1217 _ipython.
1169 \layout Section
1218 \layout Section
1170
1219
1171
1220
1172 \begin_inset LatexCommand \label{sec:good_config}
1221 \begin_inset LatexCommand \label{sec:good_config}
1173
1222
1174 \end_inset
1223 \end_inset
1175
1224
1176
1225
1177 \begin_inset OptArg
1226 \begin_inset OptArg
1178 collapsed true
1227 collapsed true
1179
1228
1180 \layout Standard
1229 \layout Standard
1181
1230
1182 Initial configuration
1231 Initial configuration
1183 \begin_inset ERT
1232 \begin_inset ERT
1184 status Collapsed
1233 status Collapsed
1185
1234
1186 \layout Standard
1235 \layout Standard
1187
1236
1188 \backslash
1237 \backslash
1189 ldots
1238 ldots
1190 \end_inset
1239 \end_inset
1191
1240
1192
1241
1193 \end_inset
1242 \end_inset
1194
1243
1195 Initial configuration of your environment
1244 Initial configuration of your environment
1196 \layout Standard
1245 \layout Standard
1197
1246
1198 This section will help you set various things in your environment for your
1247 This section will help you set various things in your environment for your
1199 IPython sessions to be as efficient as possible.
1248 IPython sessions to be as efficient as possible.
1200 All of IPython's configuration information, along with several example
1249 All of IPython's configuration information, along with several example
1201 files, is stored in a directory named by default
1250 files, is stored in a directory named by default
1202 \family typewriter
1251 \family typewriter
1203 $HOME/.ipython
1252 $HOME/.ipython
1204 \family default
1253 \family default
1205 .
1254 .
1206 You can change this by defining the environment variable
1255 You can change this by defining the environment variable
1207 \family typewriter
1256 \family typewriter
1208 IPYTHONDIR
1257 IPYTHONDIR
1209 \family default
1258 \family default
1210 , or at runtime with the command line option
1259 , or at runtime with the command line option
1211 \family typewriter
1260 \family typewriter
1212 -ipythondir
1261 -ipythondir
1213 \family default
1262 \family default
1214 .
1263 .
1215 \layout Standard
1264 \layout Standard
1216
1265
1217 If all goes well, the first time you run IPython it should automatically
1266 If all goes well, the first time you run IPython it should automatically
1218 create a user copy of the config directory for you, based on its builtin
1267 create a user copy of the config directory for you, based on its builtin
1219 defaults.
1268 defaults.
1220 You can look at the files it creates to learn more about configuring the
1269 You can look at the files it creates to learn more about configuring the
1221 system.
1270 system.
1222 The main file you will modify to configure IPython's behavior is called
1271 The main file you will modify to configure IPython's behavior is called
1223
1272
1224 \family typewriter
1273 \family typewriter
1225 ipythonrc
1274 ipythonrc
1226 \family default
1275 \family default
1227 (with a
1276 (with a
1228 \family typewriter
1277 \family typewriter
1229 .ini
1278 .ini
1230 \family default
1279 \family default
1231 extension under Windows), included for reference in Sec.
1280 extension under Windows), included for reference in Sec.
1232
1281
1233 \begin_inset LatexCommand \ref{sec:ipytonrc-sample}
1282 \begin_inset LatexCommand \ref{sec:ipytonrc-sample}
1234
1283
1235 \end_inset
1284 \end_inset
1236
1285
1237 .
1286 .
1238 This file is very commented and has many variables you can change to suit
1287 This file is very commented and has many variables you can change to suit
1239 your taste, you can find more details in Sec.
1288 your taste, you can find more details in Sec.
1240
1289
1241 \begin_inset LatexCommand \ref{sec:customization}
1290 \begin_inset LatexCommand \ref{sec:customization}
1242
1291
1243 \end_inset
1292 \end_inset
1244
1293
1245 .
1294 .
1246 Here we discuss the basic things you will want to make sure things are
1295 Here we discuss the basic things you will want to make sure things are
1247 working properly from the beginning.
1296 working properly from the beginning.
1248 \layout Subsection
1297 \layout Subsection
1249
1298
1250
1299
1251 \begin_inset LatexCommand \label{sec:help-access}
1300 \begin_inset LatexCommand \label{sec:help-access}
1252
1301
1253 \end_inset
1302 \end_inset
1254
1303
1255 Access to the Python help system
1304 Access to the Python help system
1256 \layout Standard
1305 \layout Standard
1257
1306
1258 This is true for Python in general (not just for IPython): you should have
1307 This is true for Python in general (not just for IPython): you should have
1259 an environment variable called
1308 an environment variable called
1260 \family typewriter
1309 \family typewriter
1261 PYTHONDOCS
1310 PYTHONDOCS
1262 \family default
1311 \family default
1263 pointing to the directory where your HTML Python documentation lives.
1312 pointing to the directory where your HTML Python documentation lives.
1264 In my system it's
1313 In my system it's
1265 \family typewriter
1314 \family typewriter
1266 /usr/share/doc/python-docs-2.3.4/html
1315 /usr/share/doc/python-docs-2.3.4/html
1267 \family default
1316 \family default
1268 , check your local details or ask your systems administrator.
1317 , check your local details or ask your systems administrator.
1269
1318
1270 \layout Standard
1319 \layout Standard
1271
1320
1272 This is the directory which holds the HTML version of the Python manuals.
1321 This is the directory which holds the HTML version of the Python manuals.
1273 Unfortunately it seems that different Linux distributions package these
1322 Unfortunately it seems that different Linux distributions package these
1274 files differently, so you may have to look around a bit.
1323 files differently, so you may have to look around a bit.
1275 Below I show the contents of this directory on my system for reference:
1324 Below I show the contents of this directory on my system for reference:
1276 \layout Standard
1325 \layout Standard
1277
1326
1278
1327
1279 \family typewriter
1328 \family typewriter
1280 [html]> ls
1329 [html]> ls
1281 \newline
1330 \newline
1282 about.dat acks.html dist/ ext/ index.html lib/ modindex.html stdabout.dat tut/
1331 about.dat acks.html dist/ ext/ index.html lib/ modindex.html stdabout.dat tut/
1283 about.html api/ doc/ icons/ inst/ mac/ ref/ style.css
1332 about.html api/ doc/ icons/ inst/ mac/ ref/ style.css
1284 \layout Standard
1333 \layout Standard
1285
1334
1286 You should really make sure this variable is correctly set so that Python's
1335 You should really make sure this variable is correctly set so that Python's
1287 pydoc-based help system works.
1336 pydoc-based help system works.
1288 It is a powerful and convenient system with full access to the Python manuals
1337 It is a powerful and convenient system with full access to the Python manuals
1289 and all modules accessible to you.
1338 and all modules accessible to you.
1290 \layout Standard
1339 \layout Standard
1291
1340
1292 Under Windows it seems that pydoc finds the documentation automatically,
1341 Under Windows it seems that pydoc finds the documentation automatically,
1293 so no extra setup appears necessary.
1342 so no extra setup appears necessary.
1294 \layout Subsection
1343 \layout Subsection
1295
1344
1296 Editor
1345 Editor
1297 \layout Standard
1346 \layout Standard
1298
1347
1299 The
1348 The
1300 \family typewriter
1349 \family typewriter
1301 %edit
1350 %edit
1302 \family default
1351 \family default
1303 command (and its alias
1352 command (and its alias
1304 \family typewriter
1353 \family typewriter
1305 %ed
1354 %ed
1306 \family default
1355 \family default
1307 ) will invoke the editor set in your environment as
1356 ) will invoke the editor set in your environment as
1308 \family typewriter
1357 \family typewriter
1309 EDITOR
1358 EDITOR
1310 \family default
1359 \family default
1311 .
1360 .
1312 If this variable is not set, it will default to
1361 If this variable is not set, it will default to
1313 \family typewriter
1362 \family typewriter
1314 vi
1363 vi
1315 \family default
1364 \family default
1316 under Linux/Unix and to
1365 under Linux/Unix and to
1317 \family typewriter
1366 \family typewriter
1318 notepad
1367 notepad
1319 \family default
1368 \family default
1320 under Windows.
1369 under Windows.
1321 You may want to set this variable properly and to a lightweight editor
1370 You may want to set this variable properly and to a lightweight editor
1322 which doesn't take too long to start (that is, something other than a new
1371 which doesn't take too long to start (that is, something other than a new
1323 instance of
1372 instance of
1324 \family typewriter
1373 \family typewriter
1325 Emacs
1374 Emacs
1326 \family default
1375 \family default
1327 ).
1376 ).
1328 This way you can edit multi-line code quickly and with the power of a real
1377 This way you can edit multi-line code quickly and with the power of a real
1329 editor right inside IPython.
1378 editor right inside IPython.
1330
1379
1331 \layout Standard
1380 \layout Standard
1332
1381
1333 If you are a dedicated
1382 If you are a dedicated
1334 \family typewriter
1383 \family typewriter
1335 Emacs
1384 Emacs
1336 \family default
1385 \family default
1337 user, you should set up the
1386 user, you should set up the
1338 \family typewriter
1387 \family typewriter
1339 Emacs
1388 Emacs
1340 \family default
1389 \family default
1341 server so that new requests are handled by the original process.
1390 server so that new requests are handled by the original process.
1342 This means that almost no time is spent in handling the request (assuming
1391 This means that almost no time is spent in handling the request (assuming
1343 an
1392 an
1344 \family typewriter
1393 \family typewriter
1345 Emacs
1394 Emacs
1346 \family default
1395 \family default
1347 process is already running).
1396 process is already running).
1348 For this to work, you need to set your
1397 For this to work, you need to set your
1349 \family typewriter
1398 \family typewriter
1350 EDITOR
1399 EDITOR
1351 \family default
1400 \family default
1352 environment variable to
1401 environment variable to
1353 \family typewriter
1402 \family typewriter
1354 'emacsclient'
1403 'emacsclient'
1355 \family default
1404 \family default
1356 .
1405 .
1357
1406
1358 \family typewriter
1407 \family typewriter
1359
1408
1360 \family default
1409 \family default
1361 The code below, supplied by Francois Pinard, can then be used in your
1410 The code below, supplied by Francois Pinard, can then be used in your
1362 \family typewriter
1411 \family typewriter
1363 .emacs
1412 .emacs
1364 \family default
1413 \family default
1365 file to enable the server:
1414 file to enable the server:
1366 \layout Standard
1415 \layout Standard
1367
1416
1368
1417
1369 \family typewriter
1418 \family typewriter
1370 (defvar server-buffer-clients)
1419 (defvar server-buffer-clients)
1371 \newline
1420 \newline
1372 (when (and (fboundp 'server-start) (string-equal (getenv "TERM") 'xterm))
1421 (when (and (fboundp 'server-start) (string-equal (getenv "TERM") 'xterm))
1373 \newline
1422 \newline
1374
1423
1375 \begin_inset ERT
1424 \begin_inset ERT
1376 status Collapsed
1425 status Collapsed
1377
1426
1378 \layout Standard
1427 \layout Standard
1379
1428
1380 \backslash
1429 \backslash
1381 hspace*{0mm}
1430 hspace*{0mm}
1382 \end_inset
1431 \end_inset
1383
1432
1384 \SpecialChar ~
1433 \SpecialChar ~
1385 \SpecialChar ~
1434 \SpecialChar ~
1386 (server-start)
1435 (server-start)
1387 \newline
1436 \newline
1388
1437
1389 \begin_inset ERT
1438 \begin_inset ERT
1390 status Collapsed
1439 status Collapsed
1391
1440
1392 \layout Standard
1441 \layout Standard
1393
1442
1394 \backslash
1443 \backslash
1395 hspace*{0mm}
1444 hspace*{0mm}
1396 \end_inset
1445 \end_inset
1397
1446
1398 \SpecialChar ~
1447 \SpecialChar ~
1399 \SpecialChar ~
1448 \SpecialChar ~
1400 (defun fp-kill-server-with-buffer-routine ()
1449 (defun fp-kill-server-with-buffer-routine ()
1401 \newline
1450 \newline
1402
1451
1403 \begin_inset ERT
1452 \begin_inset ERT
1404 status Collapsed
1453 status Collapsed
1405
1454
1406 \layout Standard
1455 \layout Standard
1407
1456
1408 \backslash
1457 \backslash
1409 hspace*{0mm}
1458 hspace*{0mm}
1410 \end_inset
1459 \end_inset
1411
1460
1412 \SpecialChar ~
1461 \SpecialChar ~
1413 \SpecialChar ~
1462 \SpecialChar ~
1414 \SpecialChar ~
1463 \SpecialChar ~
1415 \SpecialChar ~
1464 \SpecialChar ~
1416 (and server-buffer-clients (server-done)))
1465 (and server-buffer-clients (server-done)))
1417 \newline
1466 \newline
1418
1467
1419 \begin_inset ERT
1468 \begin_inset ERT
1420 status Collapsed
1469 status Collapsed
1421
1470
1422 \layout Standard
1471 \layout Standard
1423
1472
1424 \backslash
1473 \backslash
1425 hspace*{0mm}
1474 hspace*{0mm}
1426 \end_inset
1475 \end_inset
1427
1476
1428 \SpecialChar ~
1477 \SpecialChar ~
1429 \SpecialChar ~
1478 \SpecialChar ~
1430 (add-hook 'kill-buffer-hook 'fp-kill-server-with-buffer-routine))
1479 (add-hook 'kill-buffer-hook 'fp-kill-server-with-buffer-routine))
1431 \layout Standard
1480 \layout Standard
1432
1481
1433 You can also set the value of this editor via the commmand-line option '-
1482 You can also set the value of this editor via the commmand-line option '-
1434 \family typewriter
1483 \family typewriter
1435 editor'
1484 editor'
1436 \family default
1485 \family default
1437 or in your
1486 or in your
1438 \family typewriter
1487 \family typewriter
1439 ipythonrc
1488 ipythonrc
1440 \family default
1489 \family default
1441 file.
1490 file.
1442 This is useful if you wish to use specifically for IPython an editor different
1491 This is useful if you wish to use specifically for IPython an editor different
1443 from your typical default (and for Windows users who tend to use fewer
1492 from your typical default (and for Windows users who tend to use fewer
1444 environment variables).
1493 environment variables).
1445 \layout Subsection
1494 \layout Subsection
1446
1495
1447 Color
1496 Color
1448 \layout Standard
1497 \layout Standard
1449
1498
1450 The default IPython configuration has most bells and whistles turned on
1499 The default IPython configuration has most bells and whistles turned on
1451 (they're pretty safe).
1500 (they're pretty safe).
1452 But there's one that
1501 But there's one that
1453 \emph on
1502 \emph on
1454 may
1503 may
1455 \emph default
1504 \emph default
1456 cause problems on some systems: the use of color on screen for displaying
1505 cause problems on some systems: the use of color on screen for displaying
1457 information.
1506 information.
1458 This is very useful, since IPython can show prompts and exception tracebacks
1507 This is very useful, since IPython can show prompts and exception tracebacks
1459 with various colors, display syntax-highlighted source code, and in general
1508 with various colors, display syntax-highlighted source code, and in general
1460 make it easier to visually parse information.
1509 make it easier to visually parse information.
1461 \layout Standard
1510 \layout Standard
1462
1511
1463 The following terminals seem to handle the color sequences fine:
1512 The following terminals seem to handle the color sequences fine:
1464 \layout Itemize
1513 \layout Itemize
1465
1514
1466 Linux main text console, KDE Konsole, Gnome Terminal, E-term, rxvt, xterm.
1515 Linux main text console, KDE Konsole, Gnome Terminal, E-term, rxvt, xterm.
1467 \layout Itemize
1516 \layout Itemize
1468
1517
1469 CDE terminal (tested under Solaris).
1518 CDE terminal (tested under Solaris).
1470 This one boldfaces light colors.
1519 This one boldfaces light colors.
1471 \layout Itemize
1520 \layout Itemize
1472
1521
1473 (X)Emacs buffers.
1522 (X)Emacs buffers.
1474 See sec.
1523 See sec.
1475 \begin_inset LatexCommand \ref{sec:emacs}
1524 \begin_inset LatexCommand \ref{sec:emacs}
1476
1525
1477 \end_inset
1526 \end_inset
1478
1527
1479 for more details on using IPython with (X)Emacs.
1528 for more details on using IPython with (X)Emacs.
1480 \layout Itemize
1529 \layout Itemize
1481
1530
1482 A Windows (XP/2k) command prompt
1531 A Windows (XP/2k) command prompt
1483 \emph on
1532 \emph on
1484 with Gary Bishop's support extensions
1533 with Gary Bishop's support extensions
1485 \emph default
1534 \emph default
1486 .
1535 .
1487 Gary's extensions are discussed in Sec.\SpecialChar ~
1536 Gary's extensions are discussed in Sec.\SpecialChar ~
1488
1537
1489 \begin_inset LatexCommand \ref{sub:Under-Windows}
1538 \begin_inset LatexCommand \ref{sub:Under-Windows}
1490
1539
1491 \end_inset
1540 \end_inset
1492
1541
1493 .
1542 .
1494 \layout Itemize
1543 \layout Itemize
1495
1544
1496 A Windows (XP/2k) CygWin shell.
1545 A Windows (XP/2k) CygWin shell.
1497 Although some users have reported problems; it is not clear whether there
1546 Although some users have reported problems; it is not clear whether there
1498 is an issue for everyone or only under specific configurations.
1547 is an issue for everyone or only under specific configurations.
1499 If you have full color support under cygwin, please post to the IPython
1548 If you have full color support under cygwin, please post to the IPython
1500 mailing list so this issue can be resolved for all users.
1549 mailing list so this issue can be resolved for all users.
1501 \layout Standard
1550 \layout Standard
1502
1551
1503 These have shown problems:
1552 These have shown problems:
1504 \layout Itemize
1553 \layout Itemize
1505
1554
1506 Windows command prompt in WinXP/2k logged into a Linux machine via telnet
1555 Windows command prompt in WinXP/2k logged into a Linux machine via telnet
1507 or ssh.
1556 or ssh.
1508 \layout Itemize
1557 \layout Itemize
1509
1558
1510 Windows native command prompt in WinXP/2k,
1559 Windows native command prompt in WinXP/2k,
1511 \emph on
1560 \emph on
1512 without
1561 without
1513 \emph default
1562 \emph default
1514 Gary Bishop's extensions.
1563 Gary Bishop's extensions.
1515 Once Gary's readline library is installed, the normal WinXP/2k command
1564 Once Gary's readline library is installed, the normal WinXP/2k command
1516 prompt works perfectly.
1565 prompt works perfectly.
1517 \layout Standard
1566 \layout Standard
1518
1567
1519 Currently the following color schemes are available:
1568 Currently the following color schemes are available:
1520 \layout Itemize
1569 \layout Itemize
1521
1570
1522
1571
1523 \family typewriter
1572 \family typewriter
1524 NoColor
1573 NoColor
1525 \family default
1574 \family default
1526 : uses no color escapes at all (all escapes are empty
1575 : uses no color escapes at all (all escapes are empty
1527 \begin_inset Quotes eld
1576 \begin_inset Quotes eld
1528 \end_inset
1577 \end_inset
1529
1578
1530
1579
1531 \begin_inset Quotes eld
1580 \begin_inset Quotes eld
1532 \end_inset
1581 \end_inset
1533
1582
1534 strings).
1583 strings).
1535 This 'scheme' is thus fully safe to use in any terminal.
1584 This 'scheme' is thus fully safe to use in any terminal.
1536 \layout Itemize
1585 \layout Itemize
1537
1586
1538
1587
1539 \family typewriter
1588 \family typewriter
1540 Linux
1589 Linux
1541 \family default
1590 \family default
1542 : works well in Linux console type environments: dark background with light
1591 : works well in Linux console type environments: dark background with light
1543 fonts.
1592 fonts.
1544 It uses bright colors for information, so it is difficult to read if you
1593 It uses bright colors for information, so it is difficult to read if you
1545 have a light colored background.
1594 have a light colored background.
1546 \layout Itemize
1595 \layout Itemize
1547
1596
1548
1597
1549 \family typewriter
1598 \family typewriter
1550 LightBG
1599 LightBG
1551 \family default
1600 \family default
1552 : the basic colors are similar to those in the
1601 : the basic colors are similar to those in the
1553 \family typewriter
1602 \family typewriter
1554 Linux
1603 Linux
1555 \family default
1604 \family default
1556 scheme but darker.
1605 scheme but darker.
1557 It is easy to read in terminals with light backgrounds.
1606 It is easy to read in terminals with light backgrounds.
1558 \layout Standard
1607 \layout Standard
1559
1608
1560 IPython uses colors for two main groups of things: prompts and tracebacks
1609 IPython uses colors for two main groups of things: prompts and tracebacks
1561 which are directly printed to the terminal, and the object introspection
1610 which are directly printed to the terminal, and the object introspection
1562 system which passes large sets of data through a pager.
1611 system which passes large sets of data through a pager.
1563 \layout Subsubsection
1612 \layout Subsubsection
1564
1613
1565 Input/Output prompts and exception tracebacks
1614 Input/Output prompts and exception tracebacks
1566 \layout Standard
1615 \layout Standard
1567
1616
1568 You can test whether the colored prompts and tracebacks work on your system
1617 You can test whether the colored prompts and tracebacks work on your system
1569 interactively by typing
1618 interactively by typing
1570 \family typewriter
1619 \family typewriter
1571 '%colors Linux'
1620 '%colors Linux'
1572 \family default
1621 \family default
1573 at the prompt (use '
1622 at the prompt (use '
1574 \family typewriter
1623 \family typewriter
1575 %colors LightBG'
1624 %colors LightBG'
1576 \family default
1625 \family default
1577 if your terminal has a light background).
1626 if your terminal has a light background).
1578 If the input prompt shows garbage like:
1627 If the input prompt shows garbage like:
1579 \newline
1628 \newline
1580
1629
1581 \family typewriter
1630 \family typewriter
1582 [0;32mIn [[1;32m1[0;32m]: [0;00m
1631 [0;32mIn [[1;32m1[0;32m]: [0;00m
1583 \family default
1632 \family default
1584
1633
1585 \newline
1634 \newline
1586 instead of (in color) something like:
1635 instead of (in color) something like:
1587 \newline
1636 \newline
1588
1637
1589 \family typewriter
1638 \family typewriter
1590 In [1]:
1639 In [1]:
1591 \family default
1640 \family default
1592
1641
1593 \newline
1642 \newline
1594 this means that your terminal doesn't properly handle color escape sequences.
1643 this means that your terminal doesn't properly handle color escape sequences.
1595 You can go to a 'no color' mode by typing '
1644 You can go to a 'no color' mode by typing '
1596 \family typewriter
1645 \family typewriter
1597 %colors NoColor
1646 %colors NoColor
1598 \family default
1647 \family default
1599 '.
1648 '.
1600
1649
1601 \layout Standard
1650 \layout Standard
1602
1651
1603 You can try using a different terminal emulator program.
1652 You can try using a different terminal emulator program.
1604 To permanently set your color preferences, edit the file
1653 To permanently set your color preferences, edit the file
1605 \family typewriter
1654 \family typewriter
1606 $HOME/.ipython/ipythonrc
1655 $HOME/.ipython/ipythonrc
1607 \family default
1656 \family default
1608 and set the
1657 and set the
1609 \family typewriter
1658 \family typewriter
1610 colors
1659 colors
1611 \family default
1660 \family default
1612 option to the desired value.
1661 option to the desired value.
1613 \layout Subsubsection
1662 \layout Subsubsection
1614
1663
1615 Object details (types, docstrings, source code, etc.)
1664 Object details (types, docstrings, source code, etc.)
1616 \layout Standard
1665 \layout Standard
1617
1666
1618 IPython has a set of special functions for studying the objects you are
1667 IPython has a set of special functions for studying the objects you are
1619 working with, discussed in detail in Sec.
1668 working with, discussed in detail in Sec.
1620
1669
1621 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1670 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1622
1671
1623 \end_inset
1672 \end_inset
1624
1673
1625 .
1674 .
1626 But this system relies on passing information which is longer than your
1675 But this system relies on passing information which is longer than your
1627 screen through a data pager, such as the common Unix
1676 screen through a data pager, such as the common Unix
1628 \family typewriter
1677 \family typewriter
1629 less
1678 less
1630 \family default
1679 \family default
1631 and
1680 and
1632 \family typewriter
1681 \family typewriter
1633 more
1682 more
1634 \family default
1683 \family default
1635 programs.
1684 programs.
1636 In order to be able to see this information in color, your pager needs
1685 In order to be able to see this information in color, your pager needs
1637 to be properly configured.
1686 to be properly configured.
1638 I strongly recommend using
1687 I strongly recommend using
1639 \family typewriter
1688 \family typewriter
1640 less
1689 less
1641 \family default
1690 \family default
1642 instead of
1691 instead of
1643 \family typewriter
1692 \family typewriter
1644 more
1693 more
1645 \family default
1694 \family default
1646 , as it seems that
1695 , as it seems that
1647 \family typewriter
1696 \family typewriter
1648 more
1697 more
1649 \family default
1698 \family default
1650 simply can not understand colored text correctly.
1699 simply can not understand colored text correctly.
1651 \layout Standard
1700 \layout Standard
1652
1701
1653 In order to configure
1702 In order to configure
1654 \family typewriter
1703 \family typewriter
1655 less
1704 less
1656 \family default
1705 \family default
1657 as your default pager, do the following:
1706 as your default pager, do the following:
1658 \layout Enumerate
1707 \layout Enumerate
1659
1708
1660 Set the environment
1709 Set the environment
1661 \family typewriter
1710 \family typewriter
1662 PAGER
1711 PAGER
1663 \family default
1712 \family default
1664 variable to
1713 variable to
1665 \family typewriter
1714 \family typewriter
1666 less
1715 less
1667 \family default
1716 \family default
1668 .
1717 .
1669 \layout Enumerate
1718 \layout Enumerate
1670
1719
1671 Set the environment
1720 Set the environment
1672 \family typewriter
1721 \family typewriter
1673 LESS
1722 LESS
1674 \family default
1723 \family default
1675 variable to
1724 variable to
1676 \family typewriter
1725 \family typewriter
1677 -r
1726 -r
1678 \family default
1727 \family default
1679 (plus any other options you always want to pass to
1728 (plus any other options you always want to pass to
1680 \family typewriter
1729 \family typewriter
1681 less
1730 less
1682 \family default
1731 \family default
1683 by default).
1732 by default).
1684 This tells
1733 This tells
1685 \family typewriter
1734 \family typewriter
1686 less
1735 less
1687 \family default
1736 \family default
1688 to properly interpret control sequences, which is how color information
1737 to properly interpret control sequences, which is how color information
1689 is given to your terminal.
1738 is given to your terminal.
1690 \layout Standard
1739 \layout Standard
1691
1740
1692 For the
1741 For the
1693 \family typewriter
1742 \family typewriter
1694 csh
1743 csh
1695 \family default
1744 \family default
1696 or
1745 or
1697 \family typewriter
1746 \family typewriter
1698 tcsh
1747 tcsh
1699 \family default
1748 \family default
1700 shells, add to your
1749 shells, add to your
1701 \family typewriter
1750 \family typewriter
1702 ~/.cshrc
1751 ~/.cshrc
1703 \family default
1752 \family default
1704 file the lines:
1753 file the lines:
1705 \layout Standard
1754 \layout Standard
1706
1755
1707
1756
1708 \family typewriter
1757 \family typewriter
1709 setenv PAGER less
1758 setenv PAGER less
1710 \newline
1759 \newline
1711 setenv LESS -r
1760 setenv LESS -r
1712 \layout Standard
1761 \layout Standard
1713
1762
1714 There is similar syntax for other Unix shells, look at your system documentation
1763 There is similar syntax for other Unix shells, look at your system documentation
1715 for details.
1764 for details.
1716 \layout Standard
1765 \layout Standard
1717
1766
1718 If you are on a system which lacks proper data pagers (such as Windows),
1767 If you are on a system which lacks proper data pagers (such as Windows),
1719 IPython will use a very limited builtin pager.
1768 IPython will use a very limited builtin pager.
1720 \layout Subsection
1769 \layout Subsection
1721
1770
1722
1771
1723 \begin_inset LatexCommand \label{sec:emacs}
1772 \begin_inset LatexCommand \label{sec:emacs}
1724
1773
1725 \end_inset
1774 \end_inset
1726
1775
1727 (X)Emacs configuration
1776 (X)Emacs configuration
1728 \layout Standard
1777 \layout Standard
1729
1778
1730 Thanks to the work of Alexander Schmolck and Prabhu Ramachandran, currently
1779 Thanks to the work of Alexander Schmolck and Prabhu Ramachandran, currently
1731 (X)Emacs and IPython get along very well.
1780 (X)Emacs and IPython get along very well.
1732
1781
1733 \layout Standard
1782 \layout Standard
1734
1783
1735
1784
1736 \series bold
1785 \series bold
1737 Important note:
1786 Important note:
1738 \series default
1787 \series default
1739 You will need to use a recent enough version of
1788 You will need to use a recent enough version of
1740 \family typewriter
1789 \family typewriter
1741 python-mode.el
1790 python-mode.el
1742 \family default
1791 \family default
1743 , along with the file
1792 , along with the file
1744 \family typewriter
1793 \family typewriter
1745 ipython.el
1794 ipython.el
1746 \family default
1795 \family default
1747 .
1796 .
1748 You can check that the version you have of
1797 You can check that the version you have of
1749 \family typewriter
1798 \family typewriter
1750 python-mode.el
1799 python-mode.el
1751 \family default
1800 \family default
1752 is new enough by either looking at the revision number in the file itself,
1801 is new enough by either looking at the revision number in the file itself,
1753 or asking for it in (X)Emacs via
1802 or asking for it in (X)Emacs via
1754 \family typewriter
1803 \family typewriter
1755 M-x py-version
1804 M-x py-version
1756 \family default
1805 \family default
1757 .
1806 .
1758 Versions 4.68 and newer contain the necessary fixes for proper IPython support.
1807 Versions 4.68 and newer contain the necessary fixes for proper IPython support.
1759 \layout Standard
1808 \layout Standard
1760
1809
1761 The file
1810 The file
1762 \family typewriter
1811 \family typewriter
1763 ipython.el
1812 ipython.el
1764 \family default
1813 \family default
1765 is included with the IPython distribution, in the documentation directory
1814 is included with the IPython distribution, in the documentation directory
1766 (where this manual resides in PDF and HTML formats).
1815 (where this manual resides in PDF and HTML formats).
1767 \layout Standard
1816 \layout Standard
1768
1817
1769 Once you put these files in your Emacs path, all you need in your
1818 Once you put these files in your Emacs path, all you need in your
1770 \family typewriter
1819 \family typewriter
1771 .emacs
1820 .emacs
1772 \family default
1821 \family default
1773 file is:
1822 file is:
1774 \layout Standard
1823 \layout Standard
1775
1824
1776
1825
1777 \family typewriter
1826 \family typewriter
1778 (require 'ipython)
1827 (require 'ipython)
1779 \layout Standard
1828 \layout Standard
1780
1829
1781 This should give you full support for executing code snippets via IPython,
1830 This should give you full support for executing code snippets via IPython,
1782 opening IPython as your Python shell via
1831 opening IPython as your Python shell via
1783 \family typewriter
1832 \family typewriter
1784 C-c\SpecialChar ~
1833 C-c\SpecialChar ~
1785 !
1834 !
1786 \family default
1835 \family default
1787 , etc.
1836 , etc.
1788
1837
1789 \layout Subsubsection*
1838 \layout Subsubsection*
1790
1839
1791 Notes
1840 Notes
1792 \layout Itemize
1841 \layout Itemize
1793
1842
1794 There is one caveat you should be aware of: you must start the IPython shell
1843 There is one caveat you should be aware of: you must start the IPython shell
1795
1844
1796 \emph on
1845 \emph on
1797 before
1846 before
1798 \emph default
1847 \emph default
1799 attempting to execute any code regions via
1848 attempting to execute any code regions via
1800 \family typewriter
1849 \family typewriter
1801 C-c\SpecialChar ~
1850 C-c\SpecialChar ~
1802 |
1851 |
1803 \family default
1852 \family default
1804 .
1853 .
1805 Simply type
1854 Simply type
1806 \family typewriter
1855 \family typewriter
1807 C-c\SpecialChar ~
1856 C-c\SpecialChar ~
1808 !
1857 !
1809 \family default
1858 \family default
1810 to start IPython before passing any code regions to the interpreter, and
1859 to start IPython before passing any code regions to the interpreter, and
1811 you shouldn't experience any problems.
1860 you shouldn't experience any problems.
1812 \newline
1861 \newline
1813 This is due to a bug in Python itself, which has been fixed for Python 2.3,
1862 This is due to a bug in Python itself, which has been fixed for Python 2.3,
1814 but exists as of Python 2.2.2 (reported as SF bug [ 737947 ]).
1863 but exists as of Python 2.2.2 (reported as SF bug [ 737947 ]).
1815 \layout Itemize
1864 \layout Itemize
1816
1865
1817 The (X)Emacs support is maintained by Alexander Schmolck, so all comments/reques
1866 The (X)Emacs support is maintained by Alexander Schmolck, so all comments/reques
1818 ts should be directed to him through the IPython mailing lists.
1867 ts should be directed to him through the IPython mailing lists.
1819
1868
1820 \layout Itemize
1869 \layout Itemize
1821
1870
1822 This code is still somewhat experimental so it's a bit rough around the
1871 This code is still somewhat experimental so it's a bit rough around the
1823 edges (although in practice, it works quite well).
1872 edges (although in practice, it works quite well).
1824 \layout Itemize
1873 \layout Itemize
1825
1874
1826 Be aware that if you customize
1875 Be aware that if you customize
1827 \family typewriter
1876 \family typewriter
1828 py-python-command
1877 py-python-command
1829 \family default
1878 \family default
1830 previously, this value will override what
1879 previously, this value will override what
1831 \family typewriter
1880 \family typewriter
1832 ipython.el
1881 ipython.el
1833 \family default
1882 \family default
1834 does (because loading the customization variables comes later).
1883 does (because loading the customization variables comes later).
1835 \layout Section
1884 \layout Section
1836
1885
1837
1886
1838 \begin_inset LatexCommand \label{sec:quick_tips}
1887 \begin_inset LatexCommand \label{sec:quick_tips}
1839
1888
1840 \end_inset
1889 \end_inset
1841
1890
1842 Quick tips
1891 Quick tips
1843 \layout Standard
1892 \layout Standard
1844
1893
1845 IPython can be used as an improved replacement for the Python prompt, and
1894 IPython can be used as an improved replacement for the Python prompt, and
1846 for that you don't really need to read any more of this manual.
1895 for that you don't really need to read any more of this manual.
1847 But in this section we'll try to summarize a few tips on how to make the
1896 But in this section we'll try to summarize a few tips on how to make the
1848 most effective use of it for everyday Python development, highlighting
1897 most effective use of it for everyday Python development, highlighting
1849 things you might miss in the rest of the manual (which is getting long).
1898 things you might miss in the rest of the manual (which is getting long).
1850 We'll give references to parts in the manual which provide more detail
1899 We'll give references to parts in the manual which provide more detail
1851 when appropriate.
1900 when appropriate.
1852 \layout Standard
1901 \layout Standard
1853
1902
1854 The following article by Jeremy Jones provides an introductory tutorial
1903 The following article by Jeremy Jones provides an introductory tutorial
1855 about IPython:
1904 about IPython:
1856 \newline
1905 \newline
1857
1906
1858 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html}
1907 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2005/01/27/ipython.html}
1859
1908
1860 \end_inset
1909 \end_inset
1861
1910
1862
1911
1863 \layout Itemize
1912 \layout Itemize
1864
1913
1865 The TAB key.
1914 The TAB key.
1866 TAB-completion, especially for attributes, is a convenient way to explore
1915 TAB-completion, especially for attributes, is a convenient way to explore
1867 the structure of any object you're dealing with.
1916 the structure of any object you're dealing with.
1868 Simply type
1917 Simply type
1869 \family typewriter
1918 \family typewriter
1870 object_name.<TAB>
1919 object_name.<TAB>
1871 \family default
1920 \family default
1872 and a list of the object's attributes will be printed (see sec.
1921 and a list of the object's attributes will be printed (see sec.
1873
1922
1874 \begin_inset LatexCommand \ref{sec:readline}
1923 \begin_inset LatexCommand \ref{sec:readline}
1875
1924
1876 \end_inset
1925 \end_inset
1877
1926
1878 for more).
1927 for more).
1879 Tab completion also works on file and directory names, which combined with
1928 Tab completion also works on file and directory names, which combined with
1880 IPython's alias system allows you to do from within IPython many of the
1929 IPython's alias system allows you to do from within IPython many of the
1881 things you normally would need the system shell for.
1930 things you normally would need the system shell for.
1882
1931
1883 \layout Itemize
1932 \layout Itemize
1884
1933
1885 Explore your objects.
1934 Explore your objects.
1886 Typing
1935 Typing
1887 \family typewriter
1936 \family typewriter
1888 object_name?
1937 object_name?
1889 \family default
1938 \family default
1890 will print all sorts of details about any object, including docstrings,
1939 will print all sorts of details about any object, including docstrings,
1891 function definition lines (for call arguments) and constructor details
1940 function definition lines (for call arguments) and constructor details
1892 for classes.
1941 for classes.
1893 The magic commands
1942 The magic commands
1894 \family typewriter
1943 \family typewriter
1895 %pdoc
1944 %pdoc
1896 \family default
1945 \family default
1897 ,
1946 ,
1898 \family typewriter
1947 \family typewriter
1899 %pdef
1948 %pdef
1900 \family default
1949 \family default
1901 ,
1950 ,
1902 \family typewriter
1951 \family typewriter
1903 %psource
1952 %psource
1904 \family default
1953 \family default
1905 and
1954 and
1906 \family typewriter
1955 \family typewriter
1907 %pfile
1956 %pfile
1908 \family default
1957 \family default
1909 will respectively print the docstring, function definition line, full source
1958 will respectively print the docstring, function definition line, full source
1910 code and the complete file for any object (when they can be found).
1959 code and the complete file for any object (when they can be found).
1911 If automagic is on (it is by default), you don't need to type the '
1960 If automagic is on (it is by default), you don't need to type the '
1912 \family typewriter
1961 \family typewriter
1913 %
1962 %
1914 \family default
1963 \family default
1915 ' explicitly.
1964 ' explicitly.
1916 See sec.
1965 See sec.
1917
1966
1918 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1967 \begin_inset LatexCommand \ref{sec:dyn-object-info}
1919
1968
1920 \end_inset
1969 \end_inset
1921
1970
1922 for more.
1971 for more.
1923 \layout Itemize
1972 \layout Itemize
1924
1973
1925 The
1974 The
1926 \family typewriter
1975 \family typewriter
1927 %run
1976 %run
1928 \family default
1977 \family default
1929 magic command allows you to run any python script and load all of its data
1978 magic command allows you to run any python script and load all of its data
1930 directly into the interactive namespace.
1979 directly into the interactive namespace.
1931 Since the file is re-read from disk each time, changes you make to it are
1980 Since the file is re-read from disk each time, changes you make to it are
1932 reflected immediately (in contrast to the behavior of
1981 reflected immediately (in contrast to the behavior of
1933 \family typewriter
1982 \family typewriter
1934 import
1983 import
1935 \family default
1984 \family default
1936 ).
1985 ).
1937 I rarely use
1986 I rarely use
1938 \family typewriter
1987 \family typewriter
1939 import
1988 import
1940 \family default
1989 \family default
1941 for code I am testing, relying on
1990 for code I am testing, relying on
1942 \family typewriter
1991 \family typewriter
1943 %run
1992 %run
1944 \family default
1993 \family default
1945 instead.
1994 instead.
1946 See sec.
1995 See sec.
1947
1996
1948 \begin_inset LatexCommand \ref{sec:magic}
1997 \begin_inset LatexCommand \ref{sec:magic}
1949
1998
1950 \end_inset
1999 \end_inset
1951
2000
1952 for more on this and other magic commands, or type the name of any magic
2001 for more on this and other magic commands, or type the name of any magic
1953 command and ? to get details on it.
2002 command and ? to get details on it.
1954 See also sec.
2003 See also sec.
1955
2004
1956 \begin_inset LatexCommand \ref{sec:dreload}
2005 \begin_inset LatexCommand \ref{sec:dreload}
1957
2006
1958 \end_inset
2007 \end_inset
1959
2008
1960 for a recursive reload command.
2009 for a recursive reload command.
1961 \newline
2010 \newline
1962
2011
1963 \family typewriter
2012 \family typewriter
1964 %run
2013 %run
1965 \family default
2014 \family default
1966 also has special flags for timing the execution of your scripts (
2015 also has special flags for timing the execution of your scripts (
1967 \family typewriter
2016 \family typewriter
1968 -t
2017 -t
1969 \family default
2018 \family default
1970 ) and for executing them under the control of either Python's
2019 ) and for executing them under the control of either Python's
1971 \family typewriter
2020 \family typewriter
1972 pdb
2021 pdb
1973 \family default
2022 \family default
1974 debugger (
2023 debugger (
1975 \family typewriter
2024 \family typewriter
1976 -d
2025 -d
1977 \family default
2026 \family default
1978 ) or profiler (
2027 ) or profiler (
1979 \family typewriter
2028 \family typewriter
1980 -p
2029 -p
1981 \family default
2030 \family default
1982 ).
2031 ).
1983 With all of these,
2032 With all of these,
1984 \family typewriter
2033 \family typewriter
1985 %run
2034 %run
1986 \family default
2035 \family default
1987 can be used as the main tool for efficient interactive development of code
2036 can be used as the main tool for efficient interactive development of code
1988 which you write in your editor of choice.
2037 which you write in your editor of choice.
1989 \layout Itemize
2038 \layout Itemize
1990
2039
1991 Use the Python debugger,
2040 Use the Python debugger,
1992 \family typewriter
2041 \family typewriter
1993 pdb
2042 pdb
1994 \family default
2043 \family default
1995
2044
1996 \begin_inset Foot
2045 \begin_inset Foot
1997 collapsed true
2046 collapsed true
1998
2047
1999 \layout Standard
2048 \layout Standard
2000
2049
2001 Thanks to Christian Hart and Matthew Arnison for the suggestions leading
2050 Thanks to Christian Hart and Matthew Arnison for the suggestions leading
2002 to IPython's improved debugger and profiler support.
2051 to IPython's improved debugger and profiler support.
2003 \end_inset
2052 \end_inset
2004
2053
2005 .
2054 .
2006 The
2055 The
2007 \family typewriter
2056 \family typewriter
2008 %pdb
2057 %pdb
2009 \family default
2058 \family default
2010 command allows you to toggle on and off the automatic invocation of an
2059 command allows you to toggle on and off the automatic invocation of an
2011 IPython-enhanced
2060 IPython-enhanced
2012 \family typewriter
2061 \family typewriter
2013 pdb
2062 pdb
2014 \family default
2063 \family default
2015 debugger (with coloring, tab completion and more) at any uncaught exception.
2064 debugger (with coloring, tab completion and more) at any uncaught exception.
2016 The advantage of this is that
2065 The advantage of this is that
2017 \family typewriter
2066 \family typewriter
2018 pdb
2067 pdb
2019 \family default
2068 \family default
2020 starts
2069 starts
2021 \emph on
2070 \emph on
2022 inside
2071 inside
2023 \emph default
2072 \emph default
2024 the function where the exception occurred, with all data still available.
2073 the function where the exception occurred, with all data still available.
2025 You can print variables, see code, execute statements and even walk up
2074 You can print variables, see code, execute statements and even walk up
2026 and down the call stack to track down the true source of the problem (which
2075 and down the call stack to track down the true source of the problem (which
2027 often is many layers in the stack above where the exception gets triggered).
2076 often is many layers in the stack above where the exception gets triggered).
2028 \newline
2077 \newline
2029 Running programs with
2078 Running programs with
2030 \family typewriter
2079 \family typewriter
2031 %run
2080 %run
2032 \family default
2081 \family default
2033 and pdb active can be an efficient to develop and debug code, in many cases
2082 and pdb active can be an efficient to develop and debug code, in many cases
2034 eliminating the need for
2083 eliminating the need for
2035 \family typewriter
2084 \family typewriter
2036 print
2085 print
2037 \family default
2086 \family default
2038 statements or external debugging tools.
2087 statements or external debugging tools.
2039 I often simply put a
2088 I often simply put a
2040 \family typewriter
2089 \family typewriter
2041 1/0
2090 1/0
2042 \family default
2091 \family default
2043 in a place where I want to take a look so that pdb gets called, quickly
2092 in a place where I want to take a look so that pdb gets called, quickly
2044 view whatever variables I need to or test various pieces of code and then
2093 view whatever variables I need to or test various pieces of code and then
2045 remove the
2094 remove the
2046 \family typewriter
2095 \family typewriter
2047 1/0
2096 1/0
2048 \family default
2097 \family default
2049 .
2098 .
2050 \newline
2099 \newline
2051 Note also that `
2100 Note also that `
2052 \family typewriter
2101 \family typewriter
2053 %run -d
2102 %run -d
2054 \family default
2103 \family default
2055 ' activates
2104 ' activates
2056 \family typewriter
2105 \family typewriter
2057 pdb
2106 pdb
2058 \family default
2107 \family default
2059 and automatically sets initial breakpoints for you to step through your
2108 and automatically sets initial breakpoints for you to step through your
2060 code, watch variables, etc.
2109 code, watch variables, etc.
2061 See Sec.\SpecialChar ~
2110 See Sec.\SpecialChar ~
2062
2111
2063 \begin_inset LatexCommand \ref{sec:cache_output}
2112 \begin_inset LatexCommand \ref{sec:cache_output}
2064
2113
2065 \end_inset
2114 \end_inset
2066
2115
2067 for details.
2116 for details.
2068 \layout Itemize
2117 \layout Itemize
2069
2118
2070 Use the output cache.
2119 Use the output cache.
2071 All output results are automatically stored in a global dictionary named
2120 All output results are automatically stored in a global dictionary named
2072
2121
2073 \family typewriter
2122 \family typewriter
2074 Out
2123 Out
2075 \family default
2124 \family default
2076 and variables named
2125 and variables named
2077 \family typewriter
2126 \family typewriter
2078 _1
2127 _1
2079 \family default
2128 \family default
2080 ,
2129 ,
2081 \family typewriter
2130 \family typewriter
2082 _2
2131 _2
2083 \family default
2132 \family default
2084 , etc.
2133 , etc.
2085 alias them.
2134 alias them.
2086 For example, the result of input line 4 is available either as
2135 For example, the result of input line 4 is available either as
2087 \family typewriter
2136 \family typewriter
2088 Out[4]
2137 Out[4]
2089 \family default
2138 \family default
2090 or as
2139 or as
2091 \family typewriter
2140 \family typewriter
2092 _4
2141 _4
2093 \family default
2142 \family default
2094 .
2143 .
2095 Additionally, three variables named
2144 Additionally, three variables named
2096 \family typewriter
2145 \family typewriter
2097 _
2146 _
2098 \family default
2147 \family default
2099 ,
2148 ,
2100 \family typewriter
2149 \family typewriter
2101 __
2150 __
2102 \family default
2151 \family default
2103 and
2152 and
2104 \family typewriter
2153 \family typewriter
2105 ___
2154 ___
2106 \family default
2155 \family default
2107 are always kept updated with the for the last three results.
2156 are always kept updated with the for the last three results.
2108 This allows you to recall any previous result and further use it for new
2157 This allows you to recall any previous result and further use it for new
2109 calculations.
2158 calculations.
2110 See Sec.\SpecialChar ~
2159 See Sec.\SpecialChar ~
2111
2160
2112 \begin_inset LatexCommand \ref{sec:cache_output}
2161 \begin_inset LatexCommand \ref{sec:cache_output}
2113
2162
2114 \end_inset
2163 \end_inset
2115
2164
2116 for more.
2165 for more.
2117 \layout Itemize
2166 \layout Itemize
2118
2167
2119 Put a '
2168 Put a '
2120 \family typewriter
2169 \family typewriter
2121 ;
2170 ;
2122 \family default
2171 \family default
2123 ' at the end of a line to supress the printing of output.
2172 ' at the end of a line to supress the printing of output.
2124 This is useful when doing calculations which generate long output you are
2173 This is useful when doing calculations which generate long output you are
2125 not interested in seeing.
2174 not interested in seeing.
2126 The
2175 The
2127 \family typewriter
2176 \family typewriter
2128 _*
2177 _*
2129 \family default
2178 \family default
2130 variables and the
2179 variables and the
2131 \family typewriter
2180 \family typewriter
2132 Out[]
2181 Out[]
2133 \family default
2182 \family default
2134 list do get updated with the contents of the output, even if it is not
2183 list do get updated with the contents of the output, even if it is not
2135 printed.
2184 printed.
2136 You can thus still access the generated results this way for further processing.
2185 You can thus still access the generated results this way for further processing.
2137 \layout Itemize
2186 \layout Itemize
2138
2187
2139 A similar system exists for caching input.
2188 A similar system exists for caching input.
2140 All input is stored in a global list called
2189 All input is stored in a global list called
2141 \family typewriter
2190 \family typewriter
2142 In
2191 In
2143 \family default
2192 \family default
2144 , so you can re-execute lines 22 through 28 plus line 34 by typing
2193 , so you can re-execute lines 22 through 28 plus line 34 by typing
2145 \family typewriter
2194 \family typewriter
2146 'exec In[22:29]+In[34]'
2195 'exec In[22:29]+In[34]'
2147 \family default
2196 \family default
2148 (using Python slicing notation).
2197 (using Python slicing notation).
2149 If you need to execute the same set of lines often, you can assign them
2198 If you need to execute the same set of lines often, you can assign them
2150 to a macro with the
2199 to a macro with the
2151 \family typewriter
2200 \family typewriter
2152 %macro
2201 %macro
2153 \family default
2202 \family default
2154
2203
2155 \family typewriter
2204 \family typewriter
2156 function.
2205 function.
2157
2206
2158 \family default
2207 \family default
2159 See sec.
2208 See sec.
2160
2209
2161 \begin_inset LatexCommand \ref{sec:cache_input}
2210 \begin_inset LatexCommand \ref{sec:cache_input}
2162
2211
2163 \end_inset
2212 \end_inset
2164
2213
2165 for more.
2214 for more.
2166 \layout Itemize
2215 \layout Itemize
2167
2216
2168 Use your input history.
2217 Use your input history.
2169 The
2218 The
2170 \family typewriter
2219 \family typewriter
2171 %hist
2220 %hist
2172 \family default
2221 \family default
2173 command can show you all previous input, without line numbers if desired
2222 command can show you all previous input, without line numbers if desired
2174 (option
2223 (option
2175 \family typewriter
2224 \family typewriter
2176 -n
2225 -n
2177 \family default
2226 \family default
2178 ) so you can directly copy and paste code either back in IPython or in a
2227 ) so you can directly copy and paste code either back in IPython or in a
2179 text editor.
2228 text editor.
2180 You can also save all your history by turning on logging via
2229 You can also save all your history by turning on logging via
2181 \family typewriter
2230 \family typewriter
2182 %logstart
2231 %logstart
2183 \family default
2232 \family default
2184 ; these logs can later be either reloaded as IPython sessions or used as
2233 ; these logs can later be either reloaded as IPython sessions or used as
2185 code for your programs.
2234 code for your programs.
2186 \layout Itemize
2235 \layout Itemize
2187
2236
2188 Define your own macros with
2237 Define your own macros with
2189 \family typewriter
2238 \family typewriter
2190 %macro
2239 %macro
2191 \family default
2240 \family default
2192 .
2241 .
2193 This can be useful for automating sequences of expressions when working
2242 This can be useful for automating sequences of expressions when working
2194 interactively.
2243 interactively.
2195 \layout Itemize
2244 \layout Itemize
2196
2245
2197 Define your own system aliases.
2246 Define your own system aliases.
2198 Even though IPython gives you access to your system shell via the
2247 Even though IPython gives you access to your system shell via the
2199 \family typewriter
2248 \family typewriter
2200 !
2249 !
2201 \family default
2250 \family default
2202 prefix, it is convenient to have aliases to the system commands you use
2251 prefix, it is convenient to have aliases to the system commands you use
2203 most often.
2252 most often.
2204 This allows you to work seamlessly from inside IPython with the same commands
2253 This allows you to work seamlessly from inside IPython with the same commands
2205 you are used to in your system shell.
2254 you are used to in your system shell.
2206 \newline
2255 \newline
2207 IPython comes with some pre-defined aliases and a complete system for changing
2256 IPython comes with some pre-defined aliases and a complete system for changing
2208 directories, both via a stack (see
2257 directories, both via a stack (see
2209 \family typewriter
2258 \family typewriter
2210 %pushd
2259 %pushd
2211 \family default
2260 \family default
2212 ,
2261 ,
2213 \family typewriter
2262 \family typewriter
2214 %popd
2263 %popd
2215 \family default
2264 \family default
2216 and
2265 and
2217 \family typewriter
2266 \family typewriter
2218 %ds
2267 %ds
2219 \family default
2268 \family default
2220 ) and via direct
2269 ) and via direct
2221 \family typewriter
2270 \family typewriter
2222 %cd
2271 %cd
2223 \family default
2272 \family default
2224 .
2273 .
2225 The latter keeps a history of visited directories and allows you to go
2274 The latter keeps a history of visited directories and allows you to go
2226 to any previously visited one.
2275 to any previously visited one.
2227 \layout Itemize
2276 \layout Itemize
2228
2277
2229 Use Python to manipulate the results of system commands.
2278 Use Python to manipulate the results of system commands.
2230 The `
2279 The `
2231 \family typewriter
2280 \family typewriter
2232 !!
2281 !!
2233 \family default
2282 \family default
2234 ' special syntax, and the
2283 ' special syntax, and the
2235 \family typewriter
2284 \family typewriter
2236 %sc
2285 %sc
2237 \family default
2286 \family default
2238 and
2287 and
2239 \family typewriter
2288 \family typewriter
2240 %sx
2289 %sx
2241 \family default
2290 \family default
2242 magic commands allow you to capture system output into Python variables.
2291 magic commands allow you to capture system output into Python variables.
2243 \layout Itemize
2292 \layout Itemize
2244
2293
2245 Expand python variables when calling the shell (either via
2294 Expand python variables when calling the shell (either via
2246 \family typewriter
2295 \family typewriter
2247 `!'
2296 `!'
2248 \family default
2297 \family default
2249 and
2298 and
2250 \family typewriter
2299 \family typewriter
2251 `!!'
2300 `!!'
2252 \family default
2301 \family default
2253 or via aliases) by prepending a
2302 or via aliases) by prepending a
2254 \family typewriter
2303 \family typewriter
2255 $
2304 $
2256 \family default
2305 \family default
2257 in front of them.
2306 in front of them.
2258 You can also expand complete python expressions.
2307 You can also expand complete python expressions.
2259 See sec.\SpecialChar ~
2308 See sec.\SpecialChar ~
2260
2309
2261 \begin_inset LatexCommand \ref{sub:System-shell-access}
2310 \begin_inset LatexCommand \ref{sub:System-shell-access}
2262
2311
2263 \end_inset
2312 \end_inset
2264
2313
2265 for more.
2314 for more.
2266 \layout Itemize
2315 \layout Itemize
2267
2316
2268 Use profiles to maintain different configurations (modules to load, function
2317 Use profiles to maintain different configurations (modules to load, function
2269 definitions, option settings) for particular tasks.
2318 definitions, option settings) for particular tasks.
2270 You can then have customized versions of IPython for specific purposes.
2319 You can then have customized versions of IPython for specific purposes.
2271 See sec.\SpecialChar ~
2320 See sec.\SpecialChar ~
2272
2321
2273 \begin_inset LatexCommand \ref{sec:profiles}
2322 \begin_inset LatexCommand \ref{sec:profiles}
2274
2323
2275 \end_inset
2324 \end_inset
2276
2325
2277 for more.
2326 for more.
2278 \layout Itemize
2327 \layout Itemize
2279
2328
2280 Embed IPython in your programs.
2329 Embed IPython in your programs.
2281 A few lines of code are enough to load a complete IPython inside your own
2330 A few lines of code are enough to load a complete IPython inside your own
2282 programs, giving you the ability to work with your data interactively after
2331 programs, giving you the ability to work with your data interactively after
2283 automatic processing has been completed.
2332 automatic processing has been completed.
2284 See sec.\SpecialChar ~
2333 See sec.\SpecialChar ~
2285
2334
2286 \begin_inset LatexCommand \ref{sec:embed}
2335 \begin_inset LatexCommand \ref{sec:embed}
2287
2336
2288 \end_inset
2337 \end_inset
2289
2338
2290 for more.
2339 for more.
2291 \layout Itemize
2340 \layout Itemize
2292
2341
2293 Use the Python profiler.
2342 Use the Python profiler.
2294 When dealing with performance issues, the
2343 When dealing with performance issues, the
2295 \family typewriter
2344 \family typewriter
2296 %run
2345 %run
2297 \family default
2346 \family default
2298 command with a
2347 command with a
2299 \family typewriter
2348 \family typewriter
2300 -p
2349 -p
2301 \family default
2350 \family default
2302 option allows you to run complete programs under the control of the Python
2351 option allows you to run complete programs under the control of the Python
2303 profiler.
2352 profiler.
2304 The
2353 The
2305 \family typewriter
2354 \family typewriter
2306 %prun
2355 %prun
2307 \family default
2356 \family default
2308 command does a similar job for single Python expressions (like function
2357 command does a similar job for single Python expressions (like function
2309 calls).
2358 calls).
2310 \layout Itemize
2359 \layout Itemize
2311
2360
2312 Use
2361 Use
2313 \family typewriter
2362 \family typewriter
2314 %edit
2363 %edit
2315 \family default
2364 \family default
2316 to have almost multiline editing.
2365 to have almost multiline editing.
2317 While IPython doesn't support true multiline editing, this command allows
2366 While IPython doesn't support true multiline editing, this command allows
2318 you to call an editor on the spot, and IPython will execute the code you
2367 you to call an editor on the spot, and IPython will execute the code you
2319 type in there as if it were typed interactively.
2368 type in there as if it were typed interactively.
2320 \layout Itemize
2369 \layout Itemize
2321
2370
2322 Use the IPython.demo.Demo class to load any Python script as an interactive
2371 Use the IPython.demo.Demo class to load any Python script as an interactive
2323 demo.
2372 demo.
2324 With a minimal amount of simple markup, you can control the execution of
2373 With a minimal amount of simple markup, you can control the execution of
2325 the script, stopping as needed.
2374 the script, stopping as needed.
2326 See sec.\SpecialChar ~
2375 See sec.\SpecialChar ~
2327
2376
2328 \begin_inset LatexCommand \ref{sec:interactive-demos}
2377 \begin_inset LatexCommand \ref{sec:interactive-demos}
2329
2378
2330 \end_inset
2379 \end_inset
2331
2380
2332 for more.
2381 for more.
2333 \layout Standard
2382 \layout Standard
2334
2383
2335
2384
2336 \series bold
2385 \series bold
2337 Effective logging:
2386 Effective logging:
2338 \series default
2387 \series default
2339 a very useful suggestion sent in by Robert Kern follows
2388 a very useful suggestion sent in by Robert Kern follows
2340 \layout Standard
2389 \layout Standard
2341
2390
2342 I recently happened on a nifty way to keep tidy per-project log files.
2391 I recently happened on a nifty way to keep tidy per-project log files.
2343 I made a profile for my project (which is called "parkfield").
2392 I made a profile for my project (which is called "parkfield").
2344 \layout LyX-Code
2393 \layout LyX-Code
2345
2394
2346 include ipythonrc
2395 include ipythonrc
2347 \layout LyX-Code
2396 \layout LyX-Code
2348
2397
2349 logfile '' # cancel earlier logfile invocation
2398 logfile '' # cancel earlier logfile invocation
2350 \layout LyX-Code
2399 \layout LyX-Code
2351
2400
2352 execute import time
2401 execute import time
2353 \layout LyX-Code
2402 \layout LyX-Code
2354
2403
2355 execute __cmd = '/Users/kern/research/logfiles/parkfield-%s.log rotate'
2404 execute __cmd = '/Users/kern/research/logfiles/parkfield-%s.log rotate'
2356 \layout LyX-Code
2405 \layout LyX-Code
2357
2406
2358 execute __IP.magic_logstart(__cmd % time.strftime('%Y-%m-%d'))
2407 execute __IP.magic_logstart(__cmd % time.strftime('%Y-%m-%d'))
2359 \layout Standard
2408 \layout Standard
2360
2409
2361 I also added a shell alias for convenience:
2410 I also added a shell alias for convenience:
2362 \layout LyX-Code
2411 \layout LyX-Code
2363
2412
2364 alias parkfield="ipython -pylab -profile parkfield"
2413 alias parkfield="ipython -pylab -profile parkfield"
2365 \layout Standard
2414 \layout Standard
2366
2415
2367 Now I have a nice little directory with everything I ever type in, organized
2416 Now I have a nice little directory with everything I ever type in, organized
2368 by project and date.
2417 by project and date.
2369 \layout Standard
2418 \layout Standard
2370
2419
2371
2420
2372 \series bold
2421 \series bold
2373 Contribute your own:
2422 Contribute your own:
2374 \series default
2423 \series default
2375 If you have your own favorite tip on using IPython efficiently for a certain
2424 If you have your own favorite tip on using IPython efficiently for a certain
2376 task (especially things which can't be done in the normal Python interpreter),
2425 task (especially things which can't be done in the normal Python interpreter),
2377 don't hesitate to send it!
2426 don't hesitate to send it!
2378 \layout Section
2427 \layout Section
2379
2428
2380 Command-line use
2429 Command-line use
2381 \layout Standard
2430 \layout Standard
2382
2431
2383 You start IPython with the command:
2432 You start IPython with the command:
2384 \layout Standard
2433 \layout Standard
2385
2434
2386
2435
2387 \family typewriter
2436 \family typewriter
2388 $ ipython [options] files
2437 $ ipython [options] files
2389 \layout Standard
2438 \layout Standard
2390
2439
2391 If invoked with no options, it executes all the files listed in sequence
2440 If invoked with no options, it executes all the files listed in sequence
2392 and drops you into the interpreter while still acknowledging any options
2441 and drops you into the interpreter while still acknowledging any options
2393 you may have set in your ipythonrc file.
2442 you may have set in your ipythonrc file.
2394 This behavior is different from standard Python, which when called as
2443 This behavior is different from standard Python, which when called as
2395 \family typewriter
2444 \family typewriter
2396 python -i
2445 python -i
2397 \family default
2446 \family default
2398 will only execute one file and ignore your configuration setup.
2447 will only execute one file and ignore your configuration setup.
2399 \layout Standard
2448 \layout Standard
2400
2449
2401 Please note that some of the configuration options are not available at
2450 Please note that some of the configuration options are not available at
2402 the command line, simply because they are not practical here.
2451 the command line, simply because they are not practical here.
2403 Look into your ipythonrc configuration file for details on those.
2452 Look into your ipythonrc configuration file for details on those.
2404 This file typically installed in the
2453 This file typically installed in the
2405 \family typewriter
2454 \family typewriter
2406 $HOME/.ipython
2455 $HOME/.ipython
2407 \family default
2456 \family default
2408 directory.
2457 directory.
2409 For Windows users,
2458 For Windows users,
2410 \family typewriter
2459 \family typewriter
2411 $HOME
2460 $HOME
2412 \family default
2461 \family default
2413 resolves to
2462 resolves to
2414 \family typewriter
2463 \family typewriter
2415 C:
2464 C:
2416 \backslash
2465 \backslash
2417
2466
2418 \backslash
2467 \backslash
2419 Documents and Settings
2468 Documents and Settings
2420 \backslash
2469 \backslash
2421
2470
2422 \backslash
2471 \backslash
2423 YourUserName
2472 YourUserName
2424 \family default
2473 \family default
2425 in most instances.
2474 in most instances.
2426 In the rest of this text, we will refer to this directory as
2475 In the rest of this text, we will refer to this directory as
2427 \family typewriter
2476 \family typewriter
2428 IPYTHONDIR
2477 IPYTHONDIR
2429 \family default
2478 \family default
2430 .
2479 .
2431 \layout Subsection
2480 \layout Subsection
2432
2481
2433
2482
2434 \begin_inset LatexCommand \label{sec:threading-opts}
2483 \begin_inset LatexCommand \label{sec:threading-opts}
2435
2484
2436 \end_inset
2485 \end_inset
2437
2486
2438 Special Threading Options
2487 Special Threading Options
2439 \layout Standard
2488 \layout Standard
2440
2489
2441 The following special options are ONLY valid at the beginning of the command
2490 The following special options are ONLY valid at the beginning of the command
2442 line, and not later.
2491 line, and not later.
2443 This is because they control the initial- ization of ipython itself, before
2492 This is because they control the initial- ization of ipython itself, before
2444 the normal option-handling mechanism is active.
2493 the normal option-handling mechanism is active.
2445 \layout List
2494 \layout List
2446 \labelwidthstring 00.00.0000
2495 \labelwidthstring 00.00.0000
2447
2496
2448
2497
2449 \family typewriter
2498 \family typewriter
2450 \series bold
2499 \series bold
2451 -gthread,\SpecialChar ~
2500 -gthread,\SpecialChar ~
2452 -qthread,\SpecialChar ~
2501 -qthread,\SpecialChar ~
2453 -wthread,\SpecialChar ~
2502 -wthread,\SpecialChar ~
2454 -pylab:
2503 -pylab:
2455 \family default
2504 \family default
2456 \series default
2505 \series default
2457 Only
2506 Only
2458 \emph on
2507 \emph on
2459 one
2508 one
2460 \emph default
2509 \emph default
2461 of these can be given, and it can only be given as the first option passed
2510 of these can be given, and it can only be given as the first option passed
2462 to IPython (it will have no effect in any other position).
2511 to IPython (it will have no effect in any other position).
2463 They provide threading support for the GTK Qt and WXPython toolkits, and
2512 They provide threading support for the GTK Qt and WXPython toolkits, and
2464 for the matplotlib library.
2513 for the matplotlib library.
2465 \layout List
2514 \layout List
2466 \labelwidthstring 00.00.0000
2515 \labelwidthstring 00.00.0000
2467
2516
2468 \SpecialChar ~
2517 \SpecialChar ~
2469 With any of the first three options, IPython starts running a separate
2518 With any of the first three options, IPython starts running a separate
2470 thread for the graphical toolkit's operation, so that you can open and
2519 thread for the graphical toolkit's operation, so that you can open and
2471 control graphical elements from within an IPython command line, without
2520 control graphical elements from within an IPython command line, without
2472 blocking.
2521 blocking.
2473 All three provide essentially the same functionality, respectively for
2522 All three provide essentially the same functionality, respectively for
2474 GTK, QT and WXWidgets (via their Python interfaces).
2523 GTK, QT and WXWidgets (via their Python interfaces).
2475 \layout List
2524 \layout List
2476 \labelwidthstring 00.00.0000
2525 \labelwidthstring 00.00.0000
2477
2526
2478 \SpecialChar ~
2527 \SpecialChar ~
2528 Note that with
2529 \family typewriter
2530 -wthread
2531 \family default
2532 , you can additionally use the -wxversion option to request a specific version
2533 of wx to be used.
2534 This requires that you have the
2535 \family typewriter
2536 wxversion
2537 \family default
2538 Python module installed, which is part of recent wxPython distributions.
2539 \layout List
2540 \labelwidthstring 00.00.0000
2541
2542 \SpecialChar ~
2479 If
2543 If
2480 \family typewriter
2544 \family typewriter
2481 -pylab
2545 -pylab
2482 \family default
2546 \family default
2483 is given, IPython loads special support for the mat plotlib library (
2547 is given, IPython loads special support for the mat plotlib library (
2484 \begin_inset LatexCommand \htmlurl{http://matplotlib.sourceforge.net}
2548 \begin_inset LatexCommand \htmlurl{http://matplotlib.sourceforge.net}
2485
2549
2486 \end_inset
2550 \end_inset
2487
2551
2488 ), allowing interactive usage of any of its backends as defined in the user's
2552 ), allowing interactive usage of any of its backends as defined in the user's
2489
2553
2490 \family typewriter
2554 \family typewriter
2491 ~/.matplotlib/matplotlibrc
2555 ~/.matplotlib/matplotlibrc
2492 \family default
2556 \family default
2493 file.
2557 file.
2494 It automatically activates GTK, Qt or WX threading for IPyhton if the choice
2558 It automatically activates GTK, Qt or WX threading for IPyhton if the choice
2495 of matplotlib backend requires it.
2559 of matplotlib backend requires it.
2496 It also modifies the
2560 It also modifies the
2497 \family typewriter
2561 \family typewriter
2498 %run
2562 %run
2499 \family default
2563 \family default
2500 command to correctly execute (without blocking) any matplotlib-based script
2564 command to correctly execute (without blocking) any matplotlib-based script
2501 which calls
2565 which calls
2502 \family typewriter
2566 \family typewriter
2503 show()
2567 show()
2504 \family default
2568 \family default
2505 at the end.
2569 at the end.
2506
2570
2507 \layout List
2571 \layout List
2508 \labelwidthstring 00.00.0000
2572 \labelwidthstring 00.00.0000
2509
2573
2510
2574
2511 \family typewriter
2575 \family typewriter
2512 \series bold
2576 \series bold
2513 -tk
2577 -tk
2514 \family default
2578 \family default
2515 \series default
2579 \series default
2516 The
2580 The
2517 \family typewriter
2581 \family typewriter
2518 -g/q/wthread
2582 -g/q/wthread
2519 \family default
2583 \family default
2520 options, and
2584 options, and
2521 \family typewriter
2585 \family typewriter
2522 -pylab
2586 -pylab
2523 \family default
2587 \family default
2524 (if matplotlib is configured to use GTK, Qt or WX), will normally block
2588 (if matplotlib is configured to use GTK, Qt or WX), will normally block
2525 Tk graphical interfaces.
2589 Tk graphical interfaces.
2526 This means that when either GTK, Qt or WX threading is active, any attempt
2590 This means that when either GTK, Qt or WX threading is active, any attempt
2527 to open a Tk GUI will result in a dead window, and possibly cause the Python
2591 to open a Tk GUI will result in a dead window, and possibly cause the Python
2528 interpreter to crash.
2592 interpreter to crash.
2529 An extra option,
2593 An extra option,
2530 \family typewriter
2594 \family typewriter
2531 -tk
2595 -tk
2532 \family default
2596 \family default
2533 , is available to address this issue.
2597 , is available to address this issue.
2534 It can
2598 It can
2535 \emph on
2599 \emph on
2536 only
2600 only
2537 \emph default
2601 \emph default
2538 be given as a
2602 be given as a
2539 \emph on
2603 \emph on
2540 second
2604 second
2541 \emph default
2605 \emph default
2542 option after any of the above (
2606 option after any of the above (
2543 \family typewriter
2607 \family typewriter
2544 -gthread
2608 -gthread
2545 \family default
2609 \family default
2546 ,
2610 ,
2547 \family typewriter
2611 \family typewriter
2548 -wthread
2612 -wthread
2549 \family default
2613 \family default
2550 or
2614 or
2551 \family typewriter
2615 \family typewriter
2552 -pylab
2616 -pylab
2553 \family default
2617 \family default
2554 ).
2618 ).
2555 \layout List
2619 \layout List
2556 \labelwidthstring 00.00.0000
2620 \labelwidthstring 00.00.0000
2557
2621
2558 \SpecialChar ~
2622 \SpecialChar ~
2559 If
2623 If
2560 \family typewriter
2624 \family typewriter
2561 -tk
2625 -tk
2562 \family default
2626 \family default
2563 is given, IPython will try to coordinate Tk threading with GTK, Qt or WX.
2627 is given, IPython will try to coordinate Tk threading with GTK, Qt or WX.
2564 This is however potentially unreliable, and you will have to test on your
2628 This is however potentially unreliable, and you will have to test on your
2565 platform and Python configuration to determine whether it works for you.
2629 platform and Python configuration to determine whether it works for you.
2566 Debian users have reported success, apparently due to the fact that Debian
2630 Debian users have reported success, apparently due to the fact that Debian
2567 builds all of Tcl, Tk, Tkinter and Python with pthreads support.
2631 builds all of Tcl, Tk, Tkinter and Python with pthreads support.
2568 Under other Linux environments (such as Fedora Core 2/3), this option has
2632 Under other Linux environments (such as Fedora Core 2/3), this option has
2569 caused random crashes and lockups of the Python interpreter.
2633 caused random crashes and lockups of the Python interpreter.
2570 Under other operating systems (Mac OSX and Windows), you'll need to try
2634 Under other operating systems (Mac OSX and Windows), you'll need to try
2571 it to find out, since currently no user reports are available.
2635 it to find out, since currently no user reports are available.
2572 \layout List
2636 \layout List
2573 \labelwidthstring 00.00.0000
2637 \labelwidthstring 00.00.0000
2574
2638
2575 \SpecialChar ~
2639 \SpecialChar ~
2576 There is unfortunately no way for IPython to determine at run time whether
2640 There is unfortunately no way for IPython to determine at run time whether
2577
2641
2578 \family typewriter
2642 \family typewriter
2579 -tk
2643 -tk
2580 \family default
2644 \family default
2581 will work reliably or not, so you will need to do some experiments before
2645 will work reliably or not, so you will need to do some experiments before
2582 relying on it for regular work.
2646 relying on it for regular work.
2583
2647
2584 \layout Subsection
2648 \layout Subsection
2585
2649
2586
2650
2587 \begin_inset LatexCommand \label{sec:cmd-line-opts}
2651 \begin_inset LatexCommand \label{sec:cmd-line-opts}
2588
2652
2589 \end_inset
2653 \end_inset
2590
2654
2591 Regular Options
2655 Regular Options
2592 \layout Standard
2656 \layout Standard
2593
2657
2594 After the above threading options have been given, regular options can follow
2658 After the above threading options have been given, regular options can follow
2595 in any order.
2659 in any order.
2596 All options can be abbreviated to their shortest non-ambiguous form and
2660 All options can be abbreviated to their shortest non-ambiguous form and
2597 are case-sensitive.
2661 are case-sensitive.
2598 One or two dashes can be used.
2662 One or two dashes can be used.
2599 Some options have an alternate short form, indicated after a
2663 Some options have an alternate short form, indicated after a
2600 \family typewriter
2664 \family typewriter
2601 |
2665 |
2602 \family default
2666 \family default
2603 .
2667 .
2604 \layout Standard
2668 \layout Standard
2605
2669
2606 Most options can also be set from your ipythonrc configuration file.
2670 Most options can also be set from your ipythonrc configuration file.
2607 See the provided example for more details on what the options do.
2671 See the provided example for more details on what the options do.
2608 Options given at the command line override the values set in the ipythonrc
2672 Options given at the command line override the values set in the ipythonrc
2609 file.
2673 file.
2610 \layout Standard
2674 \layout Standard
2611
2675
2612 All options with a
2676 All options with a
2613 \family typewriter
2677 \family typewriter
2614 [no]
2678 [no]
2615 \family default
2679 \family default
2616 prepended can be specified in negated form (
2680 prepended can be specified in negated form (
2617 \family typewriter
2681 \family typewriter
2618 -nooption
2682 -nooption
2619 \family default
2683 \family default
2620 instead of
2684 instead of
2621 \family typewriter
2685 \family typewriter
2622 -option
2686 -option
2623 \family default
2687 \family default
2624 ) to turn the feature off.
2688 ) to turn the feature off.
2625 \layout List
2689 \layout List
2626 \labelwidthstring 00.00.0000
2690 \labelwidthstring 00.00.0000
2627
2691
2628
2692
2629 \family typewriter
2693 \family typewriter
2630 \series bold
2694 \series bold
2631 -help
2695 -help
2632 \family default
2696 \family default
2633 \series default
2697 \series default
2634 : print a help message and exit.
2698 : print a help message and exit.
2635 \layout List
2699 \layout List
2636 \labelwidthstring 00.00.0000
2700 \labelwidthstring 00.00.0000
2637
2701
2638
2702
2639 \family typewriter
2703 \family typewriter
2640 \series bold
2704 \series bold
2641 -pylab:
2705 -pylab:
2642 \family default
2706 \family default
2643 \series default
2707 \series default
2644 this can
2708 this can
2645 \emph on
2709 \emph on
2646 only
2710 only
2647 \emph default
2711 \emph default
2648 be given as the
2712 be given as the
2649 \emph on
2713 \emph on
2650 first
2714 first
2651 \emph default
2715 \emph default
2652 option passed to IPython (it will have no effect in any other position).
2716 option passed to IPython (it will have no effect in any other position).
2653 It adds special support for the matplotlib library (
2717 It adds special support for the matplotlib library (
2654 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
2718 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
2655
2719
2656 \end_inset
2720 \end_inset
2657
2721
2658 ), allowing interactive usage of any of its backends as defined in the user's
2722 ), allowing interactive usage of any of its backends as defined in the user's
2659
2723
2660 \family typewriter
2724 \family typewriter
2661 .matplotlibrc
2725 .matplotlibrc
2662 \family default
2726 \family default
2663 file.
2727 file.
2664 It automatically activates GTK or WX threading for IPyhton if the choice
2728 It automatically activates GTK or WX threading for IPyhton if the choice
2665 of matplotlib backend requires it.
2729 of matplotlib backend requires it.
2666 It also modifies the
2730 It also modifies the
2667 \family typewriter
2731 \family typewriter
2668 %run
2732 %run
2669 \family default
2733 \family default
2670 command to correctly execute (without blocking) any matplotlib-based script
2734 command to correctly execute (without blocking) any matplotlib-based script
2671 which calls
2735 which calls
2672 \family typewriter
2736 \family typewriter
2673 show()
2737 show()
2674 \family default
2738 \family default
2675 at the end.
2739 at the end.
2676 See Sec.\SpecialChar ~
2740 See Sec.\SpecialChar ~
2677
2741
2678 \begin_inset LatexCommand \ref{sec:matplotlib-support}
2742 \begin_inset LatexCommand \ref{sec:matplotlib-support}
2679
2743
2680 \end_inset
2744 \end_inset
2681
2745
2682 for more details.
2746 for more details.
2683 \layout List
2747 \layout List
2684 \labelwidthstring 00.00.0000
2748 \labelwidthstring 00.00.0000
2685
2749
2686
2750
2687 \family typewriter
2751 \family typewriter
2688 \series bold
2752 \series bold
2689 -autocall <val>:
2753 -autocall <val>:
2690 \family default
2754 \family default
2691 \series default
2755 \series default
2692 Make IPython automatically call any callable object even if you didn't
2756 Make IPython automatically call any callable object even if you didn't
2693 type explicit parentheses.
2757 type explicit parentheses.
2694 For example, `str 43' becomes `str(43)' automatically.
2758 For example, `str 43' becomes `str(43)' automatically.
2695 The value can be `0' to disable the feature, `1' for
2759 The value can be `0' to disable the feature, `1' for
2696 \emph on
2760 \emph on
2697 smart
2761 smart
2698 \emph default
2762 \emph default
2699 autocall, where it is not applied if there are no more arguments on the
2763 autocall, where it is not applied if there are no more arguments on the
2700 line, and `2' for
2764 line, and `2' for
2701 \emph on
2765 \emph on
2702 full
2766 full
2703 \emph default
2767 \emph default
2704 autocall, where all callable objects are automatically called (even if
2768 autocall, where all callable objects are automatically called (even if
2705 no arguments are present).
2769 no arguments are present).
2706 The default is `1'.
2770 The default is `1'.
2707 \layout List
2771 \layout List
2708 \labelwidthstring 00.00.0000
2772 \labelwidthstring 00.00.0000
2709
2773
2710
2774
2711 \family typewriter
2775 \family typewriter
2712 \series bold
2776 \series bold
2713 -[no]autoindent:
2777 -[no]autoindent:
2714 \family default
2778 \family default
2715 \series default
2779 \series default
2716 Turn automatic indentation on/off.
2780 Turn automatic indentation on/off.
2717 \layout List
2781 \layout List
2718 \labelwidthstring 00.00.0000
2782 \labelwidthstring 00.00.0000
2719
2783
2720
2784
2721 \family typewriter
2785 \family typewriter
2722 \series bold
2786 \series bold
2723 -[no]automagic
2787 -[no]automagic
2724 \series default
2788 \series default
2725 :
2789 :
2726 \family default
2790 \family default
2727 make magic commands automatic (without needing their first character to
2791 make magic commands automatic (without needing their first character to
2728 be
2792 be
2729 \family typewriter
2793 \family typewriter
2730 %
2794 %
2731 \family default
2795 \family default
2732 ).
2796 ).
2733 Type
2797 Type
2734 \family typewriter
2798 \family typewriter
2735 %magic
2799 %magic
2736 \family default
2800 \family default
2737 at the IPython prompt for more information.
2801 at the IPython prompt for more information.
2738 \layout List
2802 \layout List
2739 \labelwidthstring 00.00.0000
2803 \labelwidthstring 00.00.0000
2740
2804
2741
2805
2742 \family typewriter
2806 \family typewriter
2743 \series bold
2807 \series bold
2744 -[no]autoedit_syntax:
2808 -[no]autoedit_syntax:
2745 \family default
2809 \family default
2746 \series default
2810 \series default
2747 When a syntax error occurs after editing a file, automatically open the
2811 When a syntax error occurs after editing a file, automatically open the
2748 file to the trouble causing line for convenient fixing.
2812 file to the trouble causing line for convenient fixing.
2749
2813
2750 \layout List
2814 \layout List
2751 \labelwidthstring 00.00.0000
2815 \labelwidthstring 00.00.0000
2752
2816
2753
2817
2754 \family typewriter
2818 \family typewriter
2755 \series bold
2819 \series bold
2756 -[no]banner
2820 -[no]banner
2757 \series default
2821 \series default
2758 :
2822 :
2759 \family default
2823 \family default
2760 Print the initial information banner (default on).
2824 Print the initial information banner (default on).
2761 \layout List
2825 \layout List
2762 \labelwidthstring 00.00.0000
2826 \labelwidthstring 00.00.0000
2763
2827
2764
2828
2765 \family typewriter
2829 \family typewriter
2766 \series bold
2830 \series bold
2767 -c\SpecialChar ~
2831 -c\SpecialChar ~
2768 <command>:
2832 <command>:
2769 \family default
2833 \family default
2770 \series default
2834 \series default
2771 execute the given command string, and set sys.argv to
2835 execute the given command string, and set sys.argv to
2772 \family typewriter
2836 \family typewriter
2773 ['c']
2837 ['c']
2774 \family default
2838 \family default
2775 .
2839 .
2776 This is similar to the
2840 This is similar to the
2777 \family typewriter
2841 \family typewriter
2778 -c
2842 -c
2779 \family default
2843 \family default
2780 option in the normal Python interpreter.
2844 option in the normal Python interpreter.
2781
2845
2782 \layout List
2846 \layout List
2783 \labelwidthstring 00.00.0000
2847 \labelwidthstring 00.00.0000
2784
2848
2785
2849
2786 \family typewriter
2850 \family typewriter
2787 \series bold
2851 \series bold
2788 -cache_size|cs\SpecialChar ~
2852 -cache_size|cs\SpecialChar ~
2789 <n>
2853 <n>
2790 \series default
2854 \series default
2791 :
2855 :
2792 \family default
2856 \family default
2793 size of the output cache (maximum number of entries to hold in memory).
2857 size of the output cache (maximum number of entries to hold in memory).
2794 The default is 1000, you can change it permanently in your config file.
2858 The default is 1000, you can change it permanently in your config file.
2795 Setting it to 0 completely disables the caching system, and the minimum
2859 Setting it to 0 completely disables the caching system, and the minimum
2796 value accepted is 20 (if you provide a value less than 20, it is reset
2860 value accepted is 20 (if you provide a value less than 20, it is reset
2797 to 0 and a warning is issued) This limit is defined because otherwise you'll
2861 to 0 and a warning is issued) This limit is defined because otherwise you'll
2798 spend more time re-flushing a too small cache than working.
2862 spend more time re-flushing a too small cache than working.
2799 \layout List
2863 \layout List
2800 \labelwidthstring 00.00.0000
2864 \labelwidthstring 00.00.0000
2801
2865
2802
2866
2803 \family typewriter
2867 \family typewriter
2804 \series bold
2868 \series bold
2805 -classic|cl
2869 -classic|cl
2806 \series default
2870 \series default
2807 :
2871 :
2808 \family default
2872 \family default
2809 Gives IPython a similar feel to the classic Python prompt.
2873 Gives IPython a similar feel to the classic Python prompt.
2810 \layout List
2874 \layout List
2811 \labelwidthstring 00.00.0000
2875 \labelwidthstring 00.00.0000
2812
2876
2813
2877
2814 \family typewriter
2878 \family typewriter
2815 \series bold
2879 \series bold
2816 -colors\SpecialChar ~
2880 -colors\SpecialChar ~
2817 <scheme>:
2881 <scheme>:
2818 \family default
2882 \family default
2819 \series default
2883 \series default
2820 Color scheme for prompts and exception reporting.
2884 Color scheme for prompts and exception reporting.
2821 Currently implemented: NoColor, Linux and LightBG.
2885 Currently implemented: NoColor, Linux and LightBG.
2822 \layout List
2886 \layout List
2823 \labelwidthstring 00.00.0000
2887 \labelwidthstring 00.00.0000
2824
2888
2825
2889
2826 \family typewriter
2890 \family typewriter
2827 \series bold
2891 \series bold
2828 -[no]color_info:
2892 -[no]color_info:
2829 \family default
2893 \family default
2830 \series default
2894 \series default
2831 IPython can display information about objects via a set of functions, and
2895 IPython can display information about objects via a set of functions, and
2832 optionally can use colors for this, syntax highlighting source code and
2896 optionally can use colors for this, syntax highlighting source code and
2833 various other elements.
2897 various other elements.
2834 However, because this information is passed through a pager (like 'less')
2898 However, because this information is passed through a pager (like 'less')
2835 and many pagers get confused with color codes, this option is off by default.
2899 and many pagers get confused with color codes, this option is off by default.
2836 You can test it and turn it on permanently in your ipythonrc file if it
2900 You can test it and turn it on permanently in your ipythonrc file if it
2837 works for you.
2901 works for you.
2838 As a reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
2902 As a reference, the 'less' pager supplied with Mandrake 8.2 works ok, but
2839 that in RedHat 7.2 doesn't.
2903 that in RedHat 7.2 doesn't.
2840 \layout List
2904 \layout List
2841 \labelwidthstring 00.00.0000
2905 \labelwidthstring 00.00.0000
2842
2906
2843 \SpecialChar ~
2907 \SpecialChar ~
2844 Test it and turn it on permanently if it works with your system.
2908 Test it and turn it on permanently if it works with your system.
2845 The magic function
2909 The magic function
2846 \family typewriter
2910 \family typewriter
2847 %color_info
2911 %color_info
2848 \family default
2912 \family default
2849 allows you to toggle this interactively for testing.
2913 allows you to toggle this interactively for testing.
2850 \layout List
2914 \layout List
2851 \labelwidthstring 00.00.0000
2915 \labelwidthstring 00.00.0000
2852
2916
2853
2917
2854 \family typewriter
2918 \family typewriter
2855 \series bold
2919 \series bold
2856 -[no]debug
2920 -[no]debug
2857 \family default
2921 \family default
2858 \series default
2922 \series default
2859 : Show information about the loading process.
2923 : Show information about the loading process.
2860 Very useful to pin down problems with your configuration files or to get
2924 Very useful to pin down problems with your configuration files or to get
2861 details about session restores.
2925 details about session restores.
2862 \layout List
2926 \layout List
2863 \labelwidthstring 00.00.0000
2927 \labelwidthstring 00.00.0000
2864
2928
2865
2929
2866 \family typewriter
2930 \family typewriter
2867 \series bold
2931 \series bold
2868 -[no]deep_reload
2932 -[no]deep_reload
2869 \series default
2933 \series default
2870 :
2934 :
2871 \family default
2935 \family default
2872 IPython can use the
2936 IPython can use the
2873 \family typewriter
2937 \family typewriter
2874 deep_reload
2938 deep_reload
2875 \family default
2939 \family default
2876 module which reloads changes in modules recursively (it replaces the
2940 module which reloads changes in modules recursively (it replaces the
2877 \family typewriter
2941 \family typewriter
2878 reload()
2942 reload()
2879 \family default
2943 \family default
2880 function, so you don't need to change anything to use it).
2944 function, so you don't need to change anything to use it).
2881
2945
2882 \family typewriter
2946 \family typewriter
2883 deep_reload()
2947 deep_reload()
2884 \family default
2948 \family default
2885 forces a full reload of modules whose code may have changed, which the
2949 forces a full reload of modules whose code may have changed, which the
2886 default
2950 default
2887 \family typewriter
2951 \family typewriter
2888 reload()
2952 reload()
2889 \family default
2953 \family default
2890 function does not.
2954 function does not.
2891 \layout List
2955 \layout List
2892 \labelwidthstring 00.00.0000
2956 \labelwidthstring 00.00.0000
2893
2957
2894 \SpecialChar ~
2958 \SpecialChar ~
2895 When deep_reload is off, IPython will use the normal
2959 When deep_reload is off, IPython will use the normal
2896 \family typewriter
2960 \family typewriter
2897 reload()
2961 reload()
2898 \family default
2962 \family default
2899 , but deep_reload will still be available as
2963 , but deep_reload will still be available as
2900 \family typewriter
2964 \family typewriter
2901 dreload()
2965 dreload()
2902 \family default
2966 \family default
2903 .
2967 .
2904 This feature is off by default [which means that you have both normal
2968 This feature is off by default [which means that you have both normal
2905 \family typewriter
2969 \family typewriter
2906 reload()
2970 reload()
2907 \family default
2971 \family default
2908 and
2972 and
2909 \family typewriter
2973 \family typewriter
2910 dreload()
2974 dreload()
2911 \family default
2975 \family default
2912 ].
2976 ].
2913 \layout List
2977 \layout List
2914 \labelwidthstring 00.00.0000
2978 \labelwidthstring 00.00.0000
2915
2979
2916
2980
2917 \family typewriter
2981 \family typewriter
2918 \series bold
2982 \series bold
2919 -editor\SpecialChar ~
2983 -editor\SpecialChar ~
2920 <name>
2984 <name>
2921 \family default
2985 \family default
2922 \series default
2986 \series default
2923 : Which editor to use with the
2987 : Which editor to use with the
2924 \family typewriter
2988 \family typewriter
2925 %edit
2989 %edit
2926 \family default
2990 \family default
2927 command.
2991 command.
2928 By default, IPython will honor your
2992 By default, IPython will honor your
2929 \family typewriter
2993 \family typewriter
2930 EDITOR
2994 EDITOR
2931 \family default
2995 \family default
2932 environment variable (if not set, vi is the Unix default and notepad the
2996 environment variable (if not set, vi is the Unix default and notepad the
2933 Windows one).
2997 Windows one).
2934 Since this editor is invoked on the fly by IPython and is meant for editing
2998 Since this editor is invoked on the fly by IPython and is meant for editing
2935 small code snippets, you may want to use a small, lightweight editor here
2999 small code snippets, you may want to use a small, lightweight editor here
2936 (in case your default
3000 (in case your default
2937 \family typewriter
3001 \family typewriter
2938 EDITOR
3002 EDITOR
2939 \family default
3003 \family default
2940 is something like Emacs).
3004 is something like Emacs).
2941 \layout List
3005 \layout List
2942 \labelwidthstring 00.00.0000
3006 \labelwidthstring 00.00.0000
2943
3007
2944
3008
2945 \family typewriter
3009 \family typewriter
2946 \series bold
3010 \series bold
2947 -ipythondir\SpecialChar ~
3011 -ipythondir\SpecialChar ~
2948 <name>
3012 <name>
2949 \series default
3013 \series default
2950 :
3014 :
2951 \family default
3015 \family default
2952 name of your IPython configuration directory
3016 name of your IPython configuration directory
2953 \family typewriter
3017 \family typewriter
2954 IPYTHONDIR
3018 IPYTHONDIR
2955 \family default
3019 \family default
2956 .
3020 .
2957 This can also be specified through the environment variable
3021 This can also be specified through the environment variable
2958 \family typewriter
3022 \family typewriter
2959 IPYTHONDIR
3023 IPYTHONDIR
2960 \family default
3024 \family default
2961 .
3025 .
2962 \layout List
3026 \layout List
2963 \labelwidthstring 00.00.0000
3027 \labelwidthstring 00.00.0000
2964
3028
2965
3029
2966 \family typewriter
3030 \family typewriter
2967 \series bold
3031 \series bold
2968 -log|l
3032 -log|l
2969 \family default
3033 \family default
2970 \series default
3034 \series default
2971 : generate a log file of all input.
3035 : generate a log file of all input.
2972 The file is named
3036 The file is named
2973 \family typewriter
3037 \family typewriter
2974 ipython_log.py
3038 ipython_log.py
2975 \family default
3039 \family default
2976 in your current directory (which prevents logs from multiple IPython sessions
3040 in your current directory (which prevents logs from multiple IPython sessions
2977 from trampling each other).
3041 from trampling each other).
2978 You can use this to later restore a session by loading your logfile as
3042 You can use this to later restore a session by loading your logfile as
2979 a file to be executed with option
3043 a file to be executed with option
2980 \family typewriter
3044 \family typewriter
2981 -logplay
3045 -logplay
2982 \family default
3046 \family default
2983 (see below).
3047 (see below).
2984 \layout List
3048 \layout List
2985 \labelwidthstring 00.00.0000
3049 \labelwidthstring 00.00.0000
2986
3050
2987
3051
2988 \family typewriter
3052 \family typewriter
2989 \series bold
3053 \series bold
2990 -logfile|lf\SpecialChar ~
3054 -logfile|lf\SpecialChar ~
2991 <name>
3055 <name>
2992 \series default
3056 \series default
2993 :
3057 :
2994 \family default
3058 \family default
2995 specify the name of your logfile.
3059 specify the name of your logfile.
2996 \layout List
3060 \layout List
2997 \labelwidthstring 00.00.0000
3061 \labelwidthstring 00.00.0000
2998
3062
2999
3063
3000 \family typewriter
3064 \family typewriter
3001 \series bold
3065 \series bold
3002 -logplay|lp\SpecialChar ~
3066 -logplay|lp\SpecialChar ~
3003 <name>
3067 <name>
3004 \series default
3068 \series default
3005 :
3069 :
3006 \family default
3070 \family default
3007 you can replay a previous log.
3071 you can replay a previous log.
3008 For restoring a session as close as possible to the state you left it in,
3072 For restoring a session as close as possible to the state you left it in,
3009 use this option (don't just run the logfile).
3073 use this option (don't just run the logfile).
3010 With
3074 With
3011 \family typewriter
3075 \family typewriter
3012 -logplay
3076 -logplay
3013 \family default
3077 \family default
3014 , IPython will try to reconstruct the previous working environment in full,
3078 , IPython will try to reconstruct the previous working environment in full,
3015 not just execute the commands in the logfile.
3079 not just execute the commands in the logfile.
3016 \layout List
3080 \layout List
3017 \labelwidthstring 00.00.0000
3081 \labelwidthstring 00.00.0000
3018
3082
3019 \SpecialChar ~
3083 \SpecialChar ~
3020 When a session is restored, logging is automatically turned on again with
3084 When a session is restored, logging is automatically turned on again with
3021 the name of the logfile it was invoked with (it is read from the log header).
3085 the name of the logfile it was invoked with (it is read from the log header).
3022 So once you've turned logging on for a session, you can quit IPython and
3086 So once you've turned logging on for a session, you can quit IPython and
3023 reload it as many times as you want and it will continue to log its history
3087 reload it as many times as you want and it will continue to log its history
3024 and restore from the beginning every time.
3088 and restore from the beginning every time.
3025 \layout List
3089 \layout List
3026 \labelwidthstring 00.00.0000
3090 \labelwidthstring 00.00.0000
3027
3091
3028 \SpecialChar ~
3092 \SpecialChar ~
3029 Caveats: there are limitations in this option.
3093 Caveats: there are limitations in this option.
3030 The history variables
3094 The history variables
3031 \family typewriter
3095 \family typewriter
3032 _i*
3096 _i*
3033 \family default
3097 \family default
3034 ,
3098 ,
3035 \family typewriter
3099 \family typewriter
3036 _*
3100 _*
3037 \family default
3101 \family default
3038 and
3102 and
3039 \family typewriter
3103 \family typewriter
3040 _dh
3104 _dh
3041 \family default
3105 \family default
3042 don't get restored properly.
3106 don't get restored properly.
3043 In the future we will try to implement full session saving by writing and
3107 In the future we will try to implement full session saving by writing and
3044 retrieving a 'snapshot' of the memory state of IPython.
3108 retrieving a 'snapshot' of the memory state of IPython.
3045 But our first attempts failed because of inherent limitations of Python's
3109 But our first attempts failed because of inherent limitations of Python's
3046 Pickle module, so this may have to wait.
3110 Pickle module, so this may have to wait.
3047 \layout List
3111 \layout List
3048 \labelwidthstring 00.00.0000
3112 \labelwidthstring 00.00.0000
3049
3113
3050
3114
3051 \family typewriter
3115 \family typewriter
3052 \series bold
3116 \series bold
3053 -[no]messages
3117 -[no]messages
3054 \series default
3118 \series default
3055 :
3119 :
3056 \family default
3120 \family default
3057 Print messages which IPython collects about its startup process (default
3121 Print messages which IPython collects about its startup process (default
3058 on).
3122 on).
3059 \layout List
3123 \layout List
3060 \labelwidthstring 00.00.0000
3124 \labelwidthstring 00.00.0000
3061
3125
3062
3126
3063 \family typewriter
3127 \family typewriter
3064 \series bold
3128 \series bold
3065 -[no]pdb
3129 -[no]pdb
3066 \family default
3130 \family default
3067 \series default
3131 \series default
3068 : Automatically call the pdb debugger after every uncaught exception.
3132 : Automatically call the pdb debugger after every uncaught exception.
3069 If you are used to debugging using pdb, this puts you automatically inside
3133 If you are used to debugging using pdb, this puts you automatically inside
3070 of it after any call (either in IPython or in code called by it) which
3134 of it after any call (either in IPython or in code called by it) which
3071 triggers an exception which goes uncaught.
3135 triggers an exception which goes uncaught.
3072 \layout List
3136 \layout List
3073 \labelwidthstring 00.00.0000
3137 \labelwidthstring 00.00.0000
3074
3138
3075
3139
3076 \family typewriter
3140 \family typewriter
3077 \series bold
3141 \series bold
3078 -[no]pprint
3142 -[no]pprint
3079 \series default
3143 \series default
3080 :
3144 :
3081 \family default
3145 \family default
3082 ipython can optionally use the pprint (pretty printer) module for displaying
3146 ipython can optionally use the pprint (pretty printer) module for displaying
3083 results.
3147 results.
3084 pprint tends to give a nicer display of nested data structures.
3148 pprint tends to give a nicer display of nested data structures.
3085 If you like it, you can turn it on permanently in your config file (default
3149 If you like it, you can turn it on permanently in your config file (default
3086 off).
3150 off).
3087 \layout List
3151 \layout List
3088 \labelwidthstring 00.00.0000
3152 \labelwidthstring 00.00.0000
3089
3153
3090
3154
3091 \family typewriter
3155 \family typewriter
3092 \series bold
3156 \series bold
3093 -profile|p <name>
3157 -profile|p <name>
3094 \series default
3158 \series default
3095 :
3159 :
3096 \family default
3160 \family default
3097 assume that your config file is
3161 assume that your config file is
3098 \family typewriter
3162 \family typewriter
3099 ipythonrc-<name>
3163 ipythonrc-<name>
3100 \family default
3164 \family default
3101 (looks in current dir first, then in
3165 (looks in current dir first, then in
3102 \family typewriter
3166 \family typewriter
3103 IPYTHONDIR
3167 IPYTHONDIR
3104 \family default
3168 \family default
3105 ).
3169 ).
3106 This is a quick way to keep and load multiple config files for different
3170 This is a quick way to keep and load multiple config files for different
3107 tasks, especially if you use the include option of config files.
3171 tasks, especially if you use the include option of config files.
3108 You can keep a basic
3172 You can keep a basic
3109 \family typewriter
3173 \family typewriter
3110 IPYTHONDIR/ipythonrc
3174 IPYTHONDIR/ipythonrc
3111 \family default
3175 \family default
3112 file and then have other 'profiles' which include this one and load extra
3176 file and then have other 'profiles' which include this one and load extra
3113 things for particular tasks.
3177 things for particular tasks.
3114 For example:
3178 For example:
3115 \layout List
3179 \layout List
3116 \labelwidthstring 00.00.0000
3180 \labelwidthstring 00.00.0000
3117
3181
3118
3182
3119 \family typewriter
3183 \family typewriter
3120 \SpecialChar ~
3184 \SpecialChar ~
3121
3185
3122 \family default
3186 \family default
3123 1.
3187 1.
3124
3188
3125 \family typewriter
3189 \family typewriter
3126 $HOME/.ipython/ipythonrc
3190 $HOME/.ipython/ipythonrc
3127 \family default
3191 \family default
3128 : load basic things you always want.
3192 : load basic things you always want.
3129 \layout List
3193 \layout List
3130 \labelwidthstring 00.00.0000
3194 \labelwidthstring 00.00.0000
3131
3195
3132
3196
3133 \family typewriter
3197 \family typewriter
3134 \SpecialChar ~
3198 \SpecialChar ~
3135
3199
3136 \family default
3200 \family default
3137 2.
3201 2.
3138
3202
3139 \family typewriter
3203 \family typewriter
3140 $HOME/.ipython/ipythonrc-math
3204 $HOME/.ipython/ipythonrc-math
3141 \family default
3205 \family default
3142 : load (1) and basic math-related modules.
3206 : load (1) and basic math-related modules.
3143
3207
3144 \layout List
3208 \layout List
3145 \labelwidthstring 00.00.0000
3209 \labelwidthstring 00.00.0000
3146
3210
3147
3211
3148 \family typewriter
3212 \family typewriter
3149 \SpecialChar ~
3213 \SpecialChar ~
3150
3214
3151 \family default
3215 \family default
3152 3.
3216 3.
3153
3217
3154 \family typewriter
3218 \family typewriter
3155 $HOME/.ipython/ipythonrc-numeric
3219 $HOME/.ipython/ipythonrc-numeric
3156 \family default
3220 \family default
3157 : load (1) and Numeric and plotting modules.
3221 : load (1) and Numeric and plotting modules.
3158 \layout List
3222 \layout List
3159 \labelwidthstring 00.00.0000
3223 \labelwidthstring 00.00.0000
3160
3224
3161 \SpecialChar ~
3225 \SpecialChar ~
3162 Since it is possible to create an endless loop by having circular file
3226 Since it is possible to create an endless loop by having circular file
3163 inclusions, IPython will stop if it reaches 15 recursive inclusions.
3227 inclusions, IPython will stop if it reaches 15 recursive inclusions.
3164 \layout List
3228 \layout List
3165 \labelwidthstring 00.00.0000
3229 \labelwidthstring 00.00.0000
3166
3230
3167
3231
3168 \family typewriter
3232 \family typewriter
3169 \series bold
3233 \series bold
3170 -prompt_in1|pi1\SpecialChar ~
3234 -prompt_in1|pi1\SpecialChar ~
3171 <string>:
3235 <string>:
3172 \family default
3236 \family default
3173 \series default
3237 \series default
3174 Specify the string used for input prompts.
3238 Specify the string used for input prompts.
3175 Note that if you are using numbered prompts, the number is represented
3239 Note that if you are using numbered prompts, the number is represented
3176 with a '
3240 with a '
3177 \backslash
3241 \backslash
3178 #' in the string.
3242 #' in the string.
3179 Don't forget to quote strings with spaces embedded in them.
3243 Don't forget to quote strings with spaces embedded in them.
3180 Default: '
3244 Default: '
3181 \family typewriter
3245 \family typewriter
3182 In\SpecialChar ~
3246 In\SpecialChar ~
3183 [
3247 [
3184 \backslash
3248 \backslash
3185 #]:
3249 #]:
3186 \family default
3250 \family default
3187 '.
3251 '.
3188 Sec.\SpecialChar ~
3252 Sec.\SpecialChar ~
3189
3253
3190 \begin_inset LatexCommand \ref{sec:prompts}
3254 \begin_inset LatexCommand \ref{sec:prompts}
3191
3255
3192 \end_inset
3256 \end_inset
3193
3257
3194 discusses in detail all the available escapes to customize your prompts.
3258 discusses in detail all the available escapes to customize your prompts.
3195 \layout List
3259 \layout List
3196 \labelwidthstring 00.00.0000
3260 \labelwidthstring 00.00.0000
3197
3261
3198
3262
3199 \family typewriter
3263 \family typewriter
3200 \series bold
3264 \series bold
3201 -prompt_in2|pi2\SpecialChar ~
3265 -prompt_in2|pi2\SpecialChar ~
3202 <string>:
3266 <string>:
3203 \family default
3267 \family default
3204 \series default
3268 \series default
3205 Similar to the previous option, but used for the continuation prompts.
3269 Similar to the previous option, but used for the continuation prompts.
3206 The special sequence '
3270 The special sequence '
3207 \family typewriter
3271 \family typewriter
3208
3272
3209 \backslash
3273 \backslash
3210 D
3274 D
3211 \family default
3275 \family default
3212 ' is similar to '
3276 ' is similar to '
3213 \family typewriter
3277 \family typewriter
3214
3278
3215 \backslash
3279 \backslash
3216 #
3280 #
3217 \family default
3281 \family default
3218 ', but with all digits replaced dots (so you can have your continuation
3282 ', but with all digits replaced dots (so you can have your continuation
3219 prompt aligned with your input prompt).
3283 prompt aligned with your input prompt).
3220 Default: '
3284 Default: '
3221 \family typewriter
3285 \family typewriter
3222 \SpecialChar ~
3286 \SpecialChar ~
3223 \SpecialChar ~
3287 \SpecialChar ~
3224 \SpecialChar ~
3288 \SpecialChar ~
3225 .
3289 .
3226 \backslash
3290 \backslash
3227 D.:
3291 D.:
3228 \family default
3292 \family default
3229 ' (note three spaces at the start for alignment with '
3293 ' (note three spaces at the start for alignment with '
3230 \family typewriter
3294 \family typewriter
3231 In\SpecialChar ~
3295 In\SpecialChar ~
3232 [
3296 [
3233 \backslash
3297 \backslash
3234 #]
3298 #]
3235 \family default
3299 \family default
3236 ').
3300 ').
3237 \layout List
3301 \layout List
3238 \labelwidthstring 00.00.0000
3302 \labelwidthstring 00.00.0000
3239
3303
3240
3304
3241 \family typewriter
3305 \family typewriter
3242 \series bold
3306 \series bold
3243 -prompt_out|po\SpecialChar ~
3307 -prompt_out|po\SpecialChar ~
3244 <string>:
3308 <string>:
3245 \family default
3309 \family default
3246 \series default
3310 \series default
3247 String used for output prompts, also uses numbers like
3311 String used for output prompts, also uses numbers like
3248 \family typewriter
3312 \family typewriter
3249 prompt_in1
3313 prompt_in1
3250 \family default
3314 \family default
3251 .
3315 .
3252 Default: '
3316 Default: '
3253 \family typewriter
3317 \family typewriter
3254 Out[
3318 Out[
3255 \backslash
3319 \backslash
3256 #]:
3320 #]:
3257 \family default
3321 \family default
3258 '
3322 '
3259 \layout List
3323 \layout List
3260 \labelwidthstring 00.00.0000
3324 \labelwidthstring 00.00.0000
3261
3325
3262
3326
3263 \family typewriter
3327 \family typewriter
3264 \series bold
3328 \series bold
3265 -quick
3329 -quick
3266 \family default
3330 \family default
3267 \series default
3331 \series default
3268 : start in bare bones mode (no config file loaded).
3332 : start in bare bones mode (no config file loaded).
3269 \layout List
3333 \layout List
3270 \labelwidthstring 00.00.0000
3334 \labelwidthstring 00.00.0000
3271
3335
3272
3336
3273 \family typewriter
3337 \family typewriter
3274 \series bold
3338 \series bold
3275 -rcfile\SpecialChar ~
3339 -rcfile\SpecialChar ~
3276 <name>
3340 <name>
3277 \series default
3341 \series default
3278 :
3342 :
3279 \family default
3343 \family default
3280 name of your IPython resource configuration file.
3344 name of your IPython resource configuration file.
3281 Normally IPython loads ipythonrc (from current directory) or
3345 Normally IPython loads ipythonrc (from current directory) or
3282 \family typewriter
3346 \family typewriter
3283 IPYTHONDIR/ipythonrc
3347 IPYTHONDIR/ipythonrc
3284 \family default
3348 \family default
3285 .
3349 .
3286 \layout List
3350 \layout List
3287 \labelwidthstring 00.00.0000
3351 \labelwidthstring 00.00.0000
3288
3352
3289 \SpecialChar ~
3353 \SpecialChar ~
3290 If the loading of your config file fails, IPython starts with a bare bones
3354 If the loading of your config file fails, IPython starts with a bare bones
3291 configuration (no modules loaded at all).
3355 configuration (no modules loaded at all).
3292 \layout List
3356 \layout List
3293 \labelwidthstring 00.00.0000
3357 \labelwidthstring 00.00.0000
3294
3358
3295
3359
3296 \family typewriter
3360 \family typewriter
3297 \series bold
3361 \series bold
3298 -[no]readline
3362 -[no]readline
3299 \family default
3363 \family default
3300 \series default
3364 \series default
3301 : use the readline library, which is needed to support name completion and
3365 : use the readline library, which is needed to support name completion and
3302 command history, among other things.
3366 command history, among other things.
3303 It is enabled by default, but may cause problems for users of X/Emacs in
3367 It is enabled by default, but may cause problems for users of X/Emacs in
3304 Python comint or shell buffers.
3368 Python comint or shell buffers.
3305 \layout List
3369 \layout List
3306 \labelwidthstring 00.00.0000
3370 \labelwidthstring 00.00.0000
3307
3371
3308 \SpecialChar ~
3372 \SpecialChar ~
3309 Note that X/Emacs 'eterm' buffers (opened with
3373 Note that X/Emacs 'eterm' buffers (opened with
3310 \family typewriter
3374 \family typewriter
3311 M-x\SpecialChar ~
3375 M-x\SpecialChar ~
3312 term
3376 term
3313 \family default
3377 \family default
3314 ) support IPython's readline and syntax coloring fine, only 'emacs' (
3378 ) support IPython's readline and syntax coloring fine, only 'emacs' (
3315 \family typewriter
3379 \family typewriter
3316 M-x\SpecialChar ~
3380 M-x\SpecialChar ~
3317 shell
3381 shell
3318 \family default
3382 \family default
3319 and
3383 and
3320 \family typewriter
3384 \family typewriter
3321 C-c\SpecialChar ~
3385 C-c\SpecialChar ~
3322 !
3386 !
3323 \family default
3387 \family default
3324 ) buffers do not.
3388 ) buffers do not.
3325 \layout List
3389 \layout List
3326 \labelwidthstring 00.00.0000
3390 \labelwidthstring 00.00.0000
3327
3391
3328
3392
3329 \family typewriter
3393 \family typewriter
3330 \series bold
3394 \series bold
3331 -screen_length|sl\SpecialChar ~
3395 -screen_length|sl\SpecialChar ~
3332 <n>
3396 <n>
3333 \series default
3397 \series default
3334 :
3398 :
3335 \family default
3399 \family default
3336 number of lines of your screen.
3400 number of lines of your screen.
3337 This is used to control printing of very long strings.
3401 This is used to control printing of very long strings.
3338 Strings longer than this number of lines will be sent through a pager instead
3402 Strings longer than this number of lines will be sent through a pager instead
3339 of directly printed.
3403 of directly printed.
3340 \layout List
3404 \layout List
3341 \labelwidthstring 00.00.0000
3405 \labelwidthstring 00.00.0000
3342
3406
3343 \SpecialChar ~
3407 \SpecialChar ~
3344 The default value for this is 0, which means IPython will auto-detect your
3408 The default value for this is 0, which means IPython will auto-detect your
3345 screen size every time it needs to print certain potentially long strings
3409 screen size every time it needs to print certain potentially long strings
3346 (this doesn't change the behavior of the 'print' keyword, it's only triggered
3410 (this doesn't change the behavior of the 'print' keyword, it's only triggered
3347 internally).
3411 internally).
3348 If for some reason this isn't working well (it needs curses support), specify
3412 If for some reason this isn't working well (it needs curses support), specify
3349 it yourself.
3413 it yourself.
3350 Otherwise don't change the default.
3414 Otherwise don't change the default.
3351 \layout List
3415 \layout List
3352 \labelwidthstring 00.00.0000
3416 \labelwidthstring 00.00.0000
3353
3417
3354
3418
3355 \family typewriter
3419 \family typewriter
3356 \series bold
3420 \series bold
3357 -separate_in|si\SpecialChar ~
3421 -separate_in|si\SpecialChar ~
3358 <string>
3422 <string>
3359 \series default
3423 \series default
3360 :
3424 :
3361 \family default
3425 \family default
3362 separator before input prompts.
3426 separator before input prompts.
3363 Default: '
3427 Default: '
3364 \family typewriter
3428 \family typewriter
3365
3429
3366 \backslash
3430 \backslash
3367 n
3431 n
3368 \family default
3432 \family default
3369 '
3433 '
3370 \layout List
3434 \layout List
3371 \labelwidthstring 00.00.0000
3435 \labelwidthstring 00.00.0000
3372
3436
3373
3437
3374 \family typewriter
3438 \family typewriter
3375 \series bold
3439 \series bold
3376 -separate_out|so\SpecialChar ~
3440 -separate_out|so\SpecialChar ~
3377 <string>
3441 <string>
3378 \family default
3442 \family default
3379 \series default
3443 \series default
3380 : separator before output prompts.
3444 : separator before output prompts.
3381 Default: nothing.
3445 Default: nothing.
3382 \layout List
3446 \layout List
3383 \labelwidthstring 00.00.0000
3447 \labelwidthstring 00.00.0000
3384
3448
3385
3449
3386 \family typewriter
3450 \family typewriter
3387 \series bold
3451 \series bold
3388 -separate_out2|so2\SpecialChar ~
3452 -separate_out2|so2\SpecialChar ~
3389 <string>
3453 <string>
3390 \series default
3454 \series default
3391 :
3455 :
3392 \family default
3456 \family default
3393 separator after output prompts.
3457 separator after output prompts.
3394 Default: nothing.
3458 Default: nothing.
3395 \layout List
3459 \layout List
3396 \labelwidthstring 00.00.0000
3460 \labelwidthstring 00.00.0000
3397
3461
3398 \SpecialChar ~
3462 \SpecialChar ~
3399 For these three options, use the value 0 to specify no separator.
3463 For these three options, use the value 0 to specify no separator.
3400 \layout List
3464 \layout List
3401 \labelwidthstring 00.00.0000
3465 \labelwidthstring 00.00.0000
3402
3466
3403
3467
3404 \family typewriter
3468 \family typewriter
3405 \series bold
3469 \series bold
3406 -nosep
3470 -nosep
3407 \series default
3471 \series default
3408 :
3472 :
3409 \family default
3473 \family default
3410 shorthand for
3474 shorthand for
3411 \family typewriter
3475 \family typewriter
3412 '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'
3476 '-SeparateIn 0 -SeparateOut 0 -SeparateOut2 0'
3413 \family default
3477 \family default
3414 .
3478 .
3415 Simply removes all input/output separators.
3479 Simply removes all input/output separators.
3416 \layout List
3480 \layout List
3417 \labelwidthstring 00.00.0000
3481 \labelwidthstring 00.00.0000
3418
3482
3419
3483
3420 \family typewriter
3484 \family typewriter
3421 \series bold
3485 \series bold
3422 -upgrade
3486 -upgrade
3423 \family default
3487 \family default
3424 \series default
3488 \series default
3425 : allows you to upgrade your
3489 : allows you to upgrade your
3426 \family typewriter
3490 \family typewriter
3427 IPYTHONDIR
3491 IPYTHONDIR
3428 \family default
3492 \family default
3429 configuration when you install a new version of IPython.
3493 configuration when you install a new version of IPython.
3430 Since new versions may include new command line options or example files,
3494 Since new versions may include new command line options or example files,
3431 this copies updated ipythonrc-type files.
3495 this copies updated ipythonrc-type files.
3432 However, it backs up (with a
3496 However, it backs up (with a
3433 \family typewriter
3497 \family typewriter
3434 .old
3498 .old
3435 \family default
3499 \family default
3436 extension) all files which it overwrites so that you can merge back any
3500 extension) all files which it overwrites so that you can merge back any
3437 customizations you might have in your personal files.
3501 customizations you might have in your personal files.
3438 \layout List
3502 \layout List
3439 \labelwidthstring 00.00.0000
3503 \labelwidthstring 00.00.0000
3440
3504
3441
3505
3442 \family typewriter
3506 \family typewriter
3443 \series bold
3507 \series bold
3444 -Version
3508 -Version
3445 \series default
3509 \series default
3446 :
3510 :
3447 \family default
3511 \family default
3448 print version information and exit.
3512 print version information and exit.
3449 \layout List
3513 \layout List
3450 \labelwidthstring 00.00.0000
3514 \labelwidthstring 00.00.0000
3451
3515
3452
3516
3453 \family typewriter
3517 \family typewriter
3454 \series bold
3518 \series bold
3455 -xmode <modename>
3519 -wxversion\SpecialChar ~
3520 <string>:
3521 \family default
3522 \series default
3523 Select a specific version of wxPython (used in conjunction with
3524 \family typewriter
3525 -wthread
3526 \family default
3527 ).
3528 Requires the wxversion module, part of recent wxPython distributions
3529 \layout List
3530 \labelwidthstring 00.00.0000
3531
3532
3533 \family typewriter
3534 \series bold
3535 -xmode\SpecialChar ~
3536 <modename>
3456 \series default
3537 \series default
3457 :
3538 :
3458 \family default
3539 \family default
3459 Mode for exception reporting.
3540 Mode for exception reporting.
3460 \layout List
3541 \layout List
3461 \labelwidthstring 00.00.0000
3542 \labelwidthstring 00.00.0000
3462
3543
3463 \SpecialChar ~
3544 \SpecialChar ~
3464 Valid modes: Plain, Context and Verbose.
3545 Valid modes: Plain, Context and Verbose.
3465 \layout List
3546 \layout List
3466 \labelwidthstring 00.00.0000
3547 \labelwidthstring 00.00.0000
3467
3548
3468 \SpecialChar ~
3549 \SpecialChar ~
3469 Plain: similar to python's normal traceback printing.
3550 Plain: similar to python's normal traceback printing.
3470 \layout List
3551 \layout List
3471 \labelwidthstring 00.00.0000
3552 \labelwidthstring 00.00.0000
3472
3553
3473 \SpecialChar ~
3554 \SpecialChar ~
3474 Context: prints 5 lines of context source code around each line in the
3555 Context: prints 5 lines of context source code around each line in the
3475 traceback.
3556 traceback.
3476 \layout List
3557 \layout List
3477 \labelwidthstring 00.00.0000
3558 \labelwidthstring 00.00.0000
3478
3559
3479 \SpecialChar ~
3560 \SpecialChar ~
3480 Verbose: similar to Context, but additionally prints the variables currently
3561 Verbose: similar to Context, but additionally prints the variables currently
3481 visible where the exception happened (shortening their strings if too long).
3562 visible where the exception happened (shortening their strings if too long).
3482 This can potentially be very slow, if you happen to have a huge data structure
3563 This can potentially be very slow, if you happen to have a huge data structure
3483 whose string representation is complex to compute.
3564 whose string representation is complex to compute.
3484 Your computer may appear to freeze for a while with cpu usage at 100%.
3565 Your computer may appear to freeze for a while with cpu usage at 100%.
3485 If this occurs, you can cancel the traceback with Ctrl-C (maybe hitting
3566 If this occurs, you can cancel the traceback with Ctrl-C (maybe hitting
3486 it more than once).
3567 it more than once).
3487 \layout Section
3568 \layout Section
3488
3569
3489 Interactive use
3570 Interactive use
3490 \layout Standard
3571 \layout Standard
3491
3572
3492
3573
3493 \series bold
3574 \series bold
3494 Warning
3575 Warning
3495 \series default
3576 \series default
3496 : IPython relies on the existence of a global variable called
3577 : IPython relies on the existence of a global variable called
3497 \family typewriter
3578 \family typewriter
3498 __IP
3579 __IP
3499 \family default
3580 \family default
3500 which controls the shell itself.
3581 which controls the shell itself.
3501 If you redefine
3582 If you redefine
3502 \family typewriter
3583 \family typewriter
3503 __IP
3584 __IP
3504 \family default
3585 \family default
3505 to anything, bizarre behavior will quickly occur.
3586 to anything, bizarre behavior will quickly occur.
3506 \layout Standard
3587 \layout Standard
3507
3588
3508 Other than the above warning, IPython is meant to work as a drop-in replacement
3589 Other than the above warning, IPython is meant to work as a drop-in replacement
3509 for the standard interactive interpreter.
3590 for the standard interactive interpreter.
3510 As such, any code which is valid python should execute normally under IPython
3591 As such, any code which is valid python should execute normally under IPython
3511 (cases where this is not true should be reported as bugs).
3592 (cases where this is not true should be reported as bugs).
3512 It does, however, offer many features which are not available at a standard
3593 It does, however, offer many features which are not available at a standard
3513 python prompt.
3594 python prompt.
3514 What follows is a list of these.
3595 What follows is a list of these.
3515 \layout Subsection
3596 \layout Subsection
3516
3597
3517 Caution for Windows users
3598 Caution for Windows users
3518 \layout Standard
3599 \layout Standard
3519
3600
3520 Windows, unfortunately, uses the `
3601 Windows, unfortunately, uses the `
3521 \family typewriter
3602 \family typewriter
3522
3603
3523 \backslash
3604 \backslash
3524
3605
3525 \family default
3606 \family default
3526 ' character as a path separator.
3607 ' character as a path separator.
3527 This is a terrible choice, because `
3608 This is a terrible choice, because `
3528 \family typewriter
3609 \family typewriter
3529
3610
3530 \backslash
3611 \backslash
3531
3612
3532 \family default
3613 \family default
3533 ' also represents the escape character in most modern programming languages,
3614 ' also represents the escape character in most modern programming languages,
3534 including Python.
3615 including Python.
3535 For this reason, issuing many of the commands discussed below (especially
3616 For this reason, issuing many of the commands discussed below (especially
3536 magics which affect the filesystem) with `
3617 magics which affect the filesystem) with `
3537 \family typewriter
3618 \family typewriter
3538
3619
3539 \backslash
3620 \backslash
3540
3621
3541 \family default
3622 \family default
3542 ' in them will cause strange errors.
3623 ' in them will cause strange errors.
3543 \layout Standard
3624 \layout Standard
3544
3625
3545 A partial solution is to use instead the `
3626 A partial solution is to use instead the `
3546 \family typewriter
3627 \family typewriter
3547 /
3628 /
3548 \family default
3629 \family default
3549 ' character as a path separator, which Windows recognizes in
3630 ' character as a path separator, which Windows recognizes in
3550 \emph on
3631 \emph on
3551 most
3632 most
3552 \emph default
3633 \emph default
3553 situations.
3634 situations.
3554 However, in Windows commands `
3635 However, in Windows commands `
3555 \family typewriter
3636 \family typewriter
3556 /
3637 /
3557 \family default
3638 \family default
3558 ' flags options, so you can not use it for the root directory.
3639 ' flags options, so you can not use it for the root directory.
3559 This means that paths beginning at the root must be typed in a contrived
3640 This means that paths beginning at the root must be typed in a contrived
3560 manner like:
3641 manner like:
3561 \newline
3642 \newline
3562
3643
3563 \family typewriter
3644 \family typewriter
3564 %copy
3645 %copy
3565 \backslash
3646 \backslash
3566 opt/foo/bar.txt
3647 opt/foo/bar.txt
3567 \backslash
3648 \backslash
3568 tmp
3649 tmp
3569 \layout Standard
3650 \layout Standard
3570
3651
3571 There is no sensible thing IPython can do to truly work around this flaw
3652 There is no sensible thing IPython can do to truly work around this flaw
3572 in Windows
3653 in Windows
3573 \begin_inset Foot
3654 \begin_inset Foot
3574 collapsed true
3655 collapsed true
3575
3656
3576 \layout Standard
3657 \layout Standard
3577
3658
3578 If anyone comes up with a
3659 If anyone comes up with a
3579 \emph on
3660 \emph on
3580 clean
3661 clean
3581 \emph default
3662 \emph default
3582 solution which works consistently and does not negatively impact other
3663 solution which works consistently and does not negatively impact other
3583 platforms at all, I'll gladly accept a patch.
3664 platforms at all, I'll gladly accept a patch.
3584 \end_inset
3665 \end_inset
3585
3666
3586 .
3667 .
3587 \layout Subsection
3668 \layout Subsection
3588
3669
3589
3670
3590 \begin_inset LatexCommand \label{sec:magic}
3671 \begin_inset LatexCommand \label{sec:magic}
3591
3672
3592 \end_inset
3673 \end_inset
3593
3674
3594 Magic command system
3675 Magic command system
3595 \layout Standard
3676 \layout Standard
3596
3677
3597 IPython will treat any line whose first character is a
3678 IPython will treat any line whose first character is a
3598 \family typewriter
3679 \family typewriter
3599 %
3680 %
3600 \family default
3681 \family default
3601 as a special call to a 'magic' function.
3682 as a special call to a 'magic' function.
3602 These allow you to control the behavior of IPython itself, plus a lot of
3683 These allow you to control the behavior of IPython itself, plus a lot of
3603 system-type features.
3684 system-type features.
3604 They are all prefixed with a
3685 They are all prefixed with a
3605 \family typewriter
3686 \family typewriter
3606 %
3687 %
3607 \family default
3688 \family default
3608 character, but parameters are given without parentheses or quotes.
3689 character, but parameters are given without parentheses or quotes.
3609 \layout Standard
3690 \layout Standard
3610
3691
3611 Example: typing
3692 Example: typing
3612 \family typewriter
3693 \family typewriter
3613 '%cd mydir'
3694 '%cd mydir'
3614 \family default
3695 \family default
3615 (without the quotes) changes you working directory to
3696 (without the quotes) changes you working directory to
3616 \family typewriter
3697 \family typewriter
3617 'mydir'
3698 'mydir'
3618 \family default
3699 \family default
3619 , if it exists.
3700 , if it exists.
3620 \layout Standard
3701 \layout Standard
3621
3702
3622 If you have 'automagic' enabled (in your
3703 If you have 'automagic' enabled (in your
3623 \family typewriter
3704 \family typewriter
3624 ipythonrc
3705 ipythonrc
3625 \family default
3706 \family default
3626 file, via the command line option
3707 file, via the command line option
3627 \family typewriter
3708 \family typewriter
3628 -automagic
3709 -automagic
3629 \family default
3710 \family default
3630 or with the
3711 or with the
3631 \family typewriter
3712 \family typewriter
3632 %automagic
3713 %automagic
3633 \family default
3714 \family default
3634 function), you don't need to type in the
3715 function), you don't need to type in the
3635 \family typewriter
3716 \family typewriter
3636 %
3717 %
3637 \family default
3718 \family default
3638 explicitly.
3719 explicitly.
3639 IPython will scan its internal list of magic functions and call one if
3720 IPython will scan its internal list of magic functions and call one if
3640 it exists.
3721 it exists.
3641 With automagic on you can then just type '
3722 With automagic on you can then just type '
3642 \family typewriter
3723 \family typewriter
3643 cd mydir
3724 cd mydir
3644 \family default
3725 \family default
3645 ' to go to directory '
3726 ' to go to directory '
3646 \family typewriter
3727 \family typewriter
3647 mydir
3728 mydir
3648 \family default
3729 \family default
3649 '.
3730 '.
3650 The automagic system has the lowest possible precedence in name searches,
3731 The automagic system has the lowest possible precedence in name searches,
3651 so defining an identifier with the same name as an existing magic function
3732 so defining an identifier with the same name as an existing magic function
3652 will shadow it for automagic use.
3733 will shadow it for automagic use.
3653 You can still access the shadowed magic function by explicitly using the
3734 You can still access the shadowed magic function by explicitly using the
3654
3735
3655 \family typewriter
3736 \family typewriter
3656 %
3737 %
3657 \family default
3738 \family default
3658 character at the beginning of the line.
3739 character at the beginning of the line.
3659 \layout Standard
3740 \layout Standard
3660
3741
3661 An example (with automagic on) should clarify all this:
3742 An example (with automagic on) should clarify all this:
3662 \layout LyX-Code
3743 \layout LyX-Code
3663
3744
3664 In [1]: cd ipython # %cd is called by automagic
3745 In [1]: cd ipython # %cd is called by automagic
3665 \layout LyX-Code
3746 \layout LyX-Code
3666
3747
3667 /home/fperez/ipython
3748 /home/fperez/ipython
3668 \layout LyX-Code
3749 \layout LyX-Code
3669
3750
3670 In [2]: cd=1 # now cd is just a variable
3751 In [2]: cd=1 # now cd is just a variable
3671 \layout LyX-Code
3752 \layout LyX-Code
3672
3753
3673 In [3]: cd ..
3754 In [3]: cd ..
3674 # and doesn't work as a function anymore
3755 # and doesn't work as a function anymore
3675 \layout LyX-Code
3756 \layout LyX-Code
3676
3757
3677 ------------------------------------------------------------
3758 ------------------------------------------------------------
3678 \layout LyX-Code
3759 \layout LyX-Code
3679
3760
3680 File "<console>", line 1
3761 File "<console>", line 1
3681 \layout LyX-Code
3762 \layout LyX-Code
3682
3763
3683 cd ..
3764 cd ..
3684 \layout LyX-Code
3765 \layout LyX-Code
3685
3766
3686 ^
3767 ^
3687 \layout LyX-Code
3768 \layout LyX-Code
3688
3769
3689 SyntaxError: invalid syntax
3770 SyntaxError: invalid syntax
3690 \layout LyX-Code
3771 \layout LyX-Code
3691
3772
3692 \layout LyX-Code
3773 \layout LyX-Code
3693
3774
3694 In [4]: %cd ..
3775 In [4]: %cd ..
3695 # but %cd always works
3776 # but %cd always works
3696 \layout LyX-Code
3777 \layout LyX-Code
3697
3778
3698 /home/fperez
3779 /home/fperez
3699 \layout LyX-Code
3780 \layout LyX-Code
3700
3781
3701 In [5]: del cd # if you remove the cd variable
3782 In [5]: del cd # if you remove the cd variable
3702 \layout LyX-Code
3783 \layout LyX-Code
3703
3784
3704 In [6]: cd ipython # automagic can work again
3785 In [6]: cd ipython # automagic can work again
3705 \layout LyX-Code
3786 \layout LyX-Code
3706
3787
3707 /home/fperez/ipython
3788 /home/fperez/ipython
3708 \layout Standard
3789 \layout Standard
3709
3790
3710 You can define your own magic functions to extend the system.
3791 You can define your own magic functions to extend the system.
3711 The following is a snippet of code which shows how to do it.
3792 The following is a snippet of code which shows how to do it.
3712 It is provided as file
3793 It is provided as file
3713 \family typewriter
3794 \family typewriter
3714 example-magic.py
3795 example-magic.py
3715 \family default
3796 \family default
3716 in the examples directory:
3797 in the examples directory:
3717 \layout Standard
3798 \layout Standard
3718
3799
3719
3800
3720 \begin_inset ERT
3801 \begin_inset ERT
3721 status Open
3802 status Open
3722
3803
3723 \layout Standard
3804 \layout Standard
3724
3805
3725 \backslash
3806 \backslash
3726 codelist{examples/example-magic.py}
3807 codelist{examples/example-magic.py}
3727 \end_inset
3808 \end_inset
3728
3809
3729
3810
3730 \layout Standard
3811 \layout Standard
3731
3812
3732 You can also define your own aliased names for magic functions.
3813 You can also define your own aliased names for magic functions.
3733 In your
3814 In your
3734 \family typewriter
3815 \family typewriter
3735 ipythonrc
3816 ipythonrc
3736 \family default
3817 \family default
3737 file, placing a line like:
3818 file, placing a line like:
3738 \layout Standard
3819 \layout Standard
3739
3820
3740
3821
3741 \family typewriter
3822 \family typewriter
3742 execute __IP.magic_cl = __IP.magic_clear
3823 execute __IP.magic_cl = __IP.magic_clear
3743 \layout Standard
3824 \layout Standard
3744
3825
3745 will define
3826 will define
3746 \family typewriter
3827 \family typewriter
3747 %cl
3828 %cl
3748 \family default
3829 \family default
3749 as a new name for
3830 as a new name for
3750 \family typewriter
3831 \family typewriter
3751 %clear
3832 %clear
3752 \family default
3833 \family default
3753 .
3834 .
3754 \layout Standard
3835 \layout Standard
3755
3836
3756 Type
3837 Type
3757 \family typewriter
3838 \family typewriter
3758 %magic
3839 %magic
3759 \family default
3840 \family default
3760 for more information, including a list of all available magic functions
3841 for more information, including a list of all available magic functions
3761 at any time and their docstrings.
3842 at any time and their docstrings.
3762 You can also type
3843 You can also type
3763 \family typewriter
3844 \family typewriter
3764 %magic_function_name?
3845 %magic_function_name?
3765 \family default
3846 \family default
3766 (see sec.
3847 (see sec.
3767
3848
3768 \begin_inset LatexCommand \ref{sec:dyn-object-info}
3849 \begin_inset LatexCommand \ref{sec:dyn-object-info}
3769
3850
3770 \end_inset
3851 \end_inset
3771
3852
3772 for information on the
3853 for information on the
3773 \family typewriter
3854 \family typewriter
3774 '?'
3855 '?'
3775 \family default
3856 \family default
3776 system) to get information about any particular magic function you are
3857 system) to get information about any particular magic function you are
3777 interested in.
3858 interested in.
3778 \layout Subsubsection
3859 \layout Subsubsection
3779
3860
3780 Magic commands
3861 Magic commands
3781 \layout Standard
3862 \layout Standard
3782
3863
3783 The rest of this section is automatically generated for each release from
3864 The rest of this section is automatically generated for each release from
3784 the docstrings in the IPython code.
3865 the docstrings in the IPython code.
3785 Therefore the formatting is somewhat minimal, but this method has the advantage
3866 Therefore the formatting is somewhat minimal, but this method has the advantage
3786 of having information always in sync with the code.
3867 of having information always in sync with the code.
3787 \layout Standard
3868 \layout Standard
3788
3869
3789 A list of all the magic commands available in IPython's
3870 A list of all the magic commands available in IPython's
3790 \emph on
3871 \emph on
3791 default
3872 default
3792 \emph default
3873 \emph default
3793 installation follows.
3874 installation follows.
3794 This is similar to what you'll see by simply typing
3875 This is similar to what you'll see by simply typing
3795 \family typewriter
3876 \family typewriter
3796 %magic
3877 %magic
3797 \family default
3878 \family default
3798 at the prompt, but that will also give you information about magic commands
3879 at the prompt, but that will also give you information about magic commands
3799 you may have added as part of your personal customizations.
3880 you may have added as part of your personal customizations.
3800 \layout Standard
3881 \layout Standard
3801
3882
3802
3883
3803 \begin_inset Include \input{magic.tex}
3884 \begin_inset Include \input{magic.tex}
3804 preview false
3885 preview false
3805
3886
3806 \end_inset
3887 \end_inset
3807
3888
3808
3889
3809 \layout Subsection
3890 \layout Subsection
3810
3891
3811 Access to the standard Python help
3892 Access to the standard Python help
3812 \layout Standard
3893 \layout Standard
3813
3894
3814 As of Python 2.1, a help system is available with access to object docstrings
3895 As of Python 2.1, a help system is available with access to object docstrings
3815 and the Python manuals.
3896 and the Python manuals.
3816 Simply type
3897 Simply type
3817 \family typewriter
3898 \family typewriter
3818 'help'
3899 'help'
3819 \family default
3900 \family default
3820 (no quotes) to access it.
3901 (no quotes) to access it.
3821 You can also type
3902 You can also type
3822 \family typewriter
3903 \family typewriter
3823 help(object)
3904 help(object)
3824 \family default
3905 \family default
3825 to obtain information about a given object, and
3906 to obtain information about a given object, and
3826 \family typewriter
3907 \family typewriter
3827 help('keyword')
3908 help('keyword')
3828 \family default
3909 \family default
3829 for information on a keyword.
3910 for information on a keyword.
3830 As noted in sec.
3911 As noted in sec.
3831
3912
3832 \begin_inset LatexCommand \ref{sec:help-access}
3913 \begin_inset LatexCommand \ref{sec:help-access}
3833
3914
3834 \end_inset
3915 \end_inset
3835
3916
3836 , you need to properly configure your environment variable
3917 , you need to properly configure your environment variable
3837 \family typewriter
3918 \family typewriter
3838 PYTHONDOCS
3919 PYTHONDOCS
3839 \family default
3920 \family default
3840 for this feature to work correctly.
3921 for this feature to work correctly.
3841 \layout Subsection
3922 \layout Subsection
3842
3923
3843
3924
3844 \begin_inset LatexCommand \label{sec:dyn-object-info}
3925 \begin_inset LatexCommand \label{sec:dyn-object-info}
3845
3926
3846 \end_inset
3927 \end_inset
3847
3928
3848 Dynamic object information
3929 Dynamic object information
3849 \layout Standard
3930 \layout Standard
3850
3931
3851 Typing
3932 Typing
3852 \family typewriter
3933 \family typewriter
3853 ?word
3934 ?word
3854 \family default
3935 \family default
3855 or
3936 or
3856 \family typewriter
3937 \family typewriter
3857 word?
3938 word?
3858 \family default
3939 \family default
3859 prints detailed information about an object.
3940 prints detailed information about an object.
3860 If certain strings in the object are too long (docstrings, code, etc.) they
3941 If certain strings in the object are too long (docstrings, code, etc.) they
3861 get snipped in the center for brevity.
3942 get snipped in the center for brevity.
3862 This system gives access variable types and values, full source code for
3943 This system gives access variable types and values, full source code for
3863 any object (if available), function prototypes and other useful information.
3944 any object (if available), function prototypes and other useful information.
3864 \layout Standard
3945 \layout Standard
3865
3946
3866 Typing
3947 Typing
3867 \family typewriter
3948 \family typewriter
3868 ??word
3949 ??word
3869 \family default
3950 \family default
3870 or
3951 or
3871 \family typewriter
3952 \family typewriter
3872 word??
3953 word??
3873 \family default
3954 \family default
3874 gives access to the full information without snipping long strings.
3955 gives access to the full information without snipping long strings.
3875 Long strings are sent to the screen through the
3956 Long strings are sent to the screen through the
3876 \family typewriter
3957 \family typewriter
3877 less
3958 less
3878 \family default
3959 \family default
3879 pager if longer than the screen and printed otherwise.
3960 pager if longer than the screen and printed otherwise.
3880 On systems lacking the
3961 On systems lacking the
3881 \family typewriter
3962 \family typewriter
3882 less
3963 less
3883 \family default
3964 \family default
3884 command, IPython uses a very basic internal pager.
3965 command, IPython uses a very basic internal pager.
3885 \layout Standard
3966 \layout Standard
3886
3967
3887 The following magic functions are particularly useful for gathering information
3968 The following magic functions are particularly useful for gathering information
3888 about your working environment.
3969 about your working environment.
3889 You can get more details by typing
3970 You can get more details by typing
3890 \family typewriter
3971 \family typewriter
3891 %magic
3972 %magic
3892 \family default
3973 \family default
3893 or querying them individually (use
3974 or querying them individually (use
3894 \family typewriter
3975 \family typewriter
3895 %function_name?
3976 %function_name?
3896 \family default
3977 \family default
3897 with or without the
3978 with or without the
3898 \family typewriter
3979 \family typewriter
3899 %
3980 %
3900 \family default
3981 \family default
3901 ), this is just a summary:
3982 ), this is just a summary:
3902 \layout List
3983 \layout List
3903 \labelwidthstring 00.00.0000
3984 \labelwidthstring 00.00.0000
3904
3985
3905
3986
3906 \family typewriter
3987 \family typewriter
3907 \series bold
3988 \series bold
3908 %pdoc\SpecialChar ~
3989 %pdoc\SpecialChar ~
3909 <object>
3990 <object>
3910 \family default
3991 \family default
3911 \series default
3992 \series default
3912 : Print (or run through a pager if too long) the docstring for an object.
3993 : Print (or run through a pager if too long) the docstring for an object.
3913 If the given object is a class, it will print both the class and the constructo
3994 If the given object is a class, it will print both the class and the constructo
3914 r docstrings.
3995 r docstrings.
3915 \layout List
3996 \layout List
3916 \labelwidthstring 00.00.0000
3997 \labelwidthstring 00.00.0000
3917
3998
3918
3999
3919 \family typewriter
4000 \family typewriter
3920 \series bold
4001 \series bold
3921 %pdef\SpecialChar ~
4002 %pdef\SpecialChar ~
3922 <object>
4003 <object>
3923 \family default
4004 \family default
3924 \series default
4005 \series default
3925 : Print the definition header for any callable object.
4006 : Print the definition header for any callable object.
3926 If the object is a class, print the constructor information.
4007 If the object is a class, print the constructor information.
3927 \layout List
4008 \layout List
3928 \labelwidthstring 00.00.0000
4009 \labelwidthstring 00.00.0000
3929
4010
3930
4011
3931 \family typewriter
4012 \family typewriter
3932 \series bold
4013 \series bold
3933 %psource\SpecialChar ~
4014 %psource\SpecialChar ~
3934 <object>
4015 <object>
3935 \family default
4016 \family default
3936 \series default
4017 \series default
3937 : Print (or run through a pager if too long) the source code for an object.
4018 : Print (or run through a pager if too long) the source code for an object.
3938 \layout List
4019 \layout List
3939 \labelwidthstring 00.00.0000
4020 \labelwidthstring 00.00.0000
3940
4021
3941
4022
3942 \family typewriter
4023 \family typewriter
3943 \series bold
4024 \series bold
3944 %pfile\SpecialChar ~
4025 %pfile\SpecialChar ~
3945 <object>
4026 <object>
3946 \family default
4027 \family default
3947 \series default
4028 \series default
3948 : Show the entire source file where an object was defined via a pager, opening
4029 : Show the entire source file where an object was defined via a pager, opening
3949 it at the line where the object definition begins.
4030 it at the line where the object definition begins.
3950 \layout List
4031 \layout List
3951 \labelwidthstring 00.00.0000
4032 \labelwidthstring 00.00.0000
3952
4033
3953
4034
3954 \family typewriter
4035 \family typewriter
3955 \series bold
4036 \series bold
3956 %who/%whos
4037 %who/%whos
3957 \family default
4038 \family default
3958 \series default
4039 \series default
3959 : These functions give information about identifiers you have defined interactiv
4040 : These functions give information about identifiers you have defined interactiv
3960 ely (not things you loaded or defined in your configuration files).
4041 ely (not things you loaded or defined in your configuration files).
3961
4042
3962 \family typewriter
4043 \family typewriter
3963 %who
4044 %who
3964 \family default
4045 \family default
3965 just prints a list of identifiers and
4046 just prints a list of identifiers and
3966 \family typewriter
4047 \family typewriter
3967 %whos
4048 %whos
3968 \family default
4049 \family default
3969 prints a table with some basic details about each identifier.
4050 prints a table with some basic details about each identifier.
3970 \layout Standard
4051 \layout Standard
3971
4052
3972 Note that the dynamic object information functions (
4053 Note that the dynamic object information functions (
3973 \family typewriter
4054 \family typewriter
3974 ?/??, %pdoc, %pfile, %pdef, %psource
4055 ?/??, %pdoc, %pfile, %pdef, %psource
3975 \family default
4056 \family default
3976 ) give you access to documentation even on things which are not really defined
4057 ) give you access to documentation even on things which are not really defined
3977 as separate identifiers.
4058 as separate identifiers.
3978 Try for example typing
4059 Try for example typing
3979 \family typewriter
4060 \family typewriter
3980 {}.get?
4061 {}.get?
3981 \family default
4062 \family default
3982 or after doing
4063 or after doing
3983 \family typewriter
4064 \family typewriter
3984 import os
4065 import os
3985 \family default
4066 \family default
3986 , type
4067 , type
3987 \family typewriter
4068 \family typewriter
3988 os.path.abspath??
4069 os.path.abspath??
3989 \family default
4070 \family default
3990 .
4071 .
3991 \layout Subsection
4072 \layout Subsection
3992
4073
3993
4074
3994 \begin_inset LatexCommand \label{sec:readline}
4075 \begin_inset LatexCommand \label{sec:readline}
3995
4076
3996 \end_inset
4077 \end_inset
3997
4078
3998 Readline-based features
4079 Readline-based features
3999 \layout Standard
4080 \layout Standard
4000
4081
4001 These features require the GNU readline library, so they won't work if your
4082 These features require the GNU readline library, so they won't work if your
4002 Python installation lacks readline support.
4083 Python installation lacks readline support.
4003 We will first describe the default behavior IPython uses, and then how
4084 We will first describe the default behavior IPython uses, and then how
4004 to change it to suit your preferences.
4085 to change it to suit your preferences.
4005 \layout Subsubsection
4086 \layout Subsubsection
4006
4087
4007 Command line completion
4088 Command line completion
4008 \layout Standard
4089 \layout Standard
4009
4090
4010 At any time, hitting TAB will complete any available python commands or
4091 At any time, hitting TAB will complete any available python commands or
4011 variable names, and show you a list of the possible completions if there's
4092 variable names, and show you a list of the possible completions if there's
4012 no unambiguous one.
4093 no unambiguous one.
4013 It will also complete filenames in the current directory if no python names
4094 It will also complete filenames in the current directory if no python names
4014 match what you've typed so far.
4095 match what you've typed so far.
4015 \layout Subsubsection
4096 \layout Subsubsection
4016
4097
4017 Search command history
4098 Search command history
4018 \layout Standard
4099 \layout Standard
4019
4100
4020 IPython provides two ways for searching through previous input and thus
4101 IPython provides two ways for searching through previous input and thus
4021 reduce the need for repetitive typing:
4102 reduce the need for repetitive typing:
4022 \layout Enumerate
4103 \layout Enumerate
4023
4104
4024 Start typing, and then use
4105 Start typing, and then use
4025 \family typewriter
4106 \family typewriter
4026 Ctrl-p
4107 Ctrl-p
4027 \family default
4108 \family default
4028 (previous,up) and
4109 (previous,up) and
4029 \family typewriter
4110 \family typewriter
4030 Ctrl-n
4111 Ctrl-n
4031 \family default
4112 \family default
4032 (next,down) to search through only the history items that match what you've
4113 (next,down) to search through only the history items that match what you've
4033 typed so far.
4114 typed so far.
4034 If you use
4115 If you use
4035 \family typewriter
4116 \family typewriter
4036 Ctrl-p/Ctrl-n
4117 Ctrl-p/Ctrl-n
4037 \family default
4118 \family default
4038 at a blank prompt, they just behave like normal arrow keys.
4119 at a blank prompt, they just behave like normal arrow keys.
4039 \layout Enumerate
4120 \layout Enumerate
4040
4121
4041 Hit
4122 Hit
4042 \family typewriter
4123 \family typewriter
4043 Ctrl-r
4124 Ctrl-r
4044 \family default
4125 \family default
4045 : opens a search prompt.
4126 : opens a search prompt.
4046 Begin typing and the system searches your history for lines that contain
4127 Begin typing and the system searches your history for lines that contain
4047 what you've typed so far, completing as much as it can.
4128 what you've typed so far, completing as much as it can.
4048 \layout Subsubsection
4129 \layout Subsubsection
4049
4130
4050 Persistent command history across sessions
4131 Persistent command history across sessions
4051 \layout Standard
4132 \layout Standard
4052
4133
4053 IPython will save your input history when it leaves and reload it next time
4134 IPython will save your input history when it leaves and reload it next time
4054 you restart it.
4135 you restart it.
4055 By default, the history file is named
4136 By default, the history file is named
4056 \family typewriter
4137 \family typewriter
4057 $IPYTHONDIR/history
4138 $IPYTHONDIR/history
4058 \family default
4139 \family default
4059 , but if you've loaded a named profile, '
4140 , but if you've loaded a named profile, '
4060 \family typewriter
4141 \family typewriter
4061 -PROFILE_NAME
4142 -PROFILE_NAME
4062 \family default
4143 \family default
4063 ' is appended to the name.
4144 ' is appended to the name.
4064 This allows you to keep separate histories related to various tasks: commands
4145 This allows you to keep separate histories related to various tasks: commands
4065 related to numerical work will not be clobbered by a system shell history,
4146 related to numerical work will not be clobbered by a system shell history,
4066 for example.
4147 for example.
4067 \layout Subsubsection
4148 \layout Subsubsection
4068
4149
4069 Autoindent
4150 Autoindent
4070 \layout Standard
4151 \layout Standard
4071
4152
4072 IPython can recognize lines ending in ':' and indent the next line, while
4153 IPython can recognize lines ending in ':' and indent the next line, while
4073 also un-indenting automatically after 'raise' or 'return'.
4154 also un-indenting automatically after 'raise' or 'return'.
4074
4155
4075 \layout Standard
4156 \layout Standard
4076
4157
4077 This feature uses the readline library, so it will honor your
4158 This feature uses the readline library, so it will honor your
4078 \family typewriter
4159 \family typewriter
4079 ~/.inputrc
4160 ~/.inputrc
4080 \family default
4161 \family default
4081 configuration (or whatever file your
4162 configuration (or whatever file your
4082 \family typewriter
4163 \family typewriter
4083 INPUTRC
4164 INPUTRC
4084 \family default
4165 \family default
4085 variable points to).
4166 variable points to).
4086 Adding the following lines to your
4167 Adding the following lines to your
4087 \family typewriter
4168 \family typewriter
4088 .inputrc
4169 .inputrc
4089 \family default
4170 \family default
4090 file can make indenting/unindenting more convenient (
4171 file can make indenting/unindenting more convenient (
4091 \family typewriter
4172 \family typewriter
4092 M-i
4173 M-i
4093 \family default
4174 \family default
4094 indents,
4175 indents,
4095 \family typewriter
4176 \family typewriter
4096 M-u
4177 M-u
4097 \family default
4178 \family default
4098 unindents):
4179 unindents):
4099 \layout Standard
4180 \layout Standard
4100
4181
4101
4182
4102 \family typewriter
4183 \family typewriter
4103 $if Python
4184 $if Python
4104 \newline
4185 \newline
4105 "
4186 "
4106 \backslash
4187 \backslash
4107 M-i": "\SpecialChar ~
4188 M-i": "\SpecialChar ~
4108 \SpecialChar ~
4189 \SpecialChar ~
4109 \SpecialChar ~
4190 \SpecialChar ~
4110 \SpecialChar ~
4191 \SpecialChar ~
4111 "
4192 "
4112 \newline
4193 \newline
4113 "
4194 "
4114 \backslash
4195 \backslash
4115 M-u": "
4196 M-u": "
4116 \backslash
4197 \backslash
4117 d
4198 d
4118 \backslash
4199 \backslash
4119 d
4200 d
4120 \backslash
4201 \backslash
4121 d
4202 d
4122 \backslash
4203 \backslash
4123 d"
4204 d"
4124 \newline
4205 \newline
4125 $endif
4206 $endif
4126 \layout Standard
4207 \layout Standard
4127
4208
4128 Note that there are 4 spaces between the quote marks after
4209 Note that there are 4 spaces between the quote marks after
4129 \family typewriter
4210 \family typewriter
4130 "M-i"
4211 "M-i"
4131 \family default
4212 \family default
4132 above.
4213 above.
4133 \layout Standard
4214 \layout Standard
4134
4215
4135
4216
4136 \series bold
4217 \series bold
4137 Warning:
4218 Warning:
4138 \series default
4219 \series default
4139 this feature is ON by default, but it can cause problems with the pasting
4220 this feature is ON by default, but it can cause problems with the pasting
4140 of multi-line indented code (the pasted code gets re-indented on each line).
4221 of multi-line indented code (the pasted code gets re-indented on each line).
4141 A magic function
4222 A magic function
4142 \family typewriter
4223 \family typewriter
4143 %autoindent
4224 %autoindent
4144 \family default
4225 \family default
4145 allows you to toggle it on/off at runtime.
4226 allows you to toggle it on/off at runtime.
4146 You can also disable it permanently on in your
4227 You can also disable it permanently on in your
4147 \family typewriter
4228 \family typewriter
4148 ipythonrc
4229 ipythonrc
4149 \family default
4230 \family default
4150 file (set
4231 file (set
4151 \family typewriter
4232 \family typewriter
4152 autoindent 0
4233 autoindent 0
4153 \family default
4234 \family default
4154 ).
4235 ).
4155 \layout Subsubsection
4236 \layout Subsubsection
4156
4237
4157 Customizing readline behavior
4238 Customizing readline behavior
4158 \layout Standard
4239 \layout Standard
4159
4240
4160 All these features are based on the GNU readline library, which has an extremely
4241 All these features are based on the GNU readline library, which has an extremely
4161 customizable interface.
4242 customizable interface.
4162 Normally, readline is configured via a file which defines the behavior
4243 Normally, readline is configured via a file which defines the behavior
4163 of the library; the details of the syntax for this can be found in the
4244 of the library; the details of the syntax for this can be found in the
4164 readline documentation available with your system or on the Internet.
4245 readline documentation available with your system or on the Internet.
4165 IPython doesn't read this file (if it exists) directly, but it does support
4246 IPython doesn't read this file (if it exists) directly, but it does support
4166 passing to readline valid options via a simple interface.
4247 passing to readline valid options via a simple interface.
4167 In brief, you can customize readline by setting the following options in
4248 In brief, you can customize readline by setting the following options in
4168 your
4249 your
4169 \family typewriter
4250 \family typewriter
4170 ipythonrc
4251 ipythonrc
4171 \family default
4252 \family default
4172 configuration file (note that these options can
4253 configuration file (note that these options can
4173 \emph on
4254 \emph on
4174 not
4255 not
4175 \emph default
4256 \emph default
4176 be specified at the command line):
4257 be specified at the command line):
4177 \layout List
4258 \layout List
4178 \labelwidthstring 00.00.0000
4259 \labelwidthstring 00.00.0000
4179
4260
4180
4261
4181 \family typewriter
4262 \family typewriter
4182 \series bold
4263 \series bold
4183 readline_parse_and_bind:
4264 readline_parse_and_bind:
4184 \family default
4265 \family default
4185 \series default
4266 \series default
4186 this option can appear as many times as you want, each time defining a
4267 this option can appear as many times as you want, each time defining a
4187 string to be executed via a
4268 string to be executed via a
4188 \family typewriter
4269 \family typewriter
4189 readline.parse_and_bind()
4270 readline.parse_and_bind()
4190 \family default
4271 \family default
4191 command.
4272 command.
4192 The syntax for valid commands of this kind can be found by reading the
4273 The syntax for valid commands of this kind can be found by reading the
4193 documentation for the GNU readline library, as these commands are of the
4274 documentation for the GNU readline library, as these commands are of the
4194 kind which readline accepts in its configuration file.
4275 kind which readline accepts in its configuration file.
4195 \layout List
4276 \layout List
4196 \labelwidthstring 00.00.0000
4277 \labelwidthstring 00.00.0000
4197
4278
4198
4279
4199 \family typewriter
4280 \family typewriter
4200 \series bold
4281 \series bold
4201 readline_remove_delims:
4282 readline_remove_delims:
4202 \family default
4283 \family default
4203 \series default
4284 \series default
4204 a string of characters to be removed from the default word-delimiters list
4285 a string of characters to be removed from the default word-delimiters list
4205 used by readline, so that completions may be performed on strings which
4286 used by readline, so that completions may be performed on strings which
4206 contain them.
4287 contain them.
4207 Do not change the default value unless you know what you're doing.
4288 Do not change the default value unless you know what you're doing.
4208 \layout List
4289 \layout List
4209 \labelwidthstring 00.00.0000
4290 \labelwidthstring 00.00.0000
4210
4291
4211
4292
4212 \family typewriter
4293 \family typewriter
4213 \series bold
4294 \series bold
4214 readline_omit__names
4295 readline_omit__names
4215 \family default
4296 \family default
4216 \series default
4297 \series default
4217 : when tab-completion is enabled, hitting
4298 : when tab-completion is enabled, hitting
4218 \family typewriter
4299 \family typewriter
4219 <tab>
4300 <tab>
4220 \family default
4301 \family default
4221 after a '
4302 after a '
4222 \family typewriter
4303 \family typewriter
4223 .
4304 .
4224 \family default
4305 \family default
4225 ' in a name will complete all attributes of an object, including all the
4306 ' in a name will complete all attributes of an object, including all the
4226 special methods whose names include double underscores (like
4307 special methods whose names include double underscores (like
4227 \family typewriter
4308 \family typewriter
4228 __getitem__
4309 __getitem__
4229 \family default
4310 \family default
4230 or
4311 or
4231 \family typewriter
4312 \family typewriter
4232 __class__
4313 __class__
4233 \family default
4314 \family default
4234 ).
4315 ).
4235 If you'd rather not see these names by default, you can set this option
4316 If you'd rather not see these names by default, you can set this option
4236 to 1.
4317 to 1.
4237 Note that even when this option is set, you can still see those names by
4318 Note that even when this option is set, you can still see those names by
4238 explicitly typing a
4319 explicitly typing a
4239 \family typewriter
4320 \family typewriter
4240 _
4321 _
4241 \family default
4322 \family default
4242 after the period and hitting
4323 after the period and hitting
4243 \family typewriter
4324 \family typewriter
4244 <tab>
4325 <tab>
4245 \family default
4326 \family default
4246 : '
4327 : '
4247 \family typewriter
4328 \family typewriter
4248 name._<tab>
4329 name._<tab>
4249 \family default
4330 \family default
4250 ' will always complete attribute names starting with '
4331 ' will always complete attribute names starting with '
4251 \family typewriter
4332 \family typewriter
4252 _
4333 _
4253 \family default
4334 \family default
4254 '.
4335 '.
4255 \layout List
4336 \layout List
4256 \labelwidthstring 00.00.0000
4337 \labelwidthstring 00.00.0000
4257
4338
4258 \SpecialChar ~
4339 \SpecialChar ~
4259 This option is off by default so that new users see all attributes of any
4340 This option is off by default so that new users see all attributes of any
4260 objects they are dealing with.
4341 objects they are dealing with.
4261 \layout Standard
4342 \layout Standard
4262
4343
4263 You will find the default values along with a corresponding detailed explanation
4344 You will find the default values along with a corresponding detailed explanation
4264 in your
4345 in your
4265 \family typewriter
4346 \family typewriter
4266 ipythonrc
4347 ipythonrc
4267 \family default
4348 \family default
4268 file.
4349 file.
4269 \layout Subsection
4350 \layout Subsection
4270
4351
4271 Session logging and restoring
4352 Session logging and restoring
4272 \layout Standard
4353 \layout Standard
4273
4354
4274 You can log all input from a session either by starting IPython with the
4355 You can log all input from a session either by starting IPython with the
4275 command line switches
4356 command line switches
4276 \family typewriter
4357 \family typewriter
4277 -log
4358 -log
4278 \family default
4359 \family default
4279 or
4360 or
4280 \family typewriter
4361 \family typewriter
4281 -logfile
4362 -logfile
4282 \family default
4363 \family default
4283 (see sec.
4364 (see sec.
4284
4365
4285 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
4366 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
4286
4367
4287 \end_inset
4368 \end_inset
4288
4369
4289 )or by activating the logging at any moment with the magic function
4370 )or by activating the logging at any moment with the magic function
4290 \family typewriter
4371 \family typewriter
4291 %logstart
4372 %logstart
4292 \family default
4373 \family default
4293 .
4374 .
4294
4375
4295 \layout Standard
4376 \layout Standard
4296
4377
4297 Log files can later be reloaded with the
4378 Log files can later be reloaded with the
4298 \family typewriter
4379 \family typewriter
4299 -logplay
4380 -logplay
4300 \family default
4381 \family default
4301 option and IPython will attempt to 'replay' the log by executing all the
4382 option and IPython will attempt to 'replay' the log by executing all the
4302 lines in it, thus restoring the state of a previous session.
4383 lines in it, thus restoring the state of a previous session.
4303 This feature is not quite perfect, but can still be useful in many cases.
4384 This feature is not quite perfect, but can still be useful in many cases.
4304 \layout Standard
4385 \layout Standard
4305
4386
4306 The log files can also be used as a way to have a permanent record of any
4387 The log files can also be used as a way to have a permanent record of any
4307 code you wrote while experimenting.
4388 code you wrote while experimenting.
4308 Log files are regular text files which you can later open in your favorite
4389 Log files are regular text files which you can later open in your favorite
4309 text editor to extract code or to 'clean them up' before using them to
4390 text editor to extract code or to 'clean them up' before using them to
4310 replay a session.
4391 replay a session.
4311 \layout Standard
4392 \layout Standard
4312
4393
4313 The
4394 The
4314 \family typewriter
4395 \family typewriter
4315 %logstart
4396 %logstart
4316 \family default
4397 \family default
4317 function for activating logging in mid-session is used as follows:
4398 function for activating logging in mid-session is used as follows:
4318 \layout Standard
4399 \layout Standard
4319
4400
4320
4401
4321 \family typewriter
4402 \family typewriter
4322 %logstart [log_name [log_mode]]
4403 %logstart [log_name [log_mode]]
4323 \layout Standard
4404 \layout Standard
4324
4405
4325 If no name is given, it defaults to a file named
4406 If no name is given, it defaults to a file named
4326 \family typewriter
4407 \family typewriter
4327 'log'
4408 'log'
4328 \family default
4409 \family default
4329 in your IPYTHONDIR directory, in
4410 in your IPYTHONDIR directory, in
4330 \family typewriter
4411 \family typewriter
4331 'rotate'
4412 'rotate'
4332 \family default
4413 \family default
4333 mode (see below).
4414 mode (see below).
4334 \layout Standard
4415 \layout Standard
4335
4416
4336 '
4417 '
4337 \family typewriter
4418 \family typewriter
4338 %logstart name
4419 %logstart name
4339 \family default
4420 \family default
4340 ' saves to file
4421 ' saves to file
4341 \family typewriter
4422 \family typewriter
4342 'name'
4423 'name'
4343 \family default
4424 \family default
4344 in
4425 in
4345 \family typewriter
4426 \family typewriter
4346 'backup'
4427 'backup'
4347 \family default
4428 \family default
4348 mode.
4429 mode.
4349 It saves your history up to that point and then continues logging.
4430 It saves your history up to that point and then continues logging.
4350 \layout Standard
4431 \layout Standard
4351
4432
4352
4433
4353 \family typewriter
4434 \family typewriter
4354 %logstart
4435 %logstart
4355 \family default
4436 \family default
4356 takes a second optional parameter: logging mode.
4437 takes a second optional parameter: logging mode.
4357 This can be one of (note that the modes are given unquoted):
4438 This can be one of (note that the modes are given unquoted):
4358 \layout List
4439 \layout List
4359 \labelwidthstring 00.00.0000
4440 \labelwidthstring 00.00.0000
4360
4441
4361
4442
4362 \family typewriter
4443 \family typewriter
4363 over
4444 over
4364 \family default
4445 \family default
4365 : overwrite existing
4446 : overwrite existing
4366 \family typewriter
4447 \family typewriter
4367 log_name
4448 log_name
4368 \family default
4449 \family default
4369 .
4450 .
4370 \layout List
4451 \layout List
4371 \labelwidthstring 00.00.0000
4452 \labelwidthstring 00.00.0000
4372
4453
4373
4454
4374 \family typewriter
4455 \family typewriter
4375 backup
4456 backup
4376 \family default
4457 \family default
4377 : rename (if exists) to
4458 : rename (if exists) to
4378 \family typewriter
4459 \family typewriter
4379 log_name~
4460 log_name~
4380 \family default
4461 \family default
4381 and start
4462 and start
4382 \family typewriter
4463 \family typewriter
4383 log_name
4464 log_name
4384 \family default
4465 \family default
4385 .
4466 .
4386 \layout List
4467 \layout List
4387 \labelwidthstring 00.00.0000
4468 \labelwidthstring 00.00.0000
4388
4469
4389
4470
4390 \family typewriter
4471 \family typewriter
4391 append
4472 append
4392 \family default
4473 \family default
4393 : well, that says it.
4474 : well, that says it.
4394 \layout List
4475 \layout List
4395 \labelwidthstring 00.00.0000
4476 \labelwidthstring 00.00.0000
4396
4477
4397
4478
4398 \family typewriter
4479 \family typewriter
4399 rotate
4480 rotate
4400 \family default
4481 \family default
4401 : create rotating logs
4482 : create rotating logs
4402 \family typewriter
4483 \family typewriter
4403 log_name
4484 log_name
4404 \family default
4485 \family default
4405 .
4486 .
4406 \family typewriter
4487 \family typewriter
4407 1~
4488 1~
4408 \family default
4489 \family default
4409 ,
4490 ,
4410 \family typewriter
4491 \family typewriter
4411 log_name.2~
4492 log_name.2~
4412 \family default
4493 \family default
4413 , etc.
4494 , etc.
4414 \layout Standard
4495 \layout Standard
4415
4496
4416 The
4497 The
4417 \family typewriter
4498 \family typewriter
4418 %logoff
4499 %logoff
4419 \family default
4500 \family default
4420 and
4501 and
4421 \family typewriter
4502 \family typewriter
4422 %logon
4503 %logon
4423 \family default
4504 \family default
4424 functions allow you to temporarily stop and resume logging to a file which
4505 functions allow you to temporarily stop and resume logging to a file which
4425 had previously been started with
4506 had previously been started with
4426 \family typewriter
4507 \family typewriter
4427 %logstart
4508 %logstart
4428 \family default
4509 \family default
4429 .
4510 .
4430 They will fail (with an explanation) if you try to use them before logging
4511 They will fail (with an explanation) if you try to use them before logging
4431 has been started.
4512 has been started.
4432 \layout Subsection
4513 \layout Subsection
4433
4514
4434
4515
4435 \begin_inset LatexCommand \label{sub:System-shell-access}
4516 \begin_inset LatexCommand \label{sub:System-shell-access}
4436
4517
4437 \end_inset
4518 \end_inset
4438
4519
4439 System shell access
4520 System shell access
4440 \layout Standard
4521 \layout Standard
4441
4522
4442 Any input line beginning with a
4523 Any input line beginning with a
4443 \family typewriter
4524 \family typewriter
4444 !
4525 !
4445 \family default
4526 \family default
4446 character is passed verbatim (minus the
4527 character is passed verbatim (minus the
4447 \family typewriter
4528 \family typewriter
4448 !
4529 !
4449 \family default
4530 \family default
4450 , of course) to the underlying operating system.
4531 , of course) to the underlying operating system.
4451 For example, typing
4532 For example, typing
4452 \family typewriter
4533 \family typewriter
4453 !ls
4534 !ls
4454 \family default
4535 \family default
4455 will run
4536 will run
4456 \family typewriter
4537 \family typewriter
4457 'ls'
4538 'ls'
4458 \family default
4539 \family default
4459 in the current directory.
4540 in the current directory.
4460 \layout Subsubsection
4541 \layout Subsubsection
4461
4542
4462 Manual capture of command output
4543 Manual capture of command output
4463 \layout Standard
4544 \layout Standard
4464
4545
4465 If the input line begins with
4546 If the input line begins with
4466 \emph on
4547 \emph on
4467 two
4548 two
4468 \emph default
4549 \emph default
4469 exclamation marks,
4550 exclamation marks,
4470 \family typewriter
4551 \family typewriter
4471 !!
4552 !!
4472 \family default
4553 \family default
4473 , the command is executed but its output is captured and returned as a python
4554 , the command is executed but its output is captured and returned as a python
4474 list, split on newlines.
4555 list, split on newlines.
4475 Any output sent by the subprocess to standard error is printed separately,
4556 Any output sent by the subprocess to standard error is printed separately,
4476 so that the resulting list only captures standard output.
4557 so that the resulting list only captures standard output.
4477 The
4558 The
4478 \family typewriter
4559 \family typewriter
4479 !!
4560 !!
4480 \family default
4561 \family default
4481 syntax is a shorthand for the
4562 syntax is a shorthand for the
4482 \family typewriter
4563 \family typewriter
4483 %sx
4564 %sx
4484 \family default
4565 \family default
4485 magic command.
4566 magic command.
4486 \layout Standard
4567 \layout Standard
4487
4568
4488 Finally, the
4569 Finally, the
4489 \family typewriter
4570 \family typewriter
4490 %sc
4571 %sc
4491 \family default
4572 \family default
4492 magic (short for `shell capture') is similar to
4573 magic (short for `shell capture') is similar to
4493 \family typewriter
4574 \family typewriter
4494 %sx
4575 %sx
4495 \family default
4576 \family default
4496 , but allowing more fine-grained control of the capture details, and storing
4577 , but allowing more fine-grained control of the capture details, and storing
4497 the result directly into a named variable.
4578 the result directly into a named variable.
4498 \layout Standard
4579 \layout Standard
4499
4580
4500 See Sec.\SpecialChar ~
4581 See Sec.\SpecialChar ~
4501
4582
4502 \begin_inset LatexCommand \ref{sec:magic}
4583 \begin_inset LatexCommand \ref{sec:magic}
4503
4584
4504 \end_inset
4585 \end_inset
4505
4586
4506 for details on the magics
4587 for details on the magics
4507 \family typewriter
4588 \family typewriter
4508 %sc
4589 %sc
4509 \family default
4590 \family default
4510 and
4591 and
4511 \family typewriter
4592 \family typewriter
4512 %sx
4593 %sx
4513 \family default
4594 \family default
4514 , or use IPython's own help (
4595 , or use IPython's own help (
4515 \family typewriter
4596 \family typewriter
4516 sc?
4597 sc?
4517 \family default
4598 \family default
4518 and
4599 and
4519 \family typewriter
4600 \family typewriter
4520 sx?
4601 sx?
4521 \family default
4602 \family default
4522 ) for further details.
4603 ) for further details.
4523 \layout Standard
4604 \layout Standard
4524
4605
4525 IPython also allows you to expand the value of python variables when making
4606 IPython also allows you to expand the value of python variables when making
4526 system calls.
4607 system calls.
4527 Any python variable or expression which you prepend with
4608 Any python variable or expression which you prepend with
4528 \family typewriter
4609 \family typewriter
4529 $
4610 $
4530 \family default
4611 \family default
4531 will get expanded before the system call is made.
4612 will get expanded before the system call is made.
4532
4613
4533 \layout Standard
4614 \layout Standard
4534
4615
4535
4616
4536 \family typewriter
4617 \family typewriter
4537 In [1]: pyvar='Hello world'
4618 In [1]: pyvar='Hello world'
4538 \newline
4619 \newline
4539 In [2]: !echo "A python variable: $pyvar"
4620 In [2]: !echo "A python variable: $pyvar"
4540 \newline
4621 \newline
4541 A python variable: Hello world
4622 A python variable: Hello world
4542 \layout Standard
4623 \layout Standard
4543
4624
4544 If you want the shell to actually see a literal
4625 If you want the shell to actually see a literal
4545 \family typewriter
4626 \family typewriter
4546 $
4627 $
4547 \family default
4628 \family default
4548 , you need to type it twice:
4629 , you need to type it twice:
4549 \layout Standard
4630 \layout Standard
4550
4631
4551
4632
4552 \family typewriter
4633 \family typewriter
4553 In [3]: !echo "A system variable: $$HOME"
4634 In [3]: !echo "A system variable: $$HOME"
4554 \newline
4635 \newline
4555 A system variable: /home/fperez
4636 A system variable: /home/fperez
4556 \layout Standard
4637 \layout Standard
4557
4638
4558 You can pass arbitrary expressions, though you'll need to delimit them with
4639 You can pass arbitrary expressions, though you'll need to delimit them with
4559
4640
4560 \family typewriter
4641 \family typewriter
4561 {}
4642 {}
4562 \family default
4643 \family default
4563 if there is ambiguity as to the extent of the expression:
4644 if there is ambiguity as to the extent of the expression:
4564 \layout Standard
4645 \layout Standard
4565
4646
4566
4647
4567 \family typewriter
4648 \family typewriter
4568 In [5]: x=10
4649 In [5]: x=10
4569 \newline
4650 \newline
4570 In [6]: y=20
4651 In [6]: y=20
4571 \newline
4652 \newline
4572 In [13]: !echo $x+y
4653 In [13]: !echo $x+y
4573 \newline
4654 \newline
4574 10+y
4655 10+y
4575 \newline
4656 \newline
4576 In [7]: !echo ${x+y}
4657 In [7]: !echo ${x+y}
4577 \newline
4658 \newline
4578 30
4659 30
4579 \layout Standard
4660 \layout Standard
4580
4661
4581 Even object attributes can be expanded:
4662 Even object attributes can be expanded:
4582 \layout Standard
4663 \layout Standard
4583
4664
4584
4665
4585 \family typewriter
4666 \family typewriter
4586 In [12]: !echo $sys.argv
4667 In [12]: !echo $sys.argv
4587 \newline
4668 \newline
4588 [/home/fperez/usr/bin/ipython]
4669 [/home/fperez/usr/bin/ipython]
4589 \layout Subsection
4670 \layout Subsection
4590
4671
4591 System command aliases
4672 System command aliases
4592 \layout Standard
4673 \layout Standard
4593
4674
4594 The
4675 The
4595 \family typewriter
4676 \family typewriter
4596 %alias
4677 %alias
4597 \family default
4678 \family default
4598 magic function and the
4679 magic function and the
4599 \family typewriter
4680 \family typewriter
4600 alias
4681 alias
4601 \family default
4682 \family default
4602 option in the
4683 option in the
4603 \family typewriter
4684 \family typewriter
4604 ipythonrc
4685 ipythonrc
4605 \family default
4686 \family default
4606 configuration file allow you to define magic functions which are in fact
4687 configuration file allow you to define magic functions which are in fact
4607 system shell commands.
4688 system shell commands.
4608 These aliases can have parameters.
4689 These aliases can have parameters.
4609
4690
4610 \layout Standard
4691 \layout Standard
4611
4692
4612 '
4693 '
4613 \family typewriter
4694 \family typewriter
4614 %alias alias_name cmd
4695 %alias alias_name cmd
4615 \family default
4696 \family default
4616 ' defines '
4697 ' defines '
4617 \family typewriter
4698 \family typewriter
4618 alias_name
4699 alias_name
4619 \family default
4700 \family default
4620 ' as an alias for '
4701 ' as an alias for '
4621 \family typewriter
4702 \family typewriter
4622 cmd
4703 cmd
4623 \family default
4704 \family default
4624 '
4705 '
4625 \layout Standard
4706 \layout Standard
4626
4707
4627 Then, typing '
4708 Then, typing '
4628 \family typewriter
4709 \family typewriter
4629 %alias_name params
4710 %alias_name params
4630 \family default
4711 \family default
4631 ' will execute the system command '
4712 ' will execute the system command '
4632 \family typewriter
4713 \family typewriter
4633 cmd params
4714 cmd params
4634 \family default
4715 \family default
4635 ' (from your underlying operating system).
4716 ' (from your underlying operating system).
4636
4717
4637 \layout Standard
4718 \layout Standard
4638
4719
4639 You can also define aliases with parameters using
4720 You can also define aliases with parameters using
4640 \family typewriter
4721 \family typewriter
4641 %s
4722 %s
4642 \family default
4723 \family default
4643 specifiers (one per parameter).
4724 specifiers (one per parameter).
4644 The following example defines the
4725 The following example defines the
4645 \family typewriter
4726 \family typewriter
4646 %parts
4727 %parts
4647 \family default
4728 \family default
4648 function as an alias to the command '
4729 function as an alias to the command '
4649 \family typewriter
4730 \family typewriter
4650 echo first %s second %s
4731 echo first %s second %s
4651 \family default
4732 \family default
4652 ' where each
4733 ' where each
4653 \family typewriter
4734 \family typewriter
4654 %s
4735 %s
4655 \family default
4736 \family default
4656 will be replaced by a positional parameter to the call to
4737 will be replaced by a positional parameter to the call to
4657 \family typewriter
4738 \family typewriter
4658 %parts:
4739 %parts:
4659 \layout Standard
4740 \layout Standard
4660
4741
4661
4742
4662 \family typewriter
4743 \family typewriter
4663 In [1]: alias parts echo first %s second %s
4744 In [1]: alias parts echo first %s second %s
4664 \newline
4745 \newline
4665 In [2]: %parts A B
4746 In [2]: %parts A B
4666 \newline
4747 \newline
4667 first A second B
4748 first A second B
4668 \newline
4749 \newline
4669 In [3]: %parts A
4750 In [3]: %parts A
4670 \newline
4751 \newline
4671 Incorrect number of arguments: 2 expected.
4752 Incorrect number of arguments: 2 expected.
4672
4753
4673 \newline
4754 \newline
4674 parts is an alias to: 'echo first %s second %s'
4755 parts is an alias to: 'echo first %s second %s'
4675 \layout Standard
4756 \layout Standard
4676
4757
4677 If called with no parameters,
4758 If called with no parameters,
4678 \family typewriter
4759 \family typewriter
4679 %alias
4760 %alias
4680 \family default
4761 \family default
4681 prints the table of currently defined aliases.
4762 prints the table of currently defined aliases.
4682 \layout Standard
4763 \layout Standard
4683
4764
4684 The
4765 The
4685 \family typewriter
4766 \family typewriter
4686 %rehash/rehashx
4767 %rehash/rehashx
4687 \family default
4768 \family default
4688 magics allow you to load your entire
4769 magics allow you to load your entire
4689 \family typewriter
4770 \family typewriter
4690 $PATH
4771 $PATH
4691 \family default
4772 \family default
4692 as ipython aliases.
4773 as ipython aliases.
4693 See their respective docstrings (or sec.\SpecialChar ~
4774 See their respective docstrings (or sec.\SpecialChar ~
4694
4775
4695 \begin_inset LatexCommand \ref{sec:magic}
4776 \begin_inset LatexCommand \ref{sec:magic}
4696
4777
4697 \end_inset
4778 \end_inset
4698
4779
4699 for further details).
4780 for further details).
4700 \layout Subsection
4781 \layout Subsection
4701
4782
4702
4783
4703 \begin_inset LatexCommand \label{sec:dreload}
4784 \begin_inset LatexCommand \label{sec:dreload}
4704
4785
4705 \end_inset
4786 \end_inset
4706
4787
4707 Recursive reload
4788 Recursive reload
4708 \layout Standard
4789 \layout Standard
4709
4790
4710 The
4791 The
4711 \family typewriter
4792 \family typewriter
4712 %dreload
4793 %dreload
4713 \family default
4794 \family default
4714 command does a recursive reload of a module: changes made to the module
4795 command does a recursive reload of a module: changes made to the module
4715 since you imported will actually be available without having to exit.
4796 since you imported will actually be available without having to exit.
4716 \layout Subsection
4797 \layout Subsection
4717
4798
4718 Verbose and colored exception traceback printouts
4799 Verbose and colored exception traceback printouts
4719 \layout Standard
4800 \layout Standard
4720
4801
4721 IPython provides the option to see very detailed exception tracebacks, which
4802 IPython provides the option to see very detailed exception tracebacks, which
4722 can be especially useful when debugging large programs.
4803 can be especially useful when debugging large programs.
4723 You can run any Python file with the
4804 You can run any Python file with the
4724 \family typewriter
4805 \family typewriter
4725 %run
4806 %run
4726 \family default
4807 \family default
4727 function to benefit from these detailed tracebacks.
4808 function to benefit from these detailed tracebacks.
4728 Furthermore, both normal and verbose tracebacks can be colored (if your
4809 Furthermore, both normal and verbose tracebacks can be colored (if your
4729 terminal supports it) which makes them much easier to parse visually.
4810 terminal supports it) which makes them much easier to parse visually.
4730 \layout Standard
4811 \layout Standard
4731
4812
4732 See the magic
4813 See the magic
4733 \family typewriter
4814 \family typewriter
4734 xmode
4815 xmode
4735 \family default
4816 \family default
4736 and
4817 and
4737 \family typewriter
4818 \family typewriter
4738 colors
4819 colors
4739 \family default
4820 \family default
4740 functions for details (just type
4821 functions for details (just type
4741 \family typewriter
4822 \family typewriter
4742 %magic
4823 %magic
4743 \family default
4824 \family default
4744 ).
4825 ).
4745 \layout Standard
4826 \layout Standard
4746
4827
4747 These features are basically a terminal version of Ka-Ping Yee's
4828 These features are basically a terminal version of Ka-Ping Yee's
4748 \family typewriter
4829 \family typewriter
4749 cgitb
4830 cgitb
4750 \family default
4831 \family default
4751 module, now part of the standard Python library.
4832 module, now part of the standard Python library.
4752 \layout Subsection
4833 \layout Subsection
4753
4834
4754
4835
4755 \begin_inset LatexCommand \label{sec:cache_input}
4836 \begin_inset LatexCommand \label{sec:cache_input}
4756
4837
4757 \end_inset
4838 \end_inset
4758
4839
4759 Input caching system
4840 Input caching system
4760 \layout Standard
4841 \layout Standard
4761
4842
4762 IPython offers numbered prompts (In/Out) with input and output caching.
4843 IPython offers numbered prompts (In/Out) with input and output caching.
4763 All input is saved and can be retrieved as variables (besides the usual
4844 All input is saved and can be retrieved as variables (besides the usual
4764 arrow key recall).
4845 arrow key recall).
4765 \layout Standard
4846 \layout Standard
4766
4847
4767 The following GLOBAL variables always exist (so don't overwrite them!):
4848 The following GLOBAL variables always exist (so don't overwrite them!):
4768
4849
4769 \family typewriter
4850 \family typewriter
4770 _i
4851 _i
4771 \family default
4852 \family default
4772 : stores previous input.
4853 : stores previous input.
4773
4854
4774 \family typewriter
4855 \family typewriter
4775 _ii
4856 _ii
4776 \family default
4857 \family default
4777 : next previous.
4858 : next previous.
4778
4859
4779 \family typewriter
4860 \family typewriter
4780 _iii
4861 _iii
4781 \family default
4862 \family default
4782 : next-next previous.
4863 : next-next previous.
4783
4864
4784 \family typewriter
4865 \family typewriter
4785 _ih
4866 _ih
4786 \family default
4867 \family default
4787 : a list of all input
4868 : a list of all input
4788 \family typewriter
4869 \family typewriter
4789 _ih[n]
4870 _ih[n]
4790 \family default
4871 \family default
4791 is the input from line
4872 is the input from line
4792 \family typewriter
4873 \family typewriter
4793 n
4874 n
4794 \family default
4875 \family default
4795 and this list is aliased to the global variable
4876 and this list is aliased to the global variable
4796 \family typewriter
4877 \family typewriter
4797 In
4878 In
4798 \family default
4879 \family default
4799 .
4880 .
4800 If you overwrite
4881 If you overwrite
4801 \family typewriter
4882 \family typewriter
4802 In
4883 In
4803 \family default
4884 \family default
4804 with a variable of your own, you can remake the assignment to the internal
4885 with a variable of your own, you can remake the assignment to the internal
4805 list with a simple
4886 list with a simple
4806 \family typewriter
4887 \family typewriter
4807 'In=_ih'
4888 'In=_ih'
4808 \family default
4889 \family default
4809 .
4890 .
4810 \layout Standard
4891 \layout Standard
4811
4892
4812 Additionally, global variables named
4893 Additionally, global variables named
4813 \family typewriter
4894 \family typewriter
4814 _i<n>
4895 _i<n>
4815 \family default
4896 \family default
4816 are dynamically created (
4897 are dynamically created (
4817 \family typewriter
4898 \family typewriter
4818 <n>
4899 <n>
4819 \family default
4900 \family default
4820 being the prompt counter), such that
4901 being the prompt counter), such that
4821 \newline
4902 \newline
4822
4903
4823 \family typewriter
4904 \family typewriter
4824 _i<n> == _ih[<n>] == In[<n>].
4905 _i<n> == _ih[<n>] == In[<n>].
4825 \layout Standard
4906 \layout Standard
4826
4907
4827 For example, what you typed at prompt 14 is available as
4908 For example, what you typed at prompt 14 is available as
4828 \family typewriter
4909 \family typewriter
4829 _i14,
4910 _i14,
4830 \family default
4911 \family default
4831
4912
4832 \family typewriter
4913 \family typewriter
4833 _ih[14]
4914 _ih[14]
4834 \family default
4915 \family default
4835 and
4916 and
4836 \family typewriter
4917 \family typewriter
4837 In[14]
4918 In[14]
4838 \family default
4919 \family default
4839 .
4920 .
4840 \layout Standard
4921 \layout Standard
4841
4922
4842 This allows you to easily cut and paste multi line interactive prompts by
4923 This allows you to easily cut and paste multi line interactive prompts by
4843 printing them out: they print like a clean string, without prompt characters.
4924 printing them out: they print like a clean string, without prompt characters.
4844 You can also manipulate them like regular variables (they are strings),
4925 You can also manipulate them like regular variables (they are strings),
4845 modify or exec them (typing
4926 modify or exec them (typing
4846 \family typewriter
4927 \family typewriter
4847 'exec _i9'
4928 'exec _i9'
4848 \family default
4929 \family default
4849 will re-execute the contents of input prompt 9, '
4930 will re-execute the contents of input prompt 9, '
4850 \family typewriter
4931 \family typewriter
4851 exec In[9:14]+In[18]
4932 exec In[9:14]+In[18]
4852 \family default
4933 \family default
4853 ' will re-execute lines 9 through 13 and line 18).
4934 ' will re-execute lines 9 through 13 and line 18).
4854 \layout Standard
4935 \layout Standard
4855
4936
4856 You can also re-execute multiple lines of input easily by using the magic
4937 You can also re-execute multiple lines of input easily by using the magic
4857
4938
4858 \family typewriter
4939 \family typewriter
4859 %macro
4940 %macro
4860 \family default
4941 \family default
4861 function (which automates the process and allows re-execution without having
4942 function (which automates the process and allows re-execution without having
4862 to type '
4943 to type '
4863 \family typewriter
4944 \family typewriter
4864 exec
4945 exec
4865 \family default
4946 \family default
4866 ' every time).
4947 ' every time).
4867 The macro system also allows you to re-execute previous lines which include
4948 The macro system also allows you to re-execute previous lines which include
4868 magic function calls (which require special processing).
4949 magic function calls (which require special processing).
4869 Type
4950 Type
4870 \family typewriter
4951 \family typewriter
4871 %macro?
4952 %macro?
4872 \family default
4953 \family default
4873 or see sec.
4954 or see sec.
4874
4955
4875 \begin_inset LatexCommand \ref{sec:magic}
4956 \begin_inset LatexCommand \ref{sec:magic}
4876
4957
4877 \end_inset
4958 \end_inset
4878
4959
4879 for more details on the macro system.
4960 for more details on the macro system.
4880 \layout Standard
4961 \layout Standard
4881
4962
4882 A history function
4963 A history function
4883 \family typewriter
4964 \family typewriter
4884 %hist
4965 %hist
4885 \family default
4966 \family default
4886 allows you to see any part of your input history by printing a range of
4967 allows you to see any part of your input history by printing a range of
4887 the
4968 the
4888 \family typewriter
4969 \family typewriter
4889 _i
4970 _i
4890 \family default
4971 \family default
4891 variables.
4972 variables.
4892 \layout Subsection
4973 \layout Subsection
4893
4974
4894
4975
4895 \begin_inset LatexCommand \label{sec:cache_output}
4976 \begin_inset LatexCommand \label{sec:cache_output}
4896
4977
4897 \end_inset
4978 \end_inset
4898
4979
4899 Output caching system
4980 Output caching system
4900 \layout Standard
4981 \layout Standard
4901
4982
4902 For output that is returned from actions, a system similar to the input
4983 For output that is returned from actions, a system similar to the input
4903 cache exists but using
4984 cache exists but using
4904 \family typewriter
4985 \family typewriter
4905 _
4986 _
4906 \family default
4987 \family default
4907 instead of
4988 instead of
4908 \family typewriter
4989 \family typewriter
4909 _i
4990 _i
4910 \family default
4991 \family default
4911 .
4992 .
4912 Only actions that produce a result (NOT assignments, for example) are cached.
4993 Only actions that produce a result (NOT assignments, for example) are cached.
4913 If you are familiar with Mathematica, IPython's
4994 If you are familiar with Mathematica, IPython's
4914 \family typewriter
4995 \family typewriter
4915 _
4996 _
4916 \family default
4997 \family default
4917 variables behave exactly like Mathematica's
4998 variables behave exactly like Mathematica's
4918 \family typewriter
4999 \family typewriter
4919 %
5000 %
4920 \family default
5001 \family default
4921 variables.
5002 variables.
4922 \layout Standard
5003 \layout Standard
4923
5004
4924 The following GLOBAL variables always exist (so don't overwrite them!):
5005 The following GLOBAL variables always exist (so don't overwrite them!):
4925
5006
4926 \layout List
5007 \layout List
4927 \labelwidthstring 00.00.0000
5008 \labelwidthstring 00.00.0000
4928
5009
4929
5010
4930 \family typewriter
5011 \family typewriter
4931 \series bold
5012 \series bold
4932 _
5013 _
4933 \family default
5014 \family default
4934 \series default
5015 \series default
4935 (a
5016 (a
4936 \emph on
5017 \emph on
4937 single
5018 single
4938 \emph default
5019 \emph default
4939 underscore) : stores previous output, like Python's default interpreter.
5020 underscore) : stores previous output, like Python's default interpreter.
4940 \layout List
5021 \layout List
4941 \labelwidthstring 00.00.0000
5022 \labelwidthstring 00.00.0000
4942
5023
4943
5024
4944 \family typewriter
5025 \family typewriter
4945 \series bold
5026 \series bold
4946 __
5027 __
4947 \family default
5028 \family default
4948 \series default
5029 \series default
4949 (two underscores): next previous.
5030 (two underscores): next previous.
4950 \layout List
5031 \layout List
4951 \labelwidthstring 00.00.0000
5032 \labelwidthstring 00.00.0000
4952
5033
4953
5034
4954 \family typewriter
5035 \family typewriter
4955 \series bold
5036 \series bold
4956 ___
5037 ___
4957 \family default
5038 \family default
4958 \series default
5039 \series default
4959 (three underscores): next-next previous.
5040 (three underscores): next-next previous.
4960 \layout Standard
5041 \layout Standard
4961
5042
4962 Additionally, global variables named
5043 Additionally, global variables named
4963 \family typewriter
5044 \family typewriter
4964 _<n>
5045 _<n>
4965 \family default
5046 \family default
4966 are dynamically created (
5047 are dynamically created (
4967 \family typewriter
5048 \family typewriter
4968 <n>
5049 <n>
4969 \family default
5050 \family default
4970 being the prompt counter), such that the result of output
5051 being the prompt counter), such that the result of output
4971 \family typewriter
5052 \family typewriter
4972 <n>
5053 <n>
4973 \family default
5054 \family default
4974 is always available as
5055 is always available as
4975 \family typewriter
5056 \family typewriter
4976 _<n>
5057 _<n>
4977 \family default
5058 \family default
4978 (don't use the angle brackets, just the number, e.g.
5059 (don't use the angle brackets, just the number, e.g.
4979
5060
4980 \family typewriter
5061 \family typewriter
4981 _21
5062 _21
4982 \family default
5063 \family default
4983 ).
5064 ).
4984 \layout Standard
5065 \layout Standard
4985
5066
4986 These global variables are all stored in a global dictionary (not a list,
5067 These global variables are all stored in a global dictionary (not a list,
4987 since it only has entries for lines which returned a result) available
5068 since it only has entries for lines which returned a result) available
4988 under the names
5069 under the names
4989 \family typewriter
5070 \family typewriter
4990 _oh
5071 _oh
4991 \family default
5072 \family default
4992 and
5073 and
4993 \family typewriter
5074 \family typewriter
4994 Out
5075 Out
4995 \family default
5076 \family default
4996 (similar to
5077 (similar to
4997 \family typewriter
5078 \family typewriter
4998 _ih
5079 _ih
4999 \family default
5080 \family default
5000 and
5081 and
5001 \family typewriter
5082 \family typewriter
5002 In
5083 In
5003 \family default
5084 \family default
5004 ).
5085 ).
5005 So the output from line 12 can be obtained as
5086 So the output from line 12 can be obtained as
5006 \family typewriter
5087 \family typewriter
5007 _12
5088 _12
5008 \family default
5089 \family default
5009 ,
5090 ,
5010 \family typewriter
5091 \family typewriter
5011 Out[12]
5092 Out[12]
5012 \family default
5093 \family default
5013 or
5094 or
5014 \family typewriter
5095 \family typewriter
5015 _oh[12]
5096 _oh[12]
5016 \family default
5097 \family default
5017 .
5098 .
5018 If you accidentally overwrite the
5099 If you accidentally overwrite the
5019 \family typewriter
5100 \family typewriter
5020 Out
5101 Out
5021 \family default
5102 \family default
5022 variable you can recover it by typing
5103 variable you can recover it by typing
5023 \family typewriter
5104 \family typewriter
5024 'Out=_oh
5105 'Out=_oh
5025 \family default
5106 \family default
5026 ' at the prompt.
5107 ' at the prompt.
5027 \layout Standard
5108 \layout Standard
5028
5109
5029 This system obviously can potentially put heavy memory demands on your system,
5110 This system obviously can potentially put heavy memory demands on your system,
5030 since it prevents Python's garbage collector from removing any previously
5111 since it prevents Python's garbage collector from removing any previously
5031 computed results.
5112 computed results.
5032 You can control how many results are kept in memory with the option (at
5113 You can control how many results are kept in memory with the option (at
5033 the command line or in your
5114 the command line or in your
5034 \family typewriter
5115 \family typewriter
5035 ipythonrc
5116 ipythonrc
5036 \family default
5117 \family default
5037 file)
5118 file)
5038 \family typewriter
5119 \family typewriter
5039 cache_size
5120 cache_size
5040 \family default
5121 \family default
5041 .
5122 .
5042 If you set it to 0, the whole system is completely disabled and the prompts
5123 If you set it to 0, the whole system is completely disabled and the prompts
5043 revert to the classic
5124 revert to the classic
5044 \family typewriter
5125 \family typewriter
5045 '>>>'
5126 '>>>'
5046 \family default
5127 \family default
5047 of normal Python.
5128 of normal Python.
5048 \layout Subsection
5129 \layout Subsection
5049
5130
5050 Directory history
5131 Directory history
5051 \layout Standard
5132 \layout Standard
5052
5133
5053 Your history of visited directories is kept in the global list
5134 Your history of visited directories is kept in the global list
5054 \family typewriter
5135 \family typewriter
5055 _dh
5136 _dh
5056 \family default
5137 \family default
5057 , and the magic
5138 , and the magic
5058 \family typewriter
5139 \family typewriter
5059 %cd
5140 %cd
5060 \family default
5141 \family default
5061 command can be used to go to any entry in that list.
5142 command can be used to go to any entry in that list.
5062 The
5143 The
5063 \family typewriter
5144 \family typewriter
5064 %dhist
5145 %dhist
5065 \family default
5146 \family default
5066 command allows you to view this history.
5147 command allows you to view this history.
5067 \layout Subsection
5148 \layout Subsection
5068
5149
5069 Automatic parentheses and quotes
5150 Automatic parentheses and quotes
5070 \layout Standard
5151 \layout Standard
5071
5152
5072 These features were adapted from Nathan Gray's LazyPython.
5153 These features were adapted from Nathan Gray's LazyPython.
5073 They are meant to allow less typing for common situations.
5154 They are meant to allow less typing for common situations.
5074 \layout Subsubsection
5155 \layout Subsubsection
5075
5156
5076 Automatic parentheses
5157 Automatic parentheses
5077 \layout Standard
5158 \layout Standard
5078
5159
5079 Callable objects (i.e.
5160 Callable objects (i.e.
5080 functions, methods, etc) can be invoked like this (notice the commas between
5161 functions, methods, etc) can be invoked like this (notice the commas between
5081 the arguments):
5162 the arguments):
5082 \layout Standard
5163 \layout Standard
5083
5164
5084
5165
5085 \family typewriter
5166 \family typewriter
5086 >>> callable_ob arg1, arg2, arg3
5167 >>> callable_ob arg1, arg2, arg3
5087 \layout Standard
5168 \layout Standard
5088
5169
5089 and the input will be translated to this:
5170 and the input will be translated to this:
5090 \layout Standard
5171 \layout Standard
5091
5172
5092
5173
5093 \family typewriter
5174 \family typewriter
5094 --> callable_ob(arg1, arg2, arg3)
5175 --> callable_ob(arg1, arg2, arg3)
5095 \layout Standard
5176 \layout Standard
5096
5177
5097 You can force automatic parentheses by using '/' as the first character
5178 You can force automatic parentheses by using '/' as the first character
5098 of a line.
5179 of a line.
5099 For example:
5180 For example:
5100 \layout Standard
5181 \layout Standard
5101
5182
5102
5183
5103 \family typewriter
5184 \family typewriter
5104 >>> /globals # becomes 'globals()'
5185 >>> /globals # becomes 'globals()'
5105 \layout Standard
5186 \layout Standard
5106
5187
5107 Note that the '/' MUST be the first character on the line! This won't work:
5188 Note that the '/' MUST be the first character on the line! This won't work:
5108
5189
5109 \layout Standard
5190 \layout Standard
5110
5191
5111
5192
5112 \family typewriter
5193 \family typewriter
5113 >>> print /globals # syntax error
5194 >>> print /globals # syntax error
5114 \layout Standard
5195 \layout Standard
5115
5196
5116 In most cases the automatic algorithm should work, so you should rarely
5197 In most cases the automatic algorithm should work, so you should rarely
5117 need to explicitly invoke /.
5198 need to explicitly invoke /.
5118 One notable exception is if you are trying to call a function with a list
5199 One notable exception is if you are trying to call a function with a list
5119 of tuples as arguments (the parenthesis will confuse IPython):
5200 of tuples as arguments (the parenthesis will confuse IPython):
5120 \layout Standard
5201 \layout Standard
5121
5202
5122
5203
5123 \family typewriter
5204 \family typewriter
5124 In [1]: zip (1,2,3),(4,5,6) # won't work
5205 In [1]: zip (1,2,3),(4,5,6) # won't work
5125 \layout Standard
5206 \layout Standard
5126
5207
5127 but this will work:
5208 but this will work:
5128 \layout Standard
5209 \layout Standard
5129
5210
5130
5211
5131 \family typewriter
5212 \family typewriter
5132 In [2]: /zip (1,2,3),(4,5,6)
5213 In [2]: /zip (1,2,3),(4,5,6)
5133 \newline
5214 \newline
5134 ------> zip ((1,2,3),(4,5,6))
5215 ------> zip ((1,2,3),(4,5,6))
5135 \newline
5216 \newline
5136 Out[2]= [(1, 4), (2, 5), (3, 6)]
5217 Out[2]= [(1, 4), (2, 5), (3, 6)]
5137 \layout Standard
5218 \layout Standard
5138
5219
5139 IPython tells you that it has altered your command line by displaying the
5220 IPython tells you that it has altered your command line by displaying the
5140 new command line preceded by
5221 new command line preceded by
5141 \family typewriter
5222 \family typewriter
5142 -->
5223 -->
5143 \family default
5224 \family default
5144 .
5225 .
5145 e.g.:
5226 e.g.:
5146 \layout Standard
5227 \layout Standard
5147
5228
5148
5229
5149 \family typewriter
5230 \family typewriter
5150 In [18]: callable list
5231 In [18]: callable list
5151 \newline
5232 \newline
5152 -------> callable (list)
5233 -------> callable (list)
5153 \layout Subsubsection
5234 \layout Subsubsection
5154
5235
5155 Automatic quoting
5236 Automatic quoting
5156 \layout Standard
5237 \layout Standard
5157
5238
5158 You can force automatic quoting of a function's arguments by using
5239 You can force automatic quoting of a function's arguments by using
5159 \family typewriter
5240 \family typewriter
5160 `,'
5241 `,'
5161 \family default
5242 \family default
5162 or
5243 or
5163 \family typewriter
5244 \family typewriter
5164 `;'
5245 `;'
5165 \family default
5246 \family default
5166 as the first character of a line.
5247 as the first character of a line.
5167 For example:
5248 For example:
5168 \layout Standard
5249 \layout Standard
5169
5250
5170
5251
5171 \family typewriter
5252 \family typewriter
5172 >>> ,my_function /home/me # becomes my_function("/home/me")
5253 >>> ,my_function /home/me # becomes my_function("/home/me")
5173 \layout Standard
5254 \layout Standard
5174
5255
5175 If you use
5256 If you use
5176 \family typewriter
5257 \family typewriter
5177 `;'
5258 `;'
5178 \family default
5259 \family default
5179 instead, the whole argument is quoted as a single string (while
5260 instead, the whole argument is quoted as a single string (while
5180 \family typewriter
5261 \family typewriter
5181 `,'
5262 `,'
5182 \family default
5263 \family default
5183 splits on whitespace):
5264 splits on whitespace):
5184 \layout Standard
5265 \layout Standard
5185
5266
5186
5267
5187 \family typewriter
5268 \family typewriter
5188 >>> ,my_function a b c # becomes my_function("a","b","c")
5269 >>> ,my_function a b c # becomes my_function("a","b","c")
5189 \layout Standard
5270 \layout Standard
5190
5271
5191
5272
5192 \family typewriter
5273 \family typewriter
5193 >>> ;my_function a b c # becomes my_function("a b c")
5274 >>> ;my_function a b c # becomes my_function("a b c")
5194 \layout Standard
5275 \layout Standard
5195
5276
5196 Note that the `
5277 Note that the `
5197 \family typewriter
5278 \family typewriter
5198 ,
5279 ,
5199 \family default
5280 \family default
5200 ' or `
5281 ' or `
5201 \family typewriter
5282 \family typewriter
5202 ;
5283 ;
5203 \family default
5284 \family default
5204 ' MUST be the first character on the line! This won't work:
5285 ' MUST be the first character on the line! This won't work:
5205 \layout Standard
5286 \layout Standard
5206
5287
5207
5288
5208 \family typewriter
5289 \family typewriter
5209 >>> x = ,my_function /home/me # syntax error
5290 >>> x = ,my_function /home/me # syntax error
5210 \layout Section
5291 \layout Section
5211
5292
5212
5293
5213 \begin_inset LatexCommand \label{sec:customization}
5294 \begin_inset LatexCommand \label{sec:customization}
5214
5295
5215 \end_inset
5296 \end_inset
5216
5297
5217 Customization
5298 Customization
5218 \layout Standard
5299 \layout Standard
5219
5300
5220 As we've already mentioned, IPython reads a configuration file which can
5301 As we've already mentioned, IPython reads a configuration file which can
5221 be specified at the command line (
5302 be specified at the command line (
5222 \family typewriter
5303 \family typewriter
5223 -rcfile
5304 -rcfile
5224 \family default
5305 \family default
5225 ) or which by default is assumed to be called
5306 ) or which by default is assumed to be called
5226 \family typewriter
5307 \family typewriter
5227 ipythonrc
5308 ipythonrc
5228 \family default
5309 \family default
5229 .
5310 .
5230 Such a file is looked for in the current directory where IPython is started
5311 Such a file is looked for in the current directory where IPython is started
5231 and then in your
5312 and then in your
5232 \family typewriter
5313 \family typewriter
5233 IPYTHONDIR
5314 IPYTHONDIR
5234 \family default
5315 \family default
5235 , which allows you to have local configuration files for specific projects.
5316 , which allows you to have local configuration files for specific projects.
5236 In this section we will call these types of configuration files simply
5317 In this section we will call these types of configuration files simply
5237 rcfiles (short for resource configuration file).
5318 rcfiles (short for resource configuration file).
5238 \layout Standard
5319 \layout Standard
5239
5320
5240 The syntax of an rcfile is one of key-value pairs separated by whitespace,
5321 The syntax of an rcfile is one of key-value pairs separated by whitespace,
5241 one per line.
5322 one per line.
5242 Lines beginning with a
5323 Lines beginning with a
5243 \family typewriter
5324 \family typewriter
5244 #
5325 #
5245 \family default
5326 \family default
5246 are ignored as comments, but comments can
5327 are ignored as comments, but comments can
5247 \series bold
5328 \series bold
5248 not
5329 not
5249 \series default
5330 \series default
5250 be put on lines with data (the parser is fairly primitive).
5331 be put on lines with data (the parser is fairly primitive).
5251 Note that these are not python files, and this is deliberate, because it
5332 Note that these are not python files, and this is deliberate, because it
5252 allows us to do some things which would be quite tricky to implement if
5333 allows us to do some things which would be quite tricky to implement if
5253 they were normal python files.
5334 they were normal python files.
5254 \layout Standard
5335 \layout Standard
5255
5336
5256 First, an rcfile can contain permanent default values for almost all command
5337 First, an rcfile can contain permanent default values for almost all command
5257 line options (except things like
5338 line options (except things like
5258 \family typewriter
5339 \family typewriter
5259 -help
5340 -help
5260 \family default
5341 \family default
5261 or
5342 or
5262 \family typewriter
5343 \family typewriter
5263 -Version
5344 -Version
5264 \family default
5345 \family default
5265 ).
5346 ).
5266 Sec\SpecialChar ~
5347 Sec\SpecialChar ~
5267
5348
5268 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5349 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5269
5350
5270 \end_inset
5351 \end_inset
5271
5352
5272 contains a description of all command-line options.
5353 contains a description of all command-line options.
5273 However, values you explicitly specify at the command line override the
5354 However, values you explicitly specify at the command line override the
5274 values defined in the rcfile.
5355 values defined in the rcfile.
5275 \layout Standard
5356 \layout Standard
5276
5357
5277 Besides command line option values, the rcfile can specify values for certain
5358 Besides command line option values, the rcfile can specify values for certain
5278 extra special options which are not available at the command line.
5359 extra special options which are not available at the command line.
5279 These options are briefly described below.
5360 These options are briefly described below.
5280
5361
5281 \layout Standard
5362 \layout Standard
5282
5363
5283 Each of these options may appear as many times as you need it in the file.
5364 Each of these options may appear as many times as you need it in the file.
5284 \layout List
5365 \layout List
5285 \labelwidthstring 00.00.0000
5366 \labelwidthstring 00.00.0000
5286
5367
5287
5368
5288 \family typewriter
5369 \family typewriter
5289 \series bold
5370 \series bold
5290 include\SpecialChar ~
5371 include\SpecialChar ~
5291 <file1>\SpecialChar ~
5372 <file1>\SpecialChar ~
5292 <file2>\SpecialChar ~
5373 <file2>\SpecialChar ~
5293 ...
5374 ...
5294 \family default
5375 \family default
5295 \series default
5376 \series default
5296 : you can name
5377 : you can name
5297 \emph on
5378 \emph on
5298 other
5379 other
5299 \emph default
5380 \emph default
5300 rcfiles you want to recursively load up to 15 levels (don't use the
5381 rcfiles you want to recursively load up to 15 levels (don't use the
5301 \family typewriter
5382 \family typewriter
5302 <>
5383 <>
5303 \family default
5384 \family default
5304 brackets in your names!).
5385 brackets in your names!).
5305 This feature allows you to define a 'base' rcfile with general options
5386 This feature allows you to define a 'base' rcfile with general options
5306 and special-purpose files which can be loaded only when needed with particular
5387 and special-purpose files which can be loaded only when needed with particular
5307 configuration options.
5388 configuration options.
5308 To make this more convenient, IPython accepts the
5389 To make this more convenient, IPython accepts the
5309 \family typewriter
5390 \family typewriter
5310 -profile <name>
5391 -profile <name>
5311 \family default
5392 \family default
5312 option (abbreviates to
5393 option (abbreviates to
5313 \family typewriter
5394 \family typewriter
5314 -p <name
5395 -p <name
5315 \family default
5396 \family default
5316 >)
5397 >)
5317 \family typewriter
5398 \family typewriter
5318 which
5399 which
5319 \family default
5400 \family default
5320 tells it to look for an rcfile named
5401 tells it to look for an rcfile named
5321 \family typewriter
5402 \family typewriter
5322 ipythonrc-<name>
5403 ipythonrc-<name>
5323 \family default
5404 \family default
5324 .
5405 .
5325
5406
5326 \layout List
5407 \layout List
5327 \labelwidthstring 00.00.0000
5408 \labelwidthstring 00.00.0000
5328
5409
5329
5410
5330 \family typewriter
5411 \family typewriter
5331 \series bold
5412 \series bold
5332 import_mod\SpecialChar ~
5413 import_mod\SpecialChar ~
5333 <mod1>\SpecialChar ~
5414 <mod1>\SpecialChar ~
5334 <mod2>\SpecialChar ~
5415 <mod2>\SpecialChar ~
5335 ...
5416 ...
5336 \family default
5417 \family default
5337 \series default
5418 \series default
5338 : import modules with '
5419 : import modules with '
5339 \family typewriter
5420 \family typewriter
5340 import
5421 import
5341 \family default
5422 \family default
5342
5423
5343 \family typewriter
5424 \family typewriter
5344 <mod1>,<mod2>,...
5425 <mod1>,<mod2>,...
5345 \family default
5426 \family default
5346 '
5427 '
5347 \layout List
5428 \layout List
5348 \labelwidthstring 00.00.0000
5429 \labelwidthstring 00.00.0000
5349
5430
5350
5431
5351 \family typewriter
5432 \family typewriter
5352 \series bold
5433 \series bold
5353 import_some\SpecialChar ~
5434 import_some\SpecialChar ~
5354 <mod>\SpecialChar ~
5435 <mod>\SpecialChar ~
5355 <f1>\SpecialChar ~
5436 <f1>\SpecialChar ~
5356 <f2>\SpecialChar ~
5437 <f2>\SpecialChar ~
5357 ...
5438 ...
5358 \family default
5439 \family default
5359 \series default
5440 \series default
5360 : import functions with '
5441 : import functions with '
5361 \family typewriter
5442 \family typewriter
5362 from <mod> import
5443 from <mod> import
5363 \family default
5444 \family default
5364
5445
5365 \family typewriter
5446 \family typewriter
5366 <f1>,<f2>,...
5447 <f1>,<f2>,...
5367 \family default
5448 \family default
5368 '
5449 '
5369 \layout List
5450 \layout List
5370 \labelwidthstring 00.00.0000
5451 \labelwidthstring 00.00.0000
5371
5452
5372
5453
5373 \family typewriter
5454 \family typewriter
5374 \series bold
5455 \series bold
5375 import_all\SpecialChar ~
5456 import_all\SpecialChar ~
5376 <mod1>\SpecialChar ~
5457 <mod1>\SpecialChar ~
5377 <mod2>\SpecialChar ~
5458 <mod2>\SpecialChar ~
5378 ...
5459 ...
5379 \family default
5460 \family default
5380 \series default
5461 \series default
5381 : for each module listed import functions with '
5462 : for each module listed import functions with '
5382 \family typewriter
5463 \family typewriter
5383 from <mod> import *
5464 from <mod> import *
5384 \family default
5465 \family default
5385 '
5466 '
5386 \layout List
5467 \layout List
5387 \labelwidthstring 00.00.0000
5468 \labelwidthstring 00.00.0000
5388
5469
5389
5470
5390 \family typewriter
5471 \family typewriter
5391 \series bold
5472 \series bold
5392 execute\SpecialChar ~
5473 execute\SpecialChar ~
5393 <python\SpecialChar ~
5474 <python\SpecialChar ~
5394 code>
5475 code>
5395 \family default
5476 \family default
5396 \series default
5477 \series default
5397 : give any single-line python code to be executed.
5478 : give any single-line python code to be executed.
5398 \layout List
5479 \layout List
5399 \labelwidthstring 00.00.0000
5480 \labelwidthstring 00.00.0000
5400
5481
5401
5482
5402 \family typewriter
5483 \family typewriter
5403 \series bold
5484 \series bold
5404 execfile\SpecialChar ~
5485 execfile\SpecialChar ~
5405 <filename>
5486 <filename>
5406 \family default
5487 \family default
5407 \series default
5488 \series default
5408 : execute the python file given with an '
5489 : execute the python file given with an '
5409 \family typewriter
5490 \family typewriter
5410 execfile(filename)
5491 execfile(filename)
5411 \family default
5492 \family default
5412 ' command.
5493 ' command.
5413 Username expansion is performed on the given names.
5494 Username expansion is performed on the given names.
5414 So if you need any amount of extra fancy customization that won't fit in
5495 So if you need any amount of extra fancy customization that won't fit in
5415 any of the above 'canned' options, you can just put it in a separate python
5496 any of the above 'canned' options, you can just put it in a separate python
5416 file and execute it.
5497 file and execute it.
5417 \layout List
5498 \layout List
5418 \labelwidthstring 00.00.0000
5499 \labelwidthstring 00.00.0000
5419
5500
5420
5501
5421 \family typewriter
5502 \family typewriter
5422 \series bold
5503 \series bold
5423 alias\SpecialChar ~
5504 alias\SpecialChar ~
5424 <alias_def>
5505 <alias_def>
5425 \family default
5506 \family default
5426 \series default
5507 \series default
5427 : this is equivalent to calling '
5508 : this is equivalent to calling '
5428 \family typewriter
5509 \family typewriter
5429 %alias\SpecialChar ~
5510 %alias\SpecialChar ~
5430 <alias_def>
5511 <alias_def>
5431 \family default
5512 \family default
5432 ' at the IPython command line.
5513 ' at the IPython command line.
5433 This way, from within IPython you can do common system tasks without having
5514 This way, from within IPython you can do common system tasks without having
5434 to exit it or use the
5515 to exit it or use the
5435 \family typewriter
5516 \family typewriter
5436 !
5517 !
5437 \family default
5518 \family default
5438 escape.
5519 escape.
5439 IPython isn't meant to be a shell replacement, but it is often very useful
5520 IPython isn't meant to be a shell replacement, but it is often very useful
5440 to be able to do things with files while testing code.
5521 to be able to do things with files while testing code.
5441 This gives you the flexibility to have within IPython any aliases you may
5522 This gives you the flexibility to have within IPython any aliases you may
5442 be used to under your normal system shell.
5523 be used to under your normal system shell.
5443 \layout Subsection
5524 \layout Subsection
5444
5525
5445
5526
5446 \begin_inset LatexCommand \label{sec:ipytonrc-sample}
5527 \begin_inset LatexCommand \label{sec:ipytonrc-sample}
5447
5528
5448 \end_inset
5529 \end_inset
5449
5530
5450 Sample
5531 Sample
5451 \family typewriter
5532 \family typewriter
5452 ipythonrc
5533 ipythonrc
5453 \family default
5534 \family default
5454 file
5535 file
5455 \layout Standard
5536 \layout Standard
5456
5537
5457 The default rcfile, called
5538 The default rcfile, called
5458 \family typewriter
5539 \family typewriter
5459 ipythonrc
5540 ipythonrc
5460 \family default
5541 \family default
5461 and supplied in your
5542 and supplied in your
5462 \family typewriter
5543 \family typewriter
5463 IPYTHONDIR
5544 IPYTHONDIR
5464 \family default
5545 \family default
5465 directory contains lots of comments on all of these options.
5546 directory contains lots of comments on all of these options.
5466 We reproduce it here for reference:
5547 We reproduce it here for reference:
5467 \layout Standard
5548 \layout Standard
5468
5549
5469
5550
5470 \begin_inset ERT
5551 \begin_inset ERT
5471 status Open
5552 status Open
5472
5553
5473 \layout Standard
5554 \layout Standard
5474
5555
5475 \backslash
5556 \backslash
5476 codelist{../IPython/UserConfig/ipythonrc}
5557 codelist{../IPython/UserConfig/ipythonrc}
5477 \end_inset
5558 \end_inset
5478
5559
5479
5560
5480 \layout Subsection
5561 \layout Subsection
5481
5562
5482
5563
5483 \begin_inset LatexCommand \label{sec:prompts}
5564 \begin_inset LatexCommand \label{sec:prompts}
5484
5565
5485 \end_inset
5566 \end_inset
5486
5567
5487 Fine-tuning your prompt
5568 Fine-tuning your prompt
5488 \layout Standard
5569 \layout Standard
5489
5570
5490 IPython's prompts can be customized using a syntax similar to that of the
5571 IPython's prompts can be customized using a syntax similar to that of the
5491
5572
5492 \family typewriter
5573 \family typewriter
5493 bash
5574 bash
5494 \family default
5575 \family default
5495 shell.
5576 shell.
5496 Many of
5577 Many of
5497 \family typewriter
5578 \family typewriter
5498 bash
5579 bash
5499 \family default
5580 \family default
5500 's escapes are supported, as well as a few additional ones.
5581 's escapes are supported, as well as a few additional ones.
5501 We list them below:
5582 We list them below:
5502 \layout Description
5583 \layout Description
5503
5584
5504
5585
5505 \backslash
5586 \backslash
5506 # the prompt/history count number
5587 # the prompt/history count number
5507 \layout Description
5588 \layout Description
5508
5589
5509
5590
5510 \backslash
5591 \backslash
5511 D the prompt/history count, with the actual digits replaced by dots.
5592 D the prompt/history count, with the actual digits replaced by dots.
5512 Used mainly in continuation prompts (prompt_in2)
5593 Used mainly in continuation prompts (prompt_in2)
5513 \layout Description
5594 \layout Description
5514
5595
5515
5596
5516 \backslash
5597 \backslash
5517 w the current working directory
5598 w the current working directory
5518 \layout Description
5599 \layout Description
5519
5600
5520
5601
5521 \backslash
5602 \backslash
5522 W the basename of current working directory
5603 W the basename of current working directory
5523 \layout Description
5604 \layout Description
5524
5605
5525
5606
5526 \backslash
5607 \backslash
5527 X
5608 X
5528 \emph on
5609 \emph on
5529 n
5610 n
5530 \emph default
5611 \emph default
5531 where
5612 where
5532 \begin_inset Formula $n=0\ldots5.$
5613 \begin_inset Formula $n=0\ldots5.$
5533 \end_inset
5614 \end_inset
5534
5615
5535 The current working directory, with
5616 The current working directory, with
5536 \family typewriter
5617 \family typewriter
5537 $HOME
5618 $HOME
5538 \family default
5619 \family default
5539 replaced by
5620 replaced by
5540 \family typewriter
5621 \family typewriter
5541 ~
5622 ~
5542 \family default
5623 \family default
5543 , and filtered out to contain only
5624 , and filtered out to contain only
5544 \begin_inset Formula $n$
5625 \begin_inset Formula $n$
5545 \end_inset
5626 \end_inset
5546
5627
5547 path elements
5628 path elements
5548 \layout Description
5629 \layout Description
5549
5630
5550
5631
5551 \backslash
5632 \backslash
5552 Y
5633 Y
5553 \emph on
5634 \emph on
5554 n
5635 n
5555 \emph default
5636 \emph default
5556 Similar to
5637 Similar to
5557 \backslash
5638 \backslash
5558 X
5639 X
5559 \emph on
5640 \emph on
5560 n
5641 n
5561 \emph default
5642 \emph default
5562 , but with the
5643 , but with the
5563 \begin_inset Formula $n+1$
5644 \begin_inset Formula $n+1$
5564 \end_inset
5645 \end_inset
5565
5646
5566 element included if it is
5647 element included if it is
5567 \family typewriter
5648 \family typewriter
5568 ~
5649 ~
5569 \family default
5650 \family default
5570 (this is similar to the behavior of the %c
5651 (this is similar to the behavior of the %c
5571 \emph on
5652 \emph on
5572 n
5653 n
5573 \emph default
5654 \emph default
5574 escapes in
5655 escapes in
5575 \family typewriter
5656 \family typewriter
5576 tcsh
5657 tcsh
5577 \family default
5658 \family default
5578 )
5659 )
5579 \layout Description
5660 \layout Description
5580
5661
5581
5662
5582 \backslash
5663 \backslash
5583 u the username of the current user
5664 u the username of the current user
5584 \layout Description
5665 \layout Description
5585
5666
5586
5667
5587 \backslash
5668 \backslash
5588 $ if the effective UID is 0, a #, otherwise a $
5669 $ if the effective UID is 0, a #, otherwise a $
5589 \layout Description
5670 \layout Description
5590
5671
5591
5672
5592 \backslash
5673 \backslash
5593 h the hostname up to the first `.'
5674 h the hostname up to the first `.'
5594 \layout Description
5675 \layout Description
5595
5676
5596
5677
5597 \backslash
5678 \backslash
5598 H the hostname
5679 H the hostname
5599 \layout Description
5680 \layout Description
5600
5681
5601
5682
5602 \backslash
5683 \backslash
5603 n a newline
5684 n a newline
5604 \layout Description
5685 \layout Description
5605
5686
5606
5687
5607 \backslash
5688 \backslash
5608 r a carriage return
5689 r a carriage return
5609 \layout Description
5690 \layout Description
5610
5691
5611
5692
5612 \backslash
5693 \backslash
5613 v IPython version string
5694 v IPython version string
5614 \layout Standard
5695 \layout Standard
5615
5696
5616 In addition to these, ANSI color escapes can be insterted into the prompts,
5697 In addition to these, ANSI color escapes can be insterted into the prompts,
5617 as
5698 as
5618 \family typewriter
5699 \family typewriter
5619
5700
5620 \backslash
5701 \backslash
5621 C_
5702 C_
5622 \emph on
5703 \emph on
5623 ColorName
5704 ColorName
5624 \family default
5705 \family default
5625 \emph default
5706 \emph default
5626 .
5707 .
5627 The list of valid color names is: Black, Blue, Brown, Cyan, DarkGray, Green,
5708 The list of valid color names is: Black, Blue, Brown, Cyan, DarkGray, Green,
5628 LightBlue, LightCyan, LightGray, LightGreen, LightPurple, LightRed, NoColor,
5709 LightBlue, LightCyan, LightGray, LightGreen, LightPurple, LightRed, NoColor,
5629 Normal, Purple, Red, White, Yellow.
5710 Normal, Purple, Red, White, Yellow.
5630 \layout Standard
5711 \layout Standard
5631
5712
5632 Finally, IPython supports the evaluation of arbitrary expressions in your
5713 Finally, IPython supports the evaluation of arbitrary expressions in your
5633 prompt string.
5714 prompt string.
5634 The prompt strings are evaluated through the syntax of PEP 215, but basically
5715 The prompt strings are evaluated through the syntax of PEP 215, but basically
5635 you can use
5716 you can use
5636 \family typewriter
5717 \family typewriter
5637 $x.y
5718 $x.y
5638 \family default
5719 \family default
5639 to expand the value of
5720 to expand the value of
5640 \family typewriter
5721 \family typewriter
5641 x.y
5722 x.y
5642 \family default
5723 \family default
5643 , and for more complicated expressions you can use braces:
5724 , and for more complicated expressions you can use braces:
5644 \family typewriter
5725 \family typewriter
5645 ${foo()+x}
5726 ${foo()+x}
5646 \family default
5727 \family default
5647 will call function
5728 will call function
5648 \family typewriter
5729 \family typewriter
5649 foo
5730 foo
5650 \family default
5731 \family default
5651 and add to it the value of
5732 and add to it the value of
5652 \family typewriter
5733 \family typewriter
5653 x
5734 x
5654 \family default
5735 \family default
5655 , before putting the result into your prompt.
5736 , before putting the result into your prompt.
5656 For example, using
5737 For example, using
5657 \newline
5738 \newline
5658
5739
5659 \family typewriter
5740 \family typewriter
5660 prompt_in1 '${commands.getoutput("uptime")}
5741 prompt_in1 '${commands.getoutput("uptime")}
5661 \backslash
5742 \backslash
5662 nIn [
5743 nIn [
5663 \backslash
5744 \backslash
5664 #]: '
5745 #]: '
5665 \newline
5746 \newline
5666
5747
5667 \family default
5748 \family default
5668 will print the result of the uptime command on each prompt (assuming the
5749 will print the result of the uptime command on each prompt (assuming the
5669
5750
5670 \family typewriter
5751 \family typewriter
5671 commands
5752 commands
5672 \family default
5753 \family default
5673 module has been imported in your
5754 module has been imported in your
5674 \family typewriter
5755 \family typewriter
5675 ipythonrc
5756 ipythonrc
5676 \family default
5757 \family default
5677 file).
5758 file).
5678 \layout Subsubsection
5759 \layout Subsubsection
5679
5760
5680 Prompt examples
5761 Prompt examples
5681 \layout Standard
5762 \layout Standard
5682
5763
5683 The following options in an ipythonrc file will give you IPython's default
5764 The following options in an ipythonrc file will give you IPython's default
5684 prompts:
5765 prompts:
5685 \layout Standard
5766 \layout Standard
5686
5767
5687
5768
5688 \family typewriter
5769 \family typewriter
5689 prompt_in1 'In [
5770 prompt_in1 'In [
5690 \backslash
5771 \backslash
5691 #]:'
5772 #]:'
5692 \newline
5773 \newline
5693 prompt_in2 '\SpecialChar ~
5774 prompt_in2 '\SpecialChar ~
5694 \SpecialChar ~
5775 \SpecialChar ~
5695 \SpecialChar ~
5776 \SpecialChar ~
5696 .
5777 .
5697 \backslash
5778 \backslash
5698 D.:'
5779 D.:'
5699 \newline
5780 \newline
5700 prompt_out 'Out[
5781 prompt_out 'Out[
5701 \backslash
5782 \backslash
5702 #]:'
5783 #]:'
5703 \layout Standard
5784 \layout Standard
5704
5785
5705 which look like this:
5786 which look like this:
5706 \layout Standard
5787 \layout Standard
5707
5788
5708
5789
5709 \family typewriter
5790 \family typewriter
5710 In [1]: 1+2
5791 In [1]: 1+2
5711 \newline
5792 \newline
5712 Out[1]: 3
5793 Out[1]: 3
5713 \layout Standard
5794 \layout Standard
5714
5795
5715
5796
5716 \family typewriter
5797 \family typewriter
5717 In [2]: for i in (1,2,3):
5798 In [2]: for i in (1,2,3):
5718 \newline
5799 \newline
5719
5800
5720 \begin_inset ERT
5801 \begin_inset ERT
5721 status Collapsed
5802 status Collapsed
5722
5803
5723 \layout Standard
5804 \layout Standard
5724
5805
5725 \backslash
5806 \backslash
5726 hspace*{0mm}
5807 hspace*{0mm}
5727 \end_inset
5808 \end_inset
5728
5809
5729 \SpecialChar ~
5810 \SpecialChar ~
5730 \SpecialChar ~
5811 \SpecialChar ~
5731 \SpecialChar ~
5812 \SpecialChar ~
5732 ...: \SpecialChar ~
5813 ...: \SpecialChar ~
5733 \SpecialChar ~
5814 \SpecialChar ~
5734 \SpecialChar ~
5815 \SpecialChar ~
5735 \SpecialChar ~
5816 \SpecialChar ~
5736 print i,
5817 print i,
5737 \newline
5818 \newline
5738
5819
5739 \begin_inset ERT
5820 \begin_inset ERT
5740 status Collapsed
5821 status Collapsed
5741
5822
5742 \layout Standard
5823 \layout Standard
5743
5824
5744 \backslash
5825 \backslash
5745 hspace*{0mm}
5826 hspace*{0mm}
5746 \end_inset
5827 \end_inset
5747
5828
5748 \SpecialChar ~
5829 \SpecialChar ~
5749 \SpecialChar ~
5830 \SpecialChar ~
5750 \SpecialChar ~
5831 \SpecialChar ~
5751 ...:
5832 ...:
5752 \newline
5833 \newline
5753 1 2 3
5834 1 2 3
5754 \layout Standard
5835 \layout Standard
5755
5836
5756 These will give you a very colorful prompt with path information:
5837 These will give you a very colorful prompt with path information:
5757 \layout Standard
5838 \layout Standard
5758
5839
5759
5840
5760 \family typewriter
5841 \family typewriter
5761 #prompt_in1 '
5842 #prompt_in1 '
5762 \backslash
5843 \backslash
5763 C_Red
5844 C_Red
5764 \backslash
5845 \backslash
5765 u
5846 u
5766 \backslash
5847 \backslash
5767 C_Blue[
5848 C_Blue[
5768 \backslash
5849 \backslash
5769 C_Cyan
5850 C_Cyan
5770 \backslash
5851 \backslash
5771 Y1
5852 Y1
5772 \backslash
5853 \backslash
5773 C_Blue]
5854 C_Blue]
5774 \backslash
5855 \backslash
5775 C_LightGreen
5856 C_LightGreen
5776 \backslash
5857 \backslash
5777 #>'
5858 #>'
5778 \newline
5859 \newline
5779 prompt_in2 ' ..
5860 prompt_in2 ' ..
5780 \backslash
5861 \backslash
5781 D>'
5862 D>'
5782 \newline
5863 \newline
5783 prompt_out '<
5864 prompt_out '<
5784 \backslash
5865 \backslash
5785 #>'
5866 #>'
5786 \layout Standard
5867 \layout Standard
5787
5868
5788 which look like this:
5869 which look like this:
5789 \layout Standard
5870 \layout Standard
5790
5871
5791
5872
5792 \family typewriter
5873 \family typewriter
5793 \color red
5874 \color red
5794 fperez
5875 fperez
5795 \color blue
5876 \color blue
5796 [
5877 [
5797 \color cyan
5878 \color cyan
5798 ~/ipython
5879 ~/ipython
5799 \color blue
5880 \color blue
5800 ]
5881 ]
5801 \color green
5882 \color green
5802 1>
5883 1>
5803 \color default
5884 \color default
5804 1+2
5885 1+2
5805 \newline
5886 \newline
5806
5887
5807 \begin_inset ERT
5888 \begin_inset ERT
5808 status Collapsed
5889 status Collapsed
5809
5890
5810 \layout Standard
5891 \layout Standard
5811
5892
5812 \backslash
5893 \backslash
5813 hspace*{0mm}
5894 hspace*{0mm}
5814 \end_inset
5895 \end_inset
5815
5896
5816 \SpecialChar ~
5897 \SpecialChar ~
5817 \SpecialChar ~
5898 \SpecialChar ~
5818 \SpecialChar ~
5899 \SpecialChar ~
5819 \SpecialChar ~
5900 \SpecialChar ~
5820 \SpecialChar ~
5901 \SpecialChar ~
5821 \SpecialChar ~
5902 \SpecialChar ~
5822 \SpecialChar ~
5903 \SpecialChar ~
5823 \SpecialChar ~
5904 \SpecialChar ~
5824 \SpecialChar ~
5905 \SpecialChar ~
5825 \SpecialChar ~
5906 \SpecialChar ~
5826 \SpecialChar ~
5907 \SpecialChar ~
5827 \SpecialChar ~
5908 \SpecialChar ~
5828 \SpecialChar ~
5909 \SpecialChar ~
5829 \SpecialChar ~
5910 \SpecialChar ~
5830 \SpecialChar ~
5911 \SpecialChar ~
5831 \SpecialChar ~
5912 \SpecialChar ~
5832
5913
5833 \color red
5914 \color red
5834 <1>
5915 <1>
5835 \color default
5916 \color default
5836 3
5917 3
5837 \newline
5918 \newline
5838
5919
5839 \color red
5920 \color red
5840 fperez
5921 fperez
5841 \color blue
5922 \color blue
5842 [
5923 [
5843 \color cyan
5924 \color cyan
5844 ~/ipython
5925 ~/ipython
5845 \color blue
5926 \color blue
5846 ]
5927 ]
5847 \color green
5928 \color green
5848 2>
5929 2>
5849 \color default
5930 \color default
5850 for i in (1,2,3):
5931 for i in (1,2,3):
5851 \newline
5932 \newline
5852
5933
5853 \begin_inset ERT
5934 \begin_inset ERT
5854 status Collapsed
5935 status Collapsed
5855
5936
5856 \layout Standard
5937 \layout Standard
5857
5938
5858 \backslash
5939 \backslash
5859 hspace*{0mm}
5940 hspace*{0mm}
5860 \end_inset
5941 \end_inset
5861
5942
5862 \SpecialChar ~
5943 \SpecialChar ~
5863 \SpecialChar ~
5944 \SpecialChar ~
5864 \SpecialChar ~
5945 \SpecialChar ~
5865 \SpecialChar ~
5946 \SpecialChar ~
5866 \SpecialChar ~
5947 \SpecialChar ~
5867 \SpecialChar ~
5948 \SpecialChar ~
5868 \SpecialChar ~
5949 \SpecialChar ~
5869 \SpecialChar ~
5950 \SpecialChar ~
5870 \SpecialChar ~
5951 \SpecialChar ~
5871 \SpecialChar ~
5952 \SpecialChar ~
5872 \SpecialChar ~
5953 \SpecialChar ~
5873 \SpecialChar ~
5954 \SpecialChar ~
5874 \SpecialChar ~
5955 \SpecialChar ~
5875 \SpecialChar ~
5956 \SpecialChar ~
5876 \SpecialChar ~
5957 \SpecialChar ~
5877
5958
5878 \color green
5959 \color green
5879 ...>
5960 ...>
5880 \color default
5961 \color default
5881 \SpecialChar ~
5962 \SpecialChar ~
5882 \SpecialChar ~
5963 \SpecialChar ~
5883 \SpecialChar ~
5964 \SpecialChar ~
5884 \SpecialChar ~
5965 \SpecialChar ~
5885 print i,
5966 print i,
5886 \newline
5967 \newline
5887
5968
5888 \begin_inset ERT
5969 \begin_inset ERT
5889 status Collapsed
5970 status Collapsed
5890
5971
5891 \layout Standard
5972 \layout Standard
5892
5973
5893 \backslash
5974 \backslash
5894 hspace*{0mm}
5975 hspace*{0mm}
5895 \end_inset
5976 \end_inset
5896
5977
5897 \SpecialChar ~
5978 \SpecialChar ~
5898 \SpecialChar ~
5979 \SpecialChar ~
5899 \SpecialChar ~
5980 \SpecialChar ~
5900 \SpecialChar ~
5981 \SpecialChar ~
5901 \SpecialChar ~
5982 \SpecialChar ~
5902 \SpecialChar ~
5983 \SpecialChar ~
5903 \SpecialChar ~
5984 \SpecialChar ~
5904 \SpecialChar ~
5985 \SpecialChar ~
5905 \SpecialChar ~
5986 \SpecialChar ~
5906 \SpecialChar ~
5987 \SpecialChar ~
5907 \SpecialChar ~
5988 \SpecialChar ~
5908 \SpecialChar ~
5989 \SpecialChar ~
5909 \SpecialChar ~
5990 \SpecialChar ~
5910 \SpecialChar ~
5991 \SpecialChar ~
5911 \SpecialChar ~
5992 \SpecialChar ~
5912
5993
5913 \color green
5994 \color green
5914 ...>
5995 ...>
5915 \color default
5996 \color default
5916
5997
5917 \newline
5998 \newline
5918 1 2 3
5999 1 2 3
5919 \layout Standard
6000 \layout Standard
5920
6001
5921 The following shows the usage of dynamic expression evaluation:
6002 The following shows the usage of dynamic expression evaluation:
5922 \layout Subsection
6003 \layout Subsection
5923
6004
5924
6005
5925 \begin_inset LatexCommand \label{sec:profiles}
6006 \begin_inset LatexCommand \label{sec:profiles}
5926
6007
5927 \end_inset
6008 \end_inset
5928
6009
5929 IPython profiles
6010 IPython profiles
5930 \layout Standard
6011 \layout Standard
5931
6012
5932 As we already mentioned, IPython supports the
6013 As we already mentioned, IPython supports the
5933 \family typewriter
6014 \family typewriter
5934 -profile
6015 -profile
5935 \family default
6016 \family default
5936 command-line option (see sec.
6017 command-line option (see sec.
5937
6018
5938 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
6019 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
5939
6020
5940 \end_inset
6021 \end_inset
5941
6022
5942 ).
6023 ).
5943 A profile is nothing more than a particular configuration file like your
6024 A profile is nothing more than a particular configuration file like your
5944 basic
6025 basic
5945 \family typewriter
6026 \family typewriter
5946 ipythonrc
6027 ipythonrc
5947 \family default
6028 \family default
5948 one, but with particular customizations for a specific purpose.
6029 one, but with particular customizations for a specific purpose.
5949 When you start IPython with '
6030 When you start IPython with '
5950 \family typewriter
6031 \family typewriter
5951 ipython -profile <name>
6032 ipython -profile <name>
5952 \family default
6033 \family default
5953 ', it assumes that in your
6034 ', it assumes that in your
5954 \family typewriter
6035 \family typewriter
5955 IPYTHONDIR
6036 IPYTHONDIR
5956 \family default
6037 \family default
5957 there is a file called
6038 there is a file called
5958 \family typewriter
6039 \family typewriter
5959 ipythonrc-<name>
6040 ipythonrc-<name>
5960 \family default
6041 \family default
5961 , and loads it instead of the normal
6042 , and loads it instead of the normal
5962 \family typewriter
6043 \family typewriter
5963 ipythonrc
6044 ipythonrc
5964 \family default
6045 \family default
5965 .
6046 .
5966 \layout Standard
6047 \layout Standard
5967
6048
5968 This system allows you to maintain multiple configurations which load modules,
6049 This system allows you to maintain multiple configurations which load modules,
5969 set options, define functions, etc.
6050 set options, define functions, etc.
5970 suitable for different tasks and activate them in a very simple manner.
6051 suitable for different tasks and activate them in a very simple manner.
5971 In order to avoid having to repeat all of your basic options (common things
6052 In order to avoid having to repeat all of your basic options (common things
5972 that don't change such as your color preferences, for example), any profile
6053 that don't change such as your color preferences, for example), any profile
5973 can include another configuration file.
6054 can include another configuration file.
5974 The most common way to use profiles is then to have each one include your
6055 The most common way to use profiles is then to have each one include your
5975 basic
6056 basic
5976 \family typewriter
6057 \family typewriter
5977 ipythonrc
6058 ipythonrc
5978 \family default
6059 \family default
5979 file as a starting point, and then add further customizations.
6060 file as a starting point, and then add further customizations.
5980 \layout Standard
6061 \layout Standard
5981
6062
5982 In sections
6063 In sections
5983 \begin_inset LatexCommand \ref{sec:syntax-extensions}
6064 \begin_inset LatexCommand \ref{sec:syntax-extensions}
5984
6065
5985 \end_inset
6066 \end_inset
5986
6067
5987 and
6068 and
5988 \begin_inset LatexCommand \ref{sec:Gnuplot}
6069 \begin_inset LatexCommand \ref{sec:Gnuplot}
5989
6070
5990 \end_inset
6071 \end_inset
5991
6072
5992 we discuss some particular profiles which come as part of the standard
6073 we discuss some particular profiles which come as part of the standard
5993 IPython distribution.
6074 IPython distribution.
5994 You may also look in your
6075 You may also look in your
5995 \family typewriter
6076 \family typewriter
5996 IPYTHONDIR
6077 IPYTHONDIR
5997 \family default
6078 \family default
5998 directory, any file whose name begins with
6079 directory, any file whose name begins with
5999 \family typewriter
6080 \family typewriter
6000 ipythonrc-
6081 ipythonrc-
6001 \family default
6082 \family default
6002 is a profile.
6083 is a profile.
6003 You can use those as examples for further customizations to suit your own
6084 You can use those as examples for further customizations to suit your own
6004 needs.
6085 needs.
6005 \layout Section
6086 \layout Section
6006
6087
6007
6088
6008 \begin_inset OptArg
6089 \begin_inset OptArg
6009 collapsed false
6090 collapsed false
6010
6091
6011 \layout Standard
6092 \layout Standard
6012
6093
6013 IPython as default...
6094 IPython as default...
6014 \end_inset
6095 \end_inset
6015
6096
6016 IPython as your default Python environment
6097 IPython as your default Python environment
6017 \layout Standard
6098 \layout Standard
6018
6099
6019 Python honors the environment variable
6100 Python honors the environment variable
6020 \family typewriter
6101 \family typewriter
6021 PYTHONSTARTUP
6102 PYTHONSTARTUP
6022 \family default
6103 \family default
6023 and will execute at startup the file referenced by this variable.
6104 and will execute at startup the file referenced by this variable.
6024 If you put at the end of this file the following two lines of code:
6105 If you put at the end of this file the following two lines of code:
6025 \layout Standard
6106 \layout Standard
6026
6107
6027
6108
6028 \family typewriter
6109 \family typewriter
6029 import IPython
6110 import IPython
6030 \newline
6111 \newline
6031 IPython.Shell.IPShell().mainloop(sys_exit=1)
6112 IPython.Shell.IPShell().mainloop(sys_exit=1)
6032 \layout Standard
6113 \layout Standard
6033
6114
6034 then IPython will be your working environment anytime you start Python.
6115 then IPython will be your working environment anytime you start Python.
6035 The
6116 The
6036 \family typewriter
6117 \family typewriter
6037 sys_exit=1
6118 sys_exit=1
6038 \family default
6119 \family default
6039 is needed to have IPython issue a call to
6120 is needed to have IPython issue a call to
6040 \family typewriter
6121 \family typewriter
6041 sys.exit()
6122 sys.exit()
6042 \family default
6123 \family default
6043 when it finishes, otherwise you'll be back at the normal Python '
6124 when it finishes, otherwise you'll be back at the normal Python '
6044 \family typewriter
6125 \family typewriter
6045 >>>
6126 >>>
6046 \family default
6127 \family default
6047 ' prompt
6128 ' prompt
6048 \begin_inset Foot
6129 \begin_inset Foot
6049 collapsed true
6130 collapsed true
6050
6131
6051 \layout Standard
6132 \layout Standard
6052
6133
6053 Based on an idea by Holger Krekel.
6134 Based on an idea by Holger Krekel.
6054 \end_inset
6135 \end_inset
6055
6136
6056 .
6137 .
6057 \layout Standard
6138 \layout Standard
6058
6139
6059 This is probably useful to developers who manage multiple Python versions
6140 This is probably useful to developers who manage multiple Python versions
6060 and don't want to have correspondingly multiple IPython versions.
6141 and don't want to have correspondingly multiple IPython versions.
6061 Note that in this mode, there is no way to pass IPython any command-line
6142 Note that in this mode, there is no way to pass IPython any command-line
6062 options, as those are trapped first by Python itself.
6143 options, as those are trapped first by Python itself.
6063 \layout Section
6144 \layout Section
6064
6145
6065
6146
6066 \begin_inset LatexCommand \label{sec:embed}
6147 \begin_inset LatexCommand \label{sec:embed}
6067
6148
6068 \end_inset
6149 \end_inset
6069
6150
6070 Embedding IPython
6151 Embedding IPython
6071 \layout Standard
6152 \layout Standard
6072
6153
6073 It is possible to start an IPython instance
6154 It is possible to start an IPython instance
6074 \emph on
6155 \emph on
6075 inside
6156 inside
6076 \emph default
6157 \emph default
6077 your own Python programs.
6158 your own Python programs.
6078 This allows you to evaluate dynamically the state of your code, operate
6159 This allows you to evaluate dynamically the state of your code, operate
6079 with your variables, analyze them, etc.
6160 with your variables, analyze them, etc.
6080 Note however that any changes you make to values while in the shell do
6161 Note however that any changes you make to values while in the shell do
6081
6162
6082 \emph on
6163 \emph on
6083 not
6164 not
6084 \emph default
6165 \emph default
6085 propagate back to the running code, so it is safe to modify your values
6166 propagate back to the running code, so it is safe to modify your values
6086 because you won't break your code in bizarre ways by doing so.
6167 because you won't break your code in bizarre ways by doing so.
6087 \layout Standard
6168 \layout Standard
6088
6169
6089 This feature allows you to easily have a fully functional python environment
6170 This feature allows you to easily have a fully functional python environment
6090 for doing object introspection anywhere in your code with a simple function
6171 for doing object introspection anywhere in your code with a simple function
6091 call.
6172 call.
6092 In some cases a simple print statement is enough, but if you need to do
6173 In some cases a simple print statement is enough, but if you need to do
6093 more detailed analysis of a code fragment this feature can be very valuable.
6174 more detailed analysis of a code fragment this feature can be very valuable.
6094 \layout Standard
6175 \layout Standard
6095
6176
6096 It can also be useful in scientific computing situations where it is common
6177 It can also be useful in scientific computing situations where it is common
6097 to need to do some automatic, computationally intensive part and then stop
6178 to need to do some automatic, computationally intensive part and then stop
6098 to look at data, plots, etc
6179 to look at data, plots, etc
6099 \begin_inset Foot
6180 \begin_inset Foot
6100 collapsed true
6181 collapsed true
6101
6182
6102 \layout Standard
6183 \layout Standard
6103
6184
6104 This functionality was inspired by IDL's combination of the
6185 This functionality was inspired by IDL's combination of the
6105 \family typewriter
6186 \family typewriter
6106 stop
6187 stop
6107 \family default
6188 \family default
6108 keyword and the
6189 keyword and the
6109 \family typewriter
6190 \family typewriter
6110 .continue
6191 .continue
6111 \family default
6192 \family default
6112 executive command, which I have found very useful in the past, and by a
6193 executive command, which I have found very useful in the past, and by a
6113 posting on comp.lang.python by cmkl <cmkleffner-AT-gmx.de> on Dec.
6194 posting on comp.lang.python by cmkl <cmkleffner-AT-gmx.de> on Dec.
6114 06/01 concerning similar uses of pyrepl.
6195 06/01 concerning similar uses of pyrepl.
6115 \end_inset
6196 \end_inset
6116
6197
6117 .
6198 .
6118 Opening an IPython instance will give you full access to your data and
6199 Opening an IPython instance will give you full access to your data and
6119 functions, and you can resume program execution once you are done with
6200 functions, and you can resume program execution once you are done with
6120 the interactive part (perhaps to stop again later, as many times as needed).
6201 the interactive part (perhaps to stop again later, as many times as needed).
6121 \layout Standard
6202 \layout Standard
6122
6203
6123 The following code snippet is the bare minimum you need to include in your
6204 The following code snippet is the bare minimum you need to include in your
6124 Python programs for this to work (detailed examples follow later):
6205 Python programs for this to work (detailed examples follow later):
6125 \layout LyX-Code
6206 \layout LyX-Code
6126
6207
6127 from IPython.Shell import IPShellEmbed
6208 from IPython.Shell import IPShellEmbed
6128 \layout LyX-Code
6209 \layout LyX-Code
6129
6210
6130 ipshell = IPShellEmbed()
6211 ipshell = IPShellEmbed()
6131 \layout LyX-Code
6212 \layout LyX-Code
6132
6213
6133 ipshell() # this call anywhere in your program will start IPython
6214 ipshell() # this call anywhere in your program will start IPython
6134 \layout Standard
6215 \layout Standard
6135
6216
6136 You can run embedded instances even in code which is itself being run at
6217 You can run embedded instances even in code which is itself being run at
6137 the IPython interactive prompt with '
6218 the IPython interactive prompt with '
6138 \family typewriter
6219 \family typewriter
6139 %run\SpecialChar ~
6220 %run\SpecialChar ~
6140 <filename>
6221 <filename>
6141 \family default
6222 \family default
6142 '.
6223 '.
6143 Since it's easy to get lost as to where you are (in your top-level IPython
6224 Since it's easy to get lost as to where you are (in your top-level IPython
6144 or in your embedded one), it's a good idea in such cases to set the in/out
6225 or in your embedded one), it's a good idea in such cases to set the in/out
6145 prompts to something different for the embedded instances.
6226 prompts to something different for the embedded instances.
6146 The code examples below illustrate this.
6227 The code examples below illustrate this.
6147 \layout Standard
6228 \layout Standard
6148
6229
6149 You can also have multiple IPython instances in your program and open them
6230 You can also have multiple IPython instances in your program and open them
6150 separately, for example with different options for data presentation.
6231 separately, for example with different options for data presentation.
6151 If you close and open the same instance multiple times, its prompt counters
6232 If you close and open the same instance multiple times, its prompt counters
6152 simply continue from each execution to the next.
6233 simply continue from each execution to the next.
6153 \layout Standard
6234 \layout Standard
6154
6235
6155 Please look at the docstrings in the
6236 Please look at the docstrings in the
6156 \family typewriter
6237 \family typewriter
6157 Shell.py
6238 Shell.py
6158 \family default
6239 \family default
6159 module for more details on the use of this system.
6240 module for more details on the use of this system.
6160 \layout Standard
6241 \layout Standard
6161
6242
6162 The following sample file illustrating how to use the embedding functionality
6243 The following sample file illustrating how to use the embedding functionality
6163 is provided in the examples directory as
6244 is provided in the examples directory as
6164 \family typewriter
6245 \family typewriter
6165 example-embed.py
6246 example-embed.py
6166 \family default
6247 \family default
6167 .
6248 .
6168 It should be fairly self-explanatory:
6249 It should be fairly self-explanatory:
6169 \layout Standard
6250 \layout Standard
6170
6251
6171
6252
6172 \begin_inset ERT
6253 \begin_inset ERT
6173 status Open
6254 status Open
6174
6255
6175 \layout Standard
6256 \layout Standard
6176
6257
6177 \backslash
6258 \backslash
6178 codelist{examples/example-embed.py}
6259 codelist{examples/example-embed.py}
6179 \end_inset
6260 \end_inset
6180
6261
6181
6262
6182 \layout Standard
6263 \layout Standard
6183
6264
6184 Once you understand how the system functions, you can use the following
6265 Once you understand how the system functions, you can use the following
6185 code fragments in your programs which are ready for cut and paste:
6266 code fragments in your programs which are ready for cut and paste:
6186 \layout Standard
6267 \layout Standard
6187
6268
6188
6269
6189 \begin_inset ERT
6270 \begin_inset ERT
6190 status Open
6271 status Open
6191
6272
6192 \layout Standard
6273 \layout Standard
6193
6274
6194 \backslash
6275 \backslash
6195 codelist{examples/example-embed-short.py}
6276 codelist{examples/example-embed-short.py}
6196 \end_inset
6277 \end_inset
6197
6278
6198
6279
6199 \layout Section
6280 \layout Section
6200
6281
6201
6282
6202 \begin_inset LatexCommand \label{sec:using-pdb}
6283 \begin_inset LatexCommand \label{sec:using-pdb}
6203
6284
6204 \end_inset
6285 \end_inset
6205
6286
6206 Using the Python debugger (
6287 Using the Python debugger (
6207 \family typewriter
6288 \family typewriter
6208 pdb
6289 pdb
6209 \family default
6290 \family default
6210 )
6291 )
6211 \layout Subsection
6292 \layout Subsection
6212
6293
6213 Running entire programs via
6294 Running entire programs via
6214 \family typewriter
6295 \family typewriter
6215 pdb
6296 pdb
6216 \layout Standard
6297 \layout Standard
6217
6298
6218
6299
6219 \family typewriter
6300 \family typewriter
6220 pdb
6301 pdb
6221 \family default
6302 \family default
6222 , the Python debugger, is a powerful interactive debugger which allows you
6303 , the Python debugger, is a powerful interactive debugger which allows you
6223 to step through code, set breakpoints, watch variables, etc.
6304 to step through code, set breakpoints, watch variables, etc.
6224 IPython makes it very easy to start any script under the control of
6305 IPython makes it very easy to start any script under the control of
6225 \family typewriter
6306 \family typewriter
6226 pdb
6307 pdb
6227 \family default
6308 \family default
6228 , regardless of whether you have wrapped it into a
6309 , regardless of whether you have wrapped it into a
6229 \family typewriter
6310 \family typewriter
6230 `main()'
6311 `main()'
6231 \family default
6312 \family default
6232 function or not.
6313 function or not.
6233 For this, simply type
6314 For this, simply type
6234 \family typewriter
6315 \family typewriter
6235 `%run -d myscript'
6316 `%run -d myscript'
6236 \family default
6317 \family default
6237 at an IPython prompt.
6318 at an IPython prompt.
6238 See the
6319 See the
6239 \family typewriter
6320 \family typewriter
6240 %run
6321 %run
6241 \family default
6322 \family default
6242 command's documentation (via
6323 command's documentation (via
6243 \family typewriter
6324 \family typewriter
6244 `%run?'
6325 `%run?'
6245 \family default
6326 \family default
6246 or in Sec.\SpecialChar ~
6327 or in Sec.\SpecialChar ~
6247
6328
6248 \begin_inset LatexCommand \ref{sec:magic}
6329 \begin_inset LatexCommand \ref{sec:magic}
6249
6330
6250 \end_inset
6331 \end_inset
6251
6332
6252 ) for more details, including how to control where
6333 ) for more details, including how to control where
6253 \family typewriter
6334 \family typewriter
6254 pdb
6335 pdb
6255 \family default
6336 \family default
6256 will stop execution first.
6337 will stop execution first.
6257 \layout Standard
6338 \layout Standard
6258
6339
6259 For more information on the use of the
6340 For more information on the use of the
6260 \family typewriter
6341 \family typewriter
6261 pdb
6342 pdb
6262 \family default
6343 \family default
6263 debugger, read the included
6344 debugger, read the included
6264 \family typewriter
6345 \family typewriter
6265 pdb.doc
6346 pdb.doc
6266 \family default
6347 \family default
6267 file (part of the standard Python distribution).
6348 file (part of the standard Python distribution).
6268 On a stock Linux system it is located at
6349 On a stock Linux system it is located at
6269 \family typewriter
6350 \family typewriter
6270 /usr/lib/python2.3/pdb.doc
6351 /usr/lib/python2.3/pdb.doc
6271 \family default
6352 \family default
6272 , but the easiest way to read it is by using the
6353 , but the easiest way to read it is by using the
6273 \family typewriter
6354 \family typewriter
6274 help()
6355 help()
6275 \family default
6356 \family default
6276 function of the
6357 function of the
6277 \family typewriter
6358 \family typewriter
6278 pdb
6359 pdb
6279 \family default
6360 \family default
6280 module as follows (in an IPython prompt):
6361 module as follows (in an IPython prompt):
6281 \layout Standard
6362 \layout Standard
6282
6363
6283
6364
6284 \family typewriter
6365 \family typewriter
6285 In [1]: import pdb
6366 In [1]: import pdb
6286 \newline
6367 \newline
6287 In [2]: pdb.help()
6368 In [2]: pdb.help()
6288 \layout Standard
6369 \layout Standard
6289
6370
6290 This will load the
6371 This will load the
6291 \family typewriter
6372 \family typewriter
6292 pdb.doc
6373 pdb.doc
6293 \family default
6374 \family default
6294 document in a file viewer for you automatically.
6375 document in a file viewer for you automatically.
6295 \layout Subsection
6376 \layout Subsection
6296
6377
6297 Automatic invocation of
6378 Automatic invocation of
6298 \family typewriter
6379 \family typewriter
6299 pdb
6380 pdb
6300 \family default
6381 \family default
6301 on exceptions
6382 on exceptions
6302 \layout Standard
6383 \layout Standard
6303
6384
6304 IPython, if started with the
6385 IPython, if started with the
6305 \family typewriter
6386 \family typewriter
6306 -pdb
6387 -pdb
6307 \family default
6388 \family default
6308 option (or if the option is set in your rc file) can call the Python
6389 option (or if the option is set in your rc file) can call the Python
6309 \family typewriter
6390 \family typewriter
6310 pdb
6391 pdb
6311 \family default
6392 \family default
6312 debugger every time your code triggers an uncaught exception
6393 debugger every time your code triggers an uncaught exception
6313 \begin_inset Foot
6394 \begin_inset Foot
6314 collapsed true
6395 collapsed true
6315
6396
6316 \layout Standard
6397 \layout Standard
6317
6398
6318 Many thanks to Christopher Hart for the request which prompted adding this
6399 Many thanks to Christopher Hart for the request which prompted adding this
6319 feature to IPython.
6400 feature to IPython.
6320 \end_inset
6401 \end_inset
6321
6402
6322 .
6403 .
6323 This feature can also be toggled at any time with the
6404 This feature can also be toggled at any time with the
6324 \family typewriter
6405 \family typewriter
6325 %pdb
6406 %pdb
6326 \family default
6407 \family default
6327 magic command.
6408 magic command.
6328 This can be extremely useful in order to find the origin of subtle bugs,
6409 This can be extremely useful in order to find the origin of subtle bugs,
6329 because
6410 because
6330 \family typewriter
6411 \family typewriter
6331 pdb
6412 pdb
6332 \family default
6413 \family default
6333 opens up at the point in your code which triggered the exception, and while
6414 opens up at the point in your code which triggered the exception, and while
6334 your program is at this point `dead', all the data is still available and
6415 your program is at this point `dead', all the data is still available and
6335 you can walk up and down the stack frame and understand the origin of the
6416 you can walk up and down the stack frame and understand the origin of the
6336 problem.
6417 problem.
6337 \layout Standard
6418 \layout Standard
6338
6419
6339 Furthermore, you can use these debugging facilities both with the embedded
6420 Furthermore, you can use these debugging facilities both with the embedded
6340 IPython mode and without IPython at all.
6421 IPython mode and without IPython at all.
6341 For an embedded shell (see sec.
6422 For an embedded shell (see sec.
6342
6423
6343 \begin_inset LatexCommand \ref{sec:embed}
6424 \begin_inset LatexCommand \ref{sec:embed}
6344
6425
6345 \end_inset
6426 \end_inset
6346
6427
6347 ), simply call the constructor with
6428 ), simply call the constructor with
6348 \family typewriter
6429 \family typewriter
6349 `-pdb'
6430 `-pdb'
6350 \family default
6431 \family default
6351 in the argument string and automatically
6432 in the argument string and automatically
6352 \family typewriter
6433 \family typewriter
6353 pdb
6434 pdb
6354 \family default
6435 \family default
6355 will be called if an uncaught exception is triggered by your code.
6436 will be called if an uncaught exception is triggered by your code.
6356
6437
6357 \layout Standard
6438 \layout Standard
6358
6439
6359 For stand-alone use of the feature in your programs which do not use IPython
6440 For stand-alone use of the feature in your programs which do not use IPython
6360 at all, put the following lines toward the top of your `main' routine:
6441 at all, put the following lines toward the top of your `main' routine:
6361 \layout Standard
6442 \layout Standard
6362 \align left
6443 \align left
6363
6444
6364 \family typewriter
6445 \family typewriter
6365 import sys,IPython.ultraTB
6446 import sys,IPython.ultraTB
6366 \newline
6447 \newline
6367 sys.excepthook = IPython.ultraTB.FormattedTB(mode=`Verbose', color_scheme=`Linux',
6448 sys.excepthook = IPython.ultraTB.FormattedTB(mode=`Verbose', color_scheme=`Linux',
6368 call_pdb=1)
6449 call_pdb=1)
6369 \layout Standard
6450 \layout Standard
6370
6451
6371 The
6452 The
6372 \family typewriter
6453 \family typewriter
6373 mode
6454 mode
6374 \family default
6455 \family default
6375 keyword can be either
6456 keyword can be either
6376 \family typewriter
6457 \family typewriter
6377 `Verbose'
6458 `Verbose'
6378 \family default
6459 \family default
6379 or
6460 or
6380 \family typewriter
6461 \family typewriter
6381 `Plain'
6462 `Plain'
6382 \family default
6463 \family default
6383 , giving either very detailed or normal tracebacks respectively.
6464 , giving either very detailed or normal tracebacks respectively.
6384 The
6465 The
6385 \family typewriter
6466 \family typewriter
6386 color_scheme
6467 color_scheme
6387 \family default
6468 \family default
6388 keyword can be one of
6469 keyword can be one of
6389 \family typewriter
6470 \family typewriter
6390 `NoColor'
6471 `NoColor'
6391 \family default
6472 \family default
6392 ,
6473 ,
6393 \family typewriter
6474 \family typewriter
6394 `Linux'
6475 `Linux'
6395 \family default
6476 \family default
6396 (default) or
6477 (default) or
6397 \family typewriter
6478 \family typewriter
6398 `LightBG'
6479 `LightBG'
6399 \family default
6480 \family default
6400 .
6481 .
6401 These are the same options which can be set in IPython with
6482 These are the same options which can be set in IPython with
6402 \family typewriter
6483 \family typewriter
6403 -colors
6484 -colors
6404 \family default
6485 \family default
6405 and
6486 and
6406 \family typewriter
6487 \family typewriter
6407 -xmode
6488 -xmode
6408 \family default
6489 \family default
6409 .
6490 .
6410 \layout Standard
6491 \layout Standard
6411
6492
6412 This will give any of your programs detailed, colored tracebacks with automatic
6493 This will give any of your programs detailed, colored tracebacks with automatic
6413 invocation of
6494 invocation of
6414 \family typewriter
6495 \family typewriter
6415 pdb
6496 pdb
6416 \family default
6497 \family default
6417 .
6498 .
6418 \layout Section
6499 \layout Section
6419
6500
6420
6501
6421 \begin_inset LatexCommand \label{sec:syntax-extensions}
6502 \begin_inset LatexCommand \label{sec:syntax-extensions}
6422
6503
6423 \end_inset
6504 \end_inset
6424
6505
6425 Extensions for syntax processing
6506 Extensions for syntax processing
6426 \layout Standard
6507 \layout Standard
6427
6508
6428 This isn't for the faint of heart, because the potential for breaking things
6509 This isn't for the faint of heart, because the potential for breaking things
6429 is quite high.
6510 is quite high.
6430 But it can be a very powerful and useful feature.
6511 But it can be a very powerful and useful feature.
6431 In a nutshell, you can redefine the way IPython processes the user input
6512 In a nutshell, you can redefine the way IPython processes the user input
6432 line to accept new, special extensions to the syntax without needing to
6513 line to accept new, special extensions to the syntax without needing to
6433 change any of IPython's own code.
6514 change any of IPython's own code.
6434 \layout Standard
6515 \layout Standard
6435
6516
6436 In the
6517 In the
6437 \family typewriter
6518 \family typewriter
6438 IPython/Extensions
6519 IPython/Extensions
6439 \family default
6520 \family default
6440 directory you will find some examples supplied, which we will briefly describe
6521 directory you will find some examples supplied, which we will briefly describe
6441 now.
6522 now.
6442 These can be used `as is' (and both provide very useful functionality),
6523 These can be used `as is' (and both provide very useful functionality),
6443 or you can use them as a starting point for writing your own extensions.
6524 or you can use them as a starting point for writing your own extensions.
6444 \layout Subsection
6525 \layout Subsection
6445
6526
6446 Pasting of code starting with
6527 Pasting of code starting with
6447 \family typewriter
6528 \family typewriter
6448 `>>>
6529 `>>>
6449 \family default
6530 \family default
6450 ' or
6531 ' or
6451 \family typewriter
6532 \family typewriter
6452 `...
6533 `...
6453
6534
6454 \family default
6535 \family default
6455 '
6536 '
6456 \layout Standard
6537 \layout Standard
6457
6538
6458 In the python tutorial it is common to find code examples which have been
6539 In the python tutorial it is common to find code examples which have been
6459 taken from real python sessions.
6540 taken from real python sessions.
6460 The problem with those is that all the lines begin with either
6541 The problem with those is that all the lines begin with either
6461 \family typewriter
6542 \family typewriter
6462 `>>>
6543 `>>>
6463 \family default
6544 \family default
6464 ' or
6545 ' or
6465 \family typewriter
6546 \family typewriter
6466 `...
6547 `...
6467
6548
6468 \family default
6549 \family default
6469 ', which makes it impossible to paste them all at once.
6550 ', which makes it impossible to paste them all at once.
6470 One must instead do a line by line manual copying, carefully removing the
6551 One must instead do a line by line manual copying, carefully removing the
6471 leading extraneous characters.
6552 leading extraneous characters.
6472 \layout Standard
6553 \layout Standard
6473
6554
6474 This extension identifies those starting characters and removes them from
6555 This extension identifies those starting characters and removes them from
6475 the input automatically, so that one can paste multi-line examples directly
6556 the input automatically, so that one can paste multi-line examples directly
6476 into IPython, saving a lot of time.
6557 into IPython, saving a lot of time.
6477 Please look at the file
6558 Please look at the file
6478 \family typewriter
6559 \family typewriter
6479 InterpreterPasteInput.py
6560 InterpreterPasteInput.py
6480 \family default
6561 \family default
6481 in the
6562 in the
6482 \family typewriter
6563 \family typewriter
6483 IPython/Extensions
6564 IPython/Extensions
6484 \family default
6565 \family default
6485 directory for details on how this is done.
6566 directory for details on how this is done.
6486 \layout Standard
6567 \layout Standard
6487
6568
6488 IPython comes with a special profile enabling this feature, called
6569 IPython comes with a special profile enabling this feature, called
6489 \family typewriter
6570 \family typewriter
6490 tutorial
6571 tutorial
6491 \family default
6572 \family default
6492 \emph on
6573 \emph on
6493 .
6574 .
6494
6575
6495 \emph default
6576 \emph default
6496 Simply start IPython via
6577 Simply start IPython via
6497 \family typewriter
6578 \family typewriter
6498 `ipython\SpecialChar ~
6579 `ipython\SpecialChar ~
6499 -p\SpecialChar ~
6580 -p\SpecialChar ~
6500 tutorial'
6581 tutorial'
6501 \family default
6582 \family default
6502 and the feature will be available.
6583 and the feature will be available.
6503 In a normal IPython session you can activate the feature by importing the
6584 In a normal IPython session you can activate the feature by importing the
6504 corresponding module with:
6585 corresponding module with:
6505 \newline
6586 \newline
6506
6587
6507 \family typewriter
6588 \family typewriter
6508 In [1]: import IPython.Extensions.InterpreterPasteInput
6589 In [1]: import IPython.Extensions.InterpreterPasteInput
6509 \layout Standard
6590 \layout Standard
6510
6591
6511 The following is a 'screenshot' of how things work when this extension is
6592 The following is a 'screenshot' of how things work when this extension is
6512 on, copying an example from the standard tutorial:
6593 on, copying an example from the standard tutorial:
6513 \layout Standard
6594 \layout Standard
6514
6595
6515
6596
6516 \family typewriter
6597 \family typewriter
6517 IPython profile: tutorial
6598 IPython profile: tutorial
6518 \newline
6599 \newline
6519 \SpecialChar ~
6600 \SpecialChar ~
6520
6601
6521 \newline
6602 \newline
6522 *** Pasting of code with ">>>" or "..." has been enabled.
6603 *** Pasting of code with ">>>" or "..." has been enabled.
6523 \newline
6604 \newline
6524 \SpecialChar ~
6605 \SpecialChar ~
6525
6606
6526 \newline
6607 \newline
6527 In [1]: >>> def fib2(n): # return Fibonacci series up to n
6608 In [1]: >>> def fib2(n): # return Fibonacci series up to n
6528 \newline
6609 \newline
6529
6610
6530 \begin_inset ERT
6611 \begin_inset ERT
6531 status Collapsed
6612 status Collapsed
6532
6613
6533 \layout Standard
6614 \layout Standard
6534
6615
6535 \backslash
6616 \backslash
6536 hspace*{0mm}
6617 hspace*{0mm}
6537 \end_inset
6618 \end_inset
6538
6619
6539 \SpecialChar ~
6620 \SpecialChar ~
6540 \SpecialChar ~
6621 \SpecialChar ~
6541 ...: ...\SpecialChar ~
6622 ...: ...\SpecialChar ~
6542 \SpecialChar ~
6623 \SpecialChar ~
6543 \SpecialChar ~
6624 \SpecialChar ~
6544 \SpecialChar ~
6625 \SpecialChar ~
6545 """Return a list containing the Fibonacci series up to n."""
6626 """Return a list containing the Fibonacci series up to n."""
6546 \newline
6627 \newline
6547
6628
6548 \begin_inset ERT
6629 \begin_inset ERT
6549 status Collapsed
6630 status Collapsed
6550
6631
6551 \layout Standard
6632 \layout Standard
6552
6633
6553 \backslash
6634 \backslash
6554 hspace*{0mm}
6635 hspace*{0mm}
6555 \end_inset
6636 \end_inset
6556
6637
6557 \SpecialChar ~
6638 \SpecialChar ~
6558 \SpecialChar ~
6639 \SpecialChar ~
6559 ...: ...\SpecialChar ~
6640 ...: ...\SpecialChar ~
6560 \SpecialChar ~
6641 \SpecialChar ~
6561 \SpecialChar ~
6642 \SpecialChar ~
6562 \SpecialChar ~
6643 \SpecialChar ~
6563 result = []
6644 result = []
6564 \newline
6645 \newline
6565
6646
6566 \begin_inset ERT
6647 \begin_inset ERT
6567 status Collapsed
6648 status Collapsed
6568
6649
6569 \layout Standard
6650 \layout Standard
6570
6651
6571 \backslash
6652 \backslash
6572 hspace*{0mm}
6653 hspace*{0mm}
6573 \end_inset
6654 \end_inset
6574
6655
6575 \SpecialChar ~
6656 \SpecialChar ~
6576 \SpecialChar ~
6657 \SpecialChar ~
6577 ...: ...\SpecialChar ~
6658 ...: ...\SpecialChar ~
6578 \SpecialChar ~
6659 \SpecialChar ~
6579 \SpecialChar ~
6660 \SpecialChar ~
6580 \SpecialChar ~
6661 \SpecialChar ~
6581 a, b = 0, 1
6662 a, b = 0, 1
6582 \newline
6663 \newline
6583
6664
6584 \begin_inset ERT
6665 \begin_inset ERT
6585 status Collapsed
6666 status Collapsed
6586
6667
6587 \layout Standard
6668 \layout Standard
6588
6669
6589 \backslash
6670 \backslash
6590 hspace*{0mm}
6671 hspace*{0mm}
6591 \end_inset
6672 \end_inset
6592
6673
6593 \SpecialChar ~
6674 \SpecialChar ~
6594 \SpecialChar ~
6675 \SpecialChar ~
6595 ...: ...\SpecialChar ~
6676 ...: ...\SpecialChar ~
6596 \SpecialChar ~
6677 \SpecialChar ~
6597 \SpecialChar ~
6678 \SpecialChar ~
6598 \SpecialChar ~
6679 \SpecialChar ~
6599 while b < n:
6680 while b < n:
6600 \newline
6681 \newline
6601
6682
6602 \begin_inset ERT
6683 \begin_inset ERT
6603 status Collapsed
6684 status Collapsed
6604
6685
6605 \layout Standard
6686 \layout Standard
6606
6687
6607 \backslash
6688 \backslash
6608 hspace*{0mm}
6689 hspace*{0mm}
6609 \end_inset
6690 \end_inset
6610
6691
6611 \SpecialChar ~
6692 \SpecialChar ~
6612 \SpecialChar ~
6693 \SpecialChar ~
6613 ...: ...\SpecialChar ~
6694 ...: ...\SpecialChar ~
6614 \SpecialChar ~
6695 \SpecialChar ~
6615 \SpecialChar ~
6696 \SpecialChar ~
6616 \SpecialChar ~
6697 \SpecialChar ~
6617 \SpecialChar ~
6698 \SpecialChar ~
6618 \SpecialChar ~
6699 \SpecialChar ~
6619 \SpecialChar ~
6700 \SpecialChar ~
6620 \SpecialChar ~
6701 \SpecialChar ~
6621 result.append(b)\SpecialChar ~
6702 result.append(b)\SpecialChar ~
6622 \SpecialChar ~
6703 \SpecialChar ~
6623 \SpecialChar ~
6704 \SpecialChar ~
6624 # see below
6705 # see below
6625 \newline
6706 \newline
6626
6707
6627 \begin_inset ERT
6708 \begin_inset ERT
6628 status Collapsed
6709 status Collapsed
6629
6710
6630 \layout Standard
6711 \layout Standard
6631
6712
6632 \backslash
6713 \backslash
6633 hspace*{0mm}
6714 hspace*{0mm}
6634 \end_inset
6715 \end_inset
6635
6716
6636 \SpecialChar ~
6717 \SpecialChar ~
6637 \SpecialChar ~
6718 \SpecialChar ~
6638 ...: ...\SpecialChar ~
6719 ...: ...\SpecialChar ~
6639 \SpecialChar ~
6720 \SpecialChar ~
6640 \SpecialChar ~
6721 \SpecialChar ~
6641 \SpecialChar ~
6722 \SpecialChar ~
6642 \SpecialChar ~
6723 \SpecialChar ~
6643 \SpecialChar ~
6724 \SpecialChar ~
6644 \SpecialChar ~
6725 \SpecialChar ~
6645 \SpecialChar ~
6726 \SpecialChar ~
6646 a, b = b, a+b
6727 a, b = b, a+b
6647 \newline
6728 \newline
6648
6729
6649 \begin_inset ERT
6730 \begin_inset ERT
6650 status Collapsed
6731 status Collapsed
6651
6732
6652 \layout Standard
6733 \layout Standard
6653
6734
6654 \backslash
6735 \backslash
6655 hspace*{0mm}
6736 hspace*{0mm}
6656 \end_inset
6737 \end_inset
6657
6738
6658 \SpecialChar ~
6739 \SpecialChar ~
6659 \SpecialChar ~
6740 \SpecialChar ~
6660 ...: ...\SpecialChar ~
6741 ...: ...\SpecialChar ~
6661 \SpecialChar ~
6742 \SpecialChar ~
6662 \SpecialChar ~
6743 \SpecialChar ~
6663 \SpecialChar ~
6744 \SpecialChar ~
6664 return result
6745 return result
6665 \newline
6746 \newline
6666
6747
6667 \begin_inset ERT
6748 \begin_inset ERT
6668 status Collapsed
6749 status Collapsed
6669
6750
6670 \layout Standard
6751 \layout Standard
6671
6752
6672 \backslash
6753 \backslash
6673 hspace*{0mm}
6754 hspace*{0mm}
6674 \end_inset
6755 \end_inset
6675
6756
6676 \SpecialChar ~
6757 \SpecialChar ~
6677 \SpecialChar ~
6758 \SpecialChar ~
6678 ...:
6759 ...:
6679 \newline
6760 \newline
6680 \SpecialChar ~
6761 \SpecialChar ~
6681
6762
6682 \newline
6763 \newline
6683 In [2]: fib2(10)
6764 In [2]: fib2(10)
6684 \newline
6765 \newline
6685 Out[2]: [1, 1, 2, 3, 5, 8]
6766 Out[2]: [1, 1, 2, 3, 5, 8]
6686 \layout Standard
6767 \layout Standard
6687
6768
6688 Note that as currently written, this extension does
6769 Note that as currently written, this extension does
6689 \emph on
6770 \emph on
6690 not
6771 not
6691 \emph default
6772 \emph default
6692 recognize IPython's prompts for pasting.
6773 recognize IPython's prompts for pasting.
6693 Those are more complicated, since the user can change them very easily,
6774 Those are more complicated, since the user can change them very easily,
6694 they involve numbers and can vary in length.
6775 they involve numbers and can vary in length.
6695 One could however extract all the relevant information from the IPython
6776 One could however extract all the relevant information from the IPython
6696 instance and build an appropriate regular expression.
6777 instance and build an appropriate regular expression.
6697 This is left as an exercise for the reader.
6778 This is left as an exercise for the reader.
6698 \layout Subsection
6779 \layout Subsection
6699
6780
6700 Input of physical quantities with units
6781 Input of physical quantities with units
6701 \layout Standard
6782 \layout Standard
6702
6783
6703 The module
6784 The module
6704 \family typewriter
6785 \family typewriter
6705 PhysicalQInput
6786 PhysicalQInput
6706 \family default
6787 \family default
6707 allows a simplified form of input for physical quantities with units.
6788 allows a simplified form of input for physical quantities with units.
6708 This file is meant to be used in conjunction with the
6789 This file is meant to be used in conjunction with the
6709 \family typewriter
6790 \family typewriter
6710 PhysicalQInteractive
6791 PhysicalQInteractive
6711 \family default
6792 \family default
6712 module (in the same directory) and
6793 module (in the same directory) and
6713 \family typewriter
6794 \family typewriter
6714 Physics.PhysicalQuantities
6795 Physics.PhysicalQuantities
6715 \family default
6796 \family default
6716 from Konrad Hinsen's ScientificPython (
6797 from Konrad Hinsen's ScientificPython (
6717 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/hinsen/scientific.html}
6798 \begin_inset LatexCommand \htmlurl{http://starship.python.net/crew/hinsen/scientific.html}
6718
6799
6719 \end_inset
6800 \end_inset
6720
6801
6721 ).
6802 ).
6722 \layout Standard
6803 \layout Standard
6723
6804
6724 The
6805 The
6725 \family typewriter
6806 \family typewriter
6726 Physics.PhysicalQuantities
6807 Physics.PhysicalQuantities
6727 \family default
6808 \family default
6728 module defines
6809 module defines
6729 \family typewriter
6810 \family typewriter
6730 PhysicalQuantity
6811 PhysicalQuantity
6731 \family default
6812 \family default
6732 objects, but these must be declared as instances of a class.
6813 objects, but these must be declared as instances of a class.
6733 For example, to define
6814 For example, to define
6734 \family typewriter
6815 \family typewriter
6735 v
6816 v
6736 \family default
6817 \family default
6737 as a velocity of 3\SpecialChar ~
6818 as a velocity of 3\SpecialChar ~
6738 m/s, normally you would write:
6819 m/s, normally you would write:
6739 \family typewriter
6820 \family typewriter
6740
6821
6741 \newline
6822 \newline
6742 In [1]: v = PhysicalQuantity(3,'m/s')
6823 In [1]: v = PhysicalQuantity(3,'m/s')
6743 \layout Standard
6824 \layout Standard
6744
6825
6745 Using the
6826 Using the
6746 \family typewriter
6827 \family typewriter
6747 PhysicalQ_Input
6828 PhysicalQ_Input
6748 \family default
6829 \family default
6749 extension this can be input instead as:
6830 extension this can be input instead as:
6750 \family typewriter
6831 \family typewriter
6751
6832
6752 \newline
6833 \newline
6753 In [1]: v = 3 m/s
6834 In [1]: v = 3 m/s
6754 \family default
6835 \family default
6755
6836
6756 \newline
6837 \newline
6757 which is much more convenient for interactive use (even though it is blatantly
6838 which is much more convenient for interactive use (even though it is blatantly
6758 invalid Python syntax).
6839 invalid Python syntax).
6759 \layout Standard
6840 \layout Standard
6760
6841
6761 The
6842 The
6762 \family typewriter
6843 \family typewriter
6763 physics
6844 physics
6764 \family default
6845 \family default
6765 profile supplied with IPython (enabled via
6846 profile supplied with IPython (enabled via
6766 \family typewriter
6847 \family typewriter
6767 'ipython -p physics'
6848 'ipython -p physics'
6768 \family default
6849 \family default
6769 ) uses these extensions, which you can also activate with:
6850 ) uses these extensions, which you can also activate with:
6770 \layout Standard
6851 \layout Standard
6771
6852
6772
6853
6773 \family typewriter
6854 \family typewriter
6774 from math import * # math MUST be imported BEFORE PhysicalQInteractive
6855 from math import * # math MUST be imported BEFORE PhysicalQInteractive
6775 \newline
6856 \newline
6776 from IPython.Extensions.PhysicalQInteractive import *
6857 from IPython.Extensions.PhysicalQInteractive import *
6777 \newline
6858 \newline
6778 import IPython.Extensions.PhysicalQInput
6859 import IPython.Extensions.PhysicalQInput
6779 \layout Section
6860 \layout Section
6780
6861
6862
6863 \begin_inset LatexCommand \label{sec:IPython-as-shell}
6864
6865 \end_inset
6866
6781 IPython as a system shell
6867 IPython as a system shell
6782 \layout Standard
6868 \layout Standard
6783
6869
6784 IPython ships with a special profile called
6870 IPython ships with a special profile called
6785 \family typewriter
6871 \family typewriter
6786 pysh
6872 pysh
6787 \family default
6873 \family default
6788 , which you can activate at the command line as
6874 , which you can activate at the command line as
6789 \family typewriter
6875 \family typewriter
6790 `ipython -p pysh'
6876 `ipython -p pysh'
6791 \family default
6877 \family default
6792 .
6878 .
6793 This loads
6879 This loads
6794 \family typewriter
6880 \family typewriter
6795 InterpreterExec
6881 InterpreterExec
6796 \family default
6882 \family default
6797 , along with some additional facilities and a prompt customized for filesystem
6883 , along with some additional facilities and a prompt customized for filesystem
6798 navigation.
6884 navigation.
6799 \layout Standard
6885 \layout Standard
6800
6886
6801 Note that this does
6887 Note that this does
6802 \emph on
6888 \emph on
6803 not
6889 not
6804 \emph default
6890 \emph default
6805 make IPython a full-fledged system shell.
6891 make IPython a full-fledged system shell.
6806 In particular, it has no job control, so if you type Ctrl-Z (under Unix),
6892 In particular, it has no job control, so if you type Ctrl-Z (under Unix),
6807 you'll suspend pysh itself, not the process you just started.
6893 you'll suspend pysh itself, not the process you just started.
6808
6894
6809 \layout Standard
6895 \layout Standard
6810
6896
6811 What the shell profile allows you to do is to use the convenient and powerful
6897 What the shell profile allows you to do is to use the convenient and powerful
6812 syntax of Python to do quick scripting at the command line.
6898 syntax of Python to do quick scripting at the command line.
6813 Below we describe some of its features.
6899 Below we describe some of its features.
6814 \layout Subsection
6900 \layout Subsection
6815
6901
6816 Aliases
6902 Aliases
6817 \layout Standard
6903 \layout Standard
6818
6904
6819 All of your
6905 All of your
6820 \family typewriter
6906 \family typewriter
6821 $PATH
6907 $PATH
6822 \family default
6908 \family default
6823 has been loaded as IPython aliases, so you should be able to type any normal
6909 has been loaded as IPython aliases, so you should be able to type any normal
6824 system command and have it executed.
6910 system command and have it executed.
6825 See
6911 See
6826 \family typewriter
6912 \family typewriter
6827 %alias?
6913 %alias?
6828 \family default
6914 \family default
6829 and
6915 and
6830 \family typewriter
6916 \family typewriter
6831 %unalias?
6917 %unalias?
6832 \family default
6918 \family default
6833 for details on the alias facilities.
6919 for details on the alias facilities.
6834 See also
6920 See also
6835 \family typewriter
6921 \family typewriter
6836 %rehash?
6922 %rehash?
6837 \family default
6923 \family default
6838 and
6924 and
6839 \family typewriter
6925 \family typewriter
6840 %rehashx?
6926 %rehashx?
6841 \family default
6927 \family default
6842 for details on the mechanism used to load
6928 for details on the mechanism used to load
6843 \family typewriter
6929 \family typewriter
6844 $PATH
6930 $PATH
6845 \family default
6931 \family default
6846 .
6932 .
6847 \layout Subsection
6933 \layout Subsection
6848
6934
6849 Special syntax
6935 Special syntax
6850 \layout Standard
6936 \layout Standard
6851
6937
6852 Any lines which begin with
6938 Any lines which begin with
6853 \family typewriter
6939 \family typewriter
6854 `~'
6940 `~'
6855 \family default
6941 \family default
6856 ,
6942 ,
6857 \family typewriter
6943 \family typewriter
6858 `/'
6944 `/'
6859 \family default
6945 \family default
6860 and
6946 and
6861 \family typewriter
6947 \family typewriter
6862 `.'
6948 `.'
6863 \family default
6949 \family default
6864 will be executed as shell commands instead of as Python code.
6950 will be executed as shell commands instead of as Python code.
6865 The special escapes below are also recognized.
6951 The special escapes below are also recognized.
6866
6952
6867 \family typewriter
6953 \family typewriter
6868 !cmd
6954 !cmd
6869 \family default
6955 \family default
6870 is valid in single or multi-line input, all others are only valid in single-lin
6956 is valid in single or multi-line input, all others are only valid in single-lin
6871 e input:
6957 e input:
6872 \layout Description
6958 \layout Description
6873
6959
6874
6960
6875 \family typewriter
6961 \family typewriter
6876 !cmd
6962 !cmd
6877 \family default
6963 \family default
6878 pass `cmd' directly to the shell
6964 pass `cmd' directly to the shell
6879 \layout Description
6965 \layout Description
6880
6966
6881
6967
6882 \family typewriter
6968 \family typewriter
6883 !!cmd
6969 !!cmd
6884 \family default
6970 \family default
6885 execute `cmd' and return output as a list (split on `
6971 execute `cmd' and return output as a list (split on `
6886 \backslash
6972 \backslash
6887 n')
6973 n')
6888 \layout Description
6974 \layout Description
6889
6975
6890
6976
6891 \family typewriter
6977 \family typewriter
6892 $var=cmd
6978 $var=cmd
6893 \family default
6979 \family default
6894 capture output of cmd into var, as a string
6980 capture output of cmd into var, as a string
6895 \layout Description
6981 \layout Description
6896
6982
6897
6983
6898 \family typewriter
6984 \family typewriter
6899 $$var=cmd
6985 $$var=cmd
6900 \family default
6986 \family default
6901 capture output of cmd into var, as a list (split on `
6987 capture output of cmd into var, as a list (split on `
6902 \backslash
6988 \backslash
6903 n')
6989 n')
6904 \layout Standard
6990 \layout Standard
6905
6991
6906 The
6992 The
6907 \family typewriter
6993 \family typewriter
6908 $
6994 $
6909 \family default
6995 \family default
6910 /
6996 /
6911 \family typewriter
6997 \family typewriter
6912 $$
6998 $$
6913 \family default
6999 \family default
6914 syntaxes make Python variables from system output, which you can later
7000 syntaxes make Python variables from system output, which you can later
6915 use for further scripting.
7001 use for further scripting.
6916 The converse is also possible: when executing an alias or calling to the
7002 The converse is also possible: when executing an alias or calling to the
6917 system via
7003 system via
6918 \family typewriter
7004 \family typewriter
6919 !
7005 !
6920 \family default
7006 \family default
6921 /
7007 /
6922 \family typewriter
7008 \family typewriter
6923 !!
7009 !!
6924 \family default
7010 \family default
6925 , you can expand any python variable or expression by prepending it with
7011 , you can expand any python variable or expression by prepending it with
6926
7012
6927 \family typewriter
7013 \family typewriter
6928 $
7014 $
6929 \family default
7015 \family default
6930 .
7016 .
6931 Full details of the allowed syntax can be found in Python's PEP 215.
7017 Full details of the allowed syntax can be found in Python's PEP 215.
6932 \layout Standard
7018 \layout Standard
6933
7019
6934 A few brief examples will illustrate these (note that the indentation below
7020 A few brief examples will illustrate these (note that the indentation below
6935 may be incorrectly displayed):
7021 may be incorrectly displayed):
6936 \layout Standard
7022 \layout Standard
6937
7023
6938
7024
6939 \family typewriter
7025 \family typewriter
6940 fperez[~/test]|3> !ls *s.py
7026 fperez[~/test]|3> !ls *s.py
6941 \newline
7027 \newline
6942 scopes.py strings.py
7028 scopes.py strings.py
6943 \layout Standard
7029 \layout Standard
6944
7030
6945 ls is an internal alias, so there's no need to use
7031 ls is an internal alias, so there's no need to use
6946 \family typewriter
7032 \family typewriter
6947 !
7033 !
6948 \family default
7034 \family default
6949 :
7035 :
6950 \layout Standard
7036 \layout Standard
6951
7037
6952
7038
6953 \family typewriter
7039 \family typewriter
6954 fperez[~/test]|4> ls *s.py
7040 fperez[~/test]|4> ls *s.py
6955 \newline
7041 \newline
6956 scopes.py* strings.py
7042 scopes.py* strings.py
6957 \layout Standard
7043 \layout Standard
6958
7044
6959 !!ls will return the output into a Python variable:
7045 !!ls will return the output into a Python variable:
6960 \layout Standard
7046 \layout Standard
6961
7047
6962
7048
6963 \family typewriter
7049 \family typewriter
6964 fperez[~/test]|5> !!ls *s.py
7050 fperez[~/test]|5> !!ls *s.py
6965 \newline
7051 \newline
6966
7052
6967 \begin_inset ERT
7053 \begin_inset ERT
6968 status Collapsed
7054 status Collapsed
6969
7055
6970 \layout Standard
7056 \layout Standard
6971
7057
6972 \backslash
7058 \backslash
6973 hspace*{0mm}
7059 hspace*{0mm}
6974 \end_inset
7060 \end_inset
6975
7061
6976 \SpecialChar ~
7062 \SpecialChar ~
6977 \SpecialChar ~
7063 \SpecialChar ~
6978 \SpecialChar ~
7064 \SpecialChar ~
6979 \SpecialChar ~
7065 \SpecialChar ~
6980 \SpecialChar ~
7066 \SpecialChar ~
6981 \SpecialChar ~
7067 \SpecialChar ~
6982 \SpecialChar ~
7068 \SpecialChar ~
6983 \SpecialChar ~
7069 \SpecialChar ~
6984 \SpecialChar ~
7070 \SpecialChar ~
6985 \SpecialChar ~
7071 \SpecialChar ~
6986 \SpecialChar ~
7072 \SpecialChar ~
6987 \SpecialChar ~
7073 \SpecialChar ~
6988 \SpecialChar ~
7074 \SpecialChar ~
6989 \SpecialChar ~
7075 \SpecialChar ~
6990 <5> ['scopes.py', 'strings.py']
7076 <5> ['scopes.py', 'strings.py']
6991 \newline
7077 \newline
6992 fperez[~/test]|6> print _5
7078 fperez[~/test]|6> print _5
6993 \newline
7079 \newline
6994 ['scopes.py', 'strings.py']
7080 ['scopes.py', 'strings.py']
6995 \layout Standard
7081 \layout Standard
6996
7082
6997
7083
6998 \family typewriter
7084 \family typewriter
6999 $
7085 $
7000 \family default
7086 \family default
7001 and
7087 and
7002 \family typewriter
7088 \family typewriter
7003 $$
7089 $$
7004 \family default
7090 \family default
7005 allow direct capture to named variables:
7091 allow direct capture to named variables:
7006 \layout Standard
7092 \layout Standard
7007
7093
7008
7094
7009 \family typewriter
7095 \family typewriter
7010 fperez[~/test]|7> $astr = ls *s.py
7096 fperez[~/test]|7> $astr = ls *s.py
7011 \newline
7097 \newline
7012 fperez[~/test]|8> astr
7098 fperez[~/test]|8> astr
7013 \newline
7099 \newline
7014
7100
7015 \begin_inset ERT
7101 \begin_inset ERT
7016 status Collapsed
7102 status Collapsed
7017
7103
7018 \layout Standard
7104 \layout Standard
7019
7105
7020 \backslash
7106 \backslash
7021 hspace*{0mm}
7107 hspace*{0mm}
7022 \end_inset
7108 \end_inset
7023
7109
7024 \SpecialChar ~
7110 \SpecialChar ~
7025 \SpecialChar ~
7111 \SpecialChar ~
7026 \SpecialChar ~
7112 \SpecialChar ~
7027 \SpecialChar ~
7113 \SpecialChar ~
7028 \SpecialChar ~
7114 \SpecialChar ~
7029 \SpecialChar ~
7115 \SpecialChar ~
7030 \SpecialChar ~
7116 \SpecialChar ~
7031 \SpecialChar ~
7117 \SpecialChar ~
7032 \SpecialChar ~
7118 \SpecialChar ~
7033 \SpecialChar ~
7119 \SpecialChar ~
7034 \SpecialChar ~
7120 \SpecialChar ~
7035 \SpecialChar ~
7121 \SpecialChar ~
7036 \SpecialChar ~
7122 \SpecialChar ~
7037 \SpecialChar ~
7123 \SpecialChar ~
7038 <8> 'scopes.py
7124 <8> 'scopes.py
7039 \backslash
7125 \backslash
7040 nstrings.py'
7126 nstrings.py'
7041 \layout Standard
7127 \layout Standard
7042
7128
7043
7129
7044 \family typewriter
7130 \family typewriter
7045 fperez[~/test]|9> $$alist = ls *s.py
7131 fperez[~/test]|9> $$alist = ls *s.py
7046 \newline
7132 \newline
7047 fperez[~/test]|10> alist
7133 fperez[~/test]|10> alist
7048 \newline
7134 \newline
7049
7135
7050 \begin_inset ERT
7136 \begin_inset ERT
7051 status Collapsed
7137 status Collapsed
7052
7138
7053 \layout Standard
7139 \layout Standard
7054
7140
7055 \backslash
7141 \backslash
7056 hspace*{0mm}
7142 hspace*{0mm}
7057 \end_inset
7143 \end_inset
7058
7144
7059 \SpecialChar ~
7145 \SpecialChar ~
7060 \SpecialChar ~
7146 \SpecialChar ~
7061 \SpecialChar ~
7147 \SpecialChar ~
7062 \SpecialChar ~
7148 \SpecialChar ~
7063 \SpecialChar ~
7149 \SpecialChar ~
7064 \SpecialChar ~
7150 \SpecialChar ~
7065 \SpecialChar ~
7151 \SpecialChar ~
7066 \SpecialChar ~
7152 \SpecialChar ~
7067 \SpecialChar ~
7153 \SpecialChar ~
7068 \SpecialChar ~
7154 \SpecialChar ~
7069 \SpecialChar ~
7155 \SpecialChar ~
7070 \SpecialChar ~
7156 \SpecialChar ~
7071 \SpecialChar ~
7157 \SpecialChar ~
7072 \SpecialChar ~
7158 \SpecialChar ~
7073 <10> ['scopes.py', 'strings.py']
7159 <10> ['scopes.py', 'strings.py']
7074 \layout Standard
7160 \layout Standard
7075
7161
7076 alist is now a normal python list you can loop over.
7162 alist is now a normal python list you can loop over.
7077 Using
7163 Using
7078 \family typewriter
7164 \family typewriter
7079 $
7165 $
7080 \family default
7166 \family default
7081 will expand back the python values when alias calls are made:
7167 will expand back the python values when alias calls are made:
7082 \layout Standard
7168 \layout Standard
7083
7169
7084
7170
7085 \family typewriter
7171 \family typewriter
7086 fperez[~/test]|11> for f in alist:
7172 fperez[~/test]|11> for f in alist:
7087 \newline
7173 \newline
7088
7174
7089 \begin_inset ERT
7175 \begin_inset ERT
7090 status Collapsed
7176 status Collapsed
7091
7177
7092 \layout Standard
7178 \layout Standard
7093
7179
7094 \backslash
7180 \backslash
7095 hspace*{0mm}
7181 hspace*{0mm}
7096 \end_inset
7182 \end_inset
7097
7183
7098 \SpecialChar ~
7184 \SpecialChar ~
7099 \SpecialChar ~
7185 \SpecialChar ~
7100 \SpecialChar ~
7186 \SpecialChar ~
7101 \SpecialChar ~
7187 \SpecialChar ~
7102 \SpecialChar ~
7188 \SpecialChar ~
7103 \SpecialChar ~
7189 \SpecialChar ~
7104 \SpecialChar ~
7190 \SpecialChar ~
7105 \SpecialChar ~
7191 \SpecialChar ~
7106 \SpecialChar ~
7192 \SpecialChar ~
7107 \SpecialChar ~
7193 \SpecialChar ~
7108 \SpecialChar ~
7194 \SpecialChar ~
7109 \SpecialChar ~
7195 \SpecialChar ~
7110 \SpecialChar ~
7196 \SpecialChar ~
7111 \SpecialChar ~
7197 \SpecialChar ~
7112 |..> \SpecialChar ~
7198 |..> \SpecialChar ~
7113 \SpecialChar ~
7199 \SpecialChar ~
7114 \SpecialChar ~
7200 \SpecialChar ~
7115 \SpecialChar ~
7201 \SpecialChar ~
7116 print 'file',f,
7202 print 'file',f,
7117 \newline
7203 \newline
7118
7204
7119 \begin_inset ERT
7205 \begin_inset ERT
7120 status Collapsed
7206 status Collapsed
7121
7207
7122 \layout Standard
7208 \layout Standard
7123
7209
7124 \backslash
7210 \backslash
7125 hspace*{0mm}
7211 hspace*{0mm}
7126 \end_inset
7212 \end_inset
7127
7213
7128 \SpecialChar ~
7214 \SpecialChar ~
7129 \SpecialChar ~
7215 \SpecialChar ~
7130 \SpecialChar ~
7216 \SpecialChar ~
7131 \SpecialChar ~
7217 \SpecialChar ~
7132 \SpecialChar ~
7218 \SpecialChar ~
7133 \SpecialChar ~
7219 \SpecialChar ~
7134 \SpecialChar ~
7220 \SpecialChar ~
7135 \SpecialChar ~
7221 \SpecialChar ~
7136 \SpecialChar ~
7222 \SpecialChar ~
7137 \SpecialChar ~
7223 \SpecialChar ~
7138 \SpecialChar ~
7224 \SpecialChar ~
7139 \SpecialChar ~
7225 \SpecialChar ~
7140 \SpecialChar ~
7226 \SpecialChar ~
7141 \SpecialChar ~
7227 \SpecialChar ~
7142 |..> \SpecialChar ~
7228 |..> \SpecialChar ~
7143 \SpecialChar ~
7229 \SpecialChar ~
7144 \SpecialChar ~
7230 \SpecialChar ~
7145 \SpecialChar ~
7231 \SpecialChar ~
7146 wc -l $f
7232 wc -l $f
7147 \newline
7233 \newline
7148
7234
7149 \begin_inset ERT
7235 \begin_inset ERT
7150 status Collapsed
7236 status Collapsed
7151
7237
7152 \layout Standard
7238 \layout Standard
7153
7239
7154 \backslash
7240 \backslash
7155 hspace*{0mm}
7241 hspace*{0mm}
7156 \end_inset
7242 \end_inset
7157
7243
7158 \SpecialChar ~
7244 \SpecialChar ~
7159 \SpecialChar ~
7245 \SpecialChar ~
7160 \SpecialChar ~
7246 \SpecialChar ~
7161 \SpecialChar ~
7247 \SpecialChar ~
7162 \SpecialChar ~
7248 \SpecialChar ~
7163 \SpecialChar ~
7249 \SpecialChar ~
7164 \SpecialChar ~
7250 \SpecialChar ~
7165 \SpecialChar ~
7251 \SpecialChar ~
7166 \SpecialChar ~
7252 \SpecialChar ~
7167 \SpecialChar ~
7253 \SpecialChar ~
7168 \SpecialChar ~
7254 \SpecialChar ~
7169 \SpecialChar ~
7255 \SpecialChar ~
7170 \SpecialChar ~
7256 \SpecialChar ~
7171 \SpecialChar ~
7257 \SpecialChar ~
7172 |..>
7258 |..>
7173 \newline
7259 \newline
7174 file scopes.py 13 scopes.py
7260 file scopes.py 13 scopes.py
7175 \newline
7261 \newline
7176 file strings.py 4 strings.py
7262 file strings.py 4 strings.py
7177 \layout Standard
7263 \layout Standard
7178
7264
7179 Note that you may need to protect your variables with braces if you want
7265 Note that you may need to protect your variables with braces if you want
7180 to append strings to their names.
7266 to append strings to their names.
7181 To copy all files in alist to
7267 To copy all files in alist to
7182 \family typewriter
7268 \family typewriter
7183 .bak
7269 .bak
7184 \family default
7270 \family default
7185 extensions, you must use:
7271 extensions, you must use:
7186 \layout Standard
7272 \layout Standard
7187
7273
7188
7274
7189 \family typewriter
7275 \family typewriter
7190 fperez[~/test]|12> for f in alist:
7276 fperez[~/test]|12> for f in alist:
7191 \newline
7277 \newline
7192
7278
7193 \begin_inset ERT
7279 \begin_inset ERT
7194 status Collapsed
7280 status Collapsed
7195
7281
7196 \layout Standard
7282 \layout Standard
7197
7283
7198 \backslash
7284 \backslash
7199 hspace*{0mm}
7285 hspace*{0mm}
7200 \end_inset
7286 \end_inset
7201
7287
7202 \SpecialChar ~
7288 \SpecialChar ~
7203 \SpecialChar ~
7289 \SpecialChar ~
7204 \SpecialChar ~
7290 \SpecialChar ~
7205 \SpecialChar ~
7291 \SpecialChar ~
7206 \SpecialChar ~
7292 \SpecialChar ~
7207 \SpecialChar ~
7293 \SpecialChar ~
7208 \SpecialChar ~
7294 \SpecialChar ~
7209 \SpecialChar ~
7295 \SpecialChar ~
7210 \SpecialChar ~
7296 \SpecialChar ~
7211 \SpecialChar ~
7297 \SpecialChar ~
7212 \SpecialChar ~
7298 \SpecialChar ~
7213 \SpecialChar ~
7299 \SpecialChar ~
7214 \SpecialChar ~
7300 \SpecialChar ~
7215 \SpecialChar ~
7301 \SpecialChar ~
7216 |..> \SpecialChar ~
7302 |..> \SpecialChar ~
7217 \SpecialChar ~
7303 \SpecialChar ~
7218 \SpecialChar ~
7304 \SpecialChar ~
7219 \SpecialChar ~
7305 \SpecialChar ~
7220 cp $f ${f}.bak
7306 cp $f ${f}.bak
7221 \layout Standard
7307 \layout Standard
7222
7308
7223 If you try using
7309 If you try using
7224 \family typewriter
7310 \family typewriter
7225 $f.bak
7311 $f.bak
7226 \family default
7312 \family default
7227 , you'll get an AttributeError exception saying that your string object
7313 , you'll get an AttributeError exception saying that your string object
7228 doesn't have a
7314 doesn't have a
7229 \family typewriter
7315 \family typewriter
7230 .bak
7316 .bak
7231 \family default
7317 \family default
7232 attribute.
7318 attribute.
7233 This is because the
7319 This is because the
7234 \family typewriter
7320 \family typewriter
7235 $
7321 $
7236 \family default
7322 \family default
7237 expansion mechanism allows you to expand full Python expressions:
7323 expansion mechanism allows you to expand full Python expressions:
7238 \layout Standard
7324 \layout Standard
7239
7325
7240
7326
7241 \family typewriter
7327 \family typewriter
7242 fperez[~/test]|13> echo "sys.platform is: $sys.platform"
7328 fperez[~/test]|13> echo "sys.platform is: $sys.platform"
7243 \newline
7329 \newline
7244 sys.platform is: linux2
7330 sys.platform is: linux2
7245 \layout Standard
7331 \layout Standard
7246
7332
7247 IPython's input history handling is still active, which allows you to rerun
7333 IPython's input history handling is still active, which allows you to rerun
7248 a single block of multi-line input by simply using exec:
7334 a single block of multi-line input by simply using exec:
7249 \newline
7335 \newline
7250
7336
7251 \family typewriter
7337 \family typewriter
7252 fperez[~/test]|14> $$alist = ls *.eps
7338 fperez[~/test]|14> $$alist = ls *.eps
7253 \newline
7339 \newline
7254 fperez[~/test]|15> exec _i11
7340 fperez[~/test]|15> exec _i11
7255 \newline
7341 \newline
7256 file image2.eps 921 image2.eps
7342 file image2.eps 921 image2.eps
7257 \newline
7343 \newline
7258 file image.eps 921 image.eps
7344 file image.eps 921 image.eps
7259 \layout Standard
7345 \layout Standard
7260
7346
7261 While these are new special-case syntaxes, they are designed to allow very
7347 While these are new special-case syntaxes, they are designed to allow very
7262 efficient use of the shell with minimal typing.
7348 efficient use of the shell with minimal typing.
7263 At an interactive shell prompt, conciseness of expression wins over readability.
7349 At an interactive shell prompt, conciseness of expression wins over readability.
7264 \layout Subsection
7350 \layout Subsection
7265
7351
7266 Useful functions and modules
7352 Useful functions and modules
7267 \layout Standard
7353 \layout Standard
7268
7354
7269 The os, sys and shutil modules from the Python standard library are automaticall
7355 The os, sys and shutil modules from the Python standard library are automaticall
7270 y loaded.
7356 y loaded.
7271 Some additional functions, useful for shell usage, are listed below.
7357 Some additional functions, useful for shell usage, are listed below.
7272 You can request more help about them with `
7358 You can request more help about them with `
7273 \family typewriter
7359 \family typewriter
7274 ?
7360 ?
7275 \family default
7361 \family default
7276 '.
7362 '.
7277 \layout Description
7363 \layout Description
7278
7364
7279
7365
7280 \family typewriter
7366 \family typewriter
7281 shell
7367 shell
7282 \family default
7368 \family default
7283 - execute a command in the underlying system shell
7369 - execute a command in the underlying system shell
7284 \layout Description
7370 \layout Description
7285
7371
7286
7372
7287 \family typewriter
7373 \family typewriter
7288 system
7374 system
7289 \family default
7375 \family default
7290 - like
7376 - like
7291 \family typewriter
7377 \family typewriter
7292 shell()
7378 shell()
7293 \family default
7379 \family default
7294 , but return the exit status of the command
7380 , but return the exit status of the command
7295 \layout Description
7381 \layout Description
7296
7382
7297
7383
7298 \family typewriter
7384 \family typewriter
7299 sout
7385 sout
7300 \family default
7386 \family default
7301 - capture the output of a command as a string
7387 - capture the output of a command as a string
7302 \layout Description
7388 \layout Description
7303
7389
7304
7390
7305 \family typewriter
7391 \family typewriter
7306 lout
7392 lout
7307 \family default
7393 \family default
7308 - capture the output of a command as a list (split on `
7394 - capture the output of a command as a list (split on `
7309 \backslash
7395 \backslash
7310 n')
7396 n')
7311 \layout Description
7397 \layout Description
7312
7398
7313
7399
7314 \family typewriter
7400 \family typewriter
7315 getoutputerror
7401 getoutputerror
7316 \family default
7402 \family default
7317 - capture (output,error) of a shell commandss
7403 - capture (output,error) of a shell commandss
7318 \layout Standard
7404 \layout Standard
7319
7405
7320
7406
7321 \family typewriter
7407 \family typewriter
7322 sout
7408 sout
7323 \family default
7409 \family default
7324 /
7410 /
7325 \family typewriter
7411 \family typewriter
7326 lout
7412 lout
7327 \family default
7413 \family default
7328 are the functional equivalents of
7414 are the functional equivalents of
7329 \family typewriter
7415 \family typewriter
7330 $
7416 $
7331 \family default
7417 \family default
7332 /
7418 /
7333 \family typewriter
7419 \family typewriter
7334 $$
7420 $$
7335 \family default
7421 \family default
7336 .
7422 .
7337 They are provided to allow you to capture system output in the middle of
7423 They are provided to allow you to capture system output in the middle of
7338 true python code, function definitions, etc (where
7424 true python code, function definitions, etc (where
7339 \family typewriter
7425 \family typewriter
7340 $
7426 $
7341 \family default
7427 \family default
7342 and
7428 and
7343 \family typewriter
7429 \family typewriter
7344 $$
7430 $$
7345 \family default
7431 \family default
7346 are invalid).
7432 are invalid).
7347 \layout Subsection
7433 \layout Subsection
7348
7434
7349 Directory management
7435 Directory management
7350 \layout Standard
7436 \layout Standard
7351
7437
7352 Since each command passed by pysh to the underlying system is executed in
7438 Since each command passed by pysh to the underlying system is executed in
7353 a subshell which exits immediately, you can NOT use !cd to navigate the
7439 a subshell which exits immediately, you can NOT use !cd to navigate the
7354 filesystem.
7440 filesystem.
7355 \layout Standard
7441 \layout Standard
7356
7442
7357 Pysh provides its own builtin
7443 Pysh provides its own builtin
7358 \family typewriter
7444 \family typewriter
7359 `%cd
7445 `%cd
7360 \family default
7446 \family default
7361 ' magic command to move in the filesystem (the
7447 ' magic command to move in the filesystem (the
7362 \family typewriter
7448 \family typewriter
7363 %
7449 %
7364 \family default
7450 \family default
7365 is not required with automagic on).
7451 is not required with automagic on).
7366 It also maintains a list of visited directories (use
7452 It also maintains a list of visited directories (use
7367 \family typewriter
7453 \family typewriter
7368 %dhist
7454 %dhist
7369 \family default
7455 \family default
7370 to see it) and allows direct switching to any of them.
7456 to see it) and allows direct switching to any of them.
7371 Type
7457 Type
7372 \family typewriter
7458 \family typewriter
7373 `cd?
7459 `cd?
7374 \family default
7460 \family default
7375 ' for more details.
7461 ' for more details.
7376 \layout Standard
7462 \layout Standard
7377
7463
7378
7464
7379 \family typewriter
7465 \family typewriter
7380 %pushd
7466 %pushd
7381 \family default
7467 \family default
7382 ,
7468 ,
7383 \family typewriter
7469 \family typewriter
7384 %popd
7470 %popd
7385 \family default
7471 \family default
7386 and
7472 and
7387 \family typewriter
7473 \family typewriter
7388 %dirs
7474 %dirs
7389 \family default
7475 \family default
7390 are provided for directory stack handling.
7476 are provided for directory stack handling.
7391 \layout Subsection
7477 \layout Subsection
7392
7478
7393 Prompt customization
7479 Prompt customization
7394 \layout Standard
7480 \layout Standard
7395
7481
7396 The supplied
7482 The supplied
7397 \family typewriter
7483 \family typewriter
7398 ipythonrc-pysh
7484 ipythonrc-pysh
7399 \family default
7485 \family default
7400 profile comes with an example of a very colored and detailed prompt, mainly
7486 profile comes with an example of a very colored and detailed prompt, mainly
7401 to serve as an illustration.
7487 to serve as an illustration.
7402 The valid escape sequences, besides color names, are:
7488 The valid escape sequences, besides color names, are:
7403 \layout Description
7489 \layout Description
7404
7490
7405
7491
7406 \backslash
7492 \backslash
7407 # - Prompt number.
7493 # - Prompt number.
7408 \layout Description
7494 \layout Description
7409
7495
7410
7496
7411 \backslash
7497 \backslash
7412 D - Dots, as many as there are digits in
7498 D - Dots, as many as there are digits in
7413 \backslash
7499 \backslash
7414 # (so they align).
7500 # (so they align).
7415 \layout Description
7501 \layout Description
7416
7502
7417
7503
7418 \backslash
7504 \backslash
7419 w - Current working directory (cwd).
7505 w - Current working directory (cwd).
7420 \layout Description
7506 \layout Description
7421
7507
7422
7508
7423 \backslash
7509 \backslash
7424 W - Basename of current working directory.
7510 W - Basename of current working directory.
7425 \layout Description
7511 \layout Description
7426
7512
7427
7513
7428 \backslash
7514 \backslash
7429 X
7515 X
7430 \emph on
7516 \emph on
7431 N
7517 N
7432 \emph default
7518 \emph default
7433 - Where
7519 - Where
7434 \emph on
7520 \emph on
7435 N
7521 N
7436 \emph default
7522 \emph default
7437 =0..5.
7523 =0..5.
7438 N terms of the cwd, with $HOME written as ~.
7524 N terms of the cwd, with $HOME written as ~.
7439 \layout Description
7525 \layout Description
7440
7526
7441
7527
7442 \backslash
7528 \backslash
7443 Y
7529 Y
7444 \emph on
7530 \emph on
7445 N
7531 N
7446 \emph default
7532 \emph default
7447 - Where
7533 - Where
7448 \emph on
7534 \emph on
7449 N
7535 N
7450 \emph default
7536 \emph default
7451 =0..5.
7537 =0..5.
7452 Like X
7538 Like X
7453 \emph on
7539 \emph on
7454 N
7540 N
7455 \emph default
7541 \emph default
7456 , but if ~ is term
7542 , but if ~ is term
7457 \emph on
7543 \emph on
7458 N
7544 N
7459 \emph default
7545 \emph default
7460 +1 it's also shown.
7546 +1 it's also shown.
7461 \layout Description
7547 \layout Description
7462
7548
7463
7549
7464 \backslash
7550 \backslash
7465 u - Username.
7551 u - Username.
7466 \layout Description
7552 \layout Description
7467
7553
7468
7554
7469 \backslash
7555 \backslash
7470 H - Full hostname.
7556 H - Full hostname.
7471 \layout Description
7557 \layout Description
7472
7558
7473
7559
7474 \backslash
7560 \backslash
7475 h - Hostname up to first '.'
7561 h - Hostname up to first '.'
7476 \layout Description
7562 \layout Description
7477
7563
7478
7564
7479 \backslash
7565 \backslash
7480 $ - Root symbol ($ or #).
7566 $ - Root symbol ($ or #).
7481
7567
7482 \layout Description
7568 \layout Description
7483
7569
7484
7570
7485 \backslash
7571 \backslash
7486 t - Current time, in H:M:S format.
7572 t - Current time, in H:M:S format.
7487 \layout Description
7573 \layout Description
7488
7574
7489
7575
7490 \backslash
7576 \backslash
7491 v - IPython release version.
7577 v - IPython release version.
7492
7578
7493 \layout Description
7579 \layout Description
7494
7580
7495
7581
7496 \backslash
7582 \backslash
7497 n - Newline.
7583 n - Newline.
7498
7584
7499 \layout Description
7585 \layout Description
7500
7586
7501
7587
7502 \backslash
7588 \backslash
7503 r - Carriage return.
7589 r - Carriage return.
7504
7590
7505 \layout Description
7591 \layout Description
7506
7592
7507
7593
7508 \backslash
7594 \backslash
7509
7595
7510 \backslash
7596 \backslash
7511 - An explicitly escaped '
7597 - An explicitly escaped '
7512 \backslash
7598 \backslash
7513 '.
7599 '.
7514 \layout Standard
7600 \layout Standard
7515
7601
7516 You can configure your prompt colors using any ANSI color escape.
7602 You can configure your prompt colors using any ANSI color escape.
7517 Each color escape sets the color for any subsequent text, until another
7603 Each color escape sets the color for any subsequent text, until another
7518 escape comes in and changes things.
7604 escape comes in and changes things.
7519 The valid color escapes are:
7605 The valid color escapes are:
7520 \layout Description
7606 \layout Description
7521
7607
7522
7608
7523 \backslash
7609 \backslash
7524 C_Black
7610 C_Black
7525 \layout Description
7611 \layout Description
7526
7612
7527
7613
7528 \backslash
7614 \backslash
7529 C_Blue
7615 C_Blue
7530 \layout Description
7616 \layout Description
7531
7617
7532
7618
7533 \backslash
7619 \backslash
7534 C_Brown
7620 C_Brown
7535 \layout Description
7621 \layout Description
7536
7622
7537
7623
7538 \backslash
7624 \backslash
7539 C_Cyan
7625 C_Cyan
7540 \layout Description
7626 \layout Description
7541
7627
7542
7628
7543 \backslash
7629 \backslash
7544 C_DarkGray
7630 C_DarkGray
7545 \layout Description
7631 \layout Description
7546
7632
7547
7633
7548 \backslash
7634 \backslash
7549 C_Green
7635 C_Green
7550 \layout Description
7636 \layout Description
7551
7637
7552
7638
7553 \backslash
7639 \backslash
7554 C_LightBlue
7640 C_LightBlue
7555 \layout Description
7641 \layout Description
7556
7642
7557
7643
7558 \backslash
7644 \backslash
7559 C_LightCyan
7645 C_LightCyan
7560 \layout Description
7646 \layout Description
7561
7647
7562
7648
7563 \backslash
7649 \backslash
7564 C_LightGray
7650 C_LightGray
7565 \layout Description
7651 \layout Description
7566
7652
7567
7653
7568 \backslash
7654 \backslash
7569 C_LightGreen
7655 C_LightGreen
7570 \layout Description
7656 \layout Description
7571
7657
7572
7658
7573 \backslash
7659 \backslash
7574 C_LightPurple
7660 C_LightPurple
7575 \layout Description
7661 \layout Description
7576
7662
7577
7663
7578 \backslash
7664 \backslash
7579 C_LightRed
7665 C_LightRed
7580 \layout Description
7666 \layout Description
7581
7667
7582
7668
7583 \backslash
7669 \backslash
7584 C_Purple
7670 C_Purple
7585 \layout Description
7671 \layout Description
7586
7672
7587
7673
7588 \backslash
7674 \backslash
7589 C_Red
7675 C_Red
7590 \layout Description
7676 \layout Description
7591
7677
7592
7678
7593 \backslash
7679 \backslash
7594 C_White
7680 C_White
7595 \layout Description
7681 \layout Description
7596
7682
7597
7683
7598 \backslash
7684 \backslash
7599 C_Yellow
7685 C_Yellow
7600 \layout Description
7686 \layout Description
7601
7687
7602
7688
7603 \backslash
7689 \backslash
7604 C_Normal Stop coloring, defaults to your terminal settings.
7690 C_Normal Stop coloring, defaults to your terminal settings.
7605 \layout Section
7691 \layout Section
7606
7692
7607
7693
7608 \begin_inset LatexCommand \label{sec:Threading-support}
7694 \begin_inset LatexCommand \label{sec:Threading-support}
7609
7695
7610 \end_inset
7696 \end_inset
7611
7697
7612 Threading support
7698 Threading support
7613 \layout Standard
7699 \layout Standard
7614
7700
7615
7701
7616 \series bold
7702 \series bold
7617 WARNING:
7703 WARNING:
7618 \series default
7704 \series default
7619 The threading support is still somewhat experimental, and it has only seen
7705 The threading support is still somewhat experimental, and it has only seen
7620 reasonable testing under Linux.
7706 reasonable testing under Linux.
7621 Threaded code is particularly tricky to debug, and it tends to show extremely
7707 Threaded code is particularly tricky to debug, and it tends to show extremely
7622 platform-dependent behavior.
7708 platform-dependent behavior.
7623 Since I only have access to Linux machines, I will have to rely on user's
7709 Since I only have access to Linux machines, I will have to rely on user's
7624 experiences and assistance for this area of IPython to improve under other
7710 experiences and assistance for this area of IPython to improve under other
7625 platforms.
7711 platforms.
7626 \layout Standard
7712 \layout Standard
7627
7713
7628 IPython, via the
7714 IPython, via the
7629 \family typewriter
7715 \family typewriter
7630 -gthread
7716 -gthread
7631 \family default
7717 \family default
7632 ,
7718 ,
7633 \family typewriter
7719 \family typewriter
7634 -qthread
7720 -qthread
7635 \family default
7721 \family default
7636 and
7722 and
7637 \family typewriter
7723 \family typewriter
7638 -wthread
7724 -wthread
7639 \family default
7725 \family default
7640 options (described in Sec.\SpecialChar ~
7726 options (described in Sec.\SpecialChar ~
7641
7727
7642 \begin_inset LatexCommand \ref{sec:threading-opts}
7728 \begin_inset LatexCommand \ref{sec:threading-opts}
7643
7729
7644 \end_inset
7730 \end_inset
7645
7731
7646 ), can run in multithreaded mode to support pyGTK, Qt and WXPython applications
7732 ), can run in multithreaded mode to support pyGTK, Qt and WXPython applications
7647 respectively.
7733 respectively.
7648 These GUI toolkits need to control the python main loop of execution, so
7734 These GUI toolkits need to control the python main loop of execution, so
7649 under a normal Python interpreter, starting a pyGTK, Qt or WXPython application
7735 under a normal Python interpreter, starting a pyGTK, Qt or WXPython application
7650 will immediately freeze the shell.
7736 will immediately freeze the shell.
7651
7737
7652 \layout Standard
7738 \layout Standard
7653
7739
7654 IPython, with one of these options (you can only use one at a time), separates
7740 IPython, with one of these options (you can only use one at a time), separates
7655 the graphical loop and IPython's code execution run into different threads.
7741 the graphical loop and IPython's code execution run into different threads.
7656 This allows you to test interactively (with
7742 This allows you to test interactively (with
7657 \family typewriter
7743 \family typewriter
7658 %run
7744 %run
7659 \family default
7745 \family default
7660 , for example) your GUI code without blocking.
7746 , for example) your GUI code without blocking.
7661 \layout Standard
7747 \layout Standard
7662
7748
7663 A nice mini-tutorial on using IPython along with the Qt Designer application
7749 A nice mini-tutorial on using IPython along with the Qt Designer application
7664 is available at the SciPy wiki:
7750 is available at the SciPy wiki:
7665 \begin_inset LatexCommand \htmlurl{http://www.scipy.org/wikis/topical_software/QtWithIPythonAndDesigner}
7751 \begin_inset LatexCommand \htmlurl{http://www.scipy.org/wikis/topical_software/QtWithIPythonAndDesigner}
7666
7752
7667 \end_inset
7753 \end_inset
7668
7754
7669 .
7755 .
7670 \layout Subsection
7756 \layout Subsection
7671
7757
7672 Tk issues
7758 Tk issues
7673 \layout Standard
7759 \layout Standard
7674
7760
7675 As indicated in Sec.\SpecialChar ~
7761 As indicated in Sec.\SpecialChar ~
7676
7762
7677 \begin_inset LatexCommand \ref{sec:threading-opts}
7763 \begin_inset LatexCommand \ref{sec:threading-opts}
7678
7764
7679 \end_inset
7765 \end_inset
7680
7766
7681 , a special
7767 , a special
7682 \family typewriter
7768 \family typewriter
7683 -tk
7769 -tk
7684 \family default
7770 \family default
7685 option is provided to try and allow Tk graphical applications to coexist
7771 option is provided to try and allow Tk graphical applications to coexist
7686 interactively with WX, Qt or GTK ones.
7772 interactively with WX, Qt or GTK ones.
7687 Whether this works at all, however, is very platform and configuration
7773 Whether this works at all, however, is very platform and configuration
7688 dependent.
7774 dependent.
7689 Please experiment with simple test cases before committing to using this
7775 Please experiment with simple test cases before committing to using this
7690 combination of Tk and GTK/Qt/WX threading in a production environment.
7776 combination of Tk and GTK/Qt/WX threading in a production environment.
7691 \layout Subsection
7777 \layout Subsection
7692
7778
7693 Signals and Threads
7779 Signals and Threads
7694 \layout Standard
7780 \layout Standard
7695
7781
7696 When any of the thread systems (GTK, Qt or WX) are active, either directly
7782 When any of the thread systems (GTK, Qt or WX) are active, either directly
7697 or via
7783 or via
7698 \family typewriter
7784 \family typewriter
7699 -pylab
7785 -pylab
7700 \family default
7786 \family default
7701 with a threaded backend, it is impossible to interrupt long-running Python
7787 with a threaded backend, it is impossible to interrupt long-running Python
7702 code via
7788 code via
7703 \family typewriter
7789 \family typewriter
7704 Ctrl-C
7790 Ctrl-C
7705 \family default
7791 \family default
7706 .
7792 .
7707 IPython can not pass the KeyboardInterrupt exception (or the underlying
7793 IPython can not pass the KeyboardInterrupt exception (or the underlying
7708
7794
7709 \family typewriter
7795 \family typewriter
7710 SIGINT
7796 SIGINT
7711 \family default
7797 \family default
7712 ) across threads, so any long-running process started from IPython will
7798 ) across threads, so any long-running process started from IPython will
7713 run to completion, or will have to be killed via an external (OS-based)
7799 run to completion, or will have to be killed via an external (OS-based)
7714 mechanism.
7800 mechanism.
7715 \layout Standard
7801 \layout Standard
7716
7802
7717 To the best of my knowledge, this limitation is imposed by the Python interprete
7803 To the best of my knowledge, this limitation is imposed by the Python interprete
7718 r itself, and it comes from the difficulty of writing portable signal/threaded
7804 r itself, and it comes from the difficulty of writing portable signal/threaded
7719 code.
7805 code.
7720 If any user is an expert on this topic and can suggest a better solution,
7806 If any user is an expert on this topic and can suggest a better solution,
7721 I would love to hear about it.
7807 I would love to hear about it.
7722 In the IPython sources, look at the
7808 In the IPython sources, look at the
7723 \family typewriter
7809 \family typewriter
7724 Shell.py
7810 Shell.py
7725 \family default
7811 \family default
7726 module, and in particular at the
7812 module, and in particular at the
7727 \family typewriter
7813 \family typewriter
7728 runcode()
7814 runcode()
7729 \family default
7815 \family default
7730 method.
7816 method.
7731
7817
7732 \layout Subsection
7818 \layout Subsection
7733
7819
7734 I/O pitfalls
7820 I/O pitfalls
7735 \layout Standard
7821 \layout Standard
7736
7822
7737 Be mindful that the Python interpreter switches between threads every
7823 Be mindful that the Python interpreter switches between threads every
7738 \begin_inset Formula $N$
7824 \begin_inset Formula $N$
7739 \end_inset
7825 \end_inset
7740
7826
7741 bytecodes, where the default value as of Python\SpecialChar ~
7827 bytecodes, where the default value as of Python\SpecialChar ~
7742 2.3 is
7828 2.3 is
7743 \begin_inset Formula $N=100.$
7829 \begin_inset Formula $N=100.$
7744 \end_inset
7830 \end_inset
7745
7831
7746 This value can be read by using the
7832 This value can be read by using the
7747 \family typewriter
7833 \family typewriter
7748 sys.getcheckinterval()
7834 sys.getcheckinterval()
7749 \family default
7835 \family default
7750 function, and it can be reset via
7836 function, and it can be reset via
7751 \family typewriter
7837 \family typewriter
7752 sys.setcheckinterval(
7838 sys.setcheckinterval(
7753 \emph on
7839 \emph on
7754 N
7840 N
7755 \emph default
7841 \emph default
7756 )
7842 )
7757 \family default
7843 \family default
7758 .
7844 .
7759 This switching of threads can cause subtly confusing effects if one of
7845 This switching of threads can cause subtly confusing effects if one of
7760 your threads is doing file I/O.
7846 your threads is doing file I/O.
7761 In text mode, most systems only flush file buffers when they encounter
7847 In text mode, most systems only flush file buffers when they encounter
7762 a
7848 a
7763 \family typewriter
7849 \family typewriter
7764 `
7850 `
7765 \backslash
7851 \backslash
7766 n'
7852 n'
7767 \family default
7853 \family default
7768 .
7854 .
7769 An instruction as simple as
7855 An instruction as simple as
7770 \family typewriter
7856 \family typewriter
7771
7857
7772 \newline
7858 \newline
7773 \SpecialChar ~
7859 \SpecialChar ~
7774 \SpecialChar ~
7860 \SpecialChar ~
7775 print >> filehandle,
7861 print >> filehandle,
7776 \begin_inset Quotes eld
7862 \begin_inset Quotes eld
7777 \end_inset
7863 \end_inset
7778
7864
7779 hello world
7865 hello world
7780 \begin_inset Quotes erd
7866 \begin_inset Quotes erd
7781 \end_inset
7867 \end_inset
7782
7868
7783
7869
7784 \family default
7870 \family default
7785
7871
7786 \newline
7872 \newline
7787 actually consists of several bytecodes, so it is possible that the newline
7873 actually consists of several bytecodes, so it is possible that the newline
7788 does not reach your file before the next thread switch.
7874 does not reach your file before the next thread switch.
7789 Similarly, if you are writing to a file in binary mode, the file won't
7875 Similarly, if you are writing to a file in binary mode, the file won't
7790 be flushed until the buffer fills, and your other thread may see apparently
7876 be flushed until the buffer fills, and your other thread may see apparently
7791 truncated files.
7877 truncated files.
7792
7878
7793 \layout Standard
7879 \layout Standard
7794
7880
7795 For this reason, if you are using IPython's thread support and have (for
7881 For this reason, if you are using IPython's thread support and have (for
7796 example) a GUI application which will read data generated by files written
7882 example) a GUI application which will read data generated by files written
7797 to from the IPython thread, the safest approach is to open all of your
7883 to from the IPython thread, the safest approach is to open all of your
7798 files in unbuffered mode (the third argument to the
7884 files in unbuffered mode (the third argument to the
7799 \family typewriter
7885 \family typewriter
7800 file/open
7886 file/open
7801 \family default
7887 \family default
7802 function is the buffering value):
7888 function is the buffering value):
7803 \newline
7889 \newline
7804
7890
7805 \family typewriter
7891 \family typewriter
7806 \SpecialChar ~
7892 \SpecialChar ~
7807 \SpecialChar ~
7893 \SpecialChar ~
7808 filehandle = open(filename,mode,0)
7894 filehandle = open(filename,mode,0)
7809 \layout Standard
7895 \layout Standard
7810
7896
7811 This is obviously a brute force way of avoiding race conditions with the
7897 This is obviously a brute force way of avoiding race conditions with the
7812 file buffering.
7898 file buffering.
7813 If you want to do it cleanly, and you have a resource which is being shared
7899 If you want to do it cleanly, and you have a resource which is being shared
7814 by the interactive IPython loop and your GUI thread, you should really
7900 by the interactive IPython loop and your GUI thread, you should really
7815 handle it with thread locking and syncrhonization properties.
7901 handle it with thread locking and syncrhonization properties.
7816 The Python documentation discusses these.
7902 The Python documentation discusses these.
7817 \layout Section
7903 \layout Section
7818
7904
7819
7905
7820 \begin_inset LatexCommand \label{sec:interactive-demos}
7906 \begin_inset LatexCommand \label{sec:interactive-demos}
7821
7907
7822 \end_inset
7908 \end_inset
7823
7909
7824 Interactive demos with IPython
7910 Interactive demos with IPython
7825 \layout Standard
7911 \layout Standard
7826
7912
7827 IPython ships with a basic system for running scripts interactively in sections,
7913 IPython ships with a basic system for running scripts interactively in sections,
7828 useful when presenting code to audiences.
7914 useful when presenting code to audiences.
7829 A few tags embedded in comments (so that the script remains valid Python
7915 A few tags embedded in comments (so that the script remains valid Python
7830 code) divide a file into separate blocks, and the demo can be run one block
7916 code) divide a file into separate blocks, and the demo can be run one block
7831 at a time, with IPython printing (with syntax highlighting) the block before
7917 at a time, with IPython printing (with syntax highlighting) the block before
7832 executing it, and returning to the interactive prompt after each block.
7918 executing it, and returning to the interactive prompt after each block.
7833 The interactive namespace is updated after each block is run with the contents
7919 The interactive namespace is updated after each block is run with the contents
7834 of the demo's namespace.
7920 of the demo's namespace.
7835 \layout Standard
7921 \layout Standard
7836
7922
7837 This allows you to show a piece of code, run it and then execute interactively
7923 This allows you to show a piece of code, run it and then execute interactively
7838 commands based on the variables just created.
7924 commands based on the variables just created.
7839 Once you want to continue, you simply execute the next block of the demo.
7925 Once you want to continue, you simply execute the next block of the demo.
7840 The following listing shows the markup necessary for dividing a script
7926 The following listing shows the markup necessary for dividing a script
7841 into sections for execution as a demo.
7927 into sections for execution as a demo.
7842 \layout Standard
7928 \layout Standard
7843
7929
7844
7930
7845 \begin_inset ERT
7931 \begin_inset ERT
7846 status Open
7932 status Open
7847
7933
7848 \layout Standard
7934 \layout Standard
7849
7935
7850 \backslash
7936 \backslash
7851 codelist{examples/example-demo.py}
7937 codelist{examples/example-demo.py}
7852 \end_inset
7938 \end_inset
7853
7939
7854
7940
7855 \layout Standard
7941 \layout Standard
7856
7942
7857 In order to run a file as a demo, you must first make a
7943 In order to run a file as a demo, you must first make a
7858 \family typewriter
7944 \family typewriter
7859 Demo
7945 Demo
7860 \family default
7946 \family default
7861 object out of it.
7947 object out of it.
7862 If the file is named
7948 If the file is named
7863 \family typewriter
7949 \family typewriter
7864 myscript.py
7950 myscript.py
7865 \family default
7951 \family default
7866 , the following code will make a demo:
7952 , the following code will make a demo:
7867 \layout LyX-Code
7953 \layout LyX-Code
7868
7954
7869 from IPython.demo import Demo
7955 from IPython.demo import Demo
7870 \layout LyX-Code
7956 \layout LyX-Code
7871
7957
7872 mydemo = Demo('myscript.py')
7958 mydemo = Demo('myscript.py')
7873 \layout Standard
7959 \layout Standard
7874
7960
7875 This creates the
7961 This creates the
7876 \family typewriter
7962 \family typewriter
7877 mydemo
7963 mydemo
7878 \family default
7964 \family default
7879 object, whose blocks you run one at a time by simply calling the object
7965 object, whose blocks you run one at a time by simply calling the object
7880 with no arguments.
7966 with no arguments.
7881 If you have autocall active in IPython (the default), all you need to do
7967 If you have autocall active in IPython (the default), all you need to do
7882 is type
7968 is type
7883 \layout LyX-Code
7969 \layout LyX-Code
7884
7970
7885 mydemo
7971 mydemo
7886 \layout Standard
7972 \layout Standard
7887
7973
7888 and IPython will call it, executing each block.
7974 and IPython will call it, executing each block.
7889 Demo objects can be restarted, you can move forward or back skipping blocks,
7975 Demo objects can be restarted, you can move forward or back skipping blocks,
7890 re-execute the last block, etc.
7976 re-execute the last block, etc.
7891 Simply use the Tab key on a demo object to see its methods, and call
7977 Simply use the Tab key on a demo object to see its methods, and call
7892 \family typewriter
7978 \family typewriter
7893 `?'
7979 `?'
7894 \family default
7980 \family default
7895 on them to see their docstrings for more usage details.
7981 on them to see their docstrings for more usage details.
7896 In addition, the
7982 In addition, the
7897 \family typewriter
7983 \family typewriter
7898 demo
7984 demo
7899 \family default
7985 \family default
7900 module itself contains a comprehensive docstring, which you can access
7986 module itself contains a comprehensive docstring, which you can access
7901 via
7987 via
7902 \layout LyX-Code
7988 \layout LyX-Code
7903
7989
7904 from IPython import demo
7990 from IPython import demo
7905 \layout LyX-Code
7991 \layout LyX-Code
7906
7992
7907 demo?
7993 demo?
7908 \layout Standard
7994 \layout Standard
7909
7995
7910
7996
7911 \series bold
7997 \series bold
7912 Limitations:
7998 Limitations:
7913 \series default
7999 \series default
7914 It is important to note that these demos are limited to fairly simple uses.
8000 It is important to note that these demos are limited to fairly simple uses.
7915 In particular, you can
8001 In particular, you can
7916 \emph on
8002 \emph on
7917 not
8003 not
7918 \emph default
8004 \emph default
7919 put division marks in indented code (loops, if statements, function definitions
8005 put division marks in indented code (loops, if statements, function definitions
7920 , etc.) Supporting something like this would basically require tracking the
8006 , etc.) Supporting something like this would basically require tracking the
7921 internal execution state of the Python interpreter, so only top-level divisions
8007 internal execution state of the Python interpreter, so only top-level divisions
7922 are allowed.
8008 are allowed.
7923 If you want to be able to open an IPython instance at an arbitrary point
8009 If you want to be able to open an IPython instance at an arbitrary point
7924 in a program, you can use IPython's embedding facilities, described in
8010 in a program, you can use IPython's embedding facilities, described in
7925 detail in Sec\SpecialChar \@.
8011 detail in Sec\SpecialChar \@.
7926 \SpecialChar ~
8012 \SpecialChar ~
7927
8013
7928 \begin_inset LatexCommand \ref{sec:embed}
8014 \begin_inset LatexCommand \ref{sec:embed}
7929
8015
7930 \end_inset
8016 \end_inset
7931
8017
7932 .
8018 .
7933 \layout Section
8019 \layout Section
7934
8020
7935
8021
7936 \begin_inset LatexCommand \label{sec:matplotlib-support}
8022 \begin_inset LatexCommand \label{sec:matplotlib-support}
7937
8023
7938 \end_inset
8024 \end_inset
7939
8025
7940 Plotting with
8026 Plotting with
7941 \family typewriter
8027 \family typewriter
7942 matplotlib
8028 matplotlib
7943 \family default
8029 \family default
7944
8030
7945 \layout Standard
8031 \layout Standard
7946
8032
7947 The matplotlib library (
8033 The matplotlib library (
7948 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
8034 \begin_inset LatexCommand \htmlurl[http://matplotlib.sourceforge.net]{http://matplotlib.sourceforge.net}
7949
8035
7950 \end_inset
8036 \end_inset
7951
8037
7952 ) provides high quality 2D plotting for Python.
8038 ) provides high quality 2D plotting for Python.
7953 Matplotlib can produce plots on screen using a variety of GUI toolkits,
8039 Matplotlib can produce plots on screen using a variety of GUI toolkits,
7954 including Tk, GTK and WXPython.
8040 including Tk, GTK and WXPython.
7955 It also provides a number of commands useful for scientific computing,
8041 It also provides a number of commands useful for scientific computing,
7956 all with a syntax compatible with that of the popular Matlab program.
8042 all with a syntax compatible with that of the popular Matlab program.
7957 \layout Standard
8043 \layout Standard
7958
8044
7959 IPython accepts the special option
8045 IPython accepts the special option
7960 \family typewriter
8046 \family typewriter
7961 -pylab
8047 -pylab
7962 \family default
8048 \family default
7963 (Sec.\SpecialChar ~
8049 (Sec.\SpecialChar ~
7964
8050
7965 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
8051 \begin_inset LatexCommand \ref{sec:cmd-line-opts}
7966
8052
7967 \end_inset
8053 \end_inset
7968
8054
7969 ).
8055 ).
7970 This configures it to support matplotlib, honoring the settings in the
8056 This configures it to support matplotlib, honoring the settings in the
7971
8057
7972 \family typewriter
8058 \family typewriter
7973 .matplotlibrc
8059 .matplotlibrc
7974 \family default
8060 \family default
7975 file.
8061 file.
7976 IPython will detect the user's choice of matplotlib GUI backend, and automatica
8062 IPython will detect the user's choice of matplotlib GUI backend, and automatica
7977 lly select the proper threading model to prevent blocking.
8063 lly select the proper threading model to prevent blocking.
7978 It also sets matplotlib in interactive mode and modifies
8064 It also sets matplotlib in interactive mode and modifies
7979 \family typewriter
8065 \family typewriter
7980 %run
8066 %run
7981 \family default
8067 \family default
7982 slightly, so that any matplotlib-based script can be executed using
8068 slightly, so that any matplotlib-based script can be executed using
7983 \family typewriter
8069 \family typewriter
7984 %run
8070 %run
7985 \family default
8071 \family default
7986 and the final
8072 and the final
7987 \family typewriter
8073 \family typewriter
7988 show()
8074 show()
7989 \family default
8075 \family default
7990 command does not block the interactive shell.
8076 command does not block the interactive shell.
7991 \layout Standard
8077 \layout Standard
7992
8078
7993 The
8079 The
7994 \family typewriter
8080 \family typewriter
7995 -pylab
8081 -pylab
7996 \family default
8082 \family default
7997 option must be given first in order for IPython to configure its threading
8083 option must be given first in order for IPython to configure its threading
7998 mode.
8084 mode.
7999 However, you can still issue other options afterwards.
8085 However, you can still issue other options afterwards.
8000 This allows you to have a matplotlib-based environment customized with
8086 This allows you to have a matplotlib-based environment customized with
8001 additional modules using the standard IPython profile mechanism (Sec.\SpecialChar ~
8087 additional modules using the standard IPython profile mechanism (Sec.\SpecialChar ~
8002
8088
8003 \begin_inset LatexCommand \ref{sec:profiles}
8089 \begin_inset LatexCommand \ref{sec:profiles}
8004
8090
8005 \end_inset
8091 \end_inset
8006
8092
8007 ): ``
8093 ): ``
8008 \family typewriter
8094 \family typewriter
8009 ipython -pylab -p myprofile
8095 ipython -pylab -p myprofile
8010 \family default
8096 \family default
8011 '' will load the profile defined in
8097 '' will load the profile defined in
8012 \family typewriter
8098 \family typewriter
8013 ipythonrc-myprofile
8099 ipythonrc-myprofile
8014 \family default
8100 \family default
8015 after configuring matplotlib.
8101 after configuring matplotlib.
8016 \layout Section
8102 \layout Section
8017
8103
8018
8104
8019 \begin_inset LatexCommand \label{sec:Gnuplot}
8105 \begin_inset LatexCommand \label{sec:Gnuplot}
8020
8106
8021 \end_inset
8107 \end_inset
8022
8108
8023 Plotting with
8109 Plotting with
8024 \family typewriter
8110 \family typewriter
8025 Gnuplot
8111 Gnuplot
8026 \layout Standard
8112 \layout Standard
8027
8113
8028 Through the magic extension system described in sec.
8114 Through the magic extension system described in sec.
8029
8115
8030 \begin_inset LatexCommand \ref{sec:magic}
8116 \begin_inset LatexCommand \ref{sec:magic}
8031
8117
8032 \end_inset
8118 \end_inset
8033
8119
8034 , IPython incorporates a mechanism for conveniently interfacing with the
8120 , IPython incorporates a mechanism for conveniently interfacing with the
8035 Gnuplot system (
8121 Gnuplot system (
8036 \begin_inset LatexCommand \htmlurl{http://www.gnuplot.info}
8122 \begin_inset LatexCommand \htmlurl{http://www.gnuplot.info}
8037
8123
8038 \end_inset
8124 \end_inset
8039
8125
8040 ).
8126 ).
8041 Gnuplot is a very complete 2D and 3D plotting package available for many
8127 Gnuplot is a very complete 2D and 3D plotting package available for many
8042 operating systems and commonly included in modern Linux distributions.
8128 operating systems and commonly included in modern Linux distributions.
8043
8129
8044 \layout Standard
8130 \layout Standard
8045
8131
8046 Besides having Gnuplot installed, this functionality requires the
8132 Besides having Gnuplot installed, this functionality requires the
8047 \family typewriter
8133 \family typewriter
8048 Gnuplot.py
8134 Gnuplot.py
8049 \family default
8135 \family default
8050 module for interfacing python with Gnuplot.
8136 module for interfacing python with Gnuplot.
8051 It can be downloaded from:
8137 It can be downloaded from:
8052 \begin_inset LatexCommand \htmlurl{http://gnuplot-py.sourceforge.net}
8138 \begin_inset LatexCommand \htmlurl{http://gnuplot-py.sourceforge.net}
8053
8139
8054 \end_inset
8140 \end_inset
8055
8141
8056 .
8142 .
8057 \layout Subsection
8143 \layout Subsection
8058
8144
8059 Proper Gnuplot configuration
8145 Proper Gnuplot configuration
8060 \layout Standard
8146 \layout Standard
8061
8147
8062 As of version 4.0, Gnuplot has excellent mouse and interactive keyboard support.
8148 As of version 4.0, Gnuplot has excellent mouse and interactive keyboard support.
8063 However, as of
8149 However, as of
8064 \family typewriter
8150 \family typewriter
8065 Gnuplot.py
8151 Gnuplot.py
8066 \family default
8152 \family default
8067 version 1.7, a new option was added to communicate between Python and Gnuplot
8153 version 1.7, a new option was added to communicate between Python and Gnuplot
8068 via FIFOs (pipes).
8154 via FIFOs (pipes).
8069 This mechanism, while fast, also breaks the mouse system.
8155 This mechanism, while fast, also breaks the mouse system.
8070 You must therefore set the variable
8156 You must therefore set the variable
8071 \family typewriter
8157 \family typewriter
8072 prefer_fifo_data
8158 prefer_fifo_data
8073 \family default
8159 \family default
8074 to
8160 to
8075 \family typewriter
8161 \family typewriter
8076 0
8162 0
8077 \family default
8163 \family default
8078 in file
8164 in file
8079 \family typewriter
8165 \family typewriter
8080 gp_unix.py
8166 gp_unix.py
8081 \family default
8167 \family default
8082 if you wish to keep the interactive mouse and keyboard features working
8168 if you wish to keep the interactive mouse and keyboard features working
8083 properly (
8169 properly (
8084 \family typewriter
8170 \family typewriter
8085 prefer_inline_data
8171 prefer_inline_data
8086 \family default
8172 \family default
8087 also must be
8173 also must be
8088 \family typewriter
8174 \family typewriter
8089 0
8175 0
8090 \family default
8176 \family default
8091 , but this is the default so unless you've changed it manually you should
8177 , but this is the default so unless you've changed it manually you should
8092 be fine).
8178 be fine).
8093 \layout Standard
8179 \layout Standard
8094
8180
8095 'Out of the box', Gnuplot is configured with a rather poor set of size,
8181 'Out of the box', Gnuplot is configured with a rather poor set of size,
8096 color and linewidth choices which make the graphs fairly hard to read on
8182 color and linewidth choices which make the graphs fairly hard to read on
8097 modern high-resolution displays (although they work fine on old 640x480
8183 modern high-resolution displays (although they work fine on old 640x480
8098 ones).
8184 ones).
8099 Below is a section of my
8185 Below is a section of my
8100 \family typewriter
8186 \family typewriter
8101 .Xdefaults
8187 .Xdefaults
8102 \family default
8188 \family default
8103 file which I use for having a more convenient Gnuplot setup.
8189 file which I use for having a more convenient Gnuplot setup.
8104 Remember to load it by running
8190 Remember to load it by running
8105 \family typewriter
8191 \family typewriter
8106 `xrdb .Xdefaults`
8192 `xrdb .Xdefaults`
8107 \family default
8193 \family default
8108 :
8194 :
8109 \layout Standard
8195 \layout Standard
8110
8196
8111
8197
8112 \family typewriter
8198 \family typewriter
8113 !******************************************************************
8199 !******************************************************************
8114 \newline
8200 \newline
8115 ! gnuplot options
8201 ! gnuplot options
8116 \newline
8202 \newline
8117 ! modify this for a convenient window size
8203 ! modify this for a convenient window size
8118 \newline
8204 \newline
8119 gnuplot*geometry: 780x580
8205 gnuplot*geometry: 780x580
8120 \layout Standard
8206 \layout Standard
8121
8207
8122
8208
8123 \family typewriter
8209 \family typewriter
8124 ! on-screen font (not for PostScript)
8210 ! on-screen font (not for PostScript)
8125 \newline
8211 \newline
8126 gnuplot*font: -misc-fixed-bold-r-normal--15-120-100-100-c-90-iso8859-1
8212 gnuplot*font: -misc-fixed-bold-r-normal--15-120-100-100-c-90-iso8859-1
8127 \layout Standard
8213 \layout Standard
8128
8214
8129
8215
8130 \family typewriter
8216 \family typewriter
8131 ! color options
8217 ! color options
8132 \newline
8218 \newline
8133 gnuplot*background: black
8219 gnuplot*background: black
8134 \newline
8220 \newline
8135 gnuplot*textColor: white
8221 gnuplot*textColor: white
8136 \newline
8222 \newline
8137 gnuplot*borderColor: white
8223 gnuplot*borderColor: white
8138 \newline
8224 \newline
8139 gnuplot*axisColor: white
8225 gnuplot*axisColor: white
8140 \newline
8226 \newline
8141 gnuplot*line1Color: red
8227 gnuplot*line1Color: red
8142 \newline
8228 \newline
8143 gnuplot*line2Color: green
8229 gnuplot*line2Color: green
8144 \newline
8230 \newline
8145 gnuplot*line3Color: blue
8231 gnuplot*line3Color: blue
8146 \newline
8232 \newline
8147 gnuplot*line4Color: magenta
8233 gnuplot*line4Color: magenta
8148 \newline
8234 \newline
8149 gnuplot*line5Color: cyan
8235 gnuplot*line5Color: cyan
8150 \newline
8236 \newline
8151 gnuplot*line6Color: sienna
8237 gnuplot*line6Color: sienna
8152 \newline
8238 \newline
8153 gnuplot*line7Color: orange
8239 gnuplot*line7Color: orange
8154 \newline
8240 \newline
8155 gnuplot*line8Color: coral
8241 gnuplot*line8Color: coral
8156 \layout Standard
8242 \layout Standard
8157
8243
8158
8244
8159 \family typewriter
8245 \family typewriter
8160 ! multiplicative factor for point styles
8246 ! multiplicative factor for point styles
8161 \newline
8247 \newline
8162 gnuplot*pointsize: 2
8248 gnuplot*pointsize: 2
8163 \layout Standard
8249 \layout Standard
8164
8250
8165
8251
8166 \family typewriter
8252 \family typewriter
8167 ! line width options (in pixels)
8253 ! line width options (in pixels)
8168 \newline
8254 \newline
8169 gnuplot*borderWidth: 2
8255 gnuplot*borderWidth: 2
8170 \newline
8256 \newline
8171 gnuplot*axisWidth: 2
8257 gnuplot*axisWidth: 2
8172 \newline
8258 \newline
8173 gnuplot*line1Width: 2
8259 gnuplot*line1Width: 2
8174 \newline
8260 \newline
8175 gnuplot*line2Width: 2
8261 gnuplot*line2Width: 2
8176 \newline
8262 \newline
8177 gnuplot*line3Width: 2
8263 gnuplot*line3Width: 2
8178 \newline
8264 \newline
8179 gnuplot*line4Width: 2
8265 gnuplot*line4Width: 2
8180 \newline
8266 \newline
8181 gnuplot*line5Width: 2
8267 gnuplot*line5Width: 2
8182 \newline
8268 \newline
8183 gnuplot*line6Width: 2
8269 gnuplot*line6Width: 2
8184 \newline
8270 \newline
8185 gnuplot*line7Width: 2
8271 gnuplot*line7Width: 2
8186 \newline
8272 \newline
8187 gnuplot*line8Width: 2
8273 gnuplot*line8Width: 2
8188 \layout Subsection
8274 \layout Subsection
8189
8275
8190 The
8276 The
8191 \family typewriter
8277 \family typewriter
8192 IPython.GnuplotRuntime
8278 IPython.GnuplotRuntime
8193 \family default
8279 \family default
8194 module
8280 module
8195 \layout Standard
8281 \layout Standard
8196
8282
8197 IPython includes a module called
8283 IPython includes a module called
8198 \family typewriter
8284 \family typewriter
8199 Gnuplot2.py
8285 Gnuplot2.py
8200 \family default
8286 \family default
8201 which extends and improves the default
8287 which extends and improves the default
8202 \family typewriter
8288 \family typewriter
8203 Gnuplot
8289 Gnuplot
8204 \family default
8290 \family default
8205 .
8291 .
8206 \family typewriter
8292 \family typewriter
8207 py
8293 py
8208 \family default
8294 \family default
8209 (which it still relies upon).
8295 (which it still relies upon).
8210 For example, the new
8296 For example, the new
8211 \family typewriter
8297 \family typewriter
8212 plot
8298 plot
8213 \family default
8299 \family default
8214 function adds several improvements to the original making it more convenient
8300 function adds several improvements to the original making it more convenient
8215 for interactive use, and
8301 for interactive use, and
8216 \family typewriter
8302 \family typewriter
8217 hardcopy
8303 hardcopy
8218 \family default
8304 \family default
8219 fixes a bug in the original which under some circumstances blocks the creation
8305 fixes a bug in the original which under some circumstances blocks the creation
8220 of PostScript output.
8306 of PostScript output.
8221 \layout Standard
8307 \layout Standard
8222
8308
8223 For scripting use,
8309 For scripting use,
8224 \family typewriter
8310 \family typewriter
8225 GnuplotRuntime.py
8311 GnuplotRuntime.py
8226 \family default
8312 \family default
8227 is provided, which wraps
8313 is provided, which wraps
8228 \family typewriter
8314 \family typewriter
8229 Gnuplot2.py
8315 Gnuplot2.py
8230 \family default
8316 \family default
8231 and creates a series of global aliases.
8317 and creates a series of global aliases.
8232 These make it easy to control Gnuplot plotting jobs through the Python
8318 These make it easy to control Gnuplot plotting jobs through the Python
8233 language.
8319 language.
8234 \layout Standard
8320 \layout Standard
8235
8321
8236 Below is some example code which illustrates how to configure Gnuplot inside
8322 Below is some example code which illustrates how to configure Gnuplot inside
8237 your own programs but have it available for further interactive use through
8323 your own programs but have it available for further interactive use through
8238 an embedded IPython instance.
8324 an embedded IPython instance.
8239 Simply run this file at a system prompt.
8325 Simply run this file at a system prompt.
8240 This file is provided as
8326 This file is provided as
8241 \family typewriter
8327 \family typewriter
8242 example-gnuplot.py
8328 example-gnuplot.py
8243 \family default
8329 \family default
8244 in the examples directory:
8330 in the examples directory:
8245 \layout Standard
8331 \layout Standard
8246
8332
8247
8333
8248 \begin_inset ERT
8334 \begin_inset ERT
8249 status Open
8335 status Open
8250
8336
8251 \layout Standard
8337 \layout Standard
8252
8338
8253 \backslash
8339 \backslash
8254 codelist{examples/example-gnuplot.py}
8340 codelist{examples/example-gnuplot.py}
8255 \end_inset
8341 \end_inset
8256
8342
8257
8343
8258 \layout Subsection
8344 \layout Subsection
8259
8345
8260 The
8346 The
8261 \family typewriter
8347 \family typewriter
8262 numeric
8348 numeric
8263 \family default
8349 \family default
8264 profile: a scientific computing environment
8350 profile: a scientific computing environment
8265 \layout Standard
8351 \layout Standard
8266
8352
8267 The
8353 The
8268 \family typewriter
8354 \family typewriter
8269 numeric
8355 numeric
8270 \family default
8356 \family default
8271 IPython profile, which you can activate with
8357 IPython profile, which you can activate with
8272 \family typewriter
8358 \family typewriter
8273 `ipython -p numeric
8359 `ipython -p numeric
8274 \family default
8360 \family default
8275 ' will automatically load the IPython Gnuplot extensions (plus Numeric and
8361 ' will automatically load the IPython Gnuplot extensions (plus Numeric and
8276 other useful things for numerical computing), contained in the
8362 other useful things for numerical computing), contained in the
8277 \family typewriter
8363 \family typewriter
8278 IPython.GnuplotInteractive
8364 IPython.GnuplotInteractive
8279 \family default
8365 \family default
8280 module.
8366 module.
8281 This will create the globals
8367 This will create the globals
8282 \family typewriter
8368 \family typewriter
8283 Gnuplot
8369 Gnuplot
8284 \family default
8370 \family default
8285 (an alias to the improved Gnuplot2 module),
8371 (an alias to the improved Gnuplot2 module),
8286 \family typewriter
8372 \family typewriter
8287 gp
8373 gp
8288 \family default
8374 \family default
8289 (a Gnuplot active instance), the new magic commands
8375 (a Gnuplot active instance), the new magic commands
8290 \family typewriter
8376 \family typewriter
8291 %gpc
8377 %gpc
8292 \family default
8378 \family default
8293 and
8379 and
8294 \family typewriter
8380 \family typewriter
8295 %gp_set_instance
8381 %gp_set_instance
8296 \family default
8382 \family default
8297 and several other convenient globals.
8383 and several other convenient globals.
8298 Type
8384 Type
8299 \family typewriter
8385 \family typewriter
8300 gphelp()
8386 gphelp()
8301 \family default
8387 \family default
8302 for further details.
8388 for further details.
8303 \layout Standard
8389 \layout Standard
8304
8390
8305 This should turn IPython into a convenient environment for numerical computing,
8391 This should turn IPython into a convenient environment for numerical computing,
8306 with all the functions in the NumPy library and the Gnuplot facilities
8392 with all the functions in the NumPy library and the Gnuplot facilities
8307 for plotting.
8393 for plotting.
8308 Further improvements can be obtained by loading the SciPy libraries for
8394 Further improvements can be obtained by loading the SciPy libraries for
8309 scientific computing, available at
8395 scientific computing, available at
8310 \begin_inset LatexCommand \htmlurl{http://scipy.org}
8396 \begin_inset LatexCommand \htmlurl{http://scipy.org}
8311
8397
8312 \end_inset
8398 \end_inset
8313
8399
8314 .
8400 .
8315 \layout Standard
8401 \layout Standard
8316
8402
8317 If you are in the middle of a working session with numerical objects and
8403 If you are in the middle of a working session with numerical objects and
8318 need to plot them but you didn't start the
8404 need to plot them but you didn't start the
8319 \family typewriter
8405 \family typewriter
8320 numeric
8406 numeric
8321 \family default
8407 \family default
8322 profile, you can load these extensions at any time by typing
8408 profile, you can load these extensions at any time by typing
8323 \newline
8409 \newline
8324
8410
8325 \family typewriter
8411 \family typewriter
8326 from IPython.GnuplotInteractive import *
8412 from IPython.GnuplotInteractive import *
8327 \newline
8413 \newline
8328
8414
8329 \family default
8415 \family default
8330 at the IPython prompt.
8416 at the IPython prompt.
8331 This will allow you to keep your objects intact and start using Gnuplot
8417 This will allow you to keep your objects intact and start using Gnuplot
8332 to view them.
8418 to view them.
8333 \layout Section
8419 \layout Section
8334
8420
8335 Reporting bugs
8421 Reporting bugs
8336 \layout Subsection*
8422 \layout Subsection*
8337
8423
8338 Automatic crash reports
8424 Automatic crash reports
8339 \layout Standard
8425 \layout Standard
8340
8426
8341 Ideally, IPython itself shouldn't crash.
8427 Ideally, IPython itself shouldn't crash.
8342 It will catch exceptions produced by you, but bugs in its internals will
8428 It will catch exceptions produced by you, but bugs in its internals will
8343 still crash it.
8429 still crash it.
8344 \layout Standard
8430 \layout Standard
8345
8431
8346 In such a situation, IPython will leave a file named
8432 In such a situation, IPython will leave a file named
8347 \family typewriter
8433 \family typewriter
8348 IPython_crash_report.txt
8434 IPython_crash_report.txt
8349 \family default
8435 \family default
8350 in your IPYTHONDIR directory (that way if crashes happen several times
8436 in your IPYTHONDIR directory (that way if crashes happen several times
8351 it won't litter many directories, the post-mortem file is always located
8437 it won't litter many directories, the post-mortem file is always located
8352 in the same place and new occurrences just overwrite the previous one).
8438 in the same place and new occurrences just overwrite the previous one).
8353 If you can mail this file to the developers (see sec.
8439 If you can mail this file to the developers (see sec.
8354
8440
8355 \begin_inset LatexCommand \ref{sec:credits}
8441 \begin_inset LatexCommand \ref{sec:credits}
8356
8442
8357 \end_inset
8443 \end_inset
8358
8444
8359 for names and addresses), it will help us
8445 for names and addresses), it will help us
8360 \emph on
8446 \emph on
8361 a lot
8447 a lot
8362 \emph default
8448 \emph default
8363 in understanding the cause of the problem and fixing it sooner.
8449 in understanding the cause of the problem and fixing it sooner.
8364 \layout Subsection*
8450 \layout Subsection*
8365
8451
8366 The bug tracker
8452 The bug tracker
8367 \layout Standard
8453 \layout Standard
8368
8454
8369 IPython also has an online bug-tracker, located at
8455 IPython also has an online bug-tracker, located at
8370 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython}
8456 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython}
8371
8457
8372 \end_inset
8458 \end_inset
8373
8459
8374 .
8460 .
8375 In addition to mailing the developers, it would be a good idea to file
8461 In addition to mailing the developers, it would be a good idea to file
8376 a bug report here.
8462 a bug report here.
8377 This will ensure that the issue is properly followed to conclusion.
8463 This will ensure that the issue is properly followed to conclusion.
8378 \layout Standard
8464 \layout Standard
8379
8465
8380 You can also use this bug tracker to file feature requests.
8466 You can also use this bug tracker to file feature requests.
8381 \layout Section
8467 \layout Section
8382
8468
8383 Brief history
8469 Brief history
8384 \layout Subsection
8470 \layout Subsection
8385
8471
8386 Origins
8472 Origins
8387 \layout Standard
8473 \layout Standard
8388
8474
8389 The current IPython system grew out of the following three projects:
8475 The current IPython system grew out of the following three projects:
8390 \layout List
8476 \layout List
8391 \labelwidthstring 00.00.0000
8477 \labelwidthstring 00.00.0000
8392
8478
8393 ipython by Fernando PΓ©rez.
8479 ipython by Fernando PΓ©rez.
8394 I was working on adding Mathematica-type prompts and a flexible configuration
8480 I was working on adding Mathematica-type prompts and a flexible configuration
8395 system (something better than
8481 system (something better than
8396 \family typewriter
8482 \family typewriter
8397 $PYTHONSTARTUP
8483 $PYTHONSTARTUP
8398 \family default
8484 \family default
8399 ) to the standard Python interactive interpreter.
8485 ) to the standard Python interactive interpreter.
8400 \layout List
8486 \layout List
8401 \labelwidthstring 00.00.0000
8487 \labelwidthstring 00.00.0000
8402
8488
8403 IPP by Janko Hauser.
8489 IPP by Janko Hauser.
8404 Very well organized, great usability.
8490 Very well organized, great usability.
8405 Had an old help system.
8491 Had an old help system.
8406 IPP was used as the `container' code into which I added the functionality
8492 IPP was used as the `container' code into which I added the functionality
8407 from ipython and LazyPython.
8493 from ipython and LazyPython.
8408 \layout List
8494 \layout List
8409 \labelwidthstring 00.00.0000
8495 \labelwidthstring 00.00.0000
8410
8496
8411 LazyPython by Nathan Gray.
8497 LazyPython by Nathan Gray.
8412 Simple but
8498 Simple but
8413 \emph on
8499 \emph on
8414 very
8500 very
8415 \emph default
8501 \emph default
8416 powerful.
8502 powerful.
8417 The quick syntax (auto parens, auto quotes) and verbose/colored tracebacks
8503 The quick syntax (auto parens, auto quotes) and verbose/colored tracebacks
8418 were all taken from here.
8504 were all taken from here.
8419 \layout Standard
8505 \layout Standard
8420
8506
8421 When I found out (see sec.
8507 When I found out (see sec.
8422
8508
8423 \begin_inset LatexCommand \ref{figgins}
8509 \begin_inset LatexCommand \ref{figgins}
8424
8510
8425 \end_inset
8511 \end_inset
8426
8512
8427 ) about IPP and LazyPython I tried to join all three into a unified system.
8513 ) about IPP and LazyPython I tried to join all three into a unified system.
8428 I thought this could provide a very nice working environment, both for
8514 I thought this could provide a very nice working environment, both for
8429 regular programming and scientific computing: shell-like features, IDL/Matlab
8515 regular programming and scientific computing: shell-like features, IDL/Matlab
8430 numerics, Mathematica-type prompt history and great object introspection
8516 numerics, Mathematica-type prompt history and great object introspection
8431 and help facilities.
8517 and help facilities.
8432 I think it worked reasonably well, though it was a lot more work than I
8518 I think it worked reasonably well, though it was a lot more work than I
8433 had initially planned.
8519 had initially planned.
8434 \layout Subsection
8520 \layout Subsection
8435
8521
8436 Current status
8522 Current status
8437 \layout Standard
8523 \layout Standard
8438
8524
8439 The above listed features work, and quite well for the most part.
8525 The above listed features work, and quite well for the most part.
8440 But until a major internal restructuring is done (see below), only bug
8526 But until a major internal restructuring is done (see below), only bug
8441 fixing will be done, no other features will be added (unless very minor
8527 fixing will be done, no other features will be added (unless very minor
8442 and well localized in the cleaner parts of the code).
8528 and well localized in the cleaner parts of the code).
8443 \layout Standard
8529 \layout Standard
8444
8530
8445 IPython consists of some 12000 lines of pure python code, of which roughly
8531 IPython consists of some 12000 lines of pure python code, of which roughly
8446 50% are fairly clean.
8532 50% are fairly clean.
8447 The other 50% are fragile, messy code which needs a massive restructuring
8533 The other 50% are fragile, messy code which needs a massive restructuring
8448 before any further major work is done.
8534 before any further major work is done.
8449 Even the messy code is fairly well documented though, and most of the problems
8535 Even the messy code is fairly well documented though, and most of the problems
8450 in the (non-existent) class design are well pointed to by a PyChecker run.
8536 in the (non-existent) class design are well pointed to by a PyChecker run.
8451 So the rewriting work isn't that bad, it will just be time-consuming.
8537 So the rewriting work isn't that bad, it will just be time-consuming.
8452 \layout Subsection
8538 \layout Subsection
8453
8539
8454 Future
8540 Future
8455 \layout Standard
8541 \layout Standard
8456
8542
8457 See the separate
8543 See the separate
8458 \family typewriter
8544 \family typewriter
8459 new_design
8545 new_design
8460 \family default
8546 \family default
8461 document for details.
8547 document for details.
8462 Ultimately, I would like to see IPython become part of the standard Python
8548 Ultimately, I would like to see IPython become part of the standard Python
8463 distribution as a `big brother with batteries' to the standard Python interacti
8549 distribution as a `big brother with batteries' to the standard Python interacti
8464 ve interpreter.
8550 ve interpreter.
8465 But that will never happen with the current state of the code, so all contribut
8551 But that will never happen with the current state of the code, so all contribut
8466 ions are welcome.
8552 ions are welcome.
8467 \layout Section
8553 \layout Section
8468
8554
8469 License
8555 License
8470 \layout Standard
8556 \layout Standard
8471
8557
8472 IPython is released under the terms of the BSD license, whose general form
8558 IPython is released under the terms of the BSD license, whose general form
8473 can be found at:
8559 can be found at:
8474 \begin_inset LatexCommand \htmlurl{http://www.opensource.org/licenses/bsd-license.php}
8560 \begin_inset LatexCommand \htmlurl{http://www.opensource.org/licenses/bsd-license.php}
8475
8561
8476 \end_inset
8562 \end_inset
8477
8563
8478 .
8564 .
8479 The full text of the IPython license is reproduced below:
8565 The full text of the IPython license is reproduced below:
8480 \layout Quote
8566 \layout Quote
8481
8567
8482
8568
8483 \family typewriter
8569 \family typewriter
8484 \size small
8570 \size small
8485 IPython is released under a BSD-type license.
8571 IPython is released under a BSD-type license.
8486 \layout Quote
8572 \layout Quote
8487
8573
8488
8574
8489 \family typewriter
8575 \family typewriter
8490 \size small
8576 \size small
8491 Copyright (c) 2001, 2002, 2003, 2004 Fernando Perez <fperez@colorado.edu>.
8577 Copyright (c) 2001, 2002, 2003, 2004 Fernando Perez <fperez@colorado.edu>.
8492 \layout Quote
8578 \layout Quote
8493
8579
8494
8580
8495 \family typewriter
8581 \family typewriter
8496 \size small
8582 \size small
8497 Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and
8583 Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and
8498 \newline
8584 \newline
8499 Nathaniel Gray <n8gray@caltech.edu>.
8585 Nathaniel Gray <n8gray@caltech.edu>.
8500 \layout Quote
8586 \layout Quote
8501
8587
8502
8588
8503 \family typewriter
8589 \family typewriter
8504 \size small
8590 \size small
8505 All rights reserved.
8591 All rights reserved.
8506 \layout Quote
8592 \layout Quote
8507
8593
8508
8594
8509 \family typewriter
8595 \family typewriter
8510 \size small
8596 \size small
8511 Redistribution and use in source and binary forms, with or without modification,
8597 Redistribution and use in source and binary forms, with or without modification,
8512 are permitted provided that the following conditions are met:
8598 are permitted provided that the following conditions are met:
8513 \layout Quote
8599 \layout Quote
8514
8600
8515
8601
8516 \family typewriter
8602 \family typewriter
8517 \size small
8603 \size small
8518 a.
8604 a.
8519 Redistributions of source code must retain the above copyright notice,
8605 Redistributions of source code must retain the above copyright notice,
8520 this list of conditions and the following disclaimer.
8606 this list of conditions and the following disclaimer.
8521 \layout Quote
8607 \layout Quote
8522
8608
8523
8609
8524 \family typewriter
8610 \family typewriter
8525 \size small
8611 \size small
8526 b.
8612 b.
8527 Redistributions in binary form must reproduce the above copyright notice,
8613 Redistributions in binary form must reproduce the above copyright notice,
8528 this list of conditions and the following disclaimer in the documentation
8614 this list of conditions and the following disclaimer in the documentation
8529 and/or other materials provided with the distribution.
8615 and/or other materials provided with the distribution.
8530 \layout Quote
8616 \layout Quote
8531
8617
8532
8618
8533 \family typewriter
8619 \family typewriter
8534 \size small
8620 \size small
8535 c.
8621 c.
8536 Neither the name of the copyright holders nor the names of any contributors
8622 Neither the name of the copyright holders nor the names of any contributors
8537 to this software may be used to endorse or promote products derived from
8623 to this software may be used to endorse or promote products derived from
8538 this software without specific prior written permission.
8624 this software without specific prior written permission.
8539 \layout Quote
8625 \layout Quote
8540
8626
8541
8627
8542 \family typewriter
8628 \family typewriter
8543 \size small
8629 \size small
8544 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
8630 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
8545 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
8631 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
8546 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
8632 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
8547 PURPOSE ARE DISCLAIMED.
8633 PURPOSE ARE DISCLAIMED.
8548 IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
8634 IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
8549 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
8635 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
8550 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8636 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
8551 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8637 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
8552 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8638 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
8553 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8639 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
8554 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8640 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8555
8641
8556 \layout Standard
8642 \layout Standard
8557
8643
8558 Individual authors are the holders of the copyright for their code and are
8644 Individual authors are the holders of the copyright for their code and are
8559 listed in each file.
8645 listed in each file.
8560 \layout Standard
8646 \layout Standard
8561
8647
8562 Some files (
8648 Some files (
8563 \family typewriter
8649 \family typewriter
8564 DPyGetOpt.py
8650 DPyGetOpt.py
8565 \family default
8651 \family default
8566 , for example) may be licensed under different conditions.
8652 , for example) may be licensed under different conditions.
8567 Ultimately each file indicates clearly the conditions under which its author/au
8653 Ultimately each file indicates clearly the conditions under which its author/au
8568 thors have decided to publish the code.
8654 thors have decided to publish the code.
8569 \layout Standard
8655 \layout Standard
8570
8656
8571 Versions of IPython up to and including 0.6.3 were released under the GNU
8657 Versions of IPython up to and including 0.6.3 were released under the GNU
8572 Lesser General Public License (LGPL), available at
8658 Lesser General Public License (LGPL), available at
8573 \begin_inset LatexCommand \htmlurl{http://www.gnu.org/copyleft/lesser.html}
8659 \begin_inset LatexCommand \htmlurl{http://www.gnu.org/copyleft/lesser.html}
8574
8660
8575 \end_inset
8661 \end_inset
8576
8662
8577 .
8663 .
8578 \layout Section
8664 \layout Section
8579
8665
8580
8666
8581 \begin_inset LatexCommand \label{sec:credits}
8667 \begin_inset LatexCommand \label{sec:credits}
8582
8668
8583 \end_inset
8669 \end_inset
8584
8670
8585 Credits
8671 Credits
8586 \layout Standard
8672 \layout Standard
8587
8673
8588 IPython is mainly developed by Fernando PΓ©rez
8674 IPython is mainly developed by Fernando PΓ©rez
8589 \family typewriter
8675 \family typewriter
8590 <fperez@colorado.edu>
8676 <fperez@colorado.edu>
8591 \family default
8677 \family default
8592 , but the project was born from mixing in Fernando's code with the IPP project
8678 , but the project was born from mixing in Fernando's code with the IPP project
8593 by Janko Hauser
8679 by Janko Hauser
8594 \family typewriter
8680 \family typewriter
8595 <jhauser-AT-zscout.de>
8681 <jhauser-AT-zscout.de>
8596 \family default
8682 \family default
8597 and LazyPython by Nathan Gray
8683 and LazyPython by Nathan Gray
8598 \family typewriter
8684 \family typewriter
8599 <n8gray-AT-caltech.edu>
8685 <n8gray-AT-caltech.edu>
8600 \family default
8686 \family default
8601 .
8687 .
8602 For all IPython-related requests, please contact Fernando.
8688 For all IPython-related requests, please contact Fernando.
8603
8689
8604 \layout Standard
8690 \layout Standard
8605
8691
8606 As of late 2005, the following developers have joined the core team:
8692 As of late 2005, the following developers have joined the core team:
8607 \layout List
8693 \layout List
8608 \labelwidthstring 00.00.0000
8694 \labelwidthstring 00.00.0000
8609
8695
8610 Robert\SpecialChar ~
8696 Robert\SpecialChar ~
8611 Kern
8697 Kern
8612 \family typewriter
8698 \family typewriter
8613 <rkern-AT-enthought.com>
8699 <rkern-AT-enthought.com>
8614 \family default
8700 \family default
8615 : co-mentored the 2005 Google Summer of Code project to develop python interacti
8701 : co-mentored the 2005 Google Summer of Code project to develop python interacti
8616 ve notebooks (XML documents) and graphical interface.
8702 ve notebooks (XML documents) and graphical interface.
8617 This project was awarded to the students Tzanko Matev
8703 This project was awarded to the students Tzanko Matev
8618 \family typewriter
8704 \family typewriter
8619 <tsanko-AT-gmail.com>
8705 <tsanko-AT-gmail.com>
8620 \family default
8706 \family default
8621 and Toni Alatalo
8707 and Toni Alatalo
8622 \family typewriter
8708 \family typewriter
8623 <antont-AT-an.org>
8709 <antont-AT-an.org>
8624 \layout List
8710 \layout List
8625 \labelwidthstring 00.00.0000
8711 \labelwidthstring 00.00.0000
8626
8712
8627 Brian\SpecialChar ~
8713 Brian\SpecialChar ~
8628 Granger
8714 Granger
8629 \family typewriter
8715 \family typewriter
8630 <bgranger-AT-scu.edu>
8716 <bgranger-AT-scu.edu>
8631 \family default
8717 \family default
8632 : extending IPython to allow support for interactive parallel computing.
8718 : extending IPython to allow support for interactive parallel computing.
8633 \layout Standard
8719 \layout Standard
8634
8720
8635 User or development help should be requested via the IPython mailing lists:
8721 User or development help should be requested via the IPython mailing lists:
8636 \layout Description
8722 \layout Description
8637
8723
8638 User\SpecialChar ~
8724 User\SpecialChar ~
8639 list:
8725 list:
8640 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-user}
8726 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-user}
8641
8727
8642 \end_inset
8728 \end_inset
8643
8729
8644
8730
8645 \layout Description
8731 \layout Description
8646
8732
8647 Developer's\SpecialChar ~
8733 Developer's\SpecialChar ~
8648 list:
8734 list:
8649 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-dev}
8735 \begin_inset LatexCommand \htmlurl{http://scipy.net/mailman/listinfo/ipython-dev}
8650
8736
8651 \end_inset
8737 \end_inset
8652
8738
8653
8739
8654 \layout Standard
8740 \layout Standard
8655
8741
8656 The IPython project is also very grateful to
8742 The IPython project is also very grateful to
8657 \begin_inset Foot
8743 \begin_inset Foot
8658 collapsed true
8744 collapsed true
8659
8745
8660 \layout Standard
8746 \layout Standard
8661
8747
8662 I've mangled email addresses to reduce spam, since the IPython manuals can
8748 I've mangled email addresses to reduce spam, since the IPython manuals can
8663 be accessed online.
8749 be accessed online.
8664 \end_inset
8750 \end_inset
8665
8751
8666 :
8752 :
8667 \layout Standard
8753 \layout Standard
8668
8754
8669 Bill Bumgarner
8755 Bill Bumgarner
8670 \family typewriter
8756 \family typewriter
8671 <bbum-AT-friday.com>
8757 <bbum-AT-friday.com>
8672 \family default
8758 \family default
8673 : for providing the DPyGetOpt module which gives very powerful and convenient
8759 : for providing the DPyGetOpt module which gives very powerful and convenient
8674 handling of command-line options (light years ahead of what Python 2.1.1's
8760 handling of command-line options (light years ahead of what Python 2.1.1's
8675 getopt module does).
8761 getopt module does).
8676 \layout Standard
8762 \layout Standard
8677
8763
8678 Ka-Ping Yee
8764 Ka-Ping Yee
8679 \family typewriter
8765 \family typewriter
8680 <ping-AT-lfw.org>
8766 <ping-AT-lfw.org>
8681 \family default
8767 \family default
8682 : for providing the Itpl module for convenient and powerful string interpolation
8768 : for providing the Itpl module for convenient and powerful string interpolation
8683 with a much nicer syntax than formatting through the '%' operator.
8769 with a much nicer syntax than formatting through the '%' operator.
8684 \layout Standard
8770 \layout Standard
8685
8771
8686 Arnd BΓ€cker
8772 Arnd BΓ€cker
8687 \family typewriter
8773 \family typewriter
8688 <baecker-AT-physik.tu-dresden.de>
8774 <baecker-AT-physik.tu-dresden.de>
8689 \family default
8775 \family default
8690 : for his many very useful suggestions and comments, and lots of help with
8776 : for his many very useful suggestions and comments, and lots of help with
8691 testing and documentation checking.
8777 testing and documentation checking.
8692 Many of IPython's newer features are a result of discussions with him (bugs
8778 Many of IPython's newer features are a result of discussions with him (bugs
8693 are still my fault, not his).
8779 are still my fault, not his).
8694 \layout Standard
8780 \layout Standard
8695
8781
8696 Obviously Guido van\SpecialChar ~
8782 Obviously Guido van\SpecialChar ~
8697 Rossum and the whole Python development team, that goes
8783 Rossum and the whole Python development team, that goes
8698 without saying.
8784 without saying.
8699 \layout Standard
8785 \layout Standard
8700
8786
8701 IPython's website is generously hosted at
8787 IPython's website is generously hosted at
8702 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
8788 \begin_inset LatexCommand \htmlurl{http://ipython.scipy.org}
8703
8789
8704 \end_inset
8790 \end_inset
8705
8791
8706 by Enthought (
8792 by Enthought (
8707 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
8793 \begin_inset LatexCommand \htmlurl{http://www.enthought.com}
8708
8794
8709 \end_inset
8795 \end_inset
8710
8796
8711 ).
8797 ).
8712 I am very grateful to them and all of the SciPy team for their contribution.
8798 I am very grateful to them and all of the SciPy team for their contribution.
8713 \layout Standard
8799 \layout Standard
8714
8800
8715
8801
8716 \begin_inset LatexCommand \label{figgins}
8802 \begin_inset LatexCommand \label{figgins}
8717
8803
8718 \end_inset
8804 \end_inset
8719
8805
8720 Fernando would also like to thank Stephen Figgins
8806 Fernando would also like to thank Stephen Figgins
8721 \family typewriter
8807 \family typewriter
8722 <fig-AT-monitor.net>
8808 <fig-AT-monitor.net>
8723 \family default
8809 \family default
8724 , an O'Reilly Python editor.
8810 , an O'Reilly Python editor.
8725 His Oct/11/2001 article about IPP and LazyPython, was what got this project
8811 His Oct/11/2001 article about IPP and LazyPython, was what got this project
8726 started.
8812 started.
8727 You can read it at:
8813 You can read it at:
8728 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html}
8814 \begin_inset LatexCommand \htmlurl{http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html}
8729
8815
8730 \end_inset
8816 \end_inset
8731
8817
8732 .
8818 .
8733 \layout Standard
8819 \layout Standard
8734
8820
8735 And last but not least, all the kind IPython users who have emailed new
8821 And last but not least, all the kind IPython users who have emailed new
8736 code, bug reports, fixes, comments and ideas.
8822 code, bug reports, fixes, comments and ideas.
8737 A brief list follows, please let me know if I have ommitted your name by
8823 A brief list follows, please let me know if I have ommitted your name by
8738 accident:
8824 accident:
8739 \layout List
8825 \layout List
8740 \labelwidthstring 00.00.0000
8826 \labelwidthstring 00.00.0000
8741
8827
8742 Jack\SpecialChar ~
8828 Jack\SpecialChar ~
8743 Moffit
8829 Moffit
8744 \family typewriter
8830 \family typewriter
8745 <jack-AT-xiph.org>
8831 <jack-AT-xiph.org>
8746 \family default
8832 \family default
8747 Bug fixes, including the infamous color problem.
8833 Bug fixes, including the infamous color problem.
8748 This bug alone caused many lost hours and frustration, many thanks to him
8834 This bug alone caused many lost hours and frustration, many thanks to him
8749 for the fix.
8835 for the fix.
8750 I've always been a fan of Ogg & friends, now I have one more reason to
8836 I've always been a fan of Ogg & friends, now I have one more reason to
8751 like these folks.
8837 like these folks.
8752 \newline
8838 \newline
8753 Jack is also contributing with Debian packaging and many other things.
8839 Jack is also contributing with Debian packaging and many other things.
8754 \layout List
8840 \layout List
8755 \labelwidthstring 00.00.0000
8841 \labelwidthstring 00.00.0000
8756
8842
8757 Alexander\SpecialChar ~
8843 Alexander\SpecialChar ~
8758 Schmolck
8844 Schmolck
8759 \family typewriter
8845 \family typewriter
8760 <a.schmolck-AT-gmx.net>
8846 <a.schmolck-AT-gmx.net>
8761 \family default
8847 \family default
8762 Emacs work, bug reports, bug fixes, ideas, lots more.
8848 Emacs work, bug reports, bug fixes, ideas, lots more.
8763 The ipython.el mode for (X)Emacs is Alex's code, providing full support
8849 The ipython.el mode for (X)Emacs is Alex's code, providing full support
8764 for IPython under (X)Emacs.
8850 for IPython under (X)Emacs.
8765 \layout List
8851 \layout List
8766 \labelwidthstring 00.00.0000
8852 \labelwidthstring 00.00.0000
8767
8853
8768 Andrea\SpecialChar ~
8854 Andrea\SpecialChar ~
8769 Riciputi
8855 Riciputi
8770 \family typewriter
8856 \family typewriter
8771 <andrea.riciputi-AT-libero.it>
8857 <andrea.riciputi-AT-libero.it>
8772 \family default
8858 \family default
8773 Mac OSX information, Fink package management.
8859 Mac OSX information, Fink package management.
8774 \layout List
8860 \layout List
8775 \labelwidthstring 00.00.0000
8861 \labelwidthstring 00.00.0000
8776
8862
8777 Gary\SpecialChar ~
8863 Gary\SpecialChar ~
8778 Bishop
8864 Bishop
8779 \family typewriter
8865 \family typewriter
8780 <gb-AT-cs.unc.edu>
8866 <gb-AT-cs.unc.edu>
8781 \family default
8867 \family default
8782 Bug reports, and patches to work around the exception handling idiosyncracies
8868 Bug reports, and patches to work around the exception handling idiosyncracies
8783 of WxPython.
8869 of WxPython.
8784 Readline and color support for Windows.
8870 Readline and color support for Windows.
8785 \layout List
8871 \layout List
8786 \labelwidthstring 00.00.0000
8872 \labelwidthstring 00.00.0000
8787
8873
8788 Jeffrey\SpecialChar ~
8874 Jeffrey\SpecialChar ~
8789 Collins
8875 Collins
8790 \family typewriter
8876 \family typewriter
8791 <Jeff.Collins-AT-vexcel.com>
8877 <Jeff.Collins-AT-vexcel.com>
8792 \family default
8878 \family default
8793 Bug reports.
8879 Bug reports.
8794 Much improved readline support, including fixes for Python 2.3.
8880 Much improved readline support, including fixes for Python 2.3.
8795 \layout List
8881 \layout List
8796 \labelwidthstring 00.00.0000
8882 \labelwidthstring 00.00.0000
8797
8883
8798 Dryice\SpecialChar ~
8884 Dryice\SpecialChar ~
8799 Liu
8885 Liu
8800 \family typewriter
8886 \family typewriter
8801 <dryice-AT-liu.com.cn>
8887 <dryice-AT-liu.com.cn>
8802 \family default
8888 \family default
8803 FreeBSD port.
8889 FreeBSD port.
8804 \layout List
8890 \layout List
8805 \labelwidthstring 00.00.0000
8891 \labelwidthstring 00.00.0000
8806
8892
8807 Mike\SpecialChar ~
8893 Mike\SpecialChar ~
8808 Heeter
8894 Heeter
8809 \family typewriter
8895 \family typewriter
8810 <korora-AT-SDF.LONESTAR.ORG>
8896 <korora-AT-SDF.LONESTAR.ORG>
8811 \layout List
8897 \layout List
8812 \labelwidthstring 00.00.0000
8898 \labelwidthstring 00.00.0000
8813
8899
8814 Christopher\SpecialChar ~
8900 Christopher\SpecialChar ~
8815 Hart
8901 Hart
8816 \family typewriter
8902 \family typewriter
8817 <hart-AT-caltech.edu>
8903 <hart-AT-caltech.edu>
8818 \family default
8904 \family default
8819 PDB integration.
8905 PDB integration.
8820 \layout List
8906 \layout List
8821 \labelwidthstring 00.00.0000
8907 \labelwidthstring 00.00.0000
8822
8908
8823 Milan\SpecialChar ~
8909 Milan\SpecialChar ~
8824 Zamazal
8910 Zamazal
8825 \family typewriter
8911 \family typewriter
8826 <pdm-AT-zamazal.org>
8912 <pdm-AT-zamazal.org>
8827 \family default
8913 \family default
8828 Emacs info.
8914 Emacs info.
8829 \layout List
8915 \layout List
8830 \labelwidthstring 00.00.0000
8916 \labelwidthstring 00.00.0000
8831
8917
8832 Philip\SpecialChar ~
8918 Philip\SpecialChar ~
8833 Hisley
8919 Hisley
8834 \family typewriter
8920 \family typewriter
8835 <compsys-AT-starpower.net>
8921 <compsys-AT-starpower.net>
8836 \layout List
8922 \layout List
8837 \labelwidthstring 00.00.0000
8923 \labelwidthstring 00.00.0000
8838
8924
8839 Holger\SpecialChar ~
8925 Holger\SpecialChar ~
8840 Krekel
8926 Krekel
8841 \family typewriter
8927 \family typewriter
8842 <pyth-AT-devel.trillke.net>
8928 <pyth-AT-devel.trillke.net>
8843 \family default
8929 \family default
8844 Tab completion, lots more.
8930 Tab completion, lots more.
8845 \layout List
8931 \layout List
8846 \labelwidthstring 00.00.0000
8932 \labelwidthstring 00.00.0000
8847
8933
8848 Robin\SpecialChar ~
8934 Robin\SpecialChar ~
8849 Siebler
8935 Siebler
8850 \family typewriter
8936 \family typewriter
8851 <robinsiebler-AT-starband.net>
8937 <robinsiebler-AT-starband.net>
8852 \layout List
8938 \layout List
8853 \labelwidthstring 00.00.0000
8939 \labelwidthstring 00.00.0000
8854
8940
8855 Ralf\SpecialChar ~
8941 Ralf\SpecialChar ~
8856 Ahlbrink
8942 Ahlbrink
8857 \family typewriter
8943 \family typewriter
8858 <ralf_ahlbrink-AT-web.de>
8944 <ralf_ahlbrink-AT-web.de>
8859 \layout List
8945 \layout List
8860 \labelwidthstring 00.00.0000
8946 \labelwidthstring 00.00.0000
8861
8947
8862 Thorsten\SpecialChar ~
8948 Thorsten\SpecialChar ~
8863 Kampe
8949 Kampe
8864 \family typewriter
8950 \family typewriter
8865 <thorsten-AT-thorstenkampe.de>
8951 <thorsten-AT-thorstenkampe.de>
8866 \layout List
8952 \layout List
8867 \labelwidthstring 00.00.0000
8953 \labelwidthstring 00.00.0000
8868
8954
8869 Fredrik\SpecialChar ~
8955 Fredrik\SpecialChar ~
8870 Kant
8956 Kant
8871 \family typewriter
8957 \family typewriter
8872 <fredrik.kant-AT-front.com>
8958 <fredrik.kant-AT-front.com>
8873 \family default
8959 \family default
8874 Windows setup.
8960 Windows setup.
8875 \layout List
8961 \layout List
8876 \labelwidthstring 00.00.0000
8962 \labelwidthstring 00.00.0000
8877
8963
8878 Syver\SpecialChar ~
8964 Syver\SpecialChar ~
8879 Enstad
8965 Enstad
8880 \family typewriter
8966 \family typewriter
8881 <syver-en-AT-online.no>
8967 <syver-en-AT-online.no>
8882 \family default
8968 \family default
8883 Windows setup.
8969 Windows setup.
8884 \layout List
8970 \layout List
8885 \labelwidthstring 00.00.0000
8971 \labelwidthstring 00.00.0000
8886
8972
8887 Richard
8973 Richard
8888 \family typewriter
8974 \family typewriter
8889 <rxe-AT-renre-europe.com>
8975 <rxe-AT-renre-europe.com>
8890 \family default
8976 \family default
8891 Global embedding.
8977 Global embedding.
8892 \layout List
8978 \layout List
8893 \labelwidthstring 00.00.0000
8979 \labelwidthstring 00.00.0000
8894
8980
8895 Hayden\SpecialChar ~
8981 Hayden\SpecialChar ~
8896 Callow
8982 Callow
8897 \family typewriter
8983 \family typewriter
8898 <h.callow-AT-elec.canterbury.ac.nz>
8984 <h.callow-AT-elec.canterbury.ac.nz>
8899 \family default
8985 \family default
8900 Gnuplot.py 1.6 compatibility.
8986 Gnuplot.py 1.6 compatibility.
8901 \layout List
8987 \layout List
8902 \labelwidthstring 00.00.0000
8988 \labelwidthstring 00.00.0000
8903
8989
8904 Leonardo\SpecialChar ~
8990 Leonardo\SpecialChar ~
8905 Santagada
8991 Santagada
8906 \family typewriter
8992 \family typewriter
8907 <retype-AT-terra.com.br>
8993 <retype-AT-terra.com.br>
8908 \family default
8994 \family default
8909 Fixes for Windows installation.
8995 Fixes for Windows installation.
8910 \layout List
8996 \layout List
8911 \labelwidthstring 00.00.0000
8997 \labelwidthstring 00.00.0000
8912
8998
8913 Christopher\SpecialChar ~
8999 Christopher\SpecialChar ~
8914 Armstrong
9000 Armstrong
8915 \family typewriter
9001 \family typewriter
8916 <radix-AT-twistedmatrix.com>
9002 <radix-AT-twistedmatrix.com>
8917 \family default
9003 \family default
8918 Bugfixes.
9004 Bugfixes.
8919 \layout List
9005 \layout List
8920 \labelwidthstring 00.00.0000
9006 \labelwidthstring 00.00.0000
8921
9007
8922 Francois\SpecialChar ~
9008 Francois\SpecialChar ~
8923 Pinard
9009 Pinard
8924 \family typewriter
9010 \family typewriter
8925 <pinard-AT-iro.umontreal.ca>
9011 <pinard-AT-iro.umontreal.ca>
8926 \family default
9012 \family default
8927 Code and documentation fixes.
9013 Code and documentation fixes.
8928 \layout List
9014 \layout List
8929 \labelwidthstring 00.00.0000
9015 \labelwidthstring 00.00.0000
8930
9016
8931 Cory\SpecialChar ~
9017 Cory\SpecialChar ~
8932 Dodt
9018 Dodt
8933 \family typewriter
9019 \family typewriter
8934 <cdodt-AT-fcoe.k12.ca.us>
9020 <cdodt-AT-fcoe.k12.ca.us>
8935 \family default
9021 \family default
8936 Bug reports and Windows ideas.
9022 Bug reports and Windows ideas.
8937 Patches for Windows installer.
9023 Patches for Windows installer.
8938 \layout List
9024 \layout List
8939 \labelwidthstring 00.00.0000
9025 \labelwidthstring 00.00.0000
8940
9026
8941 Olivier\SpecialChar ~
9027 Olivier\SpecialChar ~
8942 Aubert
9028 Aubert
8943 \family typewriter
9029 \family typewriter
8944 <oaubert-AT-bat710.univ-lyon1.fr>
9030 <oaubert-AT-bat710.univ-lyon1.fr>
8945 \family default
9031 \family default
8946 New magics.
9032 New magics.
8947 \layout List
9033 \layout List
8948 \labelwidthstring 00.00.0000
9034 \labelwidthstring 00.00.0000
8949
9035
8950 King\SpecialChar ~
9036 King\SpecialChar ~
8951 C.\SpecialChar ~
9037 C.\SpecialChar ~
8952 Shu
9038 Shu
8953 \family typewriter
9039 \family typewriter
8954 <kingshu-AT-myrealbox.com>
9040 <kingshu-AT-myrealbox.com>
8955 \family default
9041 \family default
8956 Autoindent patch.
9042 Autoindent patch.
8957 \layout List
9043 \layout List
8958 \labelwidthstring 00.00.0000
9044 \labelwidthstring 00.00.0000
8959
9045
8960 Chris\SpecialChar ~
9046 Chris\SpecialChar ~
8961 Drexler
9047 Drexler
8962 \family typewriter
9048 \family typewriter
8963 <chris-AT-ac-drexler.de>
9049 <chris-AT-ac-drexler.de>
8964 \family default
9050 \family default
8965 Readline packages for Win32/CygWin.
9051 Readline packages for Win32/CygWin.
8966 \layout List
9052 \layout List
8967 \labelwidthstring 00.00.0000
9053 \labelwidthstring 00.00.0000
8968
9054
8969 Gustavo\SpecialChar ~
9055 Gustavo\SpecialChar ~
8970 CΓ³rdova\SpecialChar ~
9056 CΓ³rdova\SpecialChar ~
8971 Avila
9057 Avila
8972 \family typewriter
9058 \family typewriter
8973 <gcordova-AT-sismex.com>
9059 <gcordova-AT-sismex.com>
8974 \family default
9060 \family default
8975 EvalDict code for nice, lightweight string interpolation.
9061 EvalDict code for nice, lightweight string interpolation.
8976 \layout List
9062 \layout List
8977 \labelwidthstring 00.00.0000
9063 \labelwidthstring 00.00.0000
8978
9064
8979 Kasper\SpecialChar ~
9065 Kasper\SpecialChar ~
8980 Souren
9066 Souren
8981 \family typewriter
9067 \family typewriter
8982 <Kasper.Souren-AT-ircam.fr>
9068 <Kasper.Souren-AT-ircam.fr>
8983 \family default
9069 \family default
8984 Bug reports, ideas.
9070 Bug reports, ideas.
8985 \layout List
9071 \layout List
8986 \labelwidthstring 00.00.0000
9072 \labelwidthstring 00.00.0000
8987
9073
8988 Gever\SpecialChar ~
9074 Gever\SpecialChar ~
8989 Tulley
9075 Tulley
8990 \family typewriter
9076 \family typewriter
8991 <gever-AT-helium.com>
9077 <gever-AT-helium.com>
8992 \family default
9078 \family default
8993 Code contributions.
9079 Code contributions.
8994 \layout List
9080 \layout List
8995 \labelwidthstring 00.00.0000
9081 \labelwidthstring 00.00.0000
8996
9082
8997 Ralf\SpecialChar ~
9083 Ralf\SpecialChar ~
8998 Schmitt
9084 Schmitt
8999 \family typewriter
9085 \family typewriter
9000 <ralf-AT-brainbot.com>
9086 <ralf-AT-brainbot.com>
9001 \family default
9087 \family default
9002 Bug reports & fixes.
9088 Bug reports & fixes.
9003 \layout List
9089 \layout List
9004 \labelwidthstring 00.00.0000
9090 \labelwidthstring 00.00.0000
9005
9091
9006 Oliver\SpecialChar ~
9092 Oliver\SpecialChar ~
9007 Sander
9093 Sander
9008 \family typewriter
9094 \family typewriter
9009 <osander-AT-gmx.de>
9095 <osander-AT-gmx.de>
9010 \family default
9096 \family default
9011 Bug reports.
9097 Bug reports.
9012 \layout List
9098 \layout List
9013 \labelwidthstring 00.00.0000
9099 \labelwidthstring 00.00.0000
9014
9100
9015 Rod\SpecialChar ~
9101 Rod\SpecialChar ~
9016 Holland
9102 Holland
9017 \family typewriter
9103 \family typewriter
9018 <rhh-AT-structurelabs.com>
9104 <rhh-AT-structurelabs.com>
9019 \family default
9105 \family default
9020 Bug reports and fixes to logging module.
9106 Bug reports and fixes to logging module.
9021 \layout List
9107 \layout List
9022 \labelwidthstring 00.00.0000
9108 \labelwidthstring 00.00.0000
9023
9109
9024 Daniel\SpecialChar ~
9110 Daniel\SpecialChar ~
9025 'Dang'\SpecialChar ~
9111 'Dang'\SpecialChar ~
9026 Griffith
9112 Griffith
9027 \family typewriter
9113 \family typewriter
9028 <pythondev-dang-AT-lazytwinacres.net>
9114 <pythondev-dang-AT-lazytwinacres.net>
9029 \family default
9115 \family default
9030 Fixes, enhancement suggestions for system shell use.
9116 Fixes, enhancement suggestions for system shell use.
9031 \layout List
9117 \layout List
9032 \labelwidthstring 00.00.0000
9118 \labelwidthstring 00.00.0000
9033
9119
9034 Viktor\SpecialChar ~
9120 Viktor\SpecialChar ~
9035 Ransmayr
9121 Ransmayr
9036 \family typewriter
9122 \family typewriter
9037 <viktor.ransmayr-AT-t-online.de>
9123 <viktor.ransmayr-AT-t-online.de>
9038 \family default
9124 \family default
9039 Tests and reports on Windows installation issues.
9125 Tests and reports on Windows installation issues.
9040 Contributed a true Windows binary installer.
9126 Contributed a true Windows binary installer.
9041 \layout List
9127 \layout List
9042 \labelwidthstring 00.00.0000
9128 \labelwidthstring 00.00.0000
9043
9129
9044 Mike\SpecialChar ~
9130 Mike\SpecialChar ~
9045 Salib
9131 Salib
9046 \family typewriter
9132 \family typewriter
9047 <msalib-AT-mit.edu>
9133 <msalib-AT-mit.edu>
9048 \family default
9134 \family default
9049 Help fixing a subtle bug related to traceback printing.
9135 Help fixing a subtle bug related to traceback printing.
9050 \layout List
9136 \layout List
9051 \labelwidthstring 00.00.0000
9137 \labelwidthstring 00.00.0000
9052
9138
9053 W.J.\SpecialChar ~
9139 W.J.\SpecialChar ~
9054 van\SpecialChar ~
9140 van\SpecialChar ~
9055 der\SpecialChar ~
9141 der\SpecialChar ~
9056 Laan
9142 Laan
9057 \family typewriter
9143 \family typewriter
9058 <gnufnork-AT-hetdigitalegat.nl>
9144 <gnufnork-AT-hetdigitalegat.nl>
9059 \family default
9145 \family default
9060 Bash-like prompt specials.
9146 Bash-like prompt specials.
9061 \layout List
9147 \layout List
9062 \labelwidthstring 00.00.0000
9148 \labelwidthstring 00.00.0000
9063
9149
9064 Ville\SpecialChar ~
9150 Ville\SpecialChar ~
9065 Vainio
9151 Vainio
9066 \family typewriter
9152 \family typewriter
9067 <vivainio-AT-kolumbus.fi>
9153 <vivainio-AT-kolumbus.fi>
9068 \family default
9154 \family default
9069 Bugfixes and suggestions.
9155 Bugfixes and suggestions.
9070 Excellent patches for many new features.
9156 Excellent patches for many new features.
9071 \layout List
9157 \layout List
9072 \labelwidthstring 00.00.0000
9158 \labelwidthstring 00.00.0000
9073
9159
9074 Antoon\SpecialChar ~
9160 Antoon\SpecialChar ~
9075 Pardon
9161 Pardon
9076 \family typewriter
9162 \family typewriter
9077 <Antoon.Pardon-AT-rece.vub.ac.be>
9163 <Antoon.Pardon-AT-rece.vub.ac.be>
9078 \family default
9164 \family default
9079 Critical fix for the multithreaded IPython.
9165 Critical fix for the multithreaded IPython.
9080 \layout List
9166 \layout List
9081 \labelwidthstring 00.00.0000
9167 \labelwidthstring 00.00.0000
9082
9168
9083 John\SpecialChar ~
9169 John\SpecialChar ~
9084 Hunter
9170 Hunter
9085 \family typewriter
9171 \family typewriter
9086 <jdhunter-AT-nitace.bsd.uchicago.edu>
9172 <jdhunter-AT-nitace.bsd.uchicago.edu>
9087 \family default
9173 \family default
9088 Matplotlib author, helped with all the development of support for matplotlib
9174 Matplotlib author, helped with all the development of support for matplotlib
9089 in IPyhton, including making necessary changes to matplotlib itself.
9175 in IPyhton, including making necessary changes to matplotlib itself.
9090 \layout List
9176 \layout List
9091 \labelwidthstring 00.00.0000
9177 \labelwidthstring 00.00.0000
9092
9178
9093 Matthew\SpecialChar ~
9179 Matthew\SpecialChar ~
9094 Arnison
9180 Arnison
9095 \family typewriter
9181 \family typewriter
9096 <maffew-AT-cat.org.au>
9182 <maffew-AT-cat.org.au>
9097 \family default
9183 \family default
9098 Bug reports, `
9184 Bug reports, `
9099 \family typewriter
9185 \family typewriter
9100 %run -d
9186 %run -d
9101 \family default
9187 \family default
9102 ' idea.
9188 ' idea.
9103 \layout List
9189 \layout List
9104 \labelwidthstring 00.00.0000
9190 \labelwidthstring 00.00.0000
9105
9191
9106 Prabhu\SpecialChar ~
9192 Prabhu\SpecialChar ~
9107 Ramachandran
9193 Ramachandran
9108 \family typewriter
9194 \family typewriter
9109 <prabhu_r-AT-users.sourceforge.net>
9195 <prabhu_r-AT-users.sourceforge.net>
9110 \family default
9196 \family default
9111 Help with (X)Emacs support, threading patches, ideas...
9197 Help with (X)Emacs support, threading patches, ideas...
9112 \layout List
9198 \layout List
9113 \labelwidthstring 00.00.0000
9199 \labelwidthstring 00.00.0000
9114
9200
9115 Norbert\SpecialChar ~
9201 Norbert\SpecialChar ~
9116 Tretkowski
9202 Tretkowski
9117 \family typewriter
9203 \family typewriter
9118 <tretkowski-AT-inittab.de>
9204 <tretkowski-AT-inittab.de>
9119 \family default
9205 \family default
9120 help with Debian packaging and distribution.
9206 help with Debian packaging and distribution.
9121 \layout List
9207 \layout List
9122 \labelwidthstring 00.00.0000
9208 \labelwidthstring 00.00.0000
9123
9209
9124 George\SpecialChar ~
9210 George\SpecialChar ~
9125 Sakkis <
9211 Sakkis <
9126 \family typewriter
9212 \family typewriter
9127 gsakkis-AT-eden.rutgers.edu>
9213 gsakkis-AT-eden.rutgers.edu>
9128 \family default
9214 \family default
9129 New matcher for tab-completing named arguments of user-defined functions.
9215 New matcher for tab-completing named arguments of user-defined functions.
9130 \layout List
9216 \layout List
9131 \labelwidthstring 00.00.0000
9217 \labelwidthstring 00.00.0000
9132
9218
9133 JοΏ½rgen\SpecialChar ~
9219 JοΏ½rgen\SpecialChar ~
9134 Stenarson
9220 Stenarson
9135 \family typewriter
9221 \family typewriter
9136 <jorgen.stenarson-AT-bostream.nu>
9222 <jorgen.stenarson-AT-bostream.nu>
9137 \family default
9223 \family default
9138 Wildcard support implementation for searching namespaces.
9224 Wildcard support implementation for searching namespaces.
9139 \layout List
9225 \layout List
9140 \labelwidthstring 00.00.0000
9226 \labelwidthstring 00.00.0000
9141
9227
9142 Vivian\SpecialChar ~
9228 Vivian\SpecialChar ~
9143 De\SpecialChar ~
9229 De\SpecialChar ~
9144 Smedt
9230 Smedt
9145 \family typewriter
9231 \family typewriter
9146 <vivian-AT-vdesmedt.com>
9232 <vivian-AT-vdesmedt.com>
9147 \family default
9233 \family default
9148 Debugger enhancements, so that when pdb is activated from within IPython,
9234 Debugger enhancements, so that when pdb is activated from within IPython,
9149 coloring, tab completion and other features continue to work seamlessly.
9235 coloring, tab completion and other features continue to work seamlessly.
9150 \layout List
9236 \layout List
9151 \labelwidthstring 00.00.0000
9237 \labelwidthstring 00.00.0000
9152
9238
9153 Scott\SpecialChar ~
9239 Scott\SpecialChar ~
9154 Tsai
9240 Tsai
9155 \family typewriter
9241 \family typewriter
9156 <scottt958-AT-yahoo.com.tw>
9242 <scottt958-AT-yahoo.com.tw>
9157 \family default
9243 \family default
9158 Support for automatic editor invocation on syntax errors (see
9244 Support for automatic editor invocation on syntax errors (see
9159 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython/issue36}
9245 \begin_inset LatexCommand \htmlurl{http://www.scipy.net/roundup/ipython/issue36}
9160
9246
9161 \end_inset
9247 \end_inset
9162
9248
9163 ).
9249 ).
9164 \layout List
9250 \layout List
9165 \labelwidthstring 00.00.0000
9251 \labelwidthstring 00.00.0000
9166
9252
9167 Alexander\SpecialChar ~
9253 Alexander\SpecialChar ~
9168 Belchenko
9254 Belchenko
9169 \family typewriter
9255 \family typewriter
9170 <bialix-AT-ukr.net>
9256 <bialix-AT-ukr.net>
9171 \family default
9257 \family default
9172 Improvements for win32 paging system.
9258 Improvements for win32 paging system.
9173 \the_end
9259 \the_end
General Comments 0
You need to be logged in to leave comments. Login now