Computer programming language is a medium to communicate with the computers. To give the instructions to the computer. Because computer only can understand the machine language, that is in terms of zeros and ones or in terms of on and off (Byte Codes). But it’s really tough for us to write byte codes.
That is why we developed different languages, that’s called the programming language so that we can communicate with computers with a more easy way. There are different kind of programming language like
- High level:- Very close to the human language like python, javascripts.
- Low level:- Very close to byte code like assembly.
But, there is another program, in between byte code and the programing language, that translate this programming language to binary language or language with zeros or ones.
This middle program has a different style to convert the programing languages to computer readable language. Some of them convert line by line and some other convert as a whole.
The one, that converts each line of programing code to machine readable language and then move to the next line is called the Interpreter.
And the next one is called compiler, which converts the whole programming file as a whole into a binary file.
In case of python, the interpreter program, can be written in c or java or dot net. In the python official website, we are downloading the cpython interpreter. You can also download jython, where the interpreter is written on java and generate Java byte code so that it can run in JVM. For more details about the Jython and cpython you can visit https://stackoverflow.com/questions/17130975/python-vs-cpython
Basically what happens in the background, very first interpreter convert the programing language into a byte code, and then the Python Virtual machine take that byte code and then run it.
It’s explained quite well in the below mentioned post. https://www.geeksforgeeks.org/internal-working-of-python/