当使用Pydev插件选择“运行”或“调试”时,如何配置Eclipse以启动浏览器

时间:2022-03-08 07:20:26

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。当我按Run或Debug时,我希望内部或外部浏览器使用URL http:/127.0.0.1启动或刷新。我已经看到它使用PHP插件但不是Pydev。

2 个解决方案

#1


Here are the steps to set up an external launch configuration to launch IE:

以下是设置外部启动配置以启动IE的步骤:

  1. Select Run->External Tools->External Tools Configurations...
  2. 选择Run-> External Tools-> External Tools Configurations ...

  3. In the left hand pane, select Program then the new icon (left-most icon above the pane).
  4. 在左侧窗格中,选择Program然后选择新图标(窗格上方最左侧的图标)。

  5. In the right hand pane, select the Main tab.
  6. 在右侧窗格中,选择Main选项卡。

  7. Enter launch_ie in the Name: field.
  8. 在名称:字段中输入launch_ie。

  9. Enter ${system_path:explorer.exe} in the Location: field.
  10. 在位置:字段中输入$ {system_path:explorer.exe}。

  11. Enter http:/127.0.0.1 in the Arguments field.
  12. 在Arguments字段中输入http:/127.0.0.1。

  13. To run the external configuration, select Run.
  14. 要运行外部配置,请选择“运行”。

If you want to share the configuration you can use these optional steps:

如果要共享配置,可以使用以下可选步骤:

  1. Select the Common tab
  2. 选择Common选项卡

  3. Select the Shared file: option in the Save As section.
  4. 在“另存为”部分中选择“共享文件:”选项。

  5. 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)
  6. 选择保存配置的位置(将其保存到其他空项目可能是个好主意,因为您可以将其导入另一个工作区)

To rerun the configuration you have a few choices:

要重新运行配置,您有以下几种选择:

  1. Select the External Tools icon from the menu bar external tools icon http://tbn2.google.com/images?q=tbn:pQV646K7J7xb4M:http://help.eclipse.org/ganymede/topic/org.eclipse.cdt.doc.user/images/icon_ext_tools.png then click launch_ie
  2. 从菜单栏外部工具图标http://tbn2.google.com/images?q=tbn:pQV646K7J7xb4M:http://help.eclipse.org/ganymede/topic/org.eclipse.cdt中选择“外部工具”图标。 doc.user / images / icon_ext_tools.png然后单击launch_ie

  3. Select Run->External Tools->launch ie
  4. 选择Run-> External Tools-> launch ie

  5. Hit Alt+R, E, 1 (assuming launch_ie is the first item in the list, otherwise pick the appropriate number)
  6. 按Alt + R,E,1(假设launch_ie是列表中的第一项,否则选择适当的数字)

#2


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"

转到“运行/调试设置”,添加新配置文件。设置路径和环境等...您要启动。新配置将显示在您的构建菜单中。您还可以将其配置为“外部工具”

#1


Here are the steps to set up an external launch configuration to launch IE:

以下是设置外部启动配置以启动IE的步骤:

  1. Select Run->External Tools->External Tools Configurations...
  2. 选择Run-> External Tools-> External Tools Configurations ...

  3. In the left hand pane, select Program then the new icon (left-most icon above the pane).
  4. 在左侧窗格中,选择Program然后选择新图标(窗格上方最左侧的图标)。

  5. In the right hand pane, select the Main tab.
  6. 在右侧窗格中,选择Main选项卡。

  7. Enter launch_ie in the Name: field.
  8. 在名称:字段中输入launch_ie。

  9. Enter ${system_path:explorer.exe} in the Location: field.
  10. 在位置:字段中输入$ {system_path:explorer.exe}。

  11. Enter http:/127.0.0.1 in the Arguments field.
  12. 在Arguments字段中输入http:/127.0.0.1。

  13. To run the external configuration, select Run.
  14. 要运行外部配置,请选择“运行”。

If you want to share the configuration you can use these optional steps:

如果要共享配置,可以使用以下可选步骤:

  1. Select the Common tab
  2. 选择Common选项卡

  3. Select the Shared file: option in the Save As section.
  4. 在“另存为”部分中选择“共享文件:”选项。

  5. 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)
  6. 选择保存配置的位置(将其保存到其他空项目可能是个好主意,因为您可以将其导入另一个工作区)

To rerun the configuration you have a few choices:

要重新运行配置,您有以下几种选择:

  1. Select the External Tools icon from the menu bar external tools icon http://tbn2.google.com/images?q=tbn:pQV646K7J7xb4M:http://help.eclipse.org/ganymede/topic/org.eclipse.cdt.doc.user/images/icon_ext_tools.png then click launch_ie
  2. 从菜单栏外部工具图标http://tbn2.google.com/images?q=tbn:pQV646K7J7xb4M:http://help.eclipse.org/ganymede/topic/org.eclipse.cdt中选择“外部工具”图标。 doc.user / images / icon_ext_tools.png然后单击launch_ie

  3. Select Run->External Tools->launch ie
  4. 选择Run-> External Tools-> launch ie

  5. Hit Alt+R, E, 1 (assuming launch_ie is the first item in the list, otherwise pick the appropriate number)
  6. 按Alt + R,E,1(假设launch_ie是列表中的第一项,否则选择适当的数字)

#2


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"

转到“运行/调试设置”,添加新配置文件。设置路径和环境等...您要启动。新配置将显示在您的构建菜单中。您还可以将其配置为“外部工具”