Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Batteries Included?

Reply
Thread Tools

Batteries Included?

 
 
Alex
Guest
Posts: n/a
 
      10-11-2005
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

 
Reply With Quote
 
 
 
 
Sybren Stuvel
Guest
Posts: n/a
 
      10-11-2005
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
 
Reply With Quote
 
 
 
 
Mike Meyer
Guest
Posts: n/a
 
      10-11-2005
"Alex" <(E-Mail Removed)> 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 <(E-Mail Removed)> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
 
Reply With Quote
 
Paul Rubin
Guest
Posts: n/a
 
      10-11-2005
Sybren Stuvel <(E-Mail Removed)> 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?
 
Reply With Quote
 
Michele Simionato
Guest
Posts: n/a
 
      10-11-2005
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

 
Reply With Quote
 
Marco Aschwanden
Guest
Posts: n/a
 
      10-11-2005
> 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

 
Reply With Quote
 
Guest
Posts: n/a
 
      10-11-2005
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
 
Reply With Quote
 
Paul Rubin
Guest
Posts: n/a
 
      10-11-2005
<(E-Mail Removed)> 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.
 
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
Batteries Charger VS Batteries capacity boulay.patrick@gmail.com Digital Photography 15 11-25-2006 05:42 AM
Batteries John Turner Computer Support 12 08-20-2004 10:01 PM
Charging your batteries Scottie Computer Support 4 05-28-2004 09:43 PM
batteries reid decker Computer Support 12 04-23-2004 07:45 AM
Recharging Batteries AK Computer Support 12 11-09-2003 05:32 PM



Advertisments