contextlib
Redirecting all kinds of stdout in Python <http://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/>
Redirecting all kinds of stdout in Python <http://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/>