In yesterday evening's nice presentations on numpy, the speakers mentioned
the use of iPython, to provide an improved interactive Python shell
experience, so I decided to give it a try.

One feature that it claims to have, but which I could not get to work, is
automatic indentation.  I have fiddled with it a bit, but am still
perplexed.  For instance, here is a sample session
in which I set autoindent, but it does not seem to take effect.  Does anyone
have any suggestions?  I am using a Mac, running Snow Leopard, and just
launching ipython from a Terminal session.

Richard-Fuhrs-iMac:ipythonlearn richardfuhr$ ipython
Leopard libedit detected.
Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
Type "copyright", "credits" or "license" for more information.

IPython 0.10.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: autoindent
Automatic indentation is: OFF

In [2]: autoindent
Automatic indentation is: ON

In [3]: for i in range(10):
   ...: print i # I expected autoindent to take effect
------------------------------------------------------------
IndentationError: expected an indented block (<ipython console>, line 2)


In [4]: quit()
Do you really want to exit ([y]/n)? y
Richard-Fuhrs-iMac:ipythonlearn richardfuhr$

Reply via email to