简体   繁体   English

PyDev:将代码运行到交互式控制台

[英]PyDev: Running code to interactive console

As my problem is quite simple I'll try to make this question simple aswell. 由于我的问题很简单,我会尝试使这个问题变得简单。 The problem I'm having concerns the PyDev interactive console. 我遇到的问题是PyDev交互式控制台。 I can bring up the console just fine without problems, and even use it as an interactive shell, just as I would be able to with IDLE. 我可以毫无问题地调出控制台,甚至可以将它用作交互式shell,就像我可以使用IDLE一样。 However, when I try to run my code that I've written in my project module, it won't run to the interactive console, but to the Eclipse default console. 但是,当我尝试运行我在项目模块中编写的代码时,它不会运行到交互式控制台,而是运行到Eclipse默认控制台。 The default console displays the program just fine, but since it's not an interactive shell, I can't do anything afterwards. 默认控制台显示程序很好,但由于它不是交互式shell,我之后无法做任何事情。

With that being said, my question is: How do I get my code to run to the PyDev interactive console, and not the Eclipse default one? 话虽如此,我的问题是:如何让我的代码运行到PyDev交互式控制台,而不是Eclipse默认代码? Thanks in advance! 提前致谢!

For making the symbols of the current editor available in the interactive console, use Ctrl+Alt+Enter (which will do a runfile in the interactive console context). 要在交互式控制台中使用当前编辑器的符号,请使用Ctrl+Alt+Enter (这将在交互式控制台上下文中执行运行文件)。

Also, make sure you read: http://www.pydev.org/manual_adv_interactive_console.html 另外,请务必阅读: http//www.pydev.org/manual_adv_interactive_console.html

First it is possible. 首先它是可能的。 Second, off top of my head it might be you need to change in preferences where the debug perspective points to? 其次,我可能需要更改调试透视图指向的首选项? Look through pydev preferences too. 查看pydev首选项。 Sorry not to be more helpful. 对不起,没有更多的帮助。 Away from computer. 远离电脑。

Run the program from the code window. 从代码窗口运行该程序。 Try hitting F9 whike cyrsor in your code window. 尝试在代码窗口中点击F9之前的cyrsor。 Results and bugs should show up in console. 结果和错误应该出现在控制台中。

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

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