gpt4 book ai didi

python-3.x - VS 代码 : "Property Debug Options Not Allowed"

转载 作者:行者123 更新时间:2023-12-01 04:32:40 24 4
gpt4 key购买 nike

我正在尝试学习 Python 并设置 VS Code 的 Python 调试器,如该视频所述:https://www.lynda.com/Python-tutorials/Choosing-editor-IDE/661773/707220-4.html

但是,讲师似乎在使用 VS Code 1.18,而我在使用 1.28。我根据它在视频中的显示方式设置了 launch.json 配置,但是我在“debugOptions”下看到一条绿线,上面写着“不允许使用属性 debugOptions”。任何人都知道我可以如何设置我的环境,使其按照讲师解释的方式工作。我在 Windows 10 上。

{
// 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": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${file}",
"cwd": "",
"env":{},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOuput"
]
},
{
"name": "Python: Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost"
},
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "enter-your-module-name-here",
"console": "integratedTerminal"
},
{
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"console": "integratedTerminal",
"args": [
"runserver",
"--noreload",
"--nothreading"
],
"django": true
},
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "app.py"
},
"args": [
"run",
"--no-debugger",
"--no-reload"
],
"jinja": true
},
{
"name": "Python: Current File (External Terminal)",
"type": "python",
"request": "launch",
"program": "",
"console": "externalTerminal"
}
]

}

最佳答案

       "name": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${file}",
"cwd": "",
"env":{},
"envFile": "${workspaceRoot}/.env",
"console": "none" //add this and go

关于python-3.x - VS 代码 : "Property Debug Options Not Allowed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52807693/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com