简体   繁体   English

Pydev交互式控制台-使用“ if”时不显示输出

[英]Pydev interactive console - output does not appear when using “if”

If I type 如果我输入

if 1: print("yes")

in an interactive console in Pydev, there is no output. 在Pydev中的交互式控制台中,没有输出。 This happens whether I choose "Console for currently active editor" or "Python console". 无论我选择“当前活动的编辑器控制台”还是“ Python控制台”,都会发生这种情况。 Why is this, and how can I fix it? 为什么会这样,我该如何解决?

If I type the same line in IDLE, or in Python within the Windows Command Prompt, I get the output yes as expected (after pressing Enter twice). 如果我在IDLE或Windows命令提示符下的Python中键入同一行,则得到的输出yes预期的(两次按Enter键之后)。 If I type just print("yes") in the interactive console in Pydev, I also get the output yes as expected. 如果我在Pydev的交互式控制台中只输入print("yes") ,我也会得到预期的输出yes

I am using Python 3.6, Eclipse 4.4.1, Pydev 3.8.0.201409251235, and Windows 10. 我正在使用Python 3.6,Eclipse 4.4.1,Pydev 3.8.0.201409251235和Windows 10。

I updated to Eclipse 4.7.1a and Pydev 6.2.0.201711281614, and now the interactive console works as expected. 我更新到Eclipse 4.7.1a和Pydev 6.2.0.201711281614,现在交互式控制台可以按预期工作。

I would still be interested in knowing why the earlier versions had this problem. 我仍然会对知道为什么早期版本有此问题感兴趣。

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

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