This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Tested on Windows 10, 64 bit, Python 3.6 | |
Sources: | |
https://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/ | |
https://stackoverflow.com/questions/17942874/stdout-redirection-with-ctypes | |
""" | |
from contextlib import contextmanager | |
import ctypes | |
import io | |
import os, sys |