[Tutor] Recommended Python Compiler

Ben Finney ben+python at benfinney.id.au
Sun Jul 30 22:24:32 EDT 2017


George Sconyers via Tutor <tutor at python.org> writes:

> Hello all. I am getting started with Python and looking for a
> recommended compiler for an Ubuntu environment.

Python comes with a compiler: it is the ‘python’ command, which compiles
your program code ‘foo.py’ to a bytecode file, typically ‘foo.pyc’.

You might be looking for a different compiler, maybe one which compiles
not to Python byte code but instead to CPU machine code. There isn't
such a thing; running your compiled Python code typically requires a
Python interpreter.

(Yes, Python is both compiled *and* interpreted, in separate steps.
Those steps are typically done automatically behind the scenes, but they
are separate.)

You can find programs which will take your compiled bytecode, along with
a Python interpreter, and bundle them into a single executable file. Is
that what you're asking for?

-- 
 \         “Truth would quickly cease to become stranger than fiction, |
  `\                     once we got as used to it.” —Henry L. Mencken |
_o__)                                                                  |
Ben Finney



More information about the Tutor mailing list