[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:


and here's more background into the problem:


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.



More information about the IPython-user mailing list