[IPython-dev] Anyone done anything like this before?

David Quigley dpquigl at davequigley.com
Tue Oct 2 15:51:02 EDT 2012


On 10/02/2012 15:47, Aron Ahmadia wrote:
> Absolutely, you want the subprocess module, and in particular, the
> subprocess.communicate() method.
>
> http://docs.python.org/library/subprocess.html [3]
>
> This is core Python functionality, but it wil work from IPython as 
> well.
>
> A
>
> On Tue, Oct 2, 2012 at 10:43 PM, David Quigley
> <dpquigl at davequigley.com> wrote:
>
>> I want to use ipython as a shell which will receive commands and 
>> then
>> task a process to do things. The trick here is that I want to start 
>> the
>> process from within ipython and monitor its stdin/stdout for 
>> commands.
>> It is a message passing interface so events will come in async and I
>> need the shell to be able to handle them. Is there something similar 
>> to
>> this out there somewhere that I can look at for inspiration? Is this
>> even possible?
>>
>> Dave
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev [2]
>
>
>
> Links:
> ------
> [1] http://mail.scipy.org/mailman/listinfo/ipython-dev
> [2] http://docs.python.org/library/subprocess.html
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev


I've started down that path and I'm hoping I can select on the pipes 
for STDIN and STDOUT. I'm just wondering how this fits in with ipython's 
event model. Maybe its my lack of knowledge of python but our custom 
shell we already have written uses an io event loop to just listen for 
messages on the two pipes and process and send over them as needed. I 
guess the better way of phrasing the question would be, do I have to 
worry about decoupling an IO loop for the subprocess from the io loop 
for ipython?



More information about the IPython-dev mailing list