Possible Duplicate:
Create a zip file from a generator in Python?
from zipfile import ZipFile
with ZipFile('spam.zip', 'w') as myzip:
myzip.writestr('file.csv','records1,fields')
The above code works for creating a zip file. But I want to generate a large csv file with thousands of records. With the above code we can not append string to file 'file.csv' and I don't want to create large string in memory before writing to myzip.
Is there a way to append string to file.csv dynamically?