Python is a interpreter language.Python interpreter execute program line by line.
The Python interpreter performs following tasks to execute a Python program :
- The python code is compiled into python byte code, which creates file with extension .pyc .It checks the syntax of each line if any error throws an error immediately.
- Compilation is simply a translation step, and byte code is a lower-level, and platform-independent representation of your source code.Each of your source statements is translated into a group of byte code instructions.
- The .pyc file , created in compilation step, is then executed by appropriate Python virtual machines.
- The Virtual Machine is the runtime engine of Python and it is always present as part of the Python system, and is the component that truly runs the Python scripts .