Python's Inner Working
As we all know python is a very popular programming language. The popularity of the language is increasing day-by-day also python has very great significance in the field of Artificial Intelligence or Data related work.
Python is also a very beginner friendly language, which can be learned and understood by anyone easily.
In this article we will see how python actually works in the background.
How Python actually works?
To learn and understand any programming language it is very important to understand how the language works behind the scene. It helps us understand the language properly and enhance our learning.
Interpreted language means, when a source code is written it is compiled to bytecode and directly pass on to the runtime environment for execution.
Here the python works as follows:
A. The python source code is compiled to Byte code.
B. Then the byte code is passed on to the python virtual machine for the execution.
Python Virtual machine
Python virtual machine provides a runtime environment for your python code to be executed.
Python virtual machine is also known as Python Interpreter.
Byte code in python
The Byte code file in python is mostly hidden but the format of the file is as below:
\> For file hello_world.py
Here,
hello_world: It is the file name
cpython : It is the standard implementation of the python. In most of the cases it is cpython. There are some other implementation like jython, IronPython, Stackless, etc.
311: It is the current version of python on your system.
.pyc: It is the extension for byte code file in python.
This is the entire process of how python works internally.
Here is a video in depth explanation for python's inner working:
Also connect with me on:
Subscribe to my newsletter
Read articles from Aditya Kumbhar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by