Hi Jeff, > 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 .... > 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
You need to look at the subprocess module and the examples that replace the older popen functions. You will find more info including examples of both popen and subporocess in my tutorial under the OS topic in the Applications Section Since you are new to this you might want to read the whole topic, or for more directed help scroll down to the Manipulating Processes heading. Unfortunately I just noticed I don't give any excample of writing to a process(in response to a prompt) which is something I should fix... Finally, for more sophisticated scenarios there is a module implementing the expect program in Python, but I suspect that will be overkill here. HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
