Skip to content
| Marketplace
Sign in
Visual Studio Code>Debuggers>Python Debug VariablesNew to Visual Studio Code? Get it now.
Python Debug Variables

Python Debug Variables

YZ Yan

|
3,288 installs
| (1) | Free
A VS Code extension for inspecting Python variables during debugging
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Python Debug Variables

A powerful VS Code extension for inspecting Python variables during debugging sessions with an intuitive sidebar interface.

Screenshots

Variables Inspector — every user variable in the current frame, with its type, shape and a value preview.

Variables Inspector

Full data viewer — click a variable name to browse the complete contents in an editor tab. Here a 500 × 500 NumPy array is loaded 100 rows × 100 columns at a time.

Full data viewer

Features

🔍 Real-time Variable Inspector

  • Displays all user-defined variables in a clean, organized table view
  • Shows variable name, type, shape (for arrays/lists), and value preview
  • Automatically updates when execution stops at breakpoints or after REPL commands

📊 Smart Filtering

  • Filters out internal Python variables (those starting with _ or __)
  • Excludes functions, modules, classes, and methods
  • Shows only data variables relevant to your debugging workflow

⚡ Automatic Updates

  • Auto-refreshes variable list when:
    • Program hits a breakpoint
    • Stepping through code (step over, step into, step out)
    • Executing commands in the Debug Console

📋 Comprehensive Variable Information

  • Variable Name: Alphabetically sorted for easy lookup
  • Type: Python type (int, str, list, numpy.ndarray, etc.)
  • Shape: Dimensions for arrays/lists (e.g., 2 x 3 for numpy arrays)
  • Value: Preview of the variable's content — arrays, lists, tuples, sets, dicts, and pandas Series show their first 10 elements; long values are truncated
  • Resizable columns: Drag the divider between any two columns — in the header row or anywhere down the table body — to change column widths; widths are remembered. The Value column always fills whatever space is left, so the table matches the panel width and never overflows. Narrow columns clip long values with an ellipsis (hover a cell to see the full preview)

🔎 Full Data Viewer

  • Click a variable name in the table to open the full data
  • Supports NumPy arrays (1D/2D), pandas DataFrame/Series, SciPy sparse matrices (nonzero entries), lists, tuples, sets, and dicts
  • Opens as an editor tab that can be resized, moved to another editor group, or dragged into a separate window
  • Columns can be resized by dragging the divider between two columns anywhere down the table, not just in the header; cell values are clipped with an ellipsis when a column is too narrow (hover to see the full value)
  • Lazy loading in both directions: only the first 100 rows × 100 columns are read initially; scrolling to the bottom fetches the next 100 rows, and scrolling to the right fetches the next 100 columns (added to every row already loaded). A 500 × 500 matrix therefore starts as a 100 × 100 window instead of loading 100 × 500 up front
  • Up to 250,000 cells are browsable per 2D view (20,000 rows/elements for 1D data); the status bar shows how many rows and columns are loaded and when the browser limit is reached

Usage

  1. Open the Variables Inspector

    • Click the $(symbol-variable) icon in the Activity Bar to open the "Python Variables" sidebar
  2. Start a Python Debug Session

    • Set breakpoints in your Python code
    • Start debugging (F5)
  3. View Variables

    • When execution stops at a breakpoint, variables are automatically displayed
    • Stepping through code updates the list automatically
    • Execute commands in the Debug Console - variables update automatically
    • Reopening the sidebar refreshes the current state automatically
  4. Inspect Full Data

    • Click a variable name to open that variable in a new editor tab
    • Drag the divider between two columns (header or body) to resize columns
    • Scroll to the bottom to load the next 100 rows, or scroll to the right to load the next 100 columns of a wide matrix/DataFrame (data is read on demand)
    • Use the 刷新 (Refresh) button in the viewer to re-read the variable after modifying it

Requirements

  • Visual Studio Code v1.106.1 or higher
  • Python extension for VS Code (for debugging support)
  • Active Python debug session

Extension Settings

This extension does not add any additional VS Code settings. It works out of the box once installed.

Known Issues

  • Variables are only displayed when the debugger is paused (at breakpoints or after stepping)
  • Very large data structures may have their values truncated in the preview

Release Notes

0.0.1

Initial release of Python Debug Variables extension:

  • Variable inspector sidebar panel
  • Automatic variable updates on breakpoint stops
  • Automatic updates after Debug Console commands
  • Filtered display of user-defined variables
  • Support for shape/dimension information

Contributing

Found a bug or have a feature request? Please open an issue on our GitHub repository.

Enjoy debugging with better visibility! 🐍

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft