[Tutor] Program to Simulate Keystrokes

Chris Fuller cfuller084 at thinkingplanet.net
Tue Aug 4 21:01:56 CEST 2009


On Tuesday 04 August 2009 12:43, Megan Land wrote:
> Hi,
>
> I'm working on a python script to automate a program we run at work.  The
> program is run from one command.  The only problem is that it asks you to
> hit enter to continue after it runs.  Is there a way I can do this?
>
> If at all possible I need a program that will work on Windows and Linux (I
> know a tall order).  I'm trying to keep this simple but if I have to use
> two different programs I will.
>
> Thanks for the help!
>
> Megan Land
> FVT Blade EMET Test Engineer
> mland at us.ibm.com

If your needs are basic, popen will probably suffice.  But, there is a module, 
Pexpect, that is made just for this job.
http://sourceforge.net/projects/pexpect/

Cheers


More information about the Tutor mailing list