El método flush() en Python limpia el búfer interno.
Ejemplo
Puede borrar el búfer al escribir en un archivo:
f = open("tuarchivo.txt", "a") f.write("El archivo tiene una línea más") f.flush() f.write("ahora otra línea más")
Sintaxis
file.flush()
Valores de parámetros
No hay parámetros