The right editor accelerates learning and productivity. This guide covers the three most popular choices for Python developers.

Free, lightweight, and extensible — the most popular editor for Python.

Installation

  1. Download from code.visualstudio.com
  2. Install the Python extension by Microsoft (Ctrl+Shift+X → search “Python”)
  3. Also install: Pylance (bundled with Python ext), Python Debugger

Configure Python Interpreter

  1. Open your project folder (File → Open Folder)
  2. Ctrl+Shift+P → “Python: Select Interpreter”
  3. Choose your virtual environment: .venv/bin/python
  {
    "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
    "editor.formatOnSave": true,
    "[python]": {
        "editor.defaultFormatter": "ms-python.black-formatter"
    },
    "python.analysis.typeCheckingMode": "basic",
    "editor.rulers": [88]
}
  

Running Code

  • Run file: click ▶ button top-right, or F5
  • Integrated terminal: Ctrl+thenpython script.py`
  • REPL: Ctrl+Shift+P → “Python: Start REPL”

Debugging

  1. Click left of line number to set a breakpoint (red dot)
  2. Press F5 → select “Python File”
  3. Use F10 (step over), F11 (step into), F5 (continue)
  4. Inspect variables in the left panel

Useful Extensions

Extension Purpose
Python (Microsoft) Core support
Black Formatter Auto-format on save
autoDocstring Generate docstrings
GitLens Git blame and history
Error Lens Inline error display
Docker Container management

PyCharm

Full-featured IDE by JetBrains — best for large projects and Django/Flask development.

Editions

Edition Cost Best For
Community Free General Python, learning
Professional Paid Django, Flask, databases, web

Download: jetbrains.com/pycharm

Key Features

  • Smart code completion and refactoring
  • Integrated debugger with visual breakpoints
  • Built-in terminal and Python console
  • Database tools (Professional)
  • Django/Flask project templates (Professional)

Create a Project

  1. File → New Project
  2. Select “Pure Python” or “Django” / “Flask”
  3. Set location and interpreter (create new venv)
  4. PyCharm auto-detects requirements.txt

Run and Debug

  • Green ▶ to run current file
  • Right-click → Debug to start debugger
  • Shift+F10 to run, Shift+F9 to debug

Jupyter Notebooks

Interactive environment — ideal for data exploration, ML experiments, and learning.

Installation

  pip install jupyterlab
jupyter lab
# Opens browser at http://localhost:8888
  

Or use Google Colab (free, GPU available): colab.research.google.com

Basic Usage

  • Cell: block of code or markdown
  • Shift+Enter: run cell and move to next
  • Ctrl+Enter: run cell and stay
  • B: insert cell below (command mode)
  • M: convert cell to markdown
  # Code cell
import numpy as np
data = np.random.randn(1000)
data.mean()
  
  # Markdown cell
## Analysis Results
The mean is approximately 0 due to the normal distribution.
  

When to Use Jupyter

Use Jupyter Use .py scripts
Data exploration Production code
ML experiments Web applications
Visualizations CLI tools
Teaching/learning Version-controlled modules

Export notebooks to Python scripts: File → Save and Export → Python (.py)


Comparison

Feature VS Code PyCharm Jupyter
Cost Free Free/Paid Free
Learning curve Low Medium Low
Debugging Good Excellent Limited
Data science Good Good Excellent
Web dev Good Excellent Poor
Extensions Many Built-in Plugins

Recommendation by Goal

  • Learning Python → VS Code or Jupyter
  • Web development → VS Code or PyCharm Professional
  • Data science / ML → Jupyter + VS Code
  • Large team projects → PyCharm

Next Steps

Pick one editor, configure it once, and focus on learning Python.