Python interpreter species (reproduced from Liao Xuefeng blog)

When we write Python code we get is a Python code contained in .pya text file extension. To run the code, you need Python interpreter to execute .pythe file.

Since the whole Python language interpreter from specification to are open source, so in theory, as long as the level is high enough, anyone can write Python interpreter to execute Python code (of course, very difficult). In fact, the existence of multiple Python interpreter.

CPython

When we from Python official website after download and install Python 3.x, we have direct access to an official version of the interpreter: CPython. The interpreter is written in C language development, so called CPython. At the command line to run pythonit is to start CPython interpreter.

CPython is the most widely used Python interpreter. All the code tutorials are also executed in CPython.

IPython

IPython is based on an interactive CPython interpreter, that is to say, just IPython has been enhanced in the interactive mode, but the execution of the functions and CPython Python code is exactly the same. Like many domestic browser Although the appearance is different, but the core are actually called IE.

CPython used >>>as a prompt, and use IPython In [序号]:as a prompt.

PyPy

Python interpreter PyPy another, its goal is to speed execution. PyPy using JIT techniques , dynamic compilation of Python code (note not explained), it is possible to significantly improve the execution speed of the Python code.

Most of Python code can be run under PyPy, but CPython PyPy and some are different, which leads to the same Python code execution may have different results in the two interpreter. If you want to put under PyPy code execution, we need to understand the different points of PyPy and CPython .

Jython

Jython Python interpreter is running on the Java platform, Python code can be directly compiled into Java bytecode execution.

IronPython

IronPython and Jython similar, but IronPython Python interpreter is running on the Microsoft .Net platform, Python code can be directly translated into .Net byte code.

summary

Many Python interpreter, but the most widely used or CPython. If you want to, and interact with Java or .Net platform, the best way not using Jython or IronPython, but interact through a network calls, ensure the independence between the various programs.

Guess you like

Origin www.cnblogs.com/zhangyanlong/p/11306824.html