在 PyDev 中执行默认的 .py 文件
我正在 Eclipse 中使用 PyDev 做一个 Python 项目。我有一个“主”文件和一些“类”文件。我主要在类中工作,但我需要通过主文件执行代码。
目前我需要切换到主文件,或者使用运行/调试按钮的下拉菜单来执行主文件。按下按钮或使用 F11,只运行类文件(这是无用的)
有没有办法让 PyDev 始终运行项目中的特定文件,或者也许始终运行最后执行的文件(这可能是最好的解决方案) 。
提前致谢 :)
I'm doing a Python project in Eclipse with PyDev. I have a "main" file and some "class" files. I primarily work in the classes, but I need to execute the code via the main file.
At the moment I need to either switch to the main file, or use the drop down menu of the run/debug-button to execute the main file. Pressing the button or using F11, just runs the class file (which is useless)
Is there a way to let PyDev always run a specific file in a project, or perhaps always run the last file executed (which probably will be the best solution).
Thanks in Advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然(重新启动上次启动实际上是 Eclipse 3.2 中的默认设置,从来不明白他们为什么改变这一点)...
您可以将其返回到首选项中: window > >偏好>运行/调试>启动并将启动操作设置为始终启动先前启动的应用程序。
因此,Ctrl+F11 将重新启动上次启动,F11 将调试上次启动...
要启动文件,您可以:
(参考:http://pydev.org/manual_101_run.html
)使用单元测试,您可能还想看看:使用 Pydev(Python 和 Eclipse)进行连续单元测试
Surely (relaunching the last launch was actually the default in in Eclipse 3.2, never understood why they changed that)...
You can have that back in the preferences at: window > preferences > Run/Debug > Launching and set the Launch Operation to Always launch the previously launched application.
So, Ctrl+F11 will relaunch the last launch and F11 will debug the last launch...
And to launch the file initially you may:
(reference: http://pydev.org/manual_101_run.html)
And if you use unit-tests, you may also want to take a look at: Continuous unit testing with Pydev (Python and Eclipse)