Why Python is not both an interpreter and a compiler?

Ben Finney ben+python at benfinney.id.au
Tue Sep 1 01:15:09 CEST 2015

Mahan Marwat <mahanmarwat at gmail.com> writes:

> > Python programs *could* easily be compiled the same way, but it generally  
> > hasn't been considered all that useful.
> If it hasn't been considered all that useful, then why the tools like
> cx_freeze, pytoexe are doing very hard!

Thay don't compile to machine code for the host CPU. That's the step
that “compiled the same way” refers to above, as not having been
considered all that useful.

What those tools do – compile to Python virtual machine code, and then
bundle that machine code with the virtual machine into a single
executable file – is quite useful.
 \        “Some people, when confronted with a problem, think ‘I know, |
  `\       I'll use regular expressions’. Now they have two problems.” |
_o__)                           —Jamie Zawinski, in alt.religion.emacs |
Ben Finney

More information about the Python-list mailing list