calling a program from Python batch file
torriem at gmail.com
Wed Dec 7 12:58:39 EST 2016
On 12/07/2016 10:43 AM, Karim Farokhnia wrote:
>> Is the program that oq-console.bat runs interactive? After it
>> launches into its own console window it asks for more input?
> The program doesn't ask for more input parameters as all parameters
> are in input files and the program will automatically read the files,
> but I need to type in some required commands and press enter.
think what you mean is that it *is* interactive, at least requiring some
input before it begins to work.
As the other person who replied said, it sounds like this program will
accept input on standard in. From python you will probably have to use
subprocess.popen and use the .communicate() method. You will be able to
pass in a string that will get fed to the subprocess on it's standard in
pipe (the equivalent of typing and pressing enter). Check the online
docs, particularly for the .communicate() method.
More information about the Python-list