When stdin is not a tty, Python seems to buffer all the input through EOF before processing any of it: [ron at mickey:~]$ cat | python print 123 print 456 <hit ctrl-D here> 123 456 Is there a way to get Python to process input line-by-line the way it does when stdin is a TTY even when stdin is not a TTY? Thanks, rg