Distributing python applications as a zip file

Chris Rebert clp2 at rebertia.com
Wed Jul 23 01:46:18 EDT 2014


On Tue, Jul 22, 2014 at 9:23 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> A little known feature of Python: you can wrap your Python application in
> a zip file and distribute it as a single file. The trick to make it
> runnable is to put your main function inside a file called __main__.py
> inside the zip file.
<snip>
> It's not quite self-contained, as you still need to have Python
> installed, but otherwise it's a good way to distribute a Python
> application as a single file that users can just copy and run.

And if you want something nearly completely self-contained (probably
modulo dynamic linking), it seems that there's PEX
(http://pex.readthedocs.org/en/latest/ ).

Cheers,
Chris



More information about the Python-list mailing list