DEV Community

Samiksha Srivastav
Samiksha Srivastav

Posted on

Getting Started with Python

Today I started learning Python, and I explored some fundamental concepts that helped me understand how Python actually works behind the scenes.

What is Python?

Python is a high-level, interpreted programming language.

  • Being high-level means it is easy to read and write, as it is closer to human language and abstracts away hardware complexity.
  • This makes it very different from low-level languages like assembly or machine language, which directly interact with hardware.

Is Python Really Interpreted?

We often hear that Python is an interpreted language, but there is a bit more to it.

Python actually works in two main steps:

  1. Compilation to Bytecode
    First, Python converts your code into an intermediate format called bytecode.

  2. Execution using Python Virtual Machine (PVM)
    This bytecode is then executed by the Python Virtual Machine (PVM.)

This process is what makes Python both flexible and easy to debug.

What is pycache?

While running Python programs, you might notice a folder named pycache.

  • It stores compiled bytecode files(.pyc)
  • These files help Python run faster when the program is executed again
  • This process is usually automatic and hidden from developers

Key Takeaways

  • Python is easy to read and beginner-friendly
  • It is interpreted but internally uses bytecode
  • Execution happens through the Python Virtual Machine (PVM)
  • pycache improves performance by storing compiled code

Final Thoughts

Understanding what happens behind the scenes makes learning Python much more interesting. This is just the beginning of my journey, and I'm excited to explore more.

Follow my journey as I continue learning and building in Python!

Top comments (0)