[IPython-user] pass command flags to script

Ville M. Vainio vivainio@gmail....
Tue Nov 25 01:26:48 CST 2008


On Mon, Nov 24, 2008 at 7:16 PM, John Hunter <jdh2358@gmail.com> wrote:

> I would like to pass command args to a script and after the script
> runs, drop into an ipython shell.  Something like
>
>  >  ipython 'agg_oo.py --verbose-helpful'
>
> Which does not work.  Is such a thing possible?

In [3]: cat t.py
a= "hello"
print a,a

[~]|16> ipython -i -c '%run t.py hello'
hello hello

In [2]: print a
hello


>  from IPython.Shell import IPShellEmbed
>  ipshell = IPShellEmbed()
>  ipshell()
>
> but it did not like the command args either :-(

Set sys.argv before that.


-- 
Ville M. Vainio
http://tinyurl.com/vainio


More information about the IPython-user mailing list