This question is related to my previous question.
Error of running an executable file from Python subprosess
I am trying to run an executable file (a linear programming solver CLP.exe) from Python 3.5.
Import subprocess
exeFile = "C:\\MyPath\\CLP.exe"
arg1 = "C:\\Temp\\LpModel.mps"
arg2 = "-max"
arg3 = "-dualSimplex"
arg4 = "-printi"
arg4a = "all"
arg5 = "-solution"
arg6 = "solutionFile.txt"
arg7 = "-log"
arg8 = "6"
arg9 = ">"
arg10 = "log.txt"
subprocess.check_output([exeFile, arg1, arg2, arg3, arg4a, arg5,arg6, arg7, arg8, arg9, arg10], stderr=subprocess.STDOUT, shell=False)
When I run the python file in Eclipse PyDev, I can see the results in Eclipse console and the solution results are also saved in "solution.txt".
But, no log results are saved at the file of "log.txt".
In the Eclipse console, I got:
b'Coin LP version 1.16, build Dec 25 2015
command line - C:\\MyPath\\clp.exe C:\\Temp\\LpModel.mps -max -dualSimplex -printi all -solution C:\\Temp\\solutionFile.txt > log.txt
Optimal - objective value 118816.5
Optimal objective 110 - 40 iterations time 0.022
logLevel was changed from 1 to 6
No match for > - ? for list of commands
No match for log.txt - ? for list of commands
When I run the command in MS windows shell from command line:
C:\\MyPath\\clp.exe C:\\Temp\\LpModel.mps -max -dualSimplex -printi all -solution C:\\Temp\\solution.txt > log.txt
I can get log results in log.txt.
Why the log.txt file was not created and no log results were saved to it if I run the command from Python subprocess ?