By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,505 Members | 1,034 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,505 IT Pros & Developers. It's quick & easy.

Batteries Included?

P: n/a
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

Oct 11 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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
Oct 11 '05 #2

P: n/a
"Alex" <li*******@yahoo.se> 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 <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Oct 11 '05 #3

P: n/a
Sybren Stuvel <sy*******@YOURthirdtower.com.imagination> 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?
Oct 11 '05 #4

P: n/a
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

Oct 11 '05 #5

P: n/a
> 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

Oct 11 '05 #6

P: n/a
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
Oct 11 '05 #7

P: n/a
<en**********@ospaz.ru> 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.
Oct 11 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.