简体   繁体   English

VS Code 在调试控制台中运行 ipython

[英]VS Code run ipython in debug console

Is there a way to run an ipython like debug console in VC Code that would allow tab completion and other sort of things?有没有办法在 VC 代码中运行像调试控制台这样的ipython ,它允许制表符完成和其他类型的事情?

Meanwhile, I have become a big fan of PDB++ debugger for python.同时,我已经成为 Python 的PDB++调试器的忠实粉丝。 It works like the iPython CLI, so I think the question has become obsolete specifically for me, but still may have some value for others.它的工作方式类似于 iPython CLI,所以我认为这个问题对我来说已经过时了,但对其他人仍然可能有一些价值。

It seems this is a desired feature for VS Code but not yet implemented.这似乎是 VS Code 的理想功能,但尚未实现。 See this post: https://github.com/DonJayamanne/vscodeJupyter/issues/19看到这个帖子: https : //github.com/DonJayamanne/vscodeJupyter/issues/19

I'm trying to see if one could use the config file of VS Code to define an ipython debug configuration eg:我想看看是否可以使用 VS Code 的配置文件来定义 ipython 调试配置,例如:

{ "name": "ipython", "type": "python", "request": "launch", "program": "${file}", "pythonPath": "/Users/tsando/anaconda3/bin/ipython" }

but so far no luck.但到目前为止还没有运气。 You can see my post in the above link.你可以在上面的链接中看到我的帖子。

No, currently (unfortunately) not.不,目前(不幸的是)不是。 Here's an ongoing thread about this on github.这是 github 上的一个正在进行的主题。 The issue has P1 status, so will hopefully be implemented soon: https://github.com/microsoft/vscode-python/issues/6972该问题处于 P1 状态,因此有望尽快实施: https : //github.com/microsoft/vscode-python/issues/6972

the vscode debug console does allow for auto completion ... however, I am not sure if what you wanted was a way to trigger your code from an ipython shell, if so. vscode 调试控制台确实允许自动完成......但是,我不确定你想要的是否是一种从 ipython shell 触发代码的方法,如果是的话。 you can start ipython like so,你可以像这样启动ipython,

python -m debugpy --listen 5678 `which ipython`

For tab completion you could install pyreadline3:对于选项卡完成,您可以安装 pyreadline3:

python -m pip install pyreadline3

This is not neccessary on Linux, but on Windows it is.这在 Linux 上不是必需的,但在 Windows 上是必需的。

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

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