Computers understand only machine code that comprises 1 and 0. since computer understands only machine code.we should take the help of a compiler. A compiler normally converts the program source code into machine code. It converts the program source code into another code i.e byte code.

Then, What is the byte code?

Byte code represents the fixed set of instructions. The size of each byte code instructions is 1 byte, hence these are called byte code instructions ." Python, like many interpreted languages, actually compiles source code to a set of instructions for a virtual machine and the python interpreter is an implementation of that virtual machine. This intermediate format is called Byte Code". There may be newer instructions added to the existing byte code instructions from time to time. We can find byte code instructions in the .pyc file.   

The role of Python Virtual Machine (PVM) is to converts the byte code instructions into machine code so that the computer can execute those machine code instructions and display the final output.
Python Virtual Machine is equipped with an interpreter. The interpreter converts the byte code into machine code and sends that machine code to the computer processor for execution. The interpreter is playing the main role, Python Virtual Machine is also called an interpreter.   

Post a Comment