On 2017-10-22 21:50, Dennis Lee Bieber wrote:
> sys.stdout.flush()
instead of flushing every time you could:
# reopen stdout file descriptor with write mode
# and 0 as the buffer size (unbuffered)
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
see https://stackoverflow.com/questions/107705/disable-output-buffering
There seems to be other ways too, like passing -u to the interpreter
or setting env var PYTHONUNBUFFERED
These two last I did not test, but some years ago I did reopneh stdout
with 0 buffer and it worked fine (on python 2.7 at least)
--
--
Björn
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|