WORKING OF PYTHON ENGINE
WORKING OF PYTHON ENGINE
As a programmer we write a set of instructions (source code) in a python programming language and give it to a machine. That machine is called as python machine or python engine.
Python engine is a component that only understands the python programming language.
Example
Working of python is basing on 4 components
1.source code writing
2. syntax checker
3. compiler
4. interpreter in PVM
Step by step procedure of working of python engine
Step 1:
The set of instructions we are writing in a programming language are called as source code.
Step 2:
After writing the source code we will give the code to machine to execute or to run the code in a machine.
Step 3:
Get A Udayadeepika’s stories in your inbox
Join Medium for free to get updates from this writer.
whenever we give the source code to run in a python programming language to machine first it will be sent to syntax checker.
Syntax checker will go through the source code line by line and check whether the code is written according to the python rules.
If the source code is not written according to python rules, then syntax checker will be giving syntax error.
This syntax error is also called as compile time error because it is just occurring before compiler.
EXAMPLE:
Step 4:
If the source code is correct, then python engine will be moving to the next stage i.e., from syntax checker to compiler.
Compiler will convert the source code to byte code.
Byte code is nothing but a low-level code (binary code) with extra instructions in English language (meta data).
Step 5:
Still the code has some English language instructions so it cannot be run by the machine so for that purpose the code will be send to the python virtual machine (PVM) to completely covert it into a binary code.
Step 6:
Inside the PVM we will be having interpreter.
It will be helping the code to convert into low level code i.e.; meta data will be also converted to low level language or binary code.
While converting the code we may also get the exception error at interpreter.
This exception error occurs because of logical mistakes we make while creating the source code.
This exceptional error is also called as run time error and if there is no error it will be send to machine to give an output.






