title: Temporarily Redirect stdout/stderr
body: <p>Is it possible to temporarily redirect stdout/stderr in Python (i.e. for the duration of a method)?</p>
  <h3>Edit:</h3>
  <p>The problem with the current solutions (which I at first remembered but then forgot) is that they don't <em>redirect</em>; rather, they just replace the streams in their entirety. Hence, if a method has a <strong><em>local</em> copy</strong> of one the variable for any reason (e.g. because the stream was passed as a parameter to something), it won't work.</p>
  <p>Any solutions?</p>