[IPython-user] ipython -p sh

Jeremy M. Jones zanesdad@bellsouth....
Sat Mar 8 15:24:41 CST 2008


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.

The problem that I'm having appears to be similar to fred here: 
http://permalink.gmane.org/gmane.comp.python.ipython.user/2788

But even trying to execute some system shell stuff using full paths, I 
run into problems.  For example, if I try to execute Python while I'm in 
IPython, I get this::

[~]|7> which python
python -> python
   == /usr/bin/python
/usr/bin/python
[~]|8> /usr/bin/python
------------------------------------------------------------
    File "<ipython console>", line 1
      /usr/bin/python
      ^
SyntaxError: invalid syntax


But executing with a ! works:

[~]|9> !/usr/bin/python
Python 2.5.1 (r251:54863, Oct  5 2007, 13:50:07)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>>

And using the python in the alias_table works:
[~]|16> python
Python 2.5.1 (r251:54863, Oct  5 2007, 13:50:07)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>>

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. 
Previously, -p pysh was supposed to treat any command that it 
encountered that started with /, ~, and some otherd differently so that 
it would execute system shell commands rather than Python/IPython things.

Thanks,

- jmj


More information about the IPython-user mailing list