Creating Python "executables" on Windows?

Alex Martelli alex at magenta.com
Thu Aug 17 04:11:54 EDT 2000


"Azratax" <azratax at yahoo.com> wrote in message
news:ydJm5.7926$pu4.609221 at typhoon.ne.mediaone.net...
> In article <uog2sokf3.fsf at ctwd0143.fitlinxx.com>, David Bolen
<db3l at fitlinxx.com> wrote:
> >Alan Miller <ajm at enteract.com> writes:
> >
> >> I've also not seen any mention of Gordon McMillan's Installer, which
> >> bundles a Python program, the modules it uses (determined recursively)
> >> and the core Python files and bundles them all together into a .EXE
file.
> >> I've found it to work quite nicely.
> >
> >Yep (also on http://www.mcmillan-inc.com/install1.html), and the
> >'standalone' output from that tool, combined with a free Windows
> >installation program like Inno Setup (http://www.jrsoftware.org) works
> >pretty darn well to make a Python script install and look just like a
> >normal piece of Windows distribution.
> >
> Wow... this seems to be just what i am looking for... but how does one use
the
> standalone exe-making program?! what do i type in at a dos prompt? i have
no
> idea how to call python from comandline...

May I respectfully suggest that you invest a modicum of
time in getting some elementary Python basics, before you
worry about the fine details of packaging and deployment
of the Python applications you will eventually develop?

Those fine details will be much easier once you do have
such basics.  Now that you know it's quite possible, and
in fact pretty easy, to package and deploy Python scripts
to user machines, trying to cross the i's and dot the t's
(:-) of how one does that, right now, may not be the best
current investment for your time and energy.

To call Python from a command line, you need to have the
appropriate directory in your PATH variable.  There are
several ways to achieve that, depending on whether you
are on Windows/NT (best on NT is probably to use the
Start/Settings/Control Panel/System applet, Environment
tag), Windows/95 (best on '95 is probably to edit your
Autoexec.Bat), Linux or other Unixalike, etc, etc.


Once you're able to achieve this simple effect:

C:\>python -c "print 'hello, world'"
hello, world

C:\>

then downloading McMillan's excellent Installer and
studying up on it may be the next step (although I
still would suggest you invest more on getting Python
to do what you desire, and only later worry about how
best to package and deploy the solutions you develop;
it does make a substantial difference to best packaging
strategy, whether you want to use Tk, or some other
GUI, for example).  You may choose several strategies,
and the best one is probably, as Alan suggests, to
use Standalone.py to build the exe + the subdirectory
of dependencies, then a dedicated install-application
(there are several free ones -- and nobody except you
can examine them and determine which one you like best)
to package up that exe-and-subdirectory for deployment.


Alex






More information about the Python-list mailing list