[Tutor] Opening a dos exe

Ray Parrish crp at cmc.net
Sat Mar 13 18:41:14 CET 2010


Alan Gauld wrote:
>
> "Ray Parrish" <crp at cmc.net> wrote
>>>> but I cannot find a way of getting this information to the dos program
>>>> from python. Any ideas?
>> You could use os.system("startprogram.bat"), and create startprogram.bat
>> to run the dos program, and feed it the files, either all at once, or 
>> one at a time via the command line if it accepts command line input.
>
> I don't think you can do the second option with a bat file. There is 
> no way to interactively respond to the program once it starts. Thats 
> why WSH is better for that kind of interactive input.
>
> Or just use subprocess.Popen...
>
OK, it was not clear to me that he needed to be interactive with the dos 
program. He just said he needed to feed those files to the dos program, 
and I assumed he meant on the command line within a dos box, which can 
indeed be solved by running a batch file, if the dos program accepts 
command line parameters..

A good tool for writing interactive scripts used to be WinBatch, but I 
haven't used, or seen it anywhere for years. It would have to be 
installed on the machine you wanted to get interactive with a dos 
program however.

I remember WinBatch from back in the Windows 3.1 days, and am not sure 
if they are still keeping it up to date.

Later, Ray Parrish

-- 
Linux dpkg Software Report script set..
http://www.rayslinks.com/LinuxdpkgSoftwareReport.html
Ray's Links, a variety of links to usefull things, and articles by Ray.
http://www.rayslinks.com
Writings of "The" Schizophrenic, what it's like to be a schizo, and other
things, including my poetry.
http://www.writingsoftheschizophrenic.com




More information about the Tutor mailing list