Reading from stdin
skip at pobox.com
Wed Mar 10 16:14:14 CET 2004
Colin> However, I want the python script to print out the numbers as it
Colin> gets them, since there could be hours/days between numbers - not
Colin> a very efficient C program :). Actually, I would like to
Colin> read-a-line/ print-a-line/ read-a-line/etc
Colin> I have tried things like 'sys.stdin.read*' with no success.
Have you tried this?
for line in sys.stdin:
More information about the Python-list