reference: https://github.com/yuanzhoulvpi2017/vscode_debug_transformers
程序入口
import debugpy
try:# 5678 is the default attach port in the VS Code debug configurations. Unless a host and port are specified, host defaults to 127.0.0.1debugpy.listen(("localhost", 9501))print("Waiting for debugger attach")debugpy.wait_for_client()
except Exception as e:pass
launch.json
{"name": "sh_file_debug","type": "debugpy","request": "attach","connect": {"host": "localhost","port": 9501}
},