In <[email protected]> "D. Xenakis" 
<[email protected]> writes:

> 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?

Depending what sys.stdout is connected to (a file, the screen, a pipe,
etc.), data doesn't necessarily get written right away.  In particular,
screen output often waits until it receives a newline before displaying
anything.

flush() makes sure it all gets written *right now*.

-- 
John Gordon                   A is for Amy, who fell down the stairs
[email protected]              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to