Python Inner Working

RudranshRudransh
2 min read

Actually, When I started python 2 years ago, I left it. After learning for 2 months, where I learn about basics. I was an enthusiast and I only want to learn new things.

But at that time no one taught me about python inner working even though before reaching to "ChaiAurCode" python video I never know about python inner working lets me introduce you step by step, how it actually works.

How Python Works

python is a general-purpose programming language which we can use in our day-to-day life. Understanding the inner working helps us to interact which with it easily.

When we write a code like "chai.py" it doesn't contain any bytecode but when we use import function then it creates a __pycache__ where it creates file like chai.cpython_312.py let understand it briefly

  1. We create a file where we write some of code.

  2. now we save it as hello_chai.py it is our source code.

  3. interpreter where lots of thing are already going on let's understand it briefly.

  4. (1). it will compile the code. (2). now it will become byte code. (3). Now through Virtual Machine (PVM) the byte code will be interpreted line by line.

Point 4

My point four became kichadi so let's understand it in detail what happens is that there are terms like Bytecode, PVM

Bytecode - It is a type of code produce after compilation of python source file, it is different from machine code, machine code is capable of giving direct instruction to processor like Apple M1, Intel Chips but byte code is code which are generated after compilation of source code, and it is not understandable by computer. In order to run we need a virtual machine which is also called PVM (Python Virtual Machine).

PVM - It is a type of virtual machine specifically design to run python byte code. It read code line by line which makes slow, but it helps in debugging easily than any other language.

That's All from my side i hope you understand something from this if not then i am sorry from my side, I never written a blog in my life this is my first blog, I hope you will understand.

#ChaiAurCode

1
Subscribe to my newsletter

Read articles from Rudransh directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Rudransh
Rudransh

Hailing from the land of knowledge, Gaya, I'm Rudra, a first-semester BCA student at the esteemed Gaya College. While I may not claim mastery over everything (yet!), my thirst for knowledge rivals even the strongest cup of chai. Sure, the past semester might have felt like "tutorial hell," but consider it a fiery forge that's shaping you into a coding titan! Remember, every struggle adds a unique layer to your journey, making your eventual success all the sweeter. Beyond the lines of code, you'll find me seeking solace in a steaming cuppa. There's something magical about that quiet moment, allowing my thoughts to brew alongside the perfect chai. ☕️ This journey is just beginning, and I'm excited to see where it leads. With #Godbless and a healthy dose of determination, I know I'll conquer those coding challenges and emerge even stronger.