GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing docs.python.org — 7.16.2 PyZipFile Objects

Previous Page Up One Level Next Page Python Library Reference Contents Module Index Index
Previous: 7.16.1 ZipFile Objects Up: 7.16 zipfile Next: 7.16.3 ZipInfo Objects


7.16.2 PyZipFile Objects

The PyZipFile constructor takes the same parameters as the ZipFile constructor. Instances have one method in addition to those of ZipFile objects.

writepy (pathname[, basename])
Search for files *.py and add the corresponding file to the archive. The corresponding file is a *.pyo file if available, else a *.pyc file, compiling if necessary. If the pathname is a file, the filename must end with .py, and just the (corresponding *.py[co]) file is added at the top level (no path information). If it is a directory, and the directory is not a package directory, then all the files *.py[co] are added at the top level. If the directory is a package directory, then all *.py[oc] are added under the package name as a file path, and if any subdirectories are package directories, all of these are added recursively. basename is intended for internal use only. The writepy() method makes archives with file names like this:

    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


Previous Page Up One Level Next Page Python Library Reference Contents Module Index Index
Previous: 7.16.1 ZipFile Objects Up: 7.16 zipfile Next: 7.16.3 ZipInfo Objects

See About this document... for information on suggesting changes.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.