how to debug python in visual studio

2019-08-20 05:16发布

I recently started working in python with visual studio and I have 2 questions please:

  1. Is there some kind of special configuration that you have to perform in order to be able to debug python code? Was I supposed to install something or did VS come this way?

  2. Suppose im in a decoding session, inside a function that's declared in the scope of some class. Can I view the values of the class variables defined in the init? If so, how? I tried to write "self.someField" in the watch window but it didn't work.

Thanks you!

1条回答
Melony?
2楼-- · 2019-08-20 06:08

You could debug your python code like general debugging steps in VS, of course, it also has different settings or Environment options. If you want to get much more detailed information, please see this document here:

Debugging your Python code

In addition, one thread for one issue, for the second issue:

2.Suppose im in a decoding session, inside a function that's declared in the scope of some class. Can I view the values of the class variables defined in the init? If so, how? I tried to write "self.someField" in the watch window but it didn't work.

If possible, I suggest you open a new case for this new issue, you could also share your main code, so other community members could really repro this issue in their side.

查看更多
登录 后发表回答