[IPython-user] python vs. ipython

Fernando Perez Fernando.Perez at colorado.edu
Tue Jan 31 23:36:47 CST 2006


Peter Teuben wrote:
> Ville
>     i've been quiet for a few days, working with the new svn based ipython.
> 
> One comment and one somewhat serious bug:
> 
> 1) comment: for testing i went back and forth between the old style and new 
> style
> ipython, but in the process found out that the
>  	python setyp.py clean
> and then install didn't work. Resulted in some things not copied properly,
> and resulting in a broken ipython.
> so i had to remove the IPython tree in python manually for it to work.
> 
> 
> 2) bug:   If one does
> 
>  	ipython script a b c
> 
> then it works ok, sys.argv[] is now [script,....]
> 
> but if one does
> 
>  	ipython script -a b c
> 
> it looks like -a is seen as an ipython arg, and not, as in python, part of 
> sys.argv[]

I'd mentioned this was going to be a problem in one of my previous emails. 
This recipe shows how to solve the problem with optparse:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473788

and here's more background into the problem:

http://groups.google.com/group/comp.lang.python/browse_thread/thread/fe89b1adff7920f5/a47fe54655dc002c?lnk=st&q=optparse++comp.lang.python+debugger&rnum=1&hl=en#a47fe54655dc002c

Unfortunately, ipython was written before optparse existed, and it uses a 
different option handling module (DPyGetOpt).  Switching to optparse is on the 
todo list, but I'm not sure you really want to go there: it's rather confusing 
code, and will require a lot of testing if you change it.

Cheers,

f




More information about the IPython-user mailing list