473,382 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Batteries Included?

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
7 1908
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
"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
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
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
> 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
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
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: D. Alvarado | last post by:
Hello, I want my scripts to be warning and error free. Is it possible to check is a file has already been included as part of a "require", "require_once" or "include" call in the script? I guess...
2
by: aa | last post by:
I have an UTF-8 PHP file which generates HTML Then I cut the beginning of that file, pasted into another UTF-8 file ind included this second file into the first one. After that the whole page...
19
by: aa | last post by:
Is a PHP variable supposed to be seen in a .js file included into a .php file? I have a client side javascript code stored in a .js file which is included into a PHP file using <script...
1
by: Jan Stenberg | last post by:
I have a situation where I open a database connection in main script. Then I start a transaction, have some queries, include an another php file within some queries and then commiting queries in...
26
by: TomB | last post by:
I have a function on an "included" page. For reasons unknown to me I frequently will get an error - to the effect that the function can't be found. If I hit refresh/F5 it loads the page just...
0
by: Quinton | last post by:
I'm running a website that uses CSS to format the text and a CGI program Coranto that icludes news updates via SSI. My problem is that some parts of the CSS don't seem to take effect on the...
1
by: Larry | last post by:
Given the "includer" xml file: <?xml version="1.0"?> <test-includer xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:testns="http://www.w3.org/TR/REC-xml-names"...
3
by: John Salerno | last post by:
Pardon my naivety, you would think maybe I'd understand this by now, but I've always kind of wondered about it. I've been curious why one of the biggest points used to promote Python is that it has...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.