I am trying to use the subprocess module to run an interactive tool, issue some commands via stdin, then read the results from stdout and end.
So I do the following:
mycmd should load, write output to stdout, then prompt for data. When data is given it prints some more. Well when I call it the prompt command never gets called and output contains only the init prints. If I set stdout to None, the prompt command runs and everything prints out as intended. In this case its printed to the screen, not to the output.
So why does it break when I try to pipe the output? I am using Python 2.6.2.
So I do the following:
Code:
output = Popen(["mycmd", "myarg"], stdin=PIPE,stdout=PIPE).communicate('prompt command')[0]
So why does it break when I try to pipe the output? I am using Python 2.6.2.
Comment