Mar-19-2018, 01:23 AM
is there a way, that works in both Python2 and Python3, to set stdout to always automatically flush at the end of every print command or function, at least in the cases which output a newline (in more cases is ok)? in many scripts i do stdout.flush() after each print and would like to have an easier way but i don't want to have to fake it with os.write(). i do know Python3 supports flush=True in the print function, but i still want these scripts to work on Python2. the reason is to be sure output order remains consistent around various other things the script might be doing.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.