Converting a simple python script to a simple windows executable

Discussion in 'Python' started by geoffbache, Jun 11, 2008.

  1. geoffbache

    geoffbache Guest

    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
     
    geoffbache, Jun 11, 2008
    #1
    1. Advertising

  2. geoffbache

    jay graves Guest

    On Jun 11, 2:25 pm, geoffbache <> 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
     
    jay graves, Jun 11, 2008
    #2
    1. Advertising

  3. geoffbache

    geoffbache Guest

    On Jun 11, 9:49 pm, jay graves <> wrote:
    > On Jun 11, 2:25 pm, geoffbache <> 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
     
    geoffbache, Jun 11, 2008
    #3
  4. Re: Converting a simple python script to a simple windowsexecutable

    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
     
    William McBrine, Jun 12, 2008
    #4
  5. geoffbache

    Gerry Guest

    On Jun 12, 4:04 am, William McBrine <> 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/
     
    Gerry, Jun 12, 2008
    #5
  6. geoffbache

    geoffbache Guest

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

    Geoff
     
    geoffbache, Jun 13, 2008
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    15
    Views:
    491
    Dave Thompson
    Aug 21, 2006
  2. pratap
    Replies:
    20
    Views:
    761
    Flash Gordon
    Mar 7, 2007
  3. Jason Cavett
    Replies:
    8
    Views:
    623
    Sanjay
    May 16, 2007
  4. Replies:
    0
    Views:
    444
  5. Prakash
    Replies:
    3
    Views:
    267
    Ulrich Eckhardt
    Nov 28, 2012
Loading...

Share This Page