-1

What is flush in the print function in python? What happens if it is set True? In what cases setting it True helps? Please provide good examples to understand. print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)

Niraj Raut
  • 205
  • 2
  • 7

1 Answers1

1

It forces print's output to the screen. In python 3 instead of doing this:

import sys
sys.stdout.flush()

You can use flush. Look here for more details.

xilpex
  • 3,097
  • 2
  • 14
  • 45