python supports a -u option (or the PYTHONUNBUFFERED=1 environment variable) for forcing unbuffered IO (and line buffered text IO), allowing the IDE to show output as soon as it is printed. Use that instead of the current stream-reopening approach, and pass the option to programs when running via the IDE.
python supports a
-u
option (or thePYTHONUNBUFFERED=1
environment variable) for forcing unbuffered IO (and line buffered text IO), allowing the IDE to show output as soon as it is printed. Use that instead of the current stream-reopening approach, and pass the option to programs when running via the IDE.