Name
flush
Synopsis
f
.flush( )
Requests that f
’s buffer
be written out to the operating system, ensuring that the file as
seen by the system has exactly the contents that
Python’s code has written to
f
. Depending on the platform and on the
nature of f
’s underlying
file, f
.flush
may or
may not be able to ensure the desired effect.
Get Python in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.