gpt4 book ai didi

python-3.x - VS Code Debug 控制台转义换行符,支持 ipython?

转载 作者:行者123 更新时间:2023-12-03 19:02:12 26 4
gpt4 key购买 nike

更新:我发现我的实际问题是 VSCode 在调试控制台(我习惯 sypder)中不使用 ipthon(据我所知)。 VSCode 说它支持 Jupiter 笔记本,但我找不到任何关于如何在调试时使用 ipthon 的引用,尽管有一条关于 stackoverfow 的旧评论说它会在 future 版本中出现,但链接已经失效。所以现在回到spyder。我将那些新手的原始问题留给了被同样问题困扰的 VSCode。

很抱歉这个非常简单的问题,但我刚刚开始使用 VS Code,并且在调试 python 脚本时,调试控制台中的输出会转义换行符。我该如何阻止这种行为?

例如 :

df = pd.DataFrame(np.arange(10),columns=['关闭'])

如果我将 df 输入到调试控制台中,我会得到:

df

Close\n0       0\n1       1\n2       2\n3       3\n4       4\n5       5\n6       6\n7       7\n8       8\n9       9

最佳答案

检查是否 VSCode 1.43 (Feb. 2020)将有助于:

VS Code Debug no longer escaping whitespace

The VS Code debugger UI no longer escapes or quotes any whitespace received from a debug extension or debug adapter.
For example all strings received in DAP Variables or as DAP Output events are shown in the UI as they are without modification.

This means that it is now up to the debug extension or debug adapter to decide if whitespace needs to be escaped before sending the data to VS Code.
More details can be found in #73845 and commit f647e12.

关于python-3.x - VS Code Debug 控制台转义换行符,支持 ipython?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54833597/

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