[Tutor] how to check for stdin?

christian folini christian.folini@unifr.ch
Mon, 5 Feb 2001 15:31:41 +0100


Hi there,

I would like to check for STDIN in a script. Now there is no
problem with sys.stdin, if there really is STDIN, but as soon
as no STDIN is present, python stops and wait for me to enter
some input. 

How can i check if there actually _is_ STDIN before i attempt to
read it?

christian

P.S. sorry, if this has been asked before, i did not find anything
in the web about it.