7stud schrieb:
> I can't break out of the for loop in this example:
> 
> ------
> import sys
> 
> lst = []
> for line in sys.stdin:
>     lst.append(line)
>     break
> 
> print lst
> -----------

Works for me. But only after the stdin is closed with a C-d.

I presume this is an OS thing. The first lines aren't communicated to 
the process until either the file is closed - C-d - or the buffer the OS 
puts before the stream is filled. You can switch to unbuffered behviour 
somehow, google for it. Termios should be in your query.

Either way, it's not python behaving differently.

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to