官术网_书友最值得收藏!

Python versions

Two main version lines exist for Python: Python 2 and Python 3. Python 2 is the legacy line (version 2.7.15, at the time of writing); while it is still used for some new projects nowadays, it is predominately seen in old software that either can't or won't be upgraded to the Python 3 line. Python 2.7 is the last major release number for this line; incremental upgrades will be provided to back-port Python 3 features or for security patching, but no major features are written for it.

Python 3 (version 3.7.0, as of this writing) is the main development line, and all new features are added here first. Many features in Python 3 are not available in Python 2, or are renamed, so significant effort must be made to convert one version to another.

The Python tools 2to3 and 3to2 are provided with every Python download to help with this conversion process, but they can only handle simple things, such as changing print statements or automatically renaming built-in functions. Anything beyond that requires a programmer to look at the code and make the changes. As this is a non-trivial process (each line of code must be assessed), it may be easier to simply rewrite the code.

Python, as normally used, is technically called CPython, as it is actually written in C code. Python has bindings for use in non-native Python environments, such as Java (Jython), the .NET framework (IronPython), or microcontrollers (MicroPython). This means that you can write regular Python code and it will be interpreted into the correct byte-code for a particular environment. This way, for example, you can interact with a Java program without having to actually write Java code; the Jython interpreter translates Python into equivalent Java code.

主站蜘蛛池模板: 讷河市| 扎赉特旗| 陈巴尔虎旗| 利辛县| 山丹县| 库尔勒市| 湖州市| 巍山| 乌什县| 普宁市| 永嘉县| 辉南县| 阿拉善右旗| 纳雍县| 阿尔山市| 岳阳县| 铜山县| 隆德县| 日照市| 潜山县| 安图县| 冷水江市| 西乌珠穆沁旗| 宣汉县| 莎车县| 攀枝花市| 南川市| 襄垣县| 额济纳旗| 丹东市| 老河口市| 潜山县| 施秉县| 正阳县| 杭锦后旗| 辽阳市| 滨海县| 高雄县| 万载县| 白城市| 固始县|