CPython是什么


CPython是特指C语言实现的Python,
Python有Jython,就是Java版的Python,PyPy使用Python再把Python实现了一遍

Python官方CPython的说明
CPython is Guido van Rossum's reference version of the Python computing language.
It's most often called simply “Python”;
speakers say “CPython” generally to distinguish it explicitly from other implementations.

Python代码是一个包含Python代码的以.py为扩展名的文本文件,Python解释器执行.py文件,
Python语言从规范到解释器都是开源的,只要水平够高,任何人都可以编写Python解释器来执行Python代码

CPython
从Python官方网站下载并安装好Python,官方版本的解释器CPython
这个解释器是用C语言开发的,所以叫CPython,在命令行下运行python就是启动CPython解释器
CPython是使用最广的Python解释器,教程的所有代码也都在CPython下执行
IPython
IPython是基于CPython之上的一个交互式解释器
也就是说,IPython只是在交互方式上有所增强
但是执行Python代码的功能和CPython是完全一样的
好比很多国产浏览器虽然外观不同,但内核其实都是调用了IE
CPython用>>>作为提示符,而IPython用In [序号]:作为提示符
PyPy
PyPy是另一个Python解释器,它的目标是执行速度
PyPy采用JIT技术,对Python代码进行动态编译
显著提高Python代码的执行速度
绝大部分Python代码都可以在PyPy下运行
PyPy和CPython有一些是不同
导致相同的Python代码在两种解释器下执行可能会有不同的结果
代码要放到PyPy下执行,就需要了解PyPy和CPython的不同点
Jython
Jython是运行在Java平台上的Python解释器
可以直接把Python代码编译成Java字节码执行
IronPython
IronPython和Jython类似
只不过IronPython是运行在微软.Net平台上的Python解释器
可以直接把Python代码编译成.Net的字节码
Python各种不同的实现
https://wiki.python.org/moin/PythonImplementations?action=show&redirect=implementation
The following implementations may be comprehensive or even complete, but at the very least can be said to be working in that you can run typical programs with them already:
Brython - a way to run Python in the browser through translation to JavaScript
CLPython - Python in Common Lisp
HotPy - a virtual machine for Python supporting bytecode optimisation and translation (to native code) using type information gathered at run-time
IronPython - Python in C# for the Common Language Runtime (CLR/.NET) and the FePy project's IronPython Community Edition (IPCE)
Jython - Python in Java for the Java platform
pyjs - (formally Pyjamas) a Python to JavaScript compiler plus Web/GUI framework
PyMite - Python for embedded devices
PyPy - Python in Python, targeting several environments
pyvm - a Python-related virtual machine and software suite providing a nearly self-contained "userspace" system
RapydScript - a Python-like language that compiles to JavaScript
SNAPpy - "a subset of the Python language that has been optimized for use in low-power embedded devices" (apparently proprietary)
tinypy - a minimalist implementation of Python in 64K of code
Transcrypt - Python 3.6 to JavaScript precompiler with lean and fast generated code, sourcemaps, built-in minification, optional static typechecking, JSX support
The following implementations are apparent works in progress; they may not be able to run typical programs:
Berp - an implementation of Python 3 in Haskell, providing an interactive environment as well as a compiler
phpython - a Python interpreter written in PHP
Pyjaco - a Python to JavaScript compiler similar to Pyjs but lighterweight
Pystacho is, like Skulpt, Python in JavaScript
pyvm2.py - a CPython bytecode interpreter written in Python, mentioned on the PyPy mailing list in 2003
Skulpt - Python in JavaScript
Typhon - a Rubinius-based implementation of Python