[IPython-dev] running shell command from engine

Antonio González Peña antgonza at gmail.com
Fri Jun 20 17:08:39 EDT 2014


Thank you for the help and suggestions.

On Fri, Jun 20, 2014 at 12:53 PM, Fernando Perez <fperez.net at gmail.com> wrote:
> this is one part of the python stdlib that I've hated for years. I really
> wish something like sh was in there, thanks for the reminder...
>
>
> On Fri, Jun 20, 2014 at 3:32 AM, Maximilian Albert
> <maximilian.albert at gmail.com> wrote:
>>
>> 2014-06-19 19:29 GMT+01:00 Fernando Perez <fperez.net at gmail.com>:
>>>
>>> Sure! Popen won't give you an actual result that's very useful, you'll
>>> need to decide whether to capture stdout/err, to use pipes, etc. But
>>> subprocess/popen are just python functions like any other, so you can use
>>> them all the same...
>>
>>
>> On a related note, I have found the 'sh' module [1,2] *much* more
>> convenient to use and its error messages (which are raised as exceptions
>> when the subprocess exits with an error) much easier to debug than using
>> subprocess directly.
>>
>> Cheers,
>> Max
>>
>> [1] https://pypi.python.org/pypi/sh
>> [2] http://amoffat.github.io/sh/
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>
>
>
> --
> Fernando Perez (@fperez_org; http://fperez.org)
> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
> fernando.perez-at-berkeley: contact me here for any direct mail
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>



-- 
Antonio



More information about the IPython-dev mailing list