1.2.1 · HinglishIntroduction to Programming (Python)

Installing Python + VS Code — environment setup

1,652 words8 min readRead in English

1.2.1 · Coding › Introduction to Programming (Python)


HUM ACTUALLY KYA INSTALL KAR RAHE HAIN?

DO pieces KYU? Kyunki likhna aur run karna alag-alag kaam hain. Bahut saare editors hain (PyCharm, Sublime, yahan tak ki Notepad); Python run karne ke bahut saare tarike hain (terminal, IDE). Inhe alag rakhna system ko flexible banata hai.


PIECES AAAPAS MEIN KAISE FIT HOTE HAIN

Figure — Installing Python + VS Code — environment setup

KAISE INSTALL KAREIN — STEP BY STEP

Step 1 — Python interpreter install karo

  1. python.org → Downloads par jao aur latest stable version lo (jaise Python 3.12).
  2. Installer run karo.Neeche "Add Python to PATH" ka box CHECK karo.
    • Yeh step kyun? Iske bina, tumhara terminal python word ko nahi pehchanega, aur tumhe "python is not recognized" milega. PATH woh tarika hai jisse OS program dhundta hai.
  3. Install Now click karo.

Ise verify karo (machine ko Active Recall karo!): terminal kholke type karo:

python --version

Expected: Python 3.12.x. (macOS/Linux par shayad python3 --version chahiye ho.)

Step 2 — VS Code install karo

  1. code.visualstudio.com par jao, apne OS ke liye download karo, install karo (defaults theek hain).
  2. Windows par, "Add to PATH" tick karo taaki tum code . type karke koi folder khol sako.

Step 3 — Dono ko connect karo (woh hissa jo log bhool jaate hain)

  1. VS Code kholke → Extensions (chaar-squares wala icon) → "Python" (by Microsoft) search karo → Install karo.
    • Kyun? Yeh green Run ▶ button, syntax help, aur interpreter selector deta hai.
  2. Apne project ke liye ek folder kholo: File → Open Folder.
  3. Interpreter select karo: Ctrl/Cmd+Shift+P dabao → "Python: Select Interpreter" type karo → apna Python 3.12 chuno.
    • Yeh step kyun? Tumhare paas kai Pythons ho sakte hain; yeh VS Code ko batata hai ki is project ke liye kaunsa brain use karna hai.

Step 4 — Pehla program

hello.py banao:

print("Hello, world!")

Run ▶ dabao. Terminal mein Hello, world! dikhta hai. Yeh step kyun? Yeh prove karta hai ki teeno layers kaam kar rahe hain: editor ne file save ki, interpreter mil gaya, output wapas aaya.

Step 5 (best practice) — Ek virtual environment

VS Code terminal mein:

python -m venv .venv

Phir .venv ko interpreter ke roop mein select karo (VS Code usually prompt karta hai).

  • Kyun? Taaki is project ke liye koi library install karna (pip install requests) kisi doosre project ko kabhi break na kare. Isolation = no version wars.

Apni galatiyon ko Steel-man karo


80/20 — jo actually matter karta hai


Recall Feynman: ek 12-saal ke bacche ko samjhao

Socho tum ek secret language mein letters likhna aur padhna chahte ho. Python tumhara woh dost hai jo secret language samajhta hai — tum use ek note dete ho aur woh ise zor se padhta hai. VS Code tumhara achha desk hai jisme achhe pens aur ek lamp hai jahan tum notes neatly likhte ho. Desk language nahi samajhta — woh bas likhne mein madad karta hai. Toh tumhe DONO chahiye: likhne ke liye desk, padhne ke liye dost. "Add to PATH" aisa hai jaise apne dost ka phone number contacts mein daal dena taaki tum ghar mein kahin se bhi usse naam se turant call kar sako.


Flashcards

Python development ke liye tumhe kaun si do alag cheezein install karni chahiye?
Python interpreter (code run karta hai) aur VS Code jaisa code editor (code likhta hai).
Installation ke dauran "Add Python to PATH" kyun tick karna chahiye?
Taaki operating system kisi bhi terminal se python command dhundh sake; warna tumhe "python is not recognized" milega.
Jab tum Run press karte ho toh VS Code actually kya karta hai?
Woh ek terminal kholke selected Python interpreter ko tumhari file execute karne ke liye call karta hai — yeh khud Python run nahi karta.
Tumhara Python install aur version verify karne ka command kya hai?
python --version (ya python3 --version) → Python 3.x.x print karta hai.
VS Code ka "Python: Select Interpreter" command kis kaam ka hai?
VS Code ko batana ki current project ke liye KAUNSA installed Python use karna hai.
Virtual environment (venv) kya hai aur ise kyun use karein?
python -m venv .venv ke saath banai gayi ek isolated Python+libraries copy per project, taaki projects ki dependencies clash na karein.
macOS/Linux par agar python "command not found" kahe toh tum kya try karte ho?
python3 (aur pip3) use karo; system often plain python ko map nahi karta.
Microsoft Python extension VS Code mein kya add karta hai?
Run button, syntax highlighting/linting, debugging, aur interpreter selector.

Connections

  • Python Interpreter vs Compiler
  • The Terminal and Command Line Basics
  • pip and Package Management
  • Virtual Environments (venv)
  • Your First Python Program — print()
  • PATH Environment Variable

Concept Map

step 1 install

step 2 install

reads and runs .py

added to

lets OS find

needs

teaches VS Code about

opens

calls selected

hosts Run button

isolated copy per project

Environment setup

Python interpreter

VS Code editor

PATH variable

Python extension

Virtual environment

Terminal

Run button