Skip to content Skip to sidebar Skip to footer

Redirecting Subprocess Stdout

I've set up a stdout redirect using the class Redir in test.py (below). The output should show both print statements in the textbox. But currently only 'Output1' is sent to the te

Solution 1:

You could try this so see if you get the "Output2"

task = subprocess.Popen(["python", "test2.py"], stdout=subprocess.PIPE)
print task.communicate()

If you do, send it to the textbox :)

Post a Comment for "Redirecting Subprocess Stdout"