Paul McGuire: > def lineReader( strm ): > while 1: > yield strm.readline().rstrip("\n") > > for f in lineReader( stdin ): > print ">>> " + f You can simplify that with the iter builtin. for f in iter(stdin.readline, ""): print ">>> " + f (Hmm... maybe I should test it? Naaaaahhh.) Andrew dalke at dalkescientific.com