I might be missing the obvious, but I don't think the subprocess module has a method that will capture the standard output, standard error, and the exit code of a subprocess in a single call. It is ...
$ python tee_test.py [stdout] hello [stderr] hello [stdout] world [stderr] world [stdout] not going to be written to file [stderr] not going to be written to file $ cat mystdout.txt [stdout] hello ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results