🐍 Lesson 14 of 40 Languages Intermediate

Python Development in VS Code

With the Python extension installed, VS Code becomes a full-featured Python IDE. This lesson covers virtual environments, Pylance, Jupyter, and debugging Python code.

35% complete

1Installing the Python Extension

Search for Python in the Extensions view and install the Microsoft Python extension. This bundles Pylance (the language server), the Python debugger, and Jupyter notebook support.

2Virtual Environments & Interpreter Selection

Press Ctrl+Shift+PPython: Create Environment to create a venv or conda environment. VS Code detects it automatically. The selected interpreter is shown in the Status Bar — click it to switch.

Terminal — create and activate venv
python -m venv .venv
# VS Code activates it automatically in new terminals
pip install fastapi uvicorn

3Pylance & Type Checking

Pylance provides fast, type-aware IntelliSense including auto-imports, signature help, hover docs, and inlay type hints. Enable strict mode in pyrightconfig.json:

pyrightconfig.json
{
  "typeCheckingMode": "strict",
  "pythonVersion": "3.12"
}

4Running & Debugging Python

Click the Run Python File button in the top-right, or press F5 with a launch.json. Set breakpoints anywhere; VS Code's debugger shows the call stack, local variables, and a watch panel. The Python debugger also supports Remote Attach for debugging running servers.

5Jupyter Notebooks

Open any .ipynb file and VS Code displays it as an interactive notebook. Run cells with Shift+Enter, view rich outputs inline, and use Copilot for cell completions. Export to .py or share via Codespaces.

💡 Tip: Use Ruff (from Astral) as your Python linter and formatter — it's 10–100× faster than Flake8/Black and has a VS Code extension that slots in seamlessly.

All 40 Lessons
Pick any lesson to jump straight to it.
L01
Getting Started with VS Code
FoundationBeginner
L02
The VS Code Interface & Layout
FoundationBeginner
L03
Installing & Managing Extensions
ExtensionsBeginner
L04
Keyboard Shortcuts & Command Palette
ProductivityBeginner
L05
Settings, Themes & Customization
CustomizationBeginner
L06
IntelliSense & Code Completion
Editor FeaturesBeginner
L07
Integrated Terminal Mastery
ProductivityBeginner
L08
Search, Find & Replace Across Files
Editor FeaturesBeginner
L09
Git & Source Control with VS Code
Version ControlBeginner
L10
Snippets & Emmet Abbreviations
ProductivityBeginner
L11
GitHub Copilot — Getting Started
AI & CopilotIntermediate
L12
Copilot Chat & Inline Ask
AI & CopilotIntermediate
L13
JavaScript & TypeScript Development
LanguagesIntermediate
L14
Python Development in VS Code
LanguagesIntermediate
L15
Debugging Like a Pro
DebuggingIntermediate
L16
Linting, Formatting & ESLint
Code QualityIntermediate
L17
Multi-Cursor Editing & Refactoring
Editor FeaturesIntermediate
L18
Workspaces & Multi-Root Projects
WorkspaceIntermediate
L19
Tasks, Build Systems & npm Scripts
WorkflowIntermediate
L20
Testing with Jest, Vitest & Pytest
TestingIntermediate
L21
React Development Workflow
Web DevIntermediate
L22
Node.js & Express in VS Code
BackendIntermediate
L23
Docker & Dev Containers
DevOpsIntermediate
L24
Live Share — Real-Time Collaboration
CollaborationIntermediate
L25
Jupyter Notebooks in VS Code
Data ScienceIntermediate
L26
REST Client & API Testing
API DevIntermediate
L27
SSH Remote Development
Remote DevIntermediate
L28
WSL 2 Integration on Windows
Remote DevIntermediate
L29
Advanced Debugging: Breakpoints & Watch
DebuggingAdvanced
L30
Copilot Agent Mode — Agentic Workflows
AI & CopilotAdvanced
L31
Profile & Performance Optimisation
PerformanceAdvanced
L32
GitHub Actions & CI/CD Integration
DevOpsAdvanced
L33
Custom Keybindings & Key Maps
CustomizationAdvanced
L34
Settings Sync & Dotfiles Management
WorkflowAdvanced
L35
Language Server Protocol (LSP) Explained
InternalsAdvanced
L36
Rust Development in VS Code
LanguagesAdvanced
L37
Go Development in VS Code
LanguagesAdvanced
L38
GitHub Codespaces & vscode.dev
Remote DevExpert
L39
Writing Your First VS Code Extension
Extension DevExpert
L40
Pro VS Code Workflow & Mastery
MasteryExpert