How to make an executable file

Ben Finney bignose-hates-spam at
Wed Jun 18 03:06:49 CEST 2003

On 17 Jun 2003 17:48:38 -0700, Syed Ahmed Shah wrote:
> I am a begineer.

Welcome.  Is that like an engineer?  :-)

> I know how a C++ compiler makes an executable file from the source
> code, which you can run anywhere, independent of the Compiler. 

An important difference is that the executable file can *not* be run
"anywhere", but only in environments specifically targeted by the
compiler.  Python scripts, on the other hand, can be run unmodified in
any environment where Python is available.

> But how does one do it in Python. Is it necessary to have the Python
> interpreter in the machine to run an application written in Python.

Yes, Python is required to run your Python programs.  It is possible to
bundle the whole Python environment in with the script and distribute
that as a binary executable, but the result is far larger than the
script itself, and still needs to be installed, and *still* only works
on environments specifically targeted by whatever builds that binary

Far simpler is to give instructions on how to install Python; this needs
to be done only once, then any Python program can be run whether or not
it is distributed targeted for the specific platform the user is

 \           "An eye for an eye would make the whole world blind."  -- |
  `\                                                    Mahatma Gandhi |
_o__)                                                                  | 9CFE12B0 791A4267 887F520C B7AC2E51 BD41714B

More information about the Python-list mailing list