On 11/19/10 3:11 PM, Richard Fuhr wrote:
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.

That's weird, it works fine for me:

In [137]: autoindent
Automatic indentation is: ON

In [138]: for i in something:
   .....:     yup_auto_indent_worked
   .....:
   .....:

In [139]: autoindent
Automatic indentation is: OFF

In [140]: for i in something:
   .....: hmm_no_indent

I'm running:

OS-X 10.6
Python 2.6.6 (python.org build)
IPython 0.10
OS-X terminal.app

very similar to your setup --maybe a question for the ipython list?

Richard-Fuhrs-iMac:ipythonlearn richardfuhr$ ipython
Leopard libedit detected.

ahh -- here is one difference: I didn't get "Leopard libedit detected"

are you running the Apple-supplied python? It may have a readline work-alike that is not quite compatible -- I think my version is using the pyReadline that comes with ipython.

That may well be it, I just found this:

http://ipython.scipy.org/moin/InstallationOSXLeopard/LeopardPythonReadline

I wonder if you can disable libedit, and have it use pyReadline instead?

You might try the python.org python install -- it's a better bet for getting binary packages anyway, and Apple has never updated a python (why you're still in 2.6.1)

-Chris




--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]

Reply via email to