Skip to content

Commit 6d29585

Browse files
miss-islingtonsharktideAA-TurnerZeroIntensitysobolevn
authored
[3.13] gh-133829: Remove some specifics from the zipimport example (GH-133835) (#138273)
Co-authored-by: R Chintan Meher <[email protected]> Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: sobolevn <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]>
1 parent 8dd0276 commit 6d29585

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)