I have a small java program that I can run from the command line using this syntax:
java -jar EXEV.jar -s:myfile
This java program print some data to the screen and I want redirect stdout into a file called output.txt.
from subprocess import Popen, PIPE
def wrapper(*args):
process = Popen(list(args), stdout=PIPE)
process.communicate()[0]
return process
x = wrapper('java', '-jar', 'EXEV.jar', '-s:myfile', '>', 'output.txt')
When I run the above, output.txt is never written to and Python does not throw any errors. Can anyone help me figure out the problem?