sending keystroke to a dos application

Remco Gerlich scarblac-spamtrap at pino.selwerd.nl
Mon Jan 31 07:50:00 EST 2000


Adrian Eyre wrote in comp.lang.python:
> > I have a dos application that runs in a dos window under NT or win98 that
> > takes interactive input. Basically numbers to choose from menu items and
> > return keys. I have not found a method to script this application by
> > sending keystrokes to the dos window. Is there a any possibility 
> > to do this with python?
> 
> Providing you don't actually need this app to run on MS-DOS, but just
> 98/NT in a DOS box, you can use:
> 
> import msvcrt
> key = msvcrt.getch()
> 
> ...to get a single keystroke.

I believe that's not what he meant. He has an existing application
(probably non-Python) that runs in a DOS box. He wants to script it
with Python by sending keystrokes to it.

I don't think that's possible, but I'm not a Windows expert.
-- 
Remco Gerlich,  scarblac at pino.selwerd.nl
"This gubblick contains many nonsklarkish English flutzpahs, but the
 overall pluggandisp can be glorked from context"  (David Moser)



More information about the Python-list mailing list