Python leaning 3.1 Python interpreter – ByteSavvy

Python leaning 3.1 Python interpreter

When we write Python code, we get a text file with a .py extension containing Python code. To run the code, we need the Python interpreter to execute the .py file.

Since the entire Python language is open source, from the specification to the interpreter, theoretically, anyone who is good enough can write a Python interpreter to execute Python code (with great difficulty, of course). In fact, multiple Python interpreters do exist.

CPython.
When we download and install Python 3.x from the official Python website, we get an official version of the interpreter directly: CPython, which is developed in C, hence the name. running python from the command line starts the CPython interpreter.

CPython is the most widely used Python interpreter. All the code of the tutorial is also executed under CPython.

IPython
IPython is an interactive interpreter based on top of CPython, which means that IPython is only enhanced in terms of interaction, but executes Python code in exactly the same way as CPython.

CPython uses >>> as a prompt, while IPython uses In [serial number]: as a prompt.

PyPy
PyPy is another Python interpreter that targets execution speed.PyPy uses JIT technology to dynamically compile (not interpret, mind you) Python code, so it can dramatically increase the execution speed of Python code.

The vast majority of Python code can be run under PyPy, but there are some differences between PyPy and CPython, which leads to the fact that the same Python code may have different results when executed under both interpreters. If your code is going to be put under PyPy for execution, you need to understand the differences between PyPy and CPython.

Jython
Jython is a Python interpreter that runs on the Java platform and can compile Python code directly into Java bytecode for execution.

IronPython
IronPython is similar to Jython, except that IronPython is a Python interpreter that runs on the Microsoft .Net platform and can directly compile Python code into .

Summary
There are many Python interpreters, but the most widely used is CPython. If you want to interact with Java or the .Net platform, the best way to do so is not to use Jython or IronPython, but rather to interact with it through network calls, ensuring independence between the programs.

All code in this tutorial is only guaranteed to run with CPython version 3.x. Be sure to install CPython locally (that is, download the installer from the official Python website).

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *