Reading from stdin

Bjoern Lindstroem bkhl at
Sun Nov 5 23:41:39 CET 2000

I need to write a program that at some times reads a few lines
from <stdin> and when there is nothing more waiting there, stops
trying to read and is free to do something else. The problem is
that <stdin> is never closed, so I can't check for EOF.

What then? What do you think is the most clever way to solve

I have thought of using signal.alarm(), but that creates to long

Bjoern Lindstroem <bkhl at>

More information about the Python-list mailing list