Skip to content

Commit c7a097c

Browse files
sharktideAA-TurnerZeroIntensitysobolevnStanFromIreland
authored
gh-133829: Remove some specifics from the zipimport example (#133835)
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 d3d94e0 commit c7a097c

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
@@ -177,17 +177,20 @@ Here is an example that imports a module from a ZIP archive - note that the
177177

178178
.. code-block:: shell-session
179179
180-
$ unzip -l example.zip
181-
Archive: example.zip
180+
$ unzip -l example_archive.zip
181+
Archive: example_archive.zip
182182
Length Date Time Name
183183
-------- ---- ---- ----
184-
8467 11-26-02 22:30 jwzthreading.py
184+
8467 01-01-00 12:30 example.py
185185
-------- -------
186186
8467 1 file
187-
$ ./python
188-
Python 2.3 (#1, Aug 1 2003, 19:54:32)
187+
188+
.. code-block:: pycon
189+
189190
>>> import sys
190-
>>> sys.path.insert(0, 'example.zip') # Add .zip file to front of path
191-
>>> import jwzthreading
192-
>>> jwzthreading.__file__
193-
'example.zip/jwzthreading.py'
191+
>>> # Add the archive to the front of the module search path
192+
>>> sys.path.insert(0, 'example_archive.zip')
193+
>>> import example
194+
>>> example.__file__
195+
'example_archive.zip/example.py'
196+

0 commit comments

Comments
 (0)