Installing Python + VS Code — environment setup
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

KAISE INSTALL KAREIN — STEP BY STEP
Step 1 — Python interpreter install karo
- python.org → Downloads par jao aur latest stable version lo (jaise Python 3.12).
- Installer run karo. ✅ Neeche "Add Python to PATH" ka box CHECK karo.
- Yeh step kyun? Iske bina, tumhara terminal
pythonword ko nahi pehchanega, aur tumhe "python is not recognized" milega. PATH woh tarika hai jisse OS program dhundta hai.
- Yeh step kyun? Iske bina, tumhara terminal
- 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
- code.visualstudio.com par jao, apne OS ke liye download karo, install karo (defaults theek hain).
- 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)
- 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.
- Apne project ke liye ek folder kholo: File → Open Folder.
- Interpreter select karo:
Ctrl/Cmd+Shift+Pdabao → "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?
Installation ke dauran "Add Python to PATH" kyun tick karna chahiye?
python command dhundh sake; warna tumhe "python is not recognized" milega.Jab tum Run press karte ho toh VS Code actually kya karta hai?
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?
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?
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