I've been using PTVS to debug PythonScripts. Hitting breakpoints, watch window, etc., all work.
The only issue for me is the "Debug Interactive" window doesn't work as I expect. It's either not connected to the NPP/Python debugging session, or it's not connected at all. Interestingly, the "immediate" window works and is in the current frame. Commands like
console.write("linenum: %d", LineNum)
work there and output to the PythonScript console. The drawback is the immediate window has less functionality. Multi-line statements don't work there for example.
My guess is that PythonScript is capturing the console, and maybe PTVS needs the console for its own interactive window.
Any ideas?
Overall I'm quite pleased with how it works at this point. Getting the interactive window working would be a nice bonus.
Last edit: GravityWell 2014-09-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
GW,
I'm assuming you used the PTVS "Attach to Process" feature to attach to your running NPP PythonScript session...
IIRC, (it's been a good while), the "immediate" window IS hooked up to your attached debug process, however the PTVS "Debug Interactive" feature starts up its own separate Python process, which of course would not be aware of your attached debug session.
I may be wrong, but I think a good read of the PTVS doc will reveal that... (which I need to do myself here real soon).
Just my two cents... Hope it helps.
Dave W.
(NOT Dave G.B. ;-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Indeed I used Debug->Attach to Process (and the Python code type), and attached to NPP.
Thanks for the insight. I might post a question on the PTVS forum, using the difference between immediate and interactive as a starting point.
There are quite a few meta commands in the interactive window, $frame, $proc, $thread. I've experimented with all of them, mostly guesswork, and so far no success.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been using PTVS to debug PythonScripts. Hitting breakpoints, watch window, etc., all work.
The only issue for me is the "Debug Interactive" window doesn't work as I expect. It's either not connected to the NPP/Python debugging session, or it's not connected at all. Interestingly, the "immediate" window works and is in the current frame. Commands like
work there and output to the PythonScript console. The drawback is the immediate window has less functionality. Multi-line statements don't work there for example.
My guess is that PythonScript is capturing the console, and maybe PTVS needs the console for its own interactive window.
Any ideas?
Overall I'm quite pleased with how it works at this point. Getting the interactive window working would be a nice bonus.
Last edit: GravityWell 2014-09-15
GW,
I'm assuming you used the PTVS "Attach to Process" feature to attach to your running NPP PythonScript session...
IIRC, (it's been a good while), the "immediate" window IS hooked up to your attached debug process, however the PTVS "Debug Interactive" feature starts up its own separate Python process, which of course would not be aware of your attached debug session.
I may be wrong, but I think a good read of the PTVS doc will reveal that... (which I need to do myself here real soon).
Just my two cents... Hope it helps.
Dave W.
(NOT Dave G.B. ;-)
Indeed I used Debug->Attach to Process (and the Python code type), and attached to NPP.
Thanks for the insight. I might post a question on the PTVS forum, using the difference between immediate and interactive as a starting point.
There are quite a few meta commands in the interactive window, $frame, $proc, $thread. I've experimented with all of them, mostly guesswork, and so far no success.
Best of luck. It's an interesting issue. Let us know what you find out. ;)
DW