sending input to an embedded application

mefyl mefyl at lrde.epita.fr
Sat Jul 12 08:16:22 EDT 2008


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

-- 
mefyl
R&D engineer at Gostai - http://www.gostai.com

To understand recursion, you must first understand recursion.



More information about the Python-list mailing list