>Newbie question:file.readlines reads the entire file into a list in memory. You may not
I'm trying to turn a large XML file (~7G compressed) into a YAML file,
and my program seems to be buffering the input.
IOtest.py is just
import sys
for line in sys.stdin.readlines():
print line
but when I run
$ gzcat bigXMLfile.gz | IOtest.py
but it hangs then dies.
want to do this. You could try, instead, iterating over "sys.stdin",
which should not try to load the entire file into memory.
Jean-Paul