擅长:python、mysql、java
<h3>编辑3</h3>
<p>与python扩展的<a href="https://github.com/Microsoft/vscode-python/blob/master/CHANGELOG.md#201940-23-april-2019" rel="nofollow noreferrer">release 2019.4.0</a>一样,现在可以将<code>console</code>选项设置为<code>internalConsole</code>(<a href="https://github.com/Microsoft/vscode-python/issues/4321" rel="nofollow noreferrer">#4321</a>)。</p>
<h3>编辑2</h3>
<p>根据<a href="https://stackoverflow.com/a/54120934/6925187">omartin2010's answer</a>中的建议,您可以另外设置选项</p>
<pre><code>"internalConsoleOptions": "openOnSessionStart"
</code></pre>
<p>在开始调试时自动打开调试控制台。</p>
<h3>编辑1</h3>
<p>将<a href="https://code.visualstudio.com/docs/python/debugging#_console" rel="nofollow noreferrer">console</a>选项显式设置为<code>none</code>是一种方法。见评论。</p>
<pre><code>"console": "none"
</code></pre>
<h3>原始答案</h3>
<p>要确保将输出写入调试控制台,可以设置<a href="https://code.visualstudio.com/docs/python/debugging#_debugoptions" rel="nofollow noreferrer">debugOptions</a>。
在<code>launch.json</code>的配置中添加以下条目应该可以修复它:</p>
<pre class="lang-json prettyprint-override"><code>"debugOptions": [
"RedirectOutput"
]
</code></pre>