Converting a simple python script to a simple windows executable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • geoffbache

    Converting a simple python script to a simple windows executable

    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
  • jay graves

    #2
    Re: Converting a simple python script to a simple windows executable

    On Jun 11, 2:25 pm, geoffbache <geoff.ba...@je ppesen.comwrote :
    Anyone have any better ideas?
    How about ExeMaker?



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

    ....
    Jay

    Comment

    • geoffbache

      #3
      Re: Converting a simple python script to a simple windows executable

      On Jun 11, 9:49 pm, jay graves <jaywgra...@gma il.comwrote:
      On Jun 11, 2:25 pm, geoffbache <geoff.ba...@je ppesen.comwrote :
      >
      Anyone have any better ideas?
      >
      How about ExeMaker?
      >

      >
      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

      Comment

      • William McBrine

        #4
        Re: Converting a simple python script to a simple windowsexecutab le

        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

        Comment

        • Gerry

          #5
          Re: Converting a simple python script to a simple windows executable

          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:


          Comment

          • geoffbache

            #6
            Re: Converting a simple python script to a simple windows executable


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

            Geoff

            Comment

            Working...