Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Converting a simple python script to a simple windows executable

Reply
Thread Tools

Converting a simple python script to a simple windows executable

 
 
geoffbache
Guest
Posts: n/a
 
      06-11-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
 
Reply With Quote
 
 
 
 
jay graves
Guest
Posts: n/a
 
      06-11-2008
On Jun 11, 2:25 pm, geoffbache <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
 
 
 
geoffbache
Guest
Posts: n/a
 
      06-11-2008
On Jun 11, 9:49*pm, jay graves <(E-Mail Removed)> wrote:
> On Jun 11, 2:25 pm, geoffbache <(E-Mail Removed)> wrote:
>
> > 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
 
Reply With Quote
 
William McBrine
Guest
Posts: n/a
 
      06-12-2008
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
 
Reply With Quote
 
Gerry
Guest
Posts: n/a
 
      06-12-2008
On Jun 12, 4:04*am, William McBrine <(E-Mail Removed)> wrote:
> 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/
 
Reply With Quote
 
geoffbache
Guest
Posts: n/a
 
      06-13-2008

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

Geoff
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create an executable from python script in windows Prakash Python 3 11-28-2012 10:05 AM
Create executable from executable with py2exe vedrandekovic@gmail.com Python 0 03-29-2008 12:23 PM
Running an Executable Before Executable JAR Jason Cavett Java 8 05-16-2007 07:14 PM
what is fast dynamically linked executable or statically linked executable ?how to decide? pratap C Programming 20 03-07-2007 04:46 AM
How can I run a c executable in pwd ,while the executable is in some other directory vishsid3@gmail.com C Programming 15 08-21-2006 06:04 AM



Advertisments