Overview Version History Q & A Rating & Review
Save Debug Variable to File
Adds "Save Value to File..." and "Copy Full Value to Clipboard" options to the context menu of the debugger's Variables view.
Usage
Start a debug session and stop at a breakpoint.
In Run and Debug → Variables , right-click a variable.
Choose Save Value to File... (pick where to save it) or Copy Full Value to Clipboard (same content, ready to paste, e.g. as a column in Excel).
How the value is obtained
Python sessions (debugpy): serialization runs inside the debugged process, which writes the file directly. Nothing is truncated:
numpy.ndarray → one value per line (flattened in C order), ready to paste as a column in Excel
xarray DataArray → values only, one per line; Dataset → one section per coordinate/variable, one value per line
pandas → to_string()
anything else → repr()
Other languages: a "Copy Value"-style evaluation (context: 'clipboard'); falls back to the value shown in the view.
Notes
Arrays with millions of elements produce huge text files and take a while; that is the cost of the text format.
With remote debugging, the Python process writes on its machine: the chosen path must exist there.
Credits
Code developed by Claude Fable (Anthropic's AI model).