I have to run an executable for which input parameters are saved in a text file, say input.txt. The output is then redirected to a text file, say output.txt. In windows terminal, I use the command,
executable.exe < input.txt > output.txt
How can I do this from within a python program?
I understand that this can be achieved using os.system. But I wanted to run the same using subprocess module. I was trying something like this,
input_path = '<'+input+'>'
temp = subprocess.call([exe_path, input_path, 'out.out'])
But, the python code executes the exe file without directing the text file to it.