[EMAIL PROTECTED] wrote:

> I am using a python script as a way to test another program that I have
> written in C++. The program cannot be altered. It needs to stay the way
> it is.
> 
> I need to simulate a few keystrokes to the application while it is
> running. The application uses number keys and y and n to navigate a
> basic menu.
> 
> Is there a way within python to simulate the keystrokes to this other
> program.

I think this is possible with an expect module, such as
http://pexpect.sourceforge.net/.

<quote>
Description: Python module for automating interactive applications
 Pexpect is a pure Python module for spawning child applications;
 controlling them; and responding to expected patterns in their
 output. Pexpect works like Don Libes' Expect. Pexpect allows your
 script to spawn a child application and control it as if a human were
 typing commands.
</quote>

-- 
TeCh
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to