

May be what you want if you have not made your code Python 2 compatible).
#HTML EXECUTABLE 3.6 WINDOWS#
Launcher for Windows supports most common forms of POSIX #! line, but there Note that if you specify an interpreter and then distribute your applicationĪrchive, you need to ensure that the interpreter used is portable. It is assumed to be at the start of the archive.
#HTML EXECUTABLE 3.6 ARCHIVE#
The archive argument can be a filename or a file-like object openįor reading in bytes mode. Return the interpreter specified in the #! line at the start of theĪrchive. Passed to the zipfile.ZipFile class, and must supply the methods When creating anĪrchive from a directory, if the target is a file object it will be When copying an existing archive, file objects supplied only need If a file object is specified for source or target, it is theĬaller’s responsibility to close it after calling create_archive. Is an error to omit main if the source is a directory and does notĬontain a _main_.py file, as otherwise the resulting archive “pkg.module” and executing the given callable with no arguments. “pkg.module:callable” and the archive will be run by importing The source is a directory, and the source does not already contain a

Used as the main program for the archive. The main argument specifies the name of a callable which will be If an interpreter is specified, and the target is aįilename, the executable bit of the target file will be set. Omitting the interpreter results in no shebang line being Interpreted by the OS, and on Windows it will be handled by the Python It is written asĪ “shebang” line at the start of the archive. Interpreter with which the archive will be executed. The interpreter argument specifies the name of the Python If the target is omitted (or None), the source must be a directoryĪnd the target will be a file with the same name as the source, with.If it is an open file object, the archive will be written to thatįile object, which must be open for writing in bytes mode.The archive will be written to that file. If it is the name of a file, or a pathlb.Path object,.The target argument determines where the resulting archive will be The content of theįile should be an application archive, and the file object isĪssumed to be positioned at the start of the archive. A file object open for reading in bytes mode.The target (modifying it to reflect the value given for the interpreterĪrgument). Object referring to such a file, in which case the file is copied to The name of an existing application archive file, or a pathlib.Path.To a directory, in which case a new application archive will beĬreated from the content of that directory. The name of a directory, or a pathlib.Path object referring.create_archive ( source, target=None, interpreter=None, main=None ) ¶Ĭreate an application archive from source. The module defines two convenience functions: zipapp. This case, any other options are ignored and SOURCE must be an archive, not a info ¶ĭisplay the interpreter embedded in the archive, for diagnostic purposes. main cannot be specified when copying an archive. The _main_.py file will execute that callable.

Package/module in the archive, and “fn” is a callable in the given module. Mainfn argument should have the form “pkg.mod:fn”, where “pkg.mod” is a Write a _main_.py file to the archive that executes mainfn.

Write no #! line, and not make the file executable. Also, on POSIX, make the archive executable. p, -python = ¶Īdd a #! line to the archive specifying interpreter as the command That case, output must not be the same as source). pyz extension should be included if required).Īn output filename must be specified if the source is an archive (and in If an explicit filename is given, it is used as The output filename will be the same as the input source, with theĮxtension. The following options are understood: -o, -output = ¶ If source is a file, it should be an archive, and it will beĬopied to the target archive (or the contents of its shebang line will beĭisplayed if the –info option is specified). If source is a directory, this will create an archive from the contents of
