[python-win32] python-win32 Digest, Vol 142, Issue 5

Michael Watson michaelwtsn4 at gmail.com
Tue Jan 6 19:38:14 CET 2015


I am giving a pretty simple overview of how to use InnoSetup and py2exe to
distribute Python apps at PyTennessee.

https://www.pytennessee.org/proposals/114/

You can use the bundle_files option (mentioned above) to cut down the
number of additional files, then use InnoSetup to package everything
together into a single .msi for distribution (there will still be 3 files
once installed).

On Tue, Jan 6, 2015 at 12:30 PM, <python-win32-request at python.org> wrote:

> Send python-win32 mailing list submissions to
>         python-win32 at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.python.org/mailman/listinfo/python-win32
> or, via email, send a message with subject or body 'help' to
>         python-win32-request at python.org
>
> You can reach the person managing the list at
>         python-win32-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of python-win32 digest..."
>
>
> Today's Topics:
>
>    1. Re: Creating standalone executable (Zachary Turner)
>    2. Re: Creating standalone executable (Harald Armin Massa[legacy])
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 06 Jan 2015 17:22:57 +0000
> From: Zachary Turner <zturner at google.com>
> To: John Sampson <jrs.idx at ntlworld.com>, python foro
>         <python-win32 at python.org>
> Subject: Re: [python-win32] Creating standalone executable
> Message-ID:
>         <
> CAAErz9hVH0mi+DsN250eY3jtqbUUGx4RnjNfJrcPiLn9ZJ2wxA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Never used it before, so take this with a grain of salt, but try this:
> http://nuitka.net/pages/overview.html   AFAIK it's still not considered a
> stable release, but it might be worth checking out.
>
> On Tue Jan 06 2015 at 9:00:02 AM John Sampson <jrs.idx at ntlworld.com>
> wrote:
>
> >  I tried py2exe but the executable file has to be in a specific folder
> > along with many other files that py2exe generates. It therefore cannot be
> > placed in any folder.
> > As far as I can see cx-freeze produces a folder, not a single file.
> >
> > I am looking for a way of producing a single executable file that can be
> > run in any folder, and nothing else - that is, standalone.
> >
> > Regards
> >
> >
> > John Sampson
> >
> >
> > On 06/01/2015 13:07, Graeme Glass wrote:
> >
> > Yes it is.
> >
> >  http://www.py2exe.org/
> >  http://cx-freeze.sourceforge.net/
> >
> >
> >
> > On 6 January 2015 at 14:50, John Sampson <jrs.idx at ntlworld.com> wrote:
> >
> >> Is it possible to create a standalone executable (.EXE file) from a
> >> Python script?
> >>
> >> By 'standalone' I mean an executable file that can be placed in any
> >> folder and contains or finds the libraries, modules etc. that it
> depends on.
> >>
> >> Regards
> >>
> >> John Sampson
> >> _______________________________________________
> >> python-win32 mailing list
> >> python-win32 at python.org
> >> https://mail.python.org/mailman/listinfo/python-win32
> >>
> >
> >
> >  _______________________________________________
> > python-win32 mailing list
> > python-win32 at python.org
> > https://mail.python.org/mailman/listinfo/python-win32
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mail.python.org/pipermail/python-win32/attachments/20150106/47e43b52/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Tue, 6 Jan 2015 18:24:43 +0100
> From: "Harald Armin Massa[legacy]" <haraldarminmassa at gmail.com>
> To: "Harald Armin Massa[legacy]" <haraldarminmassa at gmail.com>
> Cc: python foro <python-win32 at python.org>
> Subject: Re: [python-win32] Creating standalone executable
> Message-ID:
>         <CAMSP2L441-C7oNB=g0w1uaoRWO6rHtz=
> dZRjbMnnXp9fYA6caA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> John,
>
> you should read under
>
> http://www.py2exe.org/index.cgi/SingleFileExecutable
>
>    1 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_1
> >
> from distutils.core import setup   2
> <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_2
> >
> import py2exe, sys, os   3
> <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_3
> >
>    4 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_4
> >
> sys.argv.append('py2exe')   5
> <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_5
> >
>    6 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_6
> >
> setup(   7 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_7
> >
>     options = {'py2exe': {'bundle_files': 1}},   8
> <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_8
> >
>     windows = [{'script': "single.py"}],   9
> <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_9
> >
>     zipfile = None,  10
> <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_10
> >
> )
>
>
> the documented secret lies with the bundle_files option.
>
> This way you will get down to 1-3 files:
>
> 1.) the singe file exe containing Python, your programm and the depending
> libraries
> 2.) 2 files from the Microsoft C-runtime.
>
> on recent Windows usually those C-Runtimes are present. To get them mangled
> into the single exe-file there is no ready made tool available; and the
> majority agrees that those libraries would not be licenced for this usage
> (they are licenced for redistribution).
>
> best wishes,
>
> Harald
>
>
>
> 2015-01-06 18:22 GMT+01:00 Harald Armin Massa[legacy] <
> haraldarminmassa at gmail.com>:
>
> > John,
> >
> > you should read under
> >
> > http://www.py2exe.org/index.cgi/SingleFileExecutable
> >
> >    1 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_1>
> from distutils.core import setup   2 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_2>
> import py2exe, sys, os   3 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_3>
>   4 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_4>
> sys.argv.append('py2exe')   5 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_5>
>   6 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_6>
> setup(   7 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_7>
>    options = {'py2exe': {'bundle_files': 1}},   8 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_8>
>    windows = [{'
>  script': "single.py"}],   9 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_9>
>    zipfile = None,  10 <
> http://www.py2exe.org/index.cgi/SingleFileExecutable#CA-7615755cbd8c1a2a3a7d2b593a265f3ed4c42c76_10>
> )
> >
> >
> > the documented secret lies with the bundle_files option.
> >
> > This way you will get down to 1-3 files:
> >
> > 1.) the singe file exe containing Python, your programm and the depending
> > libraries
> > 2.) 2 files from the Microsoft C-runtime.
> >
> > 2015-01-06 17:59 GMT+01:00 John Sampson <jrs.idx at ntlworld.com>:
> >
> >>  I tried py2exe but the executable file has to be in a specific folder
> >> along with many other files that py2exe generates. It therefore cannot
> be
> >> placed in any folder.
> >> As far as I can see cx-freeze produces a folder, not a single file.
> >>
> >> I am looking for a way of producing a single executable file that can be
> >> run in any folder, and nothing else - that is, standalone.
> >>
> >> Regards
> >>
> >> John Sampson
> >>
> >>
> >> On 06/01/2015 13:07, Graeme Glass wrote:
> >>
> >> Yes it is.
> >>
> >>  http://www.py2exe.org/
> >>  http://cx-freeze.sourceforge.net/
> >>
> >>
> >>
> >> On 6 January 2015 at 14:50, John Sampson <jrs.idx at ntlworld.com> wrote:
> >>
> >>> Is it possible to create a standalone executable (.EXE file) from a
> >>> Python script?
> >>>
> >>> By 'standalone' I mean an executable file that can be placed in any
> >>> folder and contains or finds the libraries, modules etc. that it
> depends on.
> >>>
> >>> Regards
> >>>
> >>> John Sampson
> >>> _______________________________________________
> >>> python-win32 mailing list
> >>> python-win32 at python.org
> >>> https://mail.python.org/mailman/listinfo/python-win32
> >>>
> >>
> >>
> >>
> >> _______________________________________________
> >> python-win32 mailing list
> >> python-win32 at python.org
> >> https://mail.python.org/mailman/listinfo/python-win32
> >>
> >>
> >
> >
> > --
> > LightningTalkMan
> > a brand of GHUM GmbH
> > Spielberger Stra?e 49
> > 70435 Stuttgart
> > 0173/9409607
> >
> >
>
>
> --
> LightningTalkMan
> a brand of GHUM GmbH
> Spielberger Stra?e 49
> 70435 Stuttgart
> 0173/9409607
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mail.python.org/pipermail/python-win32/attachments/20150106/2765367c/attachment.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
>
> ------------------------------
>
> End of python-win32 Digest, Vol 142, Issue 5
> ********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20150106/ad06b29a/attachment-0001.html>


More information about the python-win32 mailing list