[IPython-user] ipython -p sh questions

James Spencer jss43@cam.ac...
Tue Mar 4 10:44:10 CST 2008


>> we use the modules package here and implementing  that as a magic
function was incredibly painless*.
> What's 'modules package'?

Sorry, I meant environment modules:
http://modules.sourceforge.net/
They allow you to swap (relatively) between different environments, load
/unload conflicting programs etc.

> 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.

Cool.  'll have a shot at it once I've been using -p sh full-time then.

> There is a syntax for this:
>
> o = !some_command foo bar

Cheers.  I was being lazy and trying to avoid the extra keystrokes. :-)
 Plus, it would be nice if it was possible (but maybe not default) to be
able to handle output from python and shell commands in exactly the same
way.

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

!$ designates the last argument of the preceding command.  (!!:n
designates the n-th argument of the preceding command).  I thought about
adding it to my config files but I'm always loathe to hack things in
when someone might've already done it better. :-)

   --James



More information about the IPython-user mailing list