Lines Matching +full:shebang +full:- +full:command
12 # The __main__.py used if the users specifies "-m module:fn".
13 # Note that this will always be written as UTF-8 (module and
14 # function names can be non-ASCII in Python 3).
15 # We add a coding cookie even though UTF-8 is the default in Python 3
18 # -*- coding: utf-8 -*-
24 # The Windows launcher defaults to UTF-8 when parsing shebang lines if the
25 # file has no BOM. So use UTF-8 on Windows.
28 shebang_encoding = 'utf-8'
47 """Write a shebang line."""
49 shebang = b'#!' + interpreter.encode(shebang_encoding) + b'\n'
50 f.write(shebang)
54 """Copy an application archive, modifying the shebang line."""
56 # Skip the shebang line from the source.
60 # Discard the initial 2 bytes and the rest of the shebang line.
66 # If there was no shebang, "first_2" contains the first 2 bytes
80 The SOURCE can be the name of a directory, or a filename or a file-like
84 which can be a filename or a file-like object. If SOURCE is a directory,
88 The created application archive will have a shebang line specifying
89 that it should run with INTERPRETER (there will be no shebang line if
144 z.writestr('__main__.py', main_py.encode('utf-8'))
157 """Run the zipapp command line interface.
166 parser.add_argument('--output', '-o', default=None,
169 parser.add_argument('--python', '-p', default=None,
171 "(default: no shebang line).")
172 parser.add_argument('--main', '-m', default=None,
175 parser.add_argument('--compress', '-c', action='store_true',
178 parser.add_argument('--info', default=False, action='store_true',
185 # Handle `python -m zipapp archive.pyz --info`.
196 raise SystemExit("In-place editing of archives is not supported")