generation of keyboard events

RAM serverin2000 at
Mon Jul 6 10:11:27 CEST 2009

On 5 July, 17:12, Tim Harig <user... at> wrote:
> On 2009-07-05, RAM <serverin2... at> wrote:
> > I need to start an external program and pass the keyboard events like
> > F1,Right arrow key etc to the program..I am trying to use the
> > subprocess module to invoke the external program. I am able to invoke
> > but not able to generate the keyboard events and pass them on to the
> You have told us nothing about the environment where you are trying to
> accomplish this.  GUI, CLI, Unix, Windows, etc? So I suggest that you
> checkout the curses getch functions.  You can find them in the standard
> library documentation at  You should also reference
> documentation for the C version in your systems man pages.

Hi Tim,

I am trying to do this on windows. My program(executable) has been
written in VC++ and when I run this program, I need to click on one
button on the program GUI i,e just I am entering "Enter key" on the
key board. But this needs manual process. So i need to write a python
script which invokes my program and pass "Enter key" event to my
program so that it runs without manual intervention.

Thank in advance for the help.

Sreerama V

More information about the Python-list mailing list