[Tutor] Responding to a request for input from a MS-DOS program
AJeffrey at ntu.edu.sg
Wed Oct 11 15:19:37 CEST 2006
I want to use Python to run an old MS-DOS program that doesn't accept arguments when launched. I have to open the program first, then it will ask me for the name of another program (which it will subsequently do some analysis on). It asks two more questions (each requiring me to type '1' followed by 'enter') before it does the analysis; I don't need to capture any output (it will save the analysis in files which I can access later).
I'm new to Python. I have run some simple DOS commands (copy, delete), using os.system, but need some pointers on how to do this task. I want to bypass the human input, because I have over 100 files I want processed, and I can use Python to iterate through each file in turn (the files are named 1.sav, 2.sav, ... 100.sav).
I run Python 2.4 on Windows XP and (needless to say) I'm new to Python. >From web searches, it seems that a variation on popen might do what I want, but I'd like a pointer to some examples I can play around with.
Thanks for any help you can give.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor