Introduction To Python (Chapter: 3) | EduNotes

Python Installation & Python Virtual Machine (PVM)

How to Install Python (Windows)

Steps to Install Python

  1. Download Installer
    Official Python website par jaakar latest Python 3 version download karein.
  2. Run Installer
    Downloaded .exe file par double-click karein.
  3. Important Options Select Karein
    • Add Python to PATH → Command line se Python run karne ke liye zaroori
    • Install for all users (optional but recommended)
  4. Install Python
    “Install Now” button par click karein.
  5. Verify Installation
    Command Prompt (cmd) open karke likhein:
    python --version
    Agar Python version show ho jaye, to installation successful hai.

Python Virtual Machine (PVM)

Python Virtual Machine (PVM) ek runtime engine hai jo Python programs ko execute karta hai.

Ye Python bytecode aur computer hardware ke beech ek bridge ka kaam karta hai, isi wajah se Python ek cross-platform language hai.

How PVM Works

1. Compilation to Bytecode

  • .py source code pehle bytecode me convert hota hai
  • Bytecode platform-independent hota hai
  • Bytecode memory ya __pycache__ folder me .pyc file ke roop me hota hai

2. Execution by PVM

  • PVM bytecode ko line-by-line read karta hai
  • Use machine code me translate karke execute karta hai
  • Isi wajah se Python ko interpreted language kaha jata hai

Important Note

  • Python source code directly machine code me convert nahi hota
  • Pehle bytecode banta hai, phir PVM usse execute karta hai
  • PVM Python interpreter ka core part hota hai