Why Python is a Top Choice for Developers
Tanuj .Developer
1 min read
Table of contents
When we run code in Python, many things happen inside Python.
Let's look at a sample.
print("Hello Chai Sir")
def chai(n):
print(n)
chai("Chai using python")
Then, if we import it into another file, it looks like this:
from hello_python import chai
chai("Indian Chai")
Something interesting happens: in VS Code, a new folder named “__pycache__” appears.
Now the question is, why is this folder created and who creates it?
When we write code in VS Code and run it, the code is first converted into bytecode and then executed in the Python virtual machine. In most cases, this bytecode is hidden, but in some special cases, it appears in front of the programmer.
0
Subscribe to my newsletter
Read articles from Tanuj .Developer directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by