Movatterモバイル変換


[0]ホーム

URL:


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

gh-133829: Update zipimport example to not be from Python 2#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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sharktide wants to merge12 commits intopython:main
base:main
Choose a base branch
Loading
fromsharktide:patch-133829
Open
Changes fromall commits
Commits
Show all changes
12 commits
Select commitHold shift + click to select a range
842443e
gh-133829 Update zipimport example to use pip.pyz
sharktideMay 10, 2025
38d41ad
gh-133829 Under request, break up example into 2 code blocks
sharktideMay 10, 2025
93da900
gh-133829 remove $ ./python marker in python codeblock
sharktideMay 10, 2025
72ff028
agh-130829 simplify example
sharktideMay 10, 2025
0b5e2a5
gh-133829 Update example to use ``example.zip`` ``example.py`` and ``…
sharktideMay 11, 2025
24788eb
gh-133829 Clarify filename of zip to ``example_archive.zip``
sharktideMay 11, 2025
b8eccf7
Update zipimport.rst
sharktideMay 11, 2025
e7c93b9
Fix test fails
sharktideMay 11, 2025
b224d43
Update Doc/library/zipimport.rst
sobolevnMay 11, 2025
cff42fa
Update Doc/library/zipimport.rst
sobolevnMay 11, 2025
dc21001
Update Doc/library/zipimport.rst
sharktideMay 11, 2025
548857f
Update Doc/library/zipimport.rst
sharktideMay 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletionsDoc/library/zipimport.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -188,17 +188,20 @@ Here is an example that imports a module from a ZIP archive - note that the

.. code-block:: shell-session

$ unzip -lexample.zip
Archive:example.zip
$ unzip -lexample_archive.zip
Archive:example_archive.zip
Length Date Time Name
-------- ---- ---- ----
8467 11-26-02 22:30jwzthreading.py
846705-11-25 12:29example.py
-------- -------
8467 1 file
$ ./python
Python 2.3 (#1, Aug 1 2003, 19:54:32)

.. code-block:: pycon

>>> import sys
>>> sys.path.insert(0, 'example.zip') # Add .zip file to front of path
>>> import jwzthreading
>>> jwzthreading.__file__
'example.zip/jwzthreading.py'
>>> # Add the archive to the front of the module search path
>>> sys.path.insert(0, 'example_archive.zip')
>>> import example
>>> example.__file__
'example_archive.zip/example.py'

Loading

[8]ページ先頭

©2009-2025 Movatter.jp