with open('WarningErr.txt', 'w') as err:
subprocess.call(cmd, stderr=err)
with open('WarningOut.txt', 'w') as out:
return_code = subprocess.call(cmd, stdout=out)
Right now, I write both errors and output in ".txt and stdout".
But it is too slow. I write in one, and then in another. I got to be able to write in both at the same time.
To replicate a little bit what the tee behaviour in Bash.