[IPython-user] another article mentioning IPython

Ville M. Vainio vivainio@gmail....
Sat Feb 16 13:33:05 CST 2008


On Feb 16, 2008 3:39 PM, Jeremy M. Jones <jemejones@gmail.com> wrote:

> 1) essential for day-to-day usage of IPython

- It works almost like normal system shell, if you are used to
bash-like operation (i.e. it beats the crap out of cmd.exe on how
stuff such as tab completion etc. works). With the added bonus that
you can do some python in between :-P

- $var expansion in system commands (and magics and aliases). It just
kicks ass to be able to do:

my_cpp_files = %mglob rec:*.cpp
for fil in my_cpp_files:
    mysyscmd $fil > ${fil}.out

- Editable, persistent macros. You can execute a series of commands,
then make a %macro out of them, then %edit the macro (if something
needs polishing), then %store it for future use.

Suppose that you just executed a horrible command line

45> foo_describe --changelist=45482 //oeoe/oaeaoe/ //bor/oeoeoeoeoeaoe/

And the only thing that changes here is the changelist number.

Just store it to macro (%macro mydescribe 45), then %edit it to prompt
the changelist number from user:

cl = raw_input('Enter cl number:")
foo_describe --changelist=$cl //oeoe/oaeaoe/ //bor/oeoeoeoeoeaoe/

And then just %store 'mydescribe'.

> 2) awesome, but undersold features

I think the '-p sh' profile in general is such a thing. I try to keep
the default profile quite "backwards compatible", so I'm more inclined
to enable the new cool stuff in the 'sh' profile (that I use myself
exclusively).

Shadow history is also something that many people don't know about:

http://ipython.scipy.org/moin/Cookbook/ShadowHistory

> 3) helpful for tasks around system administration (which is the topic
> for the book that Noah and I are writing).

Here is already a good list:

http://ipython.scipy.org/moin/Cookbook/IpythonShell

Would you like me to expand on some of those?

I'm sure sysadmins will love:

-  http://ipython.scipy.org/moin/Cookbook/StringListProcessing
-  eternal directory history (now WHERE was that config file....)
- %env: http://ipython.scipy.org/moin/Cookbook/EnvPersist

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


More information about the IPython-user mailing list