Replies: 1 comment 2 replies
-
We use debugpy and vscode to allow debugging of the Python code def debug(port: int = 5678):
"""
Enable debugging for the python script
Use the example launch.json configuration below to connect from VSCode:
```
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Attach using Process Id",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"justMyCode": false
}
]
}
"""
import debugpy
debugpy.listen(port)
debugpy.wait_for_client()
debugpy.breakpoint() |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I'm working on a C# application in Visual Studio 2022 that integrates with Python using Python.NET. However, I'm facing issues when trying to debug the Python code from C#. Specifically, I'm unable to step through the Python code or set breakpoints effectively.
Could anyone provide guidance or suggestions on how to debug Python code within a C# application using Python.NET?
I've seen the following tutorial but it is from 2017 and it didn't seem straight forward to do: https://github.com/pythonnet/pythonnet/wiki/Various-debugging-scenarios-of-embedded-CPython
Thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions