[IPython-user] python vs. ipython

Peter Teuben teuben at astro.umd.edu
Fri Jan 27 12:46:16 CST 2006


On Fri, 27 Jan 2006 Fernando.Perez at colorado.edu wrote:

> Quoting Ville Vainio <vivainio at gmail.com>:
>
>> On 1/27/06, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
>
>>> call to do the same is, I think, perfectly consistent.  I'm not sure though
>> if
>>> the options parsing stuff we use will deal correctly with options meant for
>>> the script and not for ipython...
>>
>> I don't use the options parsing stuff, just snip item 0 from plain old
>> sys.argv.
>
> But how do you deal with
>
> ipython --xmode=verbose --nobanner myscript.py --foo --bar
>
> ?  The first two options should be processed by ipython, but after the script
> name the rest should be seen by the user script (and only that).


i've tried out Ville's new SVN version, where sys.argv has been reset
(much like with the -c flag). So now, it looks VERY much like python
does.

But there are some problems/caveats


1)  some users that rely on this behaviuor

 	ipython [flags] script1 script2 script3

will now be upset, since script2 and script3 are not executed anymore!
Perhaps it is better this way, at least it works much better for me.

2)  when you use the -c flag

 	ipython -c 'foo()'  foo.py  arg1 arg2

the arguments are not seen anymore, since sys.argv is now  ['-c']


- peter




More information about the IPython-user mailing list