Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 988
KuMasann Avatar asked Oct 18 '20 02:10

KuMasann


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

like image 155
Jill Cheng Avatar answered Oct 17 '22 05:10

Jill Cheng