Hello,
I would like to know how I can call a program ('example.exe') which runs as a batch process in a new command prompt and control the inputs and outputs from within a python script. I have tried the following code:
import subprocess
p = subprocessPopen('example.exe', shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT)
#this line opens the example code in a new command prompt
p.stdin.write('hello')
#i now need to send input into the example code.
But this only ends up hanging up without any information being sent into the command prompt. How can I control the data being sent into a command prompt using python.
Thanks in advance,
Surge