Converting a simple python script to a simple windows executable

G

geoffbache

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
 
W

William McBrine

(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.

If you know the target user has Python installed, why don't you just
distribute the .pyw file? (Use ".pyw" instead of ".py" to avoid the extra
console window.)
 
G

geoffbache

Thanks for all the suggestions. I have eventually used a heavily
edited version of ExeMaker which seems to do what I want.

Geoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top