简体   繁体   English

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

[英]How do I configure Eclipse to launch a browser when Run or Debug is selected using Pydev plugin

I'm learning Python and Django using the Eclipse Pydev plugin. 我正在使用Eclipse Pydev插件学习Python和Django。 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. 当我按Run或Debug时,我希望内部或外部浏览器使用URL http:/127.0.0.1启动或刷新。 I've seen it done with the PHP plugins but not Pydev. 我已经看到它使用PHP插件但不是Pydev。

Here are the steps to set up an external launch configuration to launch IE: 以下是设置外部启动配置以启动IE的步骤:

  1. Select Run -> External Tools -> External Tools Configurations... 选择运行 - > 外部工具 - > 外部工具配置...
  2. In the left hand pane, select Program then the new icon (left-most icon above the pane). 在左侧窗格中,选择“ 程序”,然后选择新图标(窗格上方最左侧的图标)。
  3. In the right hand pane, select the Main tab. 在右侧窗格中,选择Main选项卡。
  4. Enter launch_ie in the Name: field. 名称:字段中输入launch_ie
  5. Enter ${system_path:explorer.exe} in the Location: field. 位置:字段中输入$ {system_path:explorer.exe}
  6. Enter http:/127.0.0.1 in the Arguments field. Arguments字段中输入http:/127.0.0.1
  7. To run the external configuration, select Run . 要运行外部配置,请选择“运行”

If you want to share the configuration you can use these optional steps: 如果要共享配置,可以使用以下可选步骤:

  1. Select the Common tab 选择Common选项卡
  2. Select the Shared file: option in the Save As section. 在“ 另存为”部分中选择“ 共享文件:”选项。
  3. 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: 要重新运行配置,您有几个选择:

  1. Select the External Tools icon from the menu bar 从菜单栏中选择“外部工具”图标 外部工具图标 then click launch_ie 然后单击launch_ie
  2. Select Run -> External Tools -> launch ie 选择Run - > External Tools - > launch ie
  3. Hit Alt+R, E, 1 (assuming launch_ie is the first item in the list, otherwise pick the appropriate number) 按Alt + R,E,1(假设launch_ie是列表中的第一项,否则选择适当的数字)

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" 您还可以将其配置为“外部工具”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何配置eclipse(pydev)以与外部可执行文件一起运行 - how to configure eclipse(pydev) to run with external executable 如何使用eclipse和pydev调试SCons脚本? - How to debug SCons scripts using eclipse and pydev? 如何使用pydev在eclipse中添加断点? - How do I add a breakpoint in eclipse using pydev? 我如何配置Eclipse PyDev,以便八边形在注释行时尊重缩进? - How can I configure Eclipse PyDev so that octothorpes respects indents when commenting a line? 如何在PyDev Eclipse中以调试模式隐藏交互式控制台? - How can I hide interactive console in debug mode in PyDev Eclipse? python:如何调试多进程? (使用eclipse+pydev) - python: How to debug multiprocess? (using eclipse+pydev) 使用PyDev Eclipse插件时“Python已停止工作” - “Python has stopped working” when using PyDev Eclipse plugin Eclipse Pydev:运行选定的代码行 - Eclipse Pydev: Run selected lines of code 如何在龙卷风Web服务器中运行Hello world程序(Ubuntu 11.10,在带有PyDev插件的Eclipse中) - How do I run Hello world program in tornado web server (Ubuntu 11.10, in eclipse with PyDev plug in ) 如何在新的 Eclipse/Pydev 运行配置中使用 Django 命令扩展 - How do I use Django Command Extensions with a new Eclipse/Pydev run configuration
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM