Converting a simple python script to a simple windows executable

geoffbache geoff.bache at jeppesen.com
Wed Jun 11 15:25:29 EDT 2008


Hi all,

I have a small python script that doesn't depend on anything except
the standard interpreter. I would like to convert it to a small .exe
file on Windows that can distributed alone without introducing
additional dependencies. I need to assume, because of other python
scripts, that anyone using this has python installed anyway so I hoped
it would be possible to do this. (Why I want to do this is a bit
involved but I can explain if necessary)

Unfortunately, it seems to be harder than it should be. I tried

(1) py2exe. This is really for when python isn't installed on the
remote user's machine, so it requires you to distribute a large amount
of DLLs etc which are part of the python installation. A bit silly
when I know that the remote user has python anyway.

(2) setuptools. This works but requires that the remote user installs
setuptools also. Something of a shame when I don't require any
installation procedure at the moment.

(3) create a small .bat file to call the python script and then try to
compile it to .exe. There are hundreds of bat2exe tools out there but
many of them seem to produce an executable that runs the script in a
separate command window, which differs from the .bat behaviour and
isn't what I want. That's not including the various freeware ones that
just fail and the large number of ones that want my money :)

Anyone have any better ideas?

Geoff Bache



More information about the Python-list mailing list