[IPython-user] ipython -p sh questions

Ville M. Vainio vivainio@gmail....
Tue Mar 4 10:19:21 CST 2008


On Tue, Mar 4, 2008 at 5:28 PM, James Spencer <jss43@cam.ac.uk> wrote:

>  I really like ipython and have just started playing around with it as a
>  shell replacement.  I especially appreciated how easy it was to extend
>  the magic commands: we use the modules package here and implementing
>  that as a magic function was incredibly painless*.  I'm a fan.  :-)

What's 'modules package'?

>  Is there any more documentation on the shell profile apart from
>  http://ipython.scipy.org/moin/Cookbook/IpythonShell, or any in the
>  works?  I'm interested in contributing if the latter...

This work has not been started yet. It would be extremely cool if you
could flesh out something on that cookbook page. We could throw it
into the IPython manual.

>  It would be nice if the output of shell commands was captured in Out
>  like python commands.  Is there any way to implement this/any reason why
>  this can't or shouldn't be done?  Similarly, _ can't be used on the
>  output of a shell commands...

There is a syntax for this:

o = !some_command foo bar

Command output is not by default captured to _, because it would
require us to change the execution model; now the terminal commands
are executed in a fully interactive fashion (os.system()), and I
wouldn't really like to change that, at least as default.

However, it would be very easy to implement a system where system
command output was available in Out array, but the commands would not
be executed "naturally" then.

>  I use !$ all the time in bash: is there an equivalent in ipython?  Right

What does $! do? If there in no equivalent yes, we can do it ;-)

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'


More information about the IPython-user mailing list