Unlike others, Python internal working is quite different than others programming language so let's see the process step by step:-
1)Code Editor:- The first stage of program where we write our source code. This is human-readable code written according to python's syntax rules. It's where the execution of the program starts first.
2)Source code:- The code written by a programmer In the code editor is then saved as, [nameofthescript/file] as a.py file by in a system. This file of python is written in human-readable language that contains the instruction for the computer.
3)Compilation stage:- The compilation stage of python is different from any other programming language. Rather than compiling a source code directly into machine code, it converts into a byte code. It also checks for syntax errors if no such error is found then it generates a a.pyc file that contains bytecode.
4)PVM (Python Virtual Machine):- The bytecode then goes into the main part of the conversion in the PVM. The PVM is the main runtime engine of python. It's an interpreter that reads and executes the bytecode file, line-by-line. Here in the Python Virtual Machine Translate the byte code into machine code which is the binary language consisting of 0s and 1s. The machine code is highly optimized for the machine it is running on. This binary language is only understandable by the CPU (Centralized Processing Unit) of a system.
5)Running Program:- At last, the CPU executes the given machine code and the main outcome of the programmer comes as performing task and compilation you scripted at the beginning of the stage in your code editior.
Conclusion:- Internal working of python is different from other programming language as the source code is converted into byte code as further the PVM converts the byte code into binary language as the CPU executes the given machine code which is (binary language) and the output is displayed on the console.
I hope you might like the blog.
For further reference kindly acknowledge this website:-
https://www.geeksforgeeks.org/internal-working-of-python/
And don't forget to follow me on my Instagram Handle:-
https://www.instagram.com/yashpale_?igsh=MmVlMjlkMTBhMg==
Thanks for reading!...