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

标签 python-3.x visual-studio-code escaping ipython vscode-debugger

更新:我发现我的实际问题是 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/

相关文章:

Python3 判断两个字典是否相等

visual-studio-code - VSCode : What's that green statusbar terminal-ish icon in October 2019 release notes?

visual-studio-code - Visual Studio Code中的HTML5 canvas智能感知

c# - 使用调试 Visual Studio 代码的 Dotnet 监视

primefaces - 如何在 Primefaces 中添加 HTML 标签 <p :panel> header attribute?

python - 如何阻止 BeautifulSoup 转义内联 javascript

ruby-on-rails - assert_select 测试原始或 html_safe 未转义的内容

python - 沿一列将 DataFrame 从长到宽 reshape

python - 如何禁用 Gtk 上的所有默认按键

python - 覆盖 getattr 和 setattr 的方式的根本区别