Creating Python "executables" on Windows?

piet at cs.uu.nl piet at cs.uu.nl
Fri Aug 18 12:05:10 EDT 2000


>>>>> azratax at yahoo.com (Azratax) (A) writes:

A> Wow... this seems to be just what i am looking for... but how does one
A> use the standalone exe-making program?! what do i type in at a dos
A> prompt? i have no idea how to call python from comandline...

First to make it easier for you make sure the python executable is on your
PATH otherwise you will be typing C:\APPS\Python\python (or wherever your
python.exe is) every time.

Now suppose you have installer in C:\APPS\Python\installer.
And your python script is  called myprog.py.

Start a commandline, and cd to the directory where myprog.py is.

python C:\APPS\Python\installer\Simple.py myprog.py

Now you have myprog.exe, and Install_myprog.exe.

You can distribute Install_myprog.exe and when your client runs it, it
comes with a prompt in a DOS-box, and asks for a directory name. It then
unpacks a number of files in that directory, including myprog.exe.
myprog.exe can then be run from that directory.

myprog.exe needs a few additional files, so you cannot run it without
having run the Install_myprog.exe.

Install_myprog.exe isn't a flashy Windows program, so if you prefer one of
the GUI installation programs you can do thew following:

python C:\APPS\Python\installer\Standalone.py myprog.py

This generated a directory dist_myprog, that contains all the files.
I guess these are the same files that the previous Install_myprog unpacks.

Now you can use your flashy installation program to generate a flashy
setup.exe. E.g. Inno Setup and Freeman installer are free ones.

If you need additional DLL's e.g. Tkinter you have to do some more work.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list