Python Notes
Learn how to install Visual Studio Code for Python development. Setup Python extension, debugger, linter, formatter and essential tools. VS Code Python setup kaise karein – Hindi mein complete guide.
Hindi: Yeh guide aapko Visual Studio Code (VS Code) install karna aur Python ke liye configure karna sikhayega. VS Code aaj kal sabse popular code editor hai – free bhi hai aur powerful bhi.
🖥️ What is VS Code?
Visual Studio Code (VS Code) is a free, open-source, lightweight yet powerful code editor developed by Microsoft. Released in 2015, it has become the most popular code editor in the world.
Hindi: VS Code Microsoft ka free code editor hai jo 2015 mein release hua tha. Yeh aaj duniya ka sabse popular code editor hai. Iska use Python, JavaScript, Java, C++ aur bahut saari languages ke liye hota hai.
| │ Full Name | Visual Studio Code │ |
| │ Developer | Microsoft │ |
| │ Year | 2015 │ |
| │ License | MIT Open Source │ |
| │ Platforms | Windows, macOS, Linux, Web │ |
| │ Price | FREE │ |
| │ Extensions | 50,000+ available │ |
| │ Website | https://code.visualstudio.com │ |
🎯 Why VS Code for Python?
Hindi: Python ke liye VS Code best editor kyun hai – yahan kuch khaas reasons hain:
| Feature | VS Code | Notepad | PyCharm |
|---|---|---|---|
| Price | Free | Free | Paid (Community free) |
| Python Support | Excellent (via extension) | None | Excellent (built-in) |
| Extensions | 50,000+ | None | Limited |
| Performance | Fast | Very Fast | Slow |
| Git Integration | Built-in | None | Built-in |
| Debugger | Built-in | None | Built-in |
| IntelliSense | Excellent | None | Excellent |
| Multiple Languages | Yes (all languages) | No | Python only |
Key Features for Python:
- 🔍 IntelliSense – Auto-complete as you type
- 🐛 Debugger – Step through code, inspect variables
- 🧹 Linting – Highlight errors before running
- 🎨 Formatting – Auto-format code (Black, autopep8)
- 📁 File Explorer – Manage project files easily
- 💻 Integrated Terminal – Run Python without leaving VS Code
- 🔄 Git Integration – Track code changes
- 🌐 Remote Development – Code on remote servers
Hindi: VS Code mein auto-complete, debugger, linting, formatting, aur integrated terminal sab kuch hai. Ek hi editor mein poora Python development environment milta hai.
⬇️ Download VS Code
Screenshot Description:
| Windows | macOS | Linux | ||||
|---|---|---|---|---|---|---|
| [Download] | [Download] | [Download] |
Hindi: VS Code download karne ke liye official website code.visualstudio.com par jaayein. Stable Build choose karein – yeh most reliable version hai.🪟 Install VS Code on Windows
Hindi: Windows mein VS Code install karna bahut easy hai – ek simple installer run karna hai.
Step 1: Run the Installer
Double-click VSCodeUserSetup-x64-*.exe:
Step 2: Choose Installation Location
Hindi: Default location theek hai – koi change karne ki zaroorat nahi. Next click karein.
Step 3: Select Additional Tasks (IMPORTANT!)
Hindi: "Add to PATH", "Add Open with Code" dono options zaroor check karein. Yeh bahut useful hote hain.
Step 4: Install & Launch
Click Install and wait for completion. When done, check "Launch Visual Studio Code" and click Finish.
🍎 Install VS Code on macOS
Method 1: Direct Download
| VS Code | drag | 📁 Applications | ||
|---|---|---|---|---|
| .app | ──────► |
Method 2: Homebrew
brew install --cask visual-studio-codeAdd 'code' Command to PATH (macOS)
# Now you can open files from terminal
code myfile.py
code . # Open current folderHindi: Mac mein VS Code install karne ke baad code command ko PATH mein add karein taaki terminal se directly files open kar sakein.🐧 Install VS Code on Linux
Ubuntu / Debian (via .deb)
Fedora / CentOS (via .rpm)
Snap (Universal Linux)
sudo snap install --classic code🗺️ VS Code Interface Tour
Hindi: VS Code ka interface samajhna bahut important hai. Yahan har part explain kiya gaya hai.
Activity Bar Icons:
Hindi: VS Code ka interface 5 main parts se bana hai: Activity Bar (left mein icons), Explorer (files dikhata hai), Editor (jahan code likhte hain), Panel (terminal aur output), aur Status Bar (bottom mein info).
🐍 Install Python Extension
The Python extension by Microsoft is the most important extension for Python development in VS Code.
Step 1: Open Extensions Panel
Step 2: Search for Python
| python [Search box] | ||
|---|---|---|
| 🐍 Python | ||
| IntelliSense (Pylance), Linting, Debugging, | ||
| code formatting, refactoring... | ||
| Microsoft ★★★★★ 52.8M installs | ||
| [Install] ◄──────┤ |
Step 3: Install
Click the Install button next to Python (by Microsoft).
Hindi: Extensions panel mein "python" search karein. Microsoft ki Python extension install karein – 50+ million downloads wali. Yeh automatically Pylance bhi install karti hai.
What Gets Installed Automatically:
⚙️ Configure Python Interpreter
After installing the Python extension, tell VS Code which Python to use:
Method 1: Status Bar (Easiest)
| │ 🐍 Select Python Interpreter UTF-8 LF Spaces | 4 │ |
| │ ★ Python 3.13.0 ('base') C | \Python313\python.exe ◄── │ |
| │ Python 3.11.9 64-bit C | \Python311\python.exe │ |
Method 2: Command Palette
Method 3: settings.json
// .vscode/settings.json in your project
{
"python.defaultInterpreterPath": "C:\\Python313\\python.exe"
}Hindi: VS Code ko batana padta hai ki kaunsi Python use karni hai. Bottom status bar mein "Select Python Interpreter" click karein aur apna installed Python version choose karein.
🧩 Essential Python Extensions
Hindi: Python development ke liye kuch aur important extensions hain jo aapki coding life aasaan banate hain.
1. Pylance (Auto-installed)
| Publisher | Microsoft |
| Purpose | Fast IntelliSense, type checking, code analysis |
| Install | Comes with Python extension automatically |
2. Python Indent
| Publisher | Kevin Rose |
| Purpose | Correct Python indentation automatically |
| Install | Search "Python Indent" in Extensions |
3. autoDocstring
| Publisher | Nils Werner |
| Purpose | Auto-generate Python docstrings |
| Install | Search "autoDocstring" |
| Usage | Type """ after a function def, press Enter |
4. GitLens
| Publisher | GitKraken |
| Purpose | Enhanced Git visualization, blame annotations |
| Install | Search "GitLens" |
5. Bracket Pair Colorizer / Rainbow Brackets
| Publisher | OBKoro1 |
| Purpose | Color-code matching brackets |
| Install | Search "Rainbow Brackets" |
6. Error Lens
| Publisher | Alexander |
| Purpose | Show errors/warnings inline in the editor |
| Install | Search "Error Lens" |
7. Jupyter
| Publisher | Microsoft |
| Purpose | Run Jupyter notebooks inside VS Code |
| Install | Search "Jupyter" |
8. Code Runner
| Publisher | Jun Han |
| Purpose | Run code snippets with one click/shortcut |
| Install | Search "Code Runner" |
| Shortcut | Ctrl + Alt + N |
9. Material Icon Theme
| Publisher | Philipp Kief |
| Purpose | Beautiful file icons for better navigation |
| Install | Search "Material Icon Theme" |
10. One Dark Pro / Tokyo Night (Themes)
Install All Essential Extensions at Once (Terminal):
# Open VS Code integrated terminal and run:
code --install-extension ms-python.python
code --install-extension ms-python.pylance
code --install-extension ms-python.debugpy
code --install-extension KevinRose.vsc-python-indent
code --install-extension njpwerner.autodocstring
code --install-extension eamodio.gitlens
code --install-extension usernamehw.errorlens
code --install-extension ms-toolsai.jupyter
code --install-extension PKief.material-icon-theme⚙️ VS Code Settings for Python
Hindi: Python ke liye VS Code settings configure karna bahut important hai – isse coding experience bahut better ho jaata hai.
Open Settings
| Method 1: File | Preferences → Settings |
| Method 2 | Ctrl + , (Windows/Linux) or Cmd + , (macOS) |
| Method 3: Ctrl + Shift + P | "Open Settings (JSON)" |
Recommended settings.json for Python:
Hindi: Yeh settings Python coding ke liye optimized hain.editor.formatOnSavecode ko save karte waqt automatically format karta hai.editor.rulersline length limit dikhata hai (PEP8 standard: 79 characters).
💻 Using the Integrated Terminal
Hindi: VS Code ka integrated terminal bahut powerful hai – aapko alag Command Prompt/Terminal khol ke Python run karne ki zaroorat nahi.
Open Terminal
| Method 1: View | Terminal (from menu) |
| Method 2 | Ctrl + ` (backtick key) (Windows/Linux) |
| Method 3: Terminal | New Terminal (from menu) |
Terminal Commands for Python:
# Run a Python file
python hello.py
# Run Python interactively
python
# Install a package
pip install requests
# Run with specific Python version
python3.13 hello.py
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# Mac/Linux:
source venv/bin/activate
# Check Python version
python --version
# List installed packages
pip listRunning Python from Editor:
| Method 1: Right-click in editor | "Run Python File in Terminal" |
| Method 2 | Click the ▶ Play button (top right of editor) |
| Method 3: Ctrl + Shift + P | "Python: Run Python File in Terminal" |
| Method 4 | Ctrl + Alt + N (with Code Runner extension) |
⌨️ Keyboard Shortcuts
Hindi: Yeh keyboard shortcuts yaad karein – coding speed bahut badh jaayegi!
Essential Shortcuts:
| Action | Windows/Linux | macOS |
|---|---|---|
| Open Command Palette | Ctrl+Shift+P | Cmd+Shift+P |
| Open/Close Terminal | Ctrl+\` | Cmd+\` |
| Save file | Ctrl+S | Cmd+S |
| Save all | Ctrl+K S | Cmd+K S |
| Run Python file | F5 | F5 |
| Find in file | Ctrl+F | Cmd+F |
| Find in all files | Ctrl+Shift+F | Cmd+Shift+F |
| Go to line | Ctrl+G | Cmd+G |
| Toggle comment | Ctrl+/ | Cmd+/ |
| Format document | Shift+Alt+F | Shift+Option+F |
| Indent line | Tab | Tab |
| Multi-cursor | Ctrl+Alt+↓ | Cmd+Option+↓ |
| Duplicate line | Shift+Alt+↓ | Shift+Option+↓ |
| Delete line | Ctrl+Shift+K | Cmd+Shift+K |
| Move line up/down | Alt+↑/↓ | Option+↑/↓ |
| Quick open file | Ctrl+P | Cmd+P |
| Zen mode | Ctrl+K Z | Cmd+K Z |
| Extensions | Ctrl+Shift+X | Cmd+Shift+X |
| IntelliSense | Ctrl+Space | Ctrl+Space |
Hindi: Ctrl+S (save), Ctrl+/ (comment toggle), F5 (run) – yeh teen shortcuts sabse important hain. Inhe pehle yaad karein.
🐛 Using the Python Debugger
Hindi: Debugger se aap code ko step by step run kar sakte hain aur dekh sakte hain ki variables mein kya value hai.
Set a Breakpoint:
Start Debugging:
| Method 1 | Press F5 |
| Method 2: Run | Start Debugging |
| Method 3 | Click the ▶ button in Debug panel |
Debug Controls:
Example Debug Session:
# In Debug Console, hover over 'total' to see its value # In Variables panel: # total = 0 # price = 10.99 (first iteration) # items = [10.99, 25.50, 8.75, 15.00]
🔧 Troubleshooting
❌ Problem 1: "Python is not installed" error in VS Code
Hindi: VS Code ko Python nahi mil raha toh yeh karo:
Fix:
❌ Problem 2: IntelliSense (autocomplete) not working
Fix:
| 2. Ctrl+Shift+P | "Python: Select Interpreter" → choose Python |
| 3. Reload VS Code: Ctrl+Shift+P | "Developer: Reload Window" |
| "python.languageServer" | "Pylance" |
❌ Problem 3: Code won't run – "python: command not found"
Fix:
# In VS Code terminal, check if Python is found
where python # Windows
which python3 # Mac/Linux
# If not found, Python PATH issue
# See install-python.mdx → PATH setup section❌ Problem 4: Linting errors showing for correct code
Hindi: Agar correct code mein bhi errors dikhein toh linter ki settings check karein.
Fix:
// settings.json – disable if causing issues
{
"python.linting.enabled": false
}
// OR install the specific linter:
// pip install pylint OR pip install flake8❌ Problem 5: VS Code is running slowly
Fix:
❌ Problem 6: Terminal won't open in VS Code
Fix:
| 1. View | Terminal menu option |
| 2. Or: Ctrl+Shift+P | "Terminal: Create New Terminal" |
| Terminal | Select Default Profile → Command Prompt |
📊 VS Code Setup Checklist
🚀 Summary
VS Code is now configured for Python development!
Hindi: VS Code ab Python ke liye bilkul ready hai. Agle step mein Python IDLE ke baare mein seekhein, aur phir apna pehla Python program likhein!
Next Steps:
| Step | Topic | File |
|---|---|---|
| ← Previous | Install Python | install-python.mdx |
| → Next | Python IDLE | python-idle.mdx |
| → Later | First Python Program | first-python-program.mdx |
*Last Updated: June 12, 2026 | Author: WohoTech | Category: Python Setup*
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Install VS Code for Python – Complete Setup Guide with Extensions 2026.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Python Master Course topic.
Search Terms
python-master-course, python master course, python, master, course, setup, install, vscode
Related Python Master Course Topics