Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a37a382

Browse files
miss-islingtonsharktideAA-TurnerZeroIntensitysobolevn
authored
[3.14] gh-133829: Remove some specifics from the zipimport example (GH-133835) (#138274)
Co-authored-by: R Chintan Meher <meherrihaan@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
1 parent c35222a commit a37a382

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

‎Doc/library/zipimport.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,17 +188,20 @@ Here is an example that imports a module from a ZIP archive - note that the
188188

189189
.. code-block:: shell-session
190190
191-
$ unzip -l example.zip
192-
Archive: example.zip
191+
$ unzip -l example_archive.zip
192+
Archive: example_archive.zip
193193
Length Date Time Name
194194
-------- ---- ---- ----
195-
8467 11-26-02 22:30 jwzthreading.py
195+
8467 01-01-00 12:30 example.py
196196
-------- -------
197197
8467 1 file
198-
$ ./python
199-
Python 2.3 (#1, Aug 1 2003, 19:54:32)
198+
199+
.. code-block:: pycon
200+
200201
>>> import sys
201-
>>> sys.path.insert(0, 'example.zip') # Add .zip file to front of path
202-
>>> import jwzthreading
203-
>>> jwzthreading.__file__
204-
'example.zip/jwzthreading.py'
202+
>>> # Add the archive to the front of the module search path
203+
>>> sys.path.insert(0, 'example_archive.zip')
204+
>>> import example
205+
>>> example.__file__
206+
'example_archive.zip/example.py'
207+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /