On 04/30/2010 08:55 AM, pyt...@bdurham.com wrote:
Any ideas on whether or not it is possible to import from an in-memory zipfile stored in a cString vs. an on disk zipfile?
Based on the source-code to zipfile.py on my Debian machine, it looks like the zipfile.ZipFile constructor takes a "file" parameter. It then checks if it's a string (isinstance() of basestring) and opens that file if it is; otherwise, it assumes it's a file-like object and uses that, so in theory, you should be able to do something like
fp = cString(...) zf = zipfile.ZipFile(fp, ...) and it should Just Work(tm). -tkc -- http://mail.python.org/mailman/listinfo/python-list