![]() |
Integrating Python Debugging with Visual Studio Code in a Custom Application - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Networking (https://python-forum.io/forum-12.html) +--- Thread: Integrating Python Debugging with Visual Studio Code in a Custom Application (/thread-42088.html) |
Integrating Python Debugging with Visual Studio Code in a Custom Application - bill787 - May-08-2024 I’ve integrated Python directly into my application, running it within the same process by loading Python’s relevant libraries. I’m looking to debug Python code through my application’s Python interface using Visual Studio Code. After examining the debugpy module’s source code, which facilitates Python debugging in VSCode, I’m seeking guidance on how to configure my application. Specifically, I want to be able to attach to my application’s PID using VSCode, ensuring that code executions triggered by my application will pause at breakpoints set in VSCode. How can I achieve this? How does attaching to a PID, getting its corresponding port number, interaction with VSCode, debugpy and Python work? RE: Integrating Python Debugging with Visual Studio Code in a Custom Application - PyDan - May-08-2024 I do this in Python for AutoCAD I have a function that tells debugpy to listen https://github.com/CEXT-Dan/PyRx/blob/main/PyRxStubs/PyRxDebug.py Then setup a config in VS code https://github.com/CEXT-Dan/PyRx/blob/main/MyVsCodeSettings.txt edit: clients do something like this # debug def PyRxCmd_pydebug(): import PyRxDebug PyRxDebug.startListener()running the command starts the listener Hope this helps |