Marko Rauhamaa wrote: > Peter Otten <__pete...@web.de>: > >> In addition to what already has been said: you can switch off output >> buffering of stdout/stderr with >> >> python -u out.py >> >> or by setting the PYTHONUNBUFFERED environment variable. > > Very often such externalities are not in the control of the application > developer.
Sometimes it's possible to use a wrapper script rather than to sprinkle your code with flush(). Sometimes the "offending" python script is not even written and maintained by you, and setting an environment variable may be a price you are willing to pay to keep it that way. -- https://mail.python.org/mailman/listinfo/python-list