[Tutor] why doesn't python show error
Steven D'Aprano
steve at pearwood.info
Mon Nov 28 11:54:14 CET 2011
surya k wrote:
> Thanks for that information. I understood what you are saying but in general when python doesn't give us executable files (whether its in Mac/ Linux/ Windows).. how could people develop programs ?.
> At some point of time people need to provide a file that runs without the help of a python interpreter..
Why?
Perl, Javascript, PHP, Flash, Java, shell scripts, .Net, VisualBasic, and
hundreds of other languages have been successful for decades, and they all
require either an interpreter or a runtime environment, or both, to work.
Why should Python be treated any differently?
If you want to include a Python runtime environment with your code, either
include a version of Python, or use py2exe to wrap the Python runtime
environment and your code into a single executable.
Unless you are writing device drivers for hardware, or operating system
kernels, or a few other applications, compiling to machine code is of limited
value. And even where compiling to machine code is useful, it is often better
to use a Just In Time compiler that compiles the code when it is run, so it
can take advantage of runtime information about the data. A good JIT compiler
can often beat a static compiler for speed.
--
Steven
More information about the Tutor
mailing list