'r'
to read an existing file, 'w'
to
truncate and write a new file, or 'a'
to append to an
existing file. For mode is 'a'
and filename
refers to an existing ZIP file, then additional files are added to
it. If filename does not refer to a ZIP file, then a new ZIP
archive is appended to the file. This is meant for adding a ZIP
archive to another file, such as python.exe. Using
cat myzip.zip >> python.exe
XXX explain the "extra" string for the ZIP format
Index | Meaning |
---|---|
0 |
File data seek offset |
1 |
ZIP file "extra" data as a string |
2 |
ZIP file bit flags |
3 |
ZIP file compression type |
4 |
File modification time in DOS format |
5 |
File modification date in DOS format |
6 |
The CRC-32 of the uncompressed data |
7 |
The compressed size of the file |
8 |
The uncompressed size of the file |
The class ZipFile has these methods:
zipfile.TOC.keys()
.
'w'
or 'a'
.
'w'
or
'a'
.
string.pyc # Top level name test/__init__.pyc # Package directory test/testall.pyc # Module test.testall test/bogus/__init__.pyc # Subpackage directory test/bogus/myfile.pyc # Submodule test.bogus.myfile