What does sys.stdout.flush() do?

D. Xenakis gouzounakis at hotmail.com
Fri Aug 23 07:58:40 EDT 2013


Somewhere i read..
sys.stdout.flush(): Flush on a file object pushes out all the data that has been buffered to that point.

Can someone post here a script example with sys.stdout.flush(), where in case i commented that i could understand what the difference really would be?

Whenever i try to remove that line (in scripts that i find online), i cant find any differences. I've just noticed that it is usually called right after sys.stdout.write(..) 
thx



More information about the Python-list mailing list