Lines Matching +full:shebang +full:- +full:command
1 :mod:`zipapp` --- Manage executable Python zip archives
14 --------------
18 <using-on-interface-options>`. The module provides both a
19 :ref:`zipapp-command-line-interface` and a :ref:`zipapp-python-api`.
23 -------------
25 The following example shows how the :ref:`zipapp-command-line-interface`
30 .. code-block:: shell-session
32 $ python -m zipapp myapp -m "myapp:main"
37 .. _zipapp-command-line-interface:
39 Command-Line Interface
40 ----------------------
42 When called as a program from the command line, the following form is used:
44 .. code-block:: shell-session
46 $ python -m zipapp source [options]
50 copied to the target archive (or the contents of its shebang line will be
51 displayed if the --info option is specified).
57 .. cmdoption:: -o <output>, --output=<output>
67 .. cmdoption:: -p <interpreter>, --python=<interpreter>
69 Add a ``#!`` line to the archive specifying *interpreter* as the command
73 .. cmdoption:: -m <mainfn>, --main=<mainfn>
80 :option:`--main` cannot be specified when copying an archive.
82 .. cmdoption:: -c, --compress
87 :option:`--compress` has no effect when copying an archive.
91 .. cmdoption:: --info
97 .. cmdoption:: -h, --help
102 .. _zipapp-python-api:
105 ----------
115 * The name of a directory, or a :term:`path-like object` referring
118 * The name of an existing application archive file, or a :term:`path-like object`
129 * If it is the name of a file, or a :term:`path-like object`,
139 a "shebang" line at the start of the archive. On POSIX, this will be
141 launcher. Omitting the *interpreter* results in no shebang line being
181 The *archive* argument can be a filename or a file-like object open
185 .. _zipapp-examples:
188 --------
192 .. code-block:: shell-session
194 $ python -m zipapp myapp
206 .. code-block:: shell-session
208 $ python -m zipapp myapp -p "/usr/bin/env python"
212 To replace the shebang line on an existing archive, create a modified archive
233 .. _zipapp-specifying-the-interpreter:
236 --------------------------
243 * If you use "/usr/bin/env python" (or other forms of the "python" command,
252 shebang line for users of Python 3.5, for example.
259 --------------------------------------------
261 Using the :mod:`zipapp` module, it is possible to create self-contained Python
276 .. code-block:: shell-session
278 $ python -m pip install -r requirements.txt --target myapp
281 file - if not, you can just list the dependencies manually on the pip command
284 3. Optionally, delete the ``.dist-info`` directories created by pip in the
286 as you won't be making any further use of pip they aren't required -
291 .. code-block:: shell-session
293 $ python -m zipapp -p "interpreter" myapp
296 the appropriate interpreter available. See :ref:`zipapp-specifying-the-interpreter`
300 file to remove the ``.pyz`` extension if you prefer a "plain" command name. On
312 ``subprocess.run(['myapp'])`` won't find your application - you need to
320 you end up with a single-file executable that runs your application.
334 LPWSTR lpCmdLine, /* pointer to command line */
351 command line tools, or you can take advantage of the fact that distutils
418 -----------------------------------------
428 zip application format uses this ability to prepend a standard POSIX "shebang"
433 1. An optional shebang line, containing the characters ``b'#!'`` followed by an
435 name can be anything acceptable to the OS "shebang" processing, or the Python
436 launcher on Windows. The interpreter should be encoded in UTF-8 on Windows,
440 in the "root" of the zipfile - i.e., it cannot be in a subdirectory). The
443 If an application archive has a shebang line, it may have the executable bit set
447 application archives - the module is a convenience, but archives in the above