我正在 Eclipse 中使用 PyDev 插件进行开发。我的程序在多个文件中使用多个类。我通常使用绿色“播放”图标或使用 Control+F11 来运行该程序。唯一的问题是它将运行当前处于“焦点”状态的文件。通常这不是包含我的应用程序起点的那个。当我每天运行程序大约 200 次时,这意味着我需要额外点击 200 次鼠标,但我经常忘记这一点。
有没有办法设置默认启动文件?
I am developing using the PyDev plugin in Eclipse. My program uses several classes in several files. I usually run the program using the green "play" icon or using Control+F11. The only problem is that it will run the file, which is currently in "focus". Usually this is not the one containing the starting point of my application. As I run my program something like 200 times a day, this means that I need 200 extra click on the mouse and often forget about this.
Is there any way of setting the default file to launch?
发布评论
评论(2)
是的,更改启动以重新运行上次启动的启动,这样 Ctrl+F11 将启动最后一个启动,并使用 F9 启动焦点启动的启动,请参阅说明和详细信息:http://pydev.org/manual_101_run.html
Yes, change the launching to rerun the last launched, so Ctrl+F11 will launch the last one -- and use F9 to launch the one with focus -- See instructions and details at: http://pydev.org/manual_101_run.html
对我来说,快捷键是 Ctrl+Shift+F9。我认为我没有更改任何键绑定,所以很奇怪它与官方文档有所不同。
转到“运行”->“运行历史记录”,然后选择“主要”运行。现在您应该能够在任何其他文件中使用 Ctrl-Shift+F9 来重新运行 main.c 文件。如果 Ctrl+Shift+F9 不适合您,请查看控制台窗口,该窗口应位于屏幕底部,显示每次运行后的标准输出。它的顶部有一个图标,其中有绿色的开始箭头,其下方有一个指向右侧的黄色箭头。这是使用相同配置重新启动的命令。如果您将鼠标悬停在其上,它应该会告诉您所需的键盘快捷键。
For me, the shortcut is Ctrl+Shift+F9. I don't think I've changed any keybindings, so its strange that it would be different from the official documentation.
Go to Run->Run History, and select the run that is your 'main' run. Now you should be able to use Ctrl-Shift+F9 from any other file to rerun your main. If it isn't Ctrl+Shift+F9 for you, look on the console window that should be at the bottom of your screen showing the stdout after every run. There is an icon on the top of it that has the green start arrow with a yellow arrow underneath it pointing to the right. That is the command to relaunch with the same configuration. If you hover over that, it should tell you the keyboard shortcut you need.