By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,767 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,767 IT Pros & Developers. It's quick & easy.

Converting a simple python script to a simple windows executable

P: n/a
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
Jun 27 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Jun 11, 2:25 pm, geoffbache <geoff.ba...@jeppesen.comwrote:
Anyone have any better ideas?
How about ExeMaker?

http://effbot.org/zone/exemaker.htm

I have not used it but it seems to do what you want.

....
Jay

Jun 27 '08 #2

P: n/a
On Jun 11, 9:49*pm, jay graves <jaywgra...@gmail.comwrote:
On Jun 11, 2:25 pm, geoffbache <geoff.ba...@jeppesen.comwrote:
Anyone have any better ideas?

How about ExeMaker?

http://effbot.org/zone/exemaker.htm

I have not used it but it seems to do what you want.

...
Jay
Thanks, this looks very promising! Will try out a bit more tomorrow
but I think it should work.

Regards,
Geoff
Jun 27 '08 #3

P: n/a
On Wed, 11 Jun 2008 12:25:29 -0700, geoffbache wrote:
(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.)

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
Jun 27 '08 #4

P: n/a
On Jun 12, 4:04*am, William McBrine <wmcbr...@users.sf.netwrote:
On Wed, 11 Jun 2008 12:25:29 -0700, geoffbache wrote:
(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.)

--
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 -- pass it on
I really like cx_freeze:

http://python.net/crew/atuining/cx_Freeze/
Jun 27 '08 #5

P: n/a

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

Geoff
Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.