[Python-Dev] Computed Goto dispatch for Python 2
Steve Dower
Steve.Dower at microsoft.com
Thu May 28 16:55:05 CEST 2015
Donald Stufft wrote:
> I think docker is a pretty crummy answer to Go’s static binaries. What I would
> love is for Python to get:
>
> * The ability to import .so modules via zipzimport (ideally without a temporary
> directory, but that might require newer APIs from libc and such).
> * The ability to create a “static” Python that links everything it needs into
> the binary to do a zipimport of everything else (including the stdlib).
> * The ability to execute a zipfile that has been concat onto the end of the
> Python binary.
>
> I think that if we get all of that, we could easily create a single file
> executable with real, native support from Python by simply compiling Python in
> that static mode and then appending a zip file containing the standard library
> and any other distributions we need to the end of it.
And it would look like a 20MB+ file just for a simple 1KB Python script...
For Windows at least, I'd prefer to have some app-style installer generation (e.g. http://pynsist.readthedocs.org/en/latest/) which, combined with the embeddable Python distro (new for 3.5.0b1 in case anyone missed it), can simply extract everything into an install directory and run it from there. None of the items on the list above are needed for or would help with this.
(Some other Windows-specific advantages of the latter - installers get special compatibility treatment when the OS does stuff to break them, modifying official Python binaries breaks the signatures, signed executables are fully scanned before running (slow if the file is big), IT departments know how to deal with installers and users know how to deal with installed binaries, and probably more.)
Alright everyone, back on topic now unless you want to rename the thread :)
Cheers,
Steve
More information about the Python-Dev
mailing list