Is there any way(by setting or extension) to view and use variables in VSCODE other than setting breakpoints. likes Spyder?

Viewed 24614

As I know ,I can view variables in vscode by setting breakpoints, Is it possible to view and use the variables likes Spyder in Console?
Such as the picture posted bellow: the running result variable "line" can be viewed and used in Console tab. The variables in the script can be easily viewed and used in Console after running it.(also can be viewed in variable explorer)

So, Is there any way(by setting or extension) to view and use variables in VSCODE other than setting breakpoints. likes Spyder ,.
Any help will be appreciate.

enter image description here

1 Answers

In VSCode, there are two ways to view script variables besides setting breakpoints:

  1. Open the "OUTLINE" column in the lower left corner of VSCode:

    enter image description here

  2. Right-click "Run Current File in Python Interactive Window" in the script, and select "Show variables active in jupyter kernel":

    enter image description here

Related