for line in sys.stdin: Does this statement cause all of stdin to be read before the loop begins? I may need to read several GB and I do not want to swamp the machine's memory.