Eclipse下PyDev有启动文件之类的东西吗?
我在 Eclipse 中创建了一个新项目 PyDev。
如果我在 VS2010 中,我会将一个项目标记为启动项目,每当我单击 F5 时,它就会运行。
我想将一个 .py 文件标记为我所谓的 Main,并且每次单击运行 (F11) 时,它将是要运行的文件,而不是正在编辑的当前文件。
是否可以?
I have created a new project in Eclipse, PyDev.
If I were in VS2010, I would mark a project as startup project, and whenever I click F5, it runs.
I want to mark one .py file to be my so called Main, and that each time I click run (F11), it will be the one to run, and not the current that is being edited.
Is it possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
转到
运行 ->运行配置
在右侧的菜单中,您应该有
Python Run
选项。双击创建新的运行配置。在右侧您可以选择要运行的项目及其主模块。其他选项卡可用于配置参数、用于运行项目的 python 解释器等。
Go to
run -> run configurations
In the menu on the right you should have
Python Run
option. Create new run configuration by double clicking.On the right you can select the project you want to run and it's main module. The other tabs can be used to configure arguments, python interpreter used to run the project, etc..
感谢@soulcheck,我找到了问题。
看来问题是 Eclipse 3 尝试启动当前文件而不是 main.c 文件。
解决办法如下:
使用 Eclipse 在 PyDev 中调试的快捷方式是什么
Thanks to @soulcheck, I have found the problem.
It seems that the problem is that Eclipse 3 tries to launch current file instead of the main.
Here is the solution:
Whats the shortcut to Debug in PyDev using Eclipse