Eclipse下PyDev有启动文件之类的东西吗?

发布于 2024-12-23 11:50:28 字数 194 浏览 2 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

晨敛清荷 2024-12-30 11:50:28

转到运行 ->运行配置

在右侧的菜单中,您应该有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..

另类 2024-12-30 11:50:28

感谢@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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文