pymemtrace.redirect_stdout
¶
Taken from the excellent blog: https://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/
Changes:
Minor edits.
Move tfile = tempfile.TemporaryFile(mode=’w+b’) outside try block.
Duplicate for stderr
TODO: Unite duplicate code.