Reading from sys.stdin reads the whole file in

Marko Rauhamaa marko at pacujo.net
Wed Aug 27 01:31:26 EDT 2014


Marko Rauhamaa <marko at pacujo.net>:

> Try flushing after each print.

   <URL: http://stackoverflow.com/questions/230751/how-to-flush-ou
   tput-of-python-print>

   Since Python 3.3, there is no need to use sys.stdout.flush():

    print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)


Marko



More information about the Python-list mailing list