Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Side by Side Diff: Doc/library/zipimport.rst

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/xmlrpc.client.rst ('k') | Doc/Makefile » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`zipimport` --- Import modules from Zip archives 1 :mod:`zipimport` --- Import modules from Zip archives
2 ===================================================== 2 =====================================================
3 3
4 .. module:: zipimport 4 .. module:: zipimport
5 :synopsis: support for importing Python modules from ZIP archives. 5 :synopsis: support for importing Python modules from ZIP archives.
6 .. moduleauthor:: Just van Rossum <just@letterror.com> 6 .. moduleauthor:: Just van Rossum <just@letterror.com>
7 7
8 8
9 This module adds the ability to import Python modules (:file:`\*.py`, 9 This module adds the ability to import Python modules (:file:`\*.py`,
10 :file:`\*.py[co]`) and packages from ZIP-format archives. It is usually not 10 :file:`\*.py[co]`) and packages from ZIP-format archives. It is usually not
11 needed to use the :mod:`zipimport` module explicitly; it is automatically used 11 needed to use the :mod:`zipimport` module explicitly; it is automatically used
12 by the built-in :keyword:`import` mechanism for :data:`sys.path` items that are paths 12 by the built-in :keyword:`import` mechanism for ``sys.path`` items that are path s
13 to ZIP archives. 13 to ZIP archives.
14 14
15 Typically, :data:`sys.path` is a list of directory names as strings. This modul e 15 Typically, ``sys.path`` is a list of directory names as strings. This module
16 also allows an item of :data:`sys.path` to be a string naming a ZIP file archive . 16 also allows an item of ``sys.path`` to be a string naming a ZIP file archive.
17 The ZIP archive can contain a subdirectory structure to support package imports, 17 The ZIP archive can contain a subdirectory structure to support package imports,
18 and a path within the archive can be specified to only import from a 18 and a path within the archive can be specified to only import from a
19 subdirectory. For example, the path :file:`/tmp/example.zip/lib/` would only 19 subdirectory. For example, the path :file:`/tmp/example.zip/lib/` would only
20 import from the :file:`lib/` subdirectory within the archive. 20 import from the :file:`lib/` subdirectory within the archive.
21 21
22 Any files may be present in the ZIP archive, but only files :file:`.py` and 22 Any files may be present in the ZIP archive, but only files :file:`.py` and
23 :file:`.py[co]` are available for import. ZIP import of dynamic modules 23 :file:`.py[co]` are available for import. ZIP import of dynamic modules
24 (:file:`.pyd`, :file:`.so`) is disallowed. Note that if an archive only contains 24 (:file:`.pyd`, :file:`.so`) is disallowed. Note that if an archive only contains
25 :file:`.py` files, Python will not attempt to modify the archive by adding the 25 :file:`.py` files, Python will not attempt to modify the archive by adding the
26 corresponding :file:`.pyc` or :file:`.pyo` file, meaning that if a ZIP archive 26 corresponding :file:`.pyc` or :file:`.pyo` file, meaning that if a ZIP archive
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 -------- ------- 152 -------- -------
153 8467 1 file 153 8467 1 file
154 $ ./python 154 $ ./python
155 Python 2.3 (#1, Aug 1 2003, 19:54:32) 155 Python 2.3 (#1, Aug 1 2003, 19:54:32)
156 >>> import sys 156 >>> import sys
157 >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path 157 >>> sys.path.insert(0, '/tmp/example.zip') # Add .zip file to front of path
158 >>> import jwzthreading 158 >>> import jwzthreading
159 >>> jwzthreading.__file__ 159 >>> jwzthreading.__file__
160 '/tmp/example.zip/jwzthreading.py' 160 '/tmp/example.zip/jwzthreading.py'
161 161
OLDNEW
« no previous file with comments | « Doc/library/xmlrpc.client.rst ('k') | Doc/Makefile » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+