[Tutor] tutor@python.org

Kirby Urner urnerk@qwest.net
Sun, 5 May 2002 19:55:49 -0400


On Sunday 05 May 2002 06:35 pm, cmelik igor wrote:
> HI all. I traying to learn to programing, from all
> program leanguies PYTHON look like easy one....BUT in
> all other programs is easy to make exe file. same with
> aplication .
>    in all tutorials i can,t find a way to .....compile
> files
>    or what ever i must doo to make file who is
> independent from python.
>   Please i nead somme simple answer .

Yes, I agree with Danny, that making an EXE is not required.

In Windows, we create standalone files with the .exe extension=20
which are actually depending on interpreters.  For example,
Visual FoxPro (VFP) compiles exe files, but you need to=20
distruibute more than 3 meg of auxilliary runtime DLLs to provide
the interpreter.  Likewise, Visual Basic (VB) has large runtime
DLLs.  Java requires a large installation (the Java VM, part
of Java Runtime), as does C, but many of the C libraries are=20
already part of Windows (written in C), so you don't always=20
think about them.  And yes, C is a compiled language, meaning
you have straight binaries, distributable independently of=20
source code (the whole basis of the closed source economy).

In the GNU/Linux world, where Python makes its original home,
executables are not signified with a specific suffix, the .exe=20
file extension.  Rather, it is an attribute of the file, independent=20
of the file name, and if the source code needs an interpreter,
such as bash, perl, or python, this is indicated in the top line
using "bang notation".  The most used interpreters, including=20
Python by now, are expected components of the user space. =20
One simply presumes that other users already have it.

As we learned recently on this list, at least one Windows OEM,
Hewlett-Packard, is including some version of Python in its=20
default Windows distro.  This trend is probably contagious, and
in future you may expect your target Windows platform to already
have Python installed (just as you have a browser, with built-in
support for JavaScript, also interpreted).  It's a logical thing to=20
have, given the cross-platform nature of the language. =20

In that case, you simply expect a file association between=20
=2Epy, .pyc, .pyd and .pyw  files and the interpreter, as mediated=20
by Windows which keeps a registry of such associations=20
(instead of using the Unix bang notation inside the source=20
code itself).

Note that if you're anxious to distribute Python "binaries" that
aren't source code, you may share .pyc files without the .py=20
files.  This is not typical in the Python community, but it=20
certainly may be done, if you're not wanting to share source
code.

Kirby