
The interpreter converts this AST to byte code which means machine language. It generates a big structure called the AST (Abstract Syntax Tree). Once the parser of the Python interpreter receives the tokens, it starts to manipulate the lexical tokens. In the following step, the interpreter will generate byte codes. This phase is called lexical analysis, which means dividing the source code files into a list of tokens Maybe there are some incorrect lines, so it will stop the program from the execution to show the error message. It follows the indentation rule and checks the Python syntax. Here the Python interpreter receives the source code and initializes some instructions to do the following things: Source Code AnalysisĪctually, any translator starts with the source code analysis. In the following sections, you will understand how the Python interpreter works behind the scenes. This is the default implementation for Python. The Python interpreter is called “CPython” and it's written in the C programming language. They named this version “P圓K”, or Python 3.0. The third version was released in 2008 and fixed a basic flaw of the language. In version 2.0, van Rossum added minor features such as collection systems and comprehensions. The first release was in 1994 under version 1.0 (Python 1.0) and the second release was in 2000, named version 2.0. He named it Python because the first version of it was able to read the BBC comedy script “Monty Python's Flying Circus”. Rossum started the implementation in 1989 and he worked on Python alone until 2018. Python was designed to replace the ABC programming language which worked with Amoeba operating system. The first appearance of the Python programming language was in late 1980s.

In the following section, I am going to focus on the history of the Python interpreter in-depth, then I'll answer this question.

But you might be wondering – what is CPython? We can compare Python with other interpreted programming languages such as Java, JavaScript, PHP, and others. Just make sure you know the indentation rules :). You can use Python to do many tasks such as:Īdditionally, Python's syntax is pretty simple and easy to learn – often it seems that you are just writing a message to someone else. Python gives us the ability to use a lot of modules and packages with our code, which are standard libraries built in with the interpreter. It's based on the CPython interpreter which translates the Python code into something the machine can read.

Python is a high-level programming language designed to do many tasks. Then you'll write your first "Hello World" program. In this article, I am going to explain what Python is and how the Python interpreter works.
