Batteries Included?

Discussion in 'Python' started by Alex, Oct 11, 2005.

  1. Alex

    Alex Guest

    One of the first things I wanted to do when I start learning Python was
    to produce a simple standalone application that I could distribute to
    my users (windows users). Python's moto is "Batteries Included", but
    where are the batteries for making exe files and making an installer
    file? I had to download, install and use py2exe and Inno Setup in order
    to accomplish this. I might be wrong expecting that a language whose
    moto is "Batteries Included" would be able to produce exe files. Are
    there plans to do this in the future version of Python?

    Alex
     
    Alex, Oct 11, 2005
    #1
    1. Advertising

  2. Alex enlightened us with:
    > Python's moto is "Batteries Included", but where are the batteries
    > for making exe files and making an installer file?


    Those aren't "batteries". Those are things you can do with the
    program, but are outside the programming language. Writing and
    distributing software is one thing. Converting them to a
    platform-specific executable is another.

    > I had to download, install and use py2exe and Inno Setup in order to
    > accomplish this.


    Well done.

    > I might be wrong expecting that a language whose moto is "Batteries
    > Included" would be able to produce exe files.


    Indeed, you're wrong. Why would such an ability be included in Python?
    It's a cross platform language. What need would Mac, Linux, BSD,
    Solaris etc. users have for such a feature? And why would it have to
    be included, when there is an easy solution just around the corner?
    You prooved that it was easy enough to install and use by someone who
    just learned Python. I really don't see the problem here.

    > Are there plans to do this in the future version of Python?


    I doubt it.

    Sybren
    --
    The problem with the world is stupidity. Not saying there should be a
    capital punishment for stupidity, but why don't we just take the
    safety labels off of everything and let the problem solve itself?
    Frank Zappa
     
    Sybren Stuvel, Oct 11, 2005
    #2
    1. Advertising

  3. Alex

    Mike Meyer Guest

    "Alex" <> writes:

    > One of the first things I wanted to do when I start learning Python was
    > to produce a simple standalone application that I could distribute to
    > my users (windows users). Python's moto is "Batteries Included", but
    > where are the batteries for making exe files and making an installer
    > file? I had to download, install and use py2exe and Inno Setup in order
    > to accomplish this. I might be wrong expecting that a language whose
    > moto is "Batteries Included" would be able to produce exe files. Are
    > there plans to do this in the future version of Python?


    Did you try looking through the distutils docs? After you create a
    setup.py file for you program, doing

    "python setup.py bdist --formats=wininst"

    should do the trick.

    Of course, I don't own a Windows box, so I can't check it, but when I
    ask a setup file for help on formats, it tells me the wininst format
    is a windows installer.

    Personally, I think of building a platform-specific bundle for
    distribution to end users as more along the lines of shipping than
    batteries. Python comes with lots of tools to help you get your
    application working - the batteries. Once it's working, you don't need
    batteries: you need wrapping paper, and a box, and tape, and so on.

    <mike
    --
    Mike Meyer <> http://www.mired.org/home/mwm/
    Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
     
    Mike Meyer, Oct 11, 2005
    #3
  4. Alex

    Paul Rubin Guest

    Sybren Stuvel <> writes:
    > > I might be wrong expecting that a language whose moto is "Batteries
    > > Included" would be able to produce exe files.

    >
    > Indeed, you're wrong. Why would such an ability be included in Python?


    distutils.exe, included in Python, in fact does have the ability to
    produce .exe files, just not completely general ones.

    > It's a cross platform language. What need would Mac, Linux, BSD,
    > Solaris etc. users have for such a feature?


    The same need that they have for msvcrt, winreg, winsound, or the SGI
    IRIX specific functions currently in the library. The same need that
    Windows users have for the Unix specific parts which are in the
    library. The same need that non-numeric programmers have for the
    cmath module, which is also in the library.

    > And why would it have to be included, when there is an easy solution
    > just around the corner? You prooved that it was easy enough to
    > install and use by someone who just learned Python. I really don't
    > see the problem here.


    Um, if the TV ad for some Walkman says "batteries included" and the
    batteries aren't included, you have legitimate reason to ask what's
    going on. That it's easy enough for you to go to the store and buy
    batteries separately is irrelevant. You didn't get what was
    advertised.

    Now a Windows .exe installer wasn't one of the advertised features of
    Python and maybe there's good reasons to leave it out, but its
    platform specificness is not one of those reasons. There's already
    plenty of platform specific stuff in Python.

    Personally I think including a .exe packager in Python would be a
    great idea. As a Linux user I can't easily run Windows-specific
    utilities like Inno Setup. So I don't have a good way to make .exe's
    from my Python code that Windows users can easily run. Having a cross
    platform .exe packager included with Python would be useful the same
    way cross compilers are useful. I'm using an x86 computer but I can
    easily configure gcc to produce ARM code. Why shouldn't my Linux
    Python installation be able to produce Windows .exe's?
     
    Paul Rubin, Oct 11, 2005
    #4
  5. Mike Meyer:
    > After you create a setup.py file for you program, doing
    >
    > "python setup.py bdist --formats=wininst"
    >
    > should do the trick.
    >
    > Of course, I don't own a Windows box, so I can't check it, but when I
    > ask a setup file for help on formats, it tells me the wininst format
    > is a windows installer.


    I can confirm that it works (for pure Python applications), since I did
    it.

    Michele Simionato
     
    Michele Simionato, Oct 11, 2005
    #5
  6. > I might be wrong expecting that a language whose
    > moto is "Batteries Included" would be able to produce exe files. Are
    > there plans to do this in the future version of Python?


    Yes, you are wrong expecting that. Creating an exe-cutable is windows
    specific and python _tries_ to be platform neutral. py2exe - a wonderful
    tool which I use myself - is a battery on the shelves. It can be easily
    picked from there.

    Furthermore it is not Python's philosophy to create "exe-cutables". But I
    do understand your wish (being a Windows Developper at work myself) and
    Python is not a matter of course within Windows.

    Your best bet is ActiveState which bundles a windows specific version. Ask
    them, maybe they are willing to include it. Python should refrain from
    doing so.

    Before overloading the "included batteries" an approach as found in Perl
    (CPAN) should be adapted... eg.
    http://peak.telecommunity.com/DevCenter/EasyInstall

    Have a nice day,
    Marco
     
    Marco Aschwanden, Oct 11, 2005
    #6
  7. Alex

    Guest Guest

    On 11 Oct 2005 00:10:01 -0700
    Paul Rubin wrote:

    > Personally I think including a .exe packager in Python would be a
    > great idea. As a Linux user I can't easily run Windows-specific
    > utilities like Inno Setup. So I don't have a good way to make .exe's
    > from my Python code that Windows users can easily run. Having a cross
    > platform .exe packager included with Python would be useful the same
    > way cross compilers are useful. I'm using an x86 computer but I can
    > easily configure gcc to produce ARM code. Why shouldn't my Linux
    > Python installation be able to produce Windows .exe's?


    Because you can't run it yourself? If you cannot run the freshly-made exe
    yourself, why would you want to distrubute it, without even trying? But if
    you can, then you can run the InnoSetup as well.

    But, for me, I don't care whether such an option will be included or not. I
    won't object anyway.

    --
    jk
     
    Guest, Oct 11, 2005
    #7
  8. Alex

    Paul Rubin Guest

    <> writes:
    > Because you can't run it yourself? If you cannot run the
    > freshly-made exe yourself, why would you want to distrubute it,
    > without even trying? But if you can, then you can run the InnoSetup
    > as well.


    Obviously I'd want someone to test the .exe before putting it in wide
    distribution. That doesn't solve the problem of how to make the .exe.
     
    Paul Rubin, Oct 11, 2005
    #8
    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. Michael
    Replies:
    2
    Views:
    530
    J├╝rgen Exner
    Sep 15, 2004
  2. Brent Burkart
    Replies:
    0
    Views:
    271
    Brent Burkart
    Aug 26, 2003
  3. John Salerno

    the whole 'batteries included' idea

    John Salerno, Apr 20, 2006, in forum: Python
    Replies:
    3
    Views:
    261
    Ben Sizer
    Apr 21, 2006
  4. batteries included

    , Oct 25, 2006, in forum: Python
    Replies:
    1
    Views:
    259
    Diez B. Roggisch
    Oct 25, 2006
  5. Stefan Behnel

    Re: Fixing the XML batteries

    Stefan Behnel, Dec 13, 2011, in forum: Python
    Replies:
    4
    Views:
    215
Loading...

Share This Page