当使用 Pydev 插件选择运行或调试时,如何配置 Eclipse 以启动浏览器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/697142/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I configure Eclipse to launch a browser when Run or Debug is selected using Pydev plugin
提问by Clutch
I'm learning Python and Django using the Eclipse Pydev plugin. I want the internal or external browser to launch or refresh with the URL http:/127.0.0.1 when I press Run or Debug. I've seen it done with the PHP plugins but not Pydev.
我正在使用 Eclipse Pydev 插件学习 Python 和 Django。我希望内部或外部浏览器在我按下运行或调试时使用 URL http:/127.0.0.1 启动或刷新。我已经看到它是用 PHP 插件完成的,但不是 Pydev。
采纳答案by Rich Seller
Here are the steps to set up an external launch configuration to launch IE:
以下是设置外部启动配置以启动 IE 的步骤:
- Select Run->External Tools->External Tools Configurations...
- In the left hand pane, select Programthen the new icon (left-most icon above the pane).
- In the right hand pane, select the Maintab.
- Enter launch_iein the Name:field.
- Enter ${system_path:explorer.exe}in the Location:field.
- Enter http:/127.0.0.1in the Argumentsfield.
- To run the external configuration, select Run.
- 选择运行->外部工具->外部工具配置...
- 在左侧窗格中,选择程序,然后选择新图标(窗格上方最左侧的图标)。
- 在右侧窗格中,选择Main选项卡。
- 在名称:字段中输入launch_ie。
- 在位置:字段中输入${system_path:explorer.exe}。
- 在参数字段中输入http://127.0.0.1。
- 要运行外部配置,请选择Run。
If you want to share the configuration you can use these optional steps:
如果要共享配置,可以使用以下可选步骤:
- Select the Commontab
- Select the Shared file:option in the Save Assection.
- Select a location to save the configuration (saving it to an otherwise empty project might be a good idea, as you can import that to another workspace)
- 选择通用选项卡
- 在另存为部分中选择共享文件:选项。
- 选择一个位置来保存配置(将其保存到一个空项目可能是个好主意,因为您可以将其导入到另一个工作区)
To rerun the configuration you have a few choices:
要重新运行配置,您有几个选择:
回答by Trey Stout
project properties (right click project in left pane)
项目属性(右键单击左窗格中的项目)
Go to "run/debug settings", add a new profile. Setup the path and environment etc... you want to launch. The new configuration will show up in your build menu. You could also configure it as an "external tool"
转到“运行/调试设置”,添加一个新的配置文件。设置路径和环境等...你想启动。新配置将显示在您的构建菜单中。您也可以将其配置为“外部工具”