python system subprocess win32

mclaugb mclaugb at nospm.yahoo.com
Tue Aug 7 10:48:35 EDT 2007


Hello ALl,
I have a compiled program "conv.exe" that works as follows:
>>conv.exe
-----------------------------
Please selection from the following options.  press "h" for help, "p" for 
print, "r" for readfile.
Enter your request now:
...
--------------------
Is there a way to script python using the subprocess method to start this 
program "conv.exe" and then send a "r" to the command line to make it, say, 
readfile.

I have tried the following but the .communicate("r) is not doing anything

import subprocess
import time

a=subprocess.Popen("c:\\mcml\\conv.exe")
time.sleep(1)
(stdout, stderr) = a.communicate("r")

Many thanks,
Bryan





More information about the Python-list mailing list