[Tutor] Tutor Digest, Vol 40, Issue 54

Luke Paireepinart rabidpoobear at gmail.com
Sat Jun 23 20:25:13 CEST 2007

Che M wrote:
> regarding making an executable file from a python file, Alan Gauld said:
>> Assuming you are on Windows you can use py2exe but
>> its non trivial to use. (Not hard, just not trivial)
>> But first ask why you need to.
>> I've been using Python for over 10 years now and never once needed
>> to do this. (I did it once just to see how, but I've never *needed* to
>> do it)
>> Once Python is installed you can run any script by just double
>> clicking in explorer.
>> And you can build installers that will install python if its not
>> already there and then add your script. There are few cases
>> where you really need an exe file. IMHO.
> Though, yes, you never need to, perhaps you might *want* to, for reasons of 
> "marketability".  For example...if I want to make an application for 
> distribution to others, either for sale or as freeware, and I use the 
> installers option as you mentioned, it is only proper to indicate this to 
> the end user, such as, "In installing this application, the Python 
> programming language and some other libraries will also be installed on your 
> computer."
And what about all the commercial applications that require you to 
install the .NET framework, or Java, to work?
Or games that require DirectX?
People don't have problems with these.
As far as I'm concerned, I'd rather have 45k of source plus the data 
files, than an extra 10mb for Python that I already have installed.
Game downloads don't include DirectX for this reason - it's an extra 100 
megs when most people will have it,
or will have it after they play their first game.  So they put DirectX 
on the CD, and in the game install,
they ask you if you'd like to download and install DirectX if you don't 
have it already.
That's how I think python installs should work.
Just have a little check box that says "Download and install Python if 
you don't have x version or later installed."
That's not any more intrusive than these other applications that force 
you to install stuff.
In fact, it's less intrusive than .NET applications.  It takes forever 
to install the .NET framework,
and I have to navigate through web pages on microsoft.com just to find it!
> But that might trigger a common psychological response from the user, "Oh, 
> no, not a whole complex set of things installed on my computer that I don't 
> understand, have never heard of, and will only need for this one 
> application"
So add it to the 'custom' install path, and on the 'default' install 
path, just scan for Python and install it automatically for them
if they don't already have it.  Applications do this all the time.
>   But downloading a single .exe file and maybe a small folder of 
> images or a few .dll files doesn't conjure that sense.
That's essentially what the Python install is - some exes and some 
folders, that the end user never needs to look inside.
>   If I understand it 
> right, the .exe has Python bundled into it anyway, so such an end user's 
> response isn't strictly rational, but you can see how people might feel this 
> way in an age when there are so many ways one should mistrust software.
Of course you have a valid point - but only because of other people's 
> Another reason is that, as I understand it, making it an .exe obscures the 
> code (at least enough to make it take a bit more work to reveal the code).  
> For some this might be a benefit?
That's not how py2exe works.  It makes an exe and a library.zip that 
contains all the python code.
so one could simply extract the code from library.zip and use it that way.
And you might say 'well, the code can be byte-compiled to make it more 
Sure, you could do that.  You could also do that without py2exe'ing it.
I believe py2app or pyinstaller or something like that actually includes 
your code in the .exe,
but py2exe doesn't.
> I may be way off base here, just throwing it out as something I've wondered 
> about.
No, everyone thinks about this stuff whenever they consider if they 
should make .exe versions.
Personally, I find in most cases it's just a waste of bandwidth and time 
to make .exe versions.
But then, I haven't sold anything I've written yet, and my target 
audience is usually other programmers.

Honestly, though, Python's easy and quick to install, especially 
compared to Java.
I don't think it should be a big deal.

This sort of thing has to be taken on a case by case basis - determining 
who's the user base,
their level of technical knowledge, their aversion to installers 
including things they've never heard of,
things like this.

> _________________________________________________________________
> Get a preview of Live Earth, the hottest event this summer - only on MSN 
> http://liveearth.msn.com?source=msntaglineliveearthhm
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

More information about the Tutor mailing list