简体   繁体   English

如何使 PyDev 调试控制台具有交互性?

[英]How to make PyDev Debug Console Interactive?

PyDev offers both a debug console as well as an interactive console . PyDev 提供调试控制台交互式控制台 However, I am still not able to execute interactive commands such as %timeit in the debug console.但是,我仍然无法在调试控制台中执行诸如%timeit类的交互式命令。

How can I make the debug console interactive?如何使调试控制台具有交互性?

You can't currently make the debug console an IPython interactive console -- you can have a "regular" interactive console by right-clicking a stack-frame in the Debug view > PyDev > Debug Console , but it's not really an interactive console with IPython support.您目前无法使调试控制台成为 IPython 交互式控制台——您可以通过右键单击Debug view > PyDev > Debug Console中的堆栈框架来拥有一个“常规”交互式控制台,但它并不是真正的交互式控制台IPython 支持。

Starting an IPython session in the context of a breakpoint could end up having side effects that could break your debug session, so, it wasn't implemented -- although in practice, there's probably nothing stopping anyone from implementing it (the only thing is that there should probably be a preference so that users could opt out of it and the time and willingness to actually implement it).在断点的上下文中启动 IPython 会话可能最终会产生可能破坏您的调试会话的副作用,因此,它没有实现——尽管在实践中,可能没有什么能阻止任何人实现它(唯一的问题是可能应该有一个偏好,以便用户可以选择退出它以及实际实施它的时间和意愿)。

Another option is turn things the other way around.另一种选择是反过来。 Start an interactive console and have a debugger attached to it -- go to window > preferences > PyDev > Interactive Console and check Connect console to Debug Session?启动一个交互式控制台并为其附加一个调试器——转到window > preferences > PyDev > Interactive Console并选中Connect console to Debug Session?

See: http://www.pydev.org/manual_adv_interactive_console.html#full-debug-support-in-interactive-console for more details.有关更多详细信息,请参阅: http : //www.pydev.org/manual_adv_interactive_console.html#full-debug-support-in-interactive-console

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

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