I am trying to redirect the stderr of a script to a variable to use it in if/else statements. What I need is the program to behave in one way or another according to the stderr. I have found this post using StringIO which may suit my needs, but I cannot figure out how to make it to redirect stderr. I'm sure it is quite easy, but I'm quite new to python and any detailed help will be really appreciated. Thanks!
Dani
sys.stderrinstead ofsys.stdoutand do what the post says. But why do you need it. Who is writing to stderr?