python - VS 代码中的外部终端调试器

标签 python json debugging visual-studio-code

由于我无法在调试控制台中提供输入,因此我尝试在 VS Code 的外部终端中运行调试器。

这是外部终端的 launch.json 配置文件的一部分。

{
            "name": "Python: Terminal (external)",
            "type": "python",
            "request": "launch",
            "stopOnEntry": true,
            "pythonPath": "${config:python.pythonPath}",
            "program": "${file}",
            "cwd": "",
            "console": "externalTerminal",
            "env": {},
            "externalConsole": true,
            "envFile": "${workspaceRoot}/.env",
            "debugOptions": [
                "WaitOnAbnormalExit",
                "WaitOnNormalExit"
            ]
},

我按照他们所说的添加了 "externalConsole": true 部分 here我尝试了有或没有该声明。

我得到这个错误,

Debug adapter process has terminated unexpectedly

我尝试了 docs和 json 文件中的 IntelliSense,但我无法理解并让它工作。

最佳答案

"console": "externalTerminal", 添加到调试配置文件在 Linux 上运行良好!

关于python - VS 代码中的外部终端调试器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47687411/

相关文章:

python - tensorflow 2.0 : How are metrics computed when the ouput is sequential?

python - 需要输出掷 2 个骰子的前 3 个结果,这两个骰子的面数是可变的

java - 在 Java 中使用 Jackson 创建 JSON 对象

c++ - 如何修复 “a debugging check in this application has failed”错误?

java - 查找 jvm 8 中内存使用过多的原因

Python将数据框中的列表转换为字符串

python - 如何在 Python 中制作可排序的数据类型?

javascript - IndexedDB 和 Angular 应用程序上的大量插入

ruby-on-rails - 安装 json Ruby gem 时出错

debugging - 有没有办法获取先前在 PostgreSQL 中作为给定事务的一部分执行的 SQL 语句的列表?