sending input to an embedded application

Matthew Fitzgibbons elessar at nienna.org
Mon Jul 21 11:03:52 EDT 2008


mefyl wrote:
> Uwe Schmitt wrote:
>> On 12 Jul., 09:08, George Oliver <georgeolive... at gmail.com> wrote:
>>> What I would like to do is take a program and embed it or put it
>>> within a Python-run GUI, using the GUI just to capture and send input
>>> to the application, and display the ouput.
>> Which interface does your interpreter provide ? Just commandline or
>> can you access by other methods ?
>>
>> http://sourceforge.net/projects/pexpect/ might help you
>>
> 
> Although Pexpect looks more advanced and complete, you might want to take a
> look at popen* modules. It enables you to easily run a subprocess, feed him
> data on stdin, retrieve output from stdout/stderr, and wait for its
> completion.
> 
> http://docs.python.org/lib/module-popen2.html
> 

I believe the subprocess module is the recommended module to use now.

-Matt



More information about the Python-list mailing list