.........
self._process = subprocess.Popen(
exec_cmd, universal_newlines=True, startupinfo=startupinfo
)
self.started = True
exec_cmd='path_to/activitywatch/venv/bin/aw-watcher-window'
VScode 中 debug 的时候,subprocess.Popen执行完了,到下一句,都没有断在 aw-watcher-window 的main中,断点肯定是打了的
不知道如何才能在 VScode 中 debug 这种多线程的 python 代码
launch.json 配置
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"subProcess": true,
"justMyCode": true
},
{
"name": "MySubProcess",
"type": "python",
"request": "attach",
"processId":"${command:pickProcess}",
"justMyCode": true
}
]
}