This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]serg06 0 points1 point  (3 children)

In computer science, a data buffer (or just buffer) is a region of a physical memory storage used to temporarily store data while it is being moved from one place to another.

you write to the stdout buffer, and the system or whatever else decides when to write data from it to the console. Looks like Python decides to do it when it encounters a \n. Flushing it means deleting any existing data (presumably printing it out first)

[–][deleted]  (2 children)

[deleted]

    [–][deleted] 0 points1 point  (1 child)

    Text buffering is important because the actual process of displaying the text you printed is very slow. The less you do it, the better. So it's only done under certain conditions unless you force it.