问题
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?
回答1:
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..
回答2:
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
来源:https://stackoverflow.com/questions/8688050/is-there-such-a-thing-as-startup-file-in-pydev-under-eclipse