[IPython-user] ipython -p sh
Ville M. Vainio
vivainio@gmail....
Sun Mar 9 03:03:25 CDT 2008
On Sat, Mar 8, 2008 at 11:24 PM, Jeremy M. Jones <zanesdad@bellsouth.net> wrote:
> Is there anywhere that I can find even hints of documentation around the
> new "sh" profile? Looks like "pysh" isn't included in 0.8.2 and "sh"
> doesn't work the way "pysh" is supposed to.
A lot of the information is sprinkled around the CookBook section of the wiki.
> The problem that I'm having appears to be similar to fred here:
> http://permalink.gmane.org/gmane.comp.python.ipython.user/2788
There is no need for this syntax anymore:
$astr = ls *.py
The recommended way to approach the problem is to do
a = !ls *.py
This works in all profiles.
See http://ipython.scipy.org/moin/Cookbook/StringListProcessing
> But executing with a ! works:
Yes, this is true, and the way it always was with pysh as well, I think.
> And can anyone give me the 30 second sales pitch on -p sh? What are its
> benefits? It looks like it rehashes everything from the start.
It actually does very little, if you look at ipy_profile_sh.py (you
can ignore the extend_shell_behaviour function in the end) - it
enables various convenience extensions as default, and sets up some
options in a manner that is more convenient for shell use - prompt,
startup banner, etc. (like pysh). Stuff that has become unnecessary
later due to evolution of IPython core (like $a = ls *.py syntax) has
been removed.
The only "special" thing about sh profile (compared to the old pysh
profile), apart from general simplifications, is how it handles system
commands. pysh ran 'rehashx' in start of every session (essentially
scanning the PATH), sh only runs it the first time and caches the
result. So you need to run %rehashx if you e.g. install new programs.
--
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
More information about the IPython-user
mailing list