generation of keyboard events

Emile van Sebille emile at fenx.com
Sun Jul 5 12:19:48 EDT 2009


On 7/5/2009 8:56 AM RAM said...
> Hi,
> 
> 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
> external progam.

If you're on *nix, search for python and expect and you'll find 
something based apps -- I'm not sure what you do for GUIs. On windows, 
I'm sure there are ways of doing this with the win32 extensions, but I 
commonly use msched from www.mjtnet.com.  I create msched scripts from 
within python and use subprocess to invoke msched and execute the python 
generated script.

HTH,

Emile


> Please help me in this because I am a beginner.
> 
> regards
> Sreerama V




More information about the Python-list mailing list