/cc @ElaineDi
Install ptvsd via below command:
python.exe -m pip install ptvsd --pre
Add new python file named attach_test.py, enter some code like below:
import ptvsd
ptvsd.enable_attach()
ptvsd.wait_for_attach()
for i in range(1, 10, 2):
print (i)
print('demo done.')
Run attach_test.py and wait for attaching:
Run c:\python\python36\Python attach_test.py
Select debugging configuration "Python: Attach"
Press F5 to start debugging, ensure:
Hit the break point
Inspect variables
Step into/out/over, etc..


/cc @ElaineDi
Install ptvsd via below command:
python.exe -m pip install ptvsd --preAdd new python file named
attach_test.py, enter some code like below:Run attach_test.py and wait for attaching:
Run
c:\python\python36\Python attach_test.pySelect debugging configuration "Python: Attach"
Press F5 to start debugging, ensure:
Hit the break point
Inspect variables
Step into/out/over, etc..