title: contextlib.redirect_stdout in Python2.7
body: <p>I use Python2.7 and I want the function: <a href="https://docs.python.org/3/library/contextlib.html#contextlib.redirect_stdout" rel="noreferrer">contextlib.redirect_stdout</a>.
  I mean, I want to redirect the output of specific function (not the all program).
  The problem is - only Python3 supports "context.redirect_stdout" and no Python2.7. </p>
  
  <p>Someone know how can I use the same function in Python2.7 or to implement the same idea?</p>
  
  <p>Thanks in advance</p>