@@ -574,4 +574,61 @@ Instances have the following attributes:
574574
575575 Size of the uncompressed file.
576576
577+
578+ .. _zipfile-commandline :
579+ .. program :: zipfile
580+
581+ Command-Line Interface
582+ ----------------------
583+
584+ The :mod: `zipfile ` module provides a simple command-line interface to interact
585+ with ZIP archives.
586+
587+ If you want to create a new ZIP archive, specify its name after the :option: `-c `
588+ option and then list the filename(s) that should be included:
589+
590+ .. code-block :: shell-session
591+
592+ $ python -m zipfile -c monty.zip spam.txt eggs.txt
593+
594+ Passing a directory is also acceptable:
595+
596+ .. code-block :: shell-session
597+
598+ $ python -m zipfile -c monty.zip life-of-brian_1979/
599+
600+ If you want to extract a ZIP archive into the specified directory, use
601+ the :option: `-e ` option:
602+
603+ .. code-block :: shell-session
604+
605+ $ python -m zipfile -e monty.zip target-dir/
606+
607+ For a list of the files in a ZIP archive, use the :option: `-l ` option:
608+
609+ .. code-block :: shell-session
610+
611+ $ python -m zipfile -l monty.zip
612+
613+
614+ Command-line options
615+ ~~~~~~~~~~~~~~~~~~~~
616+
617+ .. cmdoption :: -l <zipfile>
618+
619+ List files in a zipfile.
620+
621+ .. cmdoption :: -c <zipfile> <source1> ... <sourceN>
622+
623+ Create zipfile from source files.
624+
625+ .. cmdoption :: -e <zipfile> <output_dir>
626+
627+ Extract zipfile into target directory.
628+
629+ .. cmdoption :: -t <zipfile>
630+
631+ Test whether the zipfile is valid or not.
632+
633+
577634.. _PKZIP Application Note : https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
0 commit comments