简体   繁体   English

VS Code Python调试控制台不完整

[英]VS Code Python debug console incomplete

Running python scripts in debugger fails to output sys.stderr . 在调试器中运行python脚本无法输出sys.stderr When my script crashes in the terminal I see the full stack trace while when it crashes while debugging it just finishes without any output. 当我的脚本在终端崩溃时,我看到了完整的堆栈跟踪,而在调试时崩溃了,它只是结束而没有任何输出。

RedirectOutput is supposed to do that, RedirectOutput应该做到这一点,

https://code.visualstudio.com/docs/python/debugging https://code.visualstudio.com/docs/python/debugging

yet it fails. 但是失败了。 I am running the debugOptions as below in my configuration 我在配置中按以下方式运行debugOptions

"debugOptions": [
                "WaitOnAbnormalExit",
                "WaitOnNormalExit",
                "RedirectOutput"
            ]

Running python 2.7 by the way 顺便运行python 2.7

Fixed it myself. 自己修复。 It's a mix of settings. 这是设置的混合。

Now it pipes all output into the terminal instead of the debug_console and displays every channel stdout & stderr 现在,它将所有输出而不是debug_console输送到终端,并显示每个通道stdout和stderr

"debugOptions": [
            "WaitOnAbnormalExit",
            "WaitOnNormalExit"
        ],
        "console": "integratedTerminal",
        "stopOnEntry": false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM