[IPython-user] help issues

Fernando Perez Fernando.Perez at colorado.edu
Tue Jun 29 09:26:13 CDT 2004


Arnd Baecker wrote:
> So after installing a fresh python 2.3.4, Numeric, ..., CVS scipy,
> and CVS IPython I was prepared to go through my list of help problems.
> Good news: I think there are no issues concerning help left!
> 
> But I found the following:
> 
> Pasting the following lines 3 lines
> #########################################
> def f(x):
>     """doc string for f(x)"""
>     return x*x
> #########################################
> in IPython 0.0.6 worked fine and gave
> In [1]: def f(x):
>    ...:     """doc string for f(x)"""
>    ...:     return x*x
>    ...:
> In [2]:
> 
> Now with 0.6.1.cvs I get
> 
> In [1]: def f(x):
>    ...:         """doc string for f(x)"""
>    ...:             return x*x
> ------------------------------------------------------------
>    File "<console>", line 3
>      return x*x
>      ^
> SyntaxError: invalid syntax
> 
> Somehow IPython auto-indents now
> (which is nice on one hand, but ...). I am not sure
> if there is an easy solution for this (How should
> Ipython know whether input is typed or pasted?)

Yes, autoindent is now on by default (it has always existed).  But it means 
that before you paste code, you _must_ turn it off or you'll end up with 
misindented text.  @autoindent will toggle it back and forth for you.

I decided to make it on by default, because I suspected (correctly it seems, 
since even a longtime user like you didn't know about it) that people didn't 
know about the facility.  I figured that once they got bitten by the pasting 
problem once they'd learn about it, and from then onwards they could toggle it 
as needed.   If you want it off permanently, just set it off in your ipythonrc 
file.

But I'm willing to reconsider the wisdom of having it on by default if you 
think this will lead to too much user confusion.

> Another, really minor one:
> When using the pysh profile the color scheme is
> not taken into account
> (so somehow one should query the color scheme from
> ipythonrc in ipythonrc-pysh and set the prompt accordingly)

Indeed, the whole 'color scheme' idea (Linux, LightBG) only applies to the 
normal ipython prompts, exception tracebacks, etc.  The pysh prompt must be 
manually configured by specifying its colors one by one.  Ther are so many 
possible combinations of prompts possible now with pysh that it's not easy to 
include this into a generic scheme, and I just didn't have the time to even 
hack a half-assed solution.

So just type in whichever colors you like in your ipythonrc-pysh file.

Best,

f




More information about the IPython-user mailing list