python-3.x - VS Code:“不允许属性调试选项”
问题描述
我正在尝试学习 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”下得到一条绿线,上面写着“不允许使用Property 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
推荐阅读
- c# - 反序列化发布请求
- linux - 如何在linux上创建脚本链接
- c# - 在 Azure 中部署 ASP.net 核心应用程序时,Azure AD 的 400 无效 id 令牌
- python - 如何使用python将whatsapp web上的群聊中发送的最新消息作为字符串获取
- python - 如何在 python 中对这张图片的坐标进行排序?
- javascript - React.js - 使用“npx create-react-app”命令时的警告和错误
- php - 使用 php 拆分大 XML 文件
- java - Java Appium - 线程“主”java.lang.ExceptionInInitializerError 中的异常 - 原因:java.lang.IllegalArgumentException
- javascript - 如何通过任何匹配的代码/名称而不是每个可用字段来过滤表
- vb.net - 12C 上的提供程序 OraOLEDB.Oracle 的 AccessViolationException?