我想用
rl_methods.py
来调试 xvfb-run
,就像输入命令一样
xvfb-run -a -s "-screen 0 640x480x24" python rl_methods.py
在终端中。 我应该如何修改
launch.json
才能实现这一目标。
我询问了chatgpt并测试了它的答案。这是启动配置:
"configurations": [
{
"name": "Python: xvfb-run rl_methods.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/rl_methods.py",
"args": [],
"env": {},
"console": "integratedTerminal",
"preLaunchTask": "Run xvfb-run"
}
]
这是相应的任务配置:
"tasks": [
{
"label": "Run xvfb-run",
"type": "shell",
"command": "xvfb-run -a -s \"-screen 0 640x480x24\"",
"args": ["python", "${workspaceFolder}/rl_methods.py"],
"problemMatcher": [],
"isBackground": true
}
]