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

Appearance settings

gh-133829: Update zipimport example to not mention Python 2.3 #133835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
Loading
from
Open
22 changes: 7 additions & 15 deletions 22 Doc/library/zipimport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -186,19 +186,11 @@ Examples
Here is an example that imports a module from a ZIP archive - note that the
:mod:`zipimport` module is not explicitly used.

.. code-block:: shell-session

$ unzip -l example.zip
sobolevn marked this conversation as resolved.
Show resolved Hide resolved
Archive: example.zip
Length Date Time Name
-------- ---- ---- ----
8467 11-26-02 22:30 jwzthreading.py
-------- -------
8467 1 file
$ ./python
Python 2.3 (#1, Aug 1 2003, 19:54:32)
.. code-block:: python
sobolevn marked this conversation as resolved.
Show resolved Hide resolved

>>> import sys
>>> sys.path.insert(0, 'example.zip') # Add .zip file to front of path
>>> import jwzthreading
>>> jwzthreading.__file__
'example.zip/jwzthreading.py'
>>> sys.path.insert(0, 'pip.pyz') # Add .pyz file to front of path
sobolevn marked this conversation as resolved.
Show resolved Hide resolved
>>> import pip
>>> pip.__file__
'pip.pyz/pip/__main__.py'

Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.