Skip to content

Instantly share code, notes, and snippets.

@gyng
Created August 25, 2021 06:29
Show Gist options
  • Save gyng/4c1a94bd88213527d0de2e42208b8149 to your computer and use it in GitHub Desktop.
Save gyng/4c1a94bd88213527d0de2e42208b8149 to your computer and use it in GitHub Desktop.
Python debuggin for vscode
import debugpy
try:
debugpy.listen(("0.0.0.0", 5678))
debugpy.wait_for_client()
except RuntimeError:
pass
breakpoint()
{
"name": "Attach debugger",
"type": "python",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
}
]
}
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach debugger",
"type": "python",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment