Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4efd2ed4
Commit
4efd2ed4
authored
Nov 02, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #28513: Documented command-line interface of zipfile.
parent
6bbf1b9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
Doc/library/zipfile.rst
Doc/library/zipfile.rst
+57
-0
Misc/NEWS
Misc/NEWS
+5
-0
No files found.
Doc/library/zipfile.rst
View file @
4efd2ed4
...
...
@@ -574,4 +574,61 @@ Instances have the following attributes:
Size of the uncompressed file.
.. _zipfile-commandline:
.. program:: zipfile
Command-Line Interface
----------------------
The :mod:`zipfile` module provides a simple command-line interface to interact
with ZIP archives.
If you want to create a new ZIP archive, specify its name after the :option:`-c`
option and then list the filename(s) that should be included:
.. code-block:: shell-session
$ python -m zipfile -c monty.zip spam.txt eggs.txt
Passing a directory is also acceptable:
.. code-block:: shell-session
$ python -m zipfile -c monty.zip life-of-brian_1979/
If you want to extract a ZIP archive into the specified directory, use
the :option:`-e` option:
.. code-block:: shell-session
$ python -m zipfile -e monty.zip target-dir/
For a list of the files in a ZIP archive, use the :option:`-l` option:
.. code-block:: shell-session
$ python -m zipfile -l monty.zip
Command-line options
~~~~~~~~~~~~~~~~~~~~
.. cmdoption:: -l <zipfile>
List files in a zipfile.
.. cmdoption:: -c <zipfile> <source1> ... <sourceN>
Create zipfile from source files.
.. cmdoption:: -e <zipfile> <output_dir>
Extract zipfile into target directory.
.. cmdoption:: -t <zipfile>
Test whether the zipfile is valid or not.
.. _PKZIP Application Note: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
Misc/NEWS
View file @
4efd2ed4
...
...
@@ -471,6 +471,11 @@ C API
- Issue #26754: PyUnicode_FSDecoder() accepted a filename argument encoded as
an iterable of integers. Now only strings and bytes-like objects are accepted.
Documentation
-------------
- Issue #28513: Documented command-line interface of zipfile.
Tests
-----
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment