简体   繁体   English

PyDev不执行将当前行发送到控制台的快捷方式

[英]PyDev doesn't execute shortcut to send current line to console

According to this question and the PyDev documentation on the interactive console , pressing F2 should send the current line from the PyDev editor to the Python console. 根据这个问题交互式控制台上PyDev文档 ,按F2应该将当前行从PyDev编辑器发送到Python控制台。

I have a Python file open in the Python editor (I made sure of this by opening it "Open With" --> "Python Editor") and have started a console session by pressing Ctrl + Enter . 我在Python编辑器中打开了一个Python文件(通过打开它“打开方式” - >“Python编辑器”确认了这一点)并按Ctrl + Enter启动了控制台会话。 Nonetheless, when I press F2 , nothing happens. 尽管如此,当我按F2时 ,没有任何反应。 I have to select the line I'm interested in and send it to the console with Ctrl + Enter . 我必须选择我感兴趣的行,然后使用Ctrl + Enter将其发送到控制台。

I've checked my keybinding options under "Window" --> "Preferences" --> "General" --> "Keys" and am unable to see any differences between the settings for the commands "Execute line in console", which is mapped to F2 , and "Interactive Console", which is mapped to Ctrl + Alt + Enter . 我已经在“窗口” - >“首选项” - >“常规” - >“键”下检查了我的键绑定选项,并且无法看到命令“在控制台中执行行”的设置之间的任何差异,映射到F2和“交互式控制台”,映射到Ctrl + Alt + Enter However, the second command works whereas the first does not. 但是,第二个命令有效,而第一个命令不起作用。 I've also tried mapping the command to other keys, but that hasn't changed the results at all. 我也尝试将命令映射到其他键,但这根本没有改变结果。 Any tips on how I can use this command? 有关如何使用此命令的任何提示?

I had that problem. 我有那个问题。 All shortcuts worked except F2. 除F2外,所有快捷方式均有效。 I tried many things without success. 我尝试了许多没有成功的事情。 But in the end. 不过最终。 Simply restarting Eclipse solved the problem. 简单地重启Eclipse解决了这个问题。

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

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