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

Thomas Kluyver takowl at gmail.com
Tue Oct 2 16:42:08 EDT 2012

On 2 October 2012 20:47, Aron Ahmadia <aron at ahmadia.net> wrote:
> Absolutely, you want the subprocess module, and in particular, the
> subprocess.communicate() method.
> http://docs.python.org/library/subprocess.html

I'm not sure that that is the best thing here. The docs for
communicate() say "...Wait for process to terminate...", whereas it
sounds like David wants to repeatedly communicate with a process.

I'm not entirely sure from the description, but I'd point you to
pexpect, which is designed to wait for particular output patterns from
a process and respond with input.



More information about the IPython-dev mailing list