Python, Be Bold!
Barry Scott
barry at barrys-emacs.org
Thu Jan 2 17:50:36 EST 2020
> On 2 Jan 2020, at 21:17, Abdur-Rahmaan Janhangeer <arj.python at gmail.com> wrote:
>
> On Fri, 3 Jan 2020, 01:05 Chris Angelico, <rosuav at gmail.com> wrote:
>
>>
>> They are still FAR better than trying to create a single bloated
>> executable that contains everything and magically knows how and when
>> to update itself.
>>
>
> Proposing to freeze things. You distribute a version of the program. The
> single file (not using the word executable as it seemingly leads to
> confusions) is given with the assurance that the only thing you need is an
> interpreter for it to work.
Expect for trivial programs you cannot distribute a single file python exe for windows.
As you found zipapp is not a solution.
Many stdlib modules use DLL's on Windows and you cannot run a DLL from
inside a zip file.
As soon as you have a GUI interface you have to install lots of DLLs and
the C++ runtime. The only easy way to support users is by using a
windows installer. I use inno installer for windows which is a very powerful
tool, https://www.jrsoftware.org/isinfo.php <https://www.jrsoftware.org/isinfo.php>. And I create the windows app
with https://pypi.org/project/win-app-packager/ <https://pypi.org/project/win-app-packager/> (I'm the author).
The situation for the Mac requires you to create a .app bundle.
The way these are distributed is as a compressed .dmg file.
I use py2app and dmgbuild to get the job done on macOS.
As Chris noted its easier on Linux systems. You can make a package
(.deb or .rpm) that uses the already packaged python code and libraries.
There are excellent solutions that have existed for many years to
package python apps for Windows, macOS and Linux. On Windows
and macOS it is necessary to install python, you just bundle it inside the
app.
I support two apps on Windows, macOS and unix that does exactly this.
http://barrys-emacs.org <http://barrys-emacs.org/> and http://http://scm-workbench.barrys-emacs.org/ <http://http//scm-workbench.barrys-emacs.org/>
For command line tools pip knows how to install a .exe for Windows that
runs the tool. On macOS and linux its creates a small boot strap script.
As an example see my https://pypi.org/project/colour-text/ <https://pypi.org/project/colour-text/> project
that installs the colour-print command.
All the code for the above is open source and you can read the code
used to build the install kits.
Barry
> --
> https://mail.python.org/mailman/listinfo/python-list
>
More information about the Python-list
mailing list