> The code works fine. I just don't know how f.write works. It says that > file.write won't write the file until file.close or file.flush.
You are misinterpreting the documentation. It certainly won't keep the entire file in memory. Instead, it has a fixed-size buffer (something like 8kiB or 32kiB) in which it writes and which it flushes when that buffer is full. The comment about flush and close merely refers to the problem that some data may still be in the buffer at any point in time, unless you just called close or flush. HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list