Sitemap
Vamsiab

Vamsiab

Working of Python Engine

2 min read1 day ago
Press enter or click to view image in full size

Many of us write code and except for output right!

Here is the thing we actually should know while writing/developing code using python programming language. That is the working of Python Engine..

Get Vamsiab’s stories in your inbox

Join Medium for free to get updates from this writer.

Now Let’s see how the Python Engine Works….

  1. Firstly the programmer/ we write the code or program using Python Programming Lanugage.
  2. Then when we run the program/code, do you think we will get output directly? Let’s see….
  3. Here is where the Python Engine comes into picture. When we click on run button, then the actual process starts.
  4. Python Engine gives the code to syntax checker, it checks whether the code follows the python syntax rules or not. If the code follows the rules/syntax then the source code is given to the compiler or else it throughs syntax error to the user.
# Example 1
X = 'Hello World'

As the given code follows syntax rule, so it doesn’t generate any error.

# Example 2
X = 'Hello

Raises syntax error as it doesn’t follow the rules/ grammar.

5. When the source code is given to compiler , the code is generated to bytecode(0’s ,1’s) along with additonal information.

6. Then the bytecode is passed to the interpreter , where Python Virtual Machine analyses bytecode and checks whether it has any exceptions(logical errors) or not. If we no exceptions found then the bytecode is converted to machine level language(MLL) and performs the operations and gives the output or else it raises the exception error in case of any errors.

This is how the Python Engine works after writing the code and hitting the run button.

--

--