Skip to main content

How python code get executed – architecture

Python is interpreted language. When user execute any python file then internally it compiles the code in bytecode format. Byte code is lower level representation of source code. These compiled (bytecode) files are available on machine in .pyc format.

So when we run the program again without any change then python again load that .pyc files by skipping compilation step.

If python don’t have write access then those pyc files get created in memory and get discarded on exiting program.

Once program is successfully compiled to byte code then it gives those code to Python Virtual Machine. PVM (Python virtual machine) is just run time engine from Python. Which is completely hidden from end user or programmer. PVM converts this bytecode in machine executable.

Latest version of python can be downloaded from here https://www.python.org/downloads/