Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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.

like image 981
Clutch Avatar asked Mar 30 '09 13:03

Clutch


People also ask

How do I open PyDev in Eclipse?

Your first Python program in EclipseSelect File New Project. Select Pydev → Pydev Project.

How do I use PyDev debugger?

Use Ctrl+F10 to open the context-menu and then select Add Breakpoint; Right-click the left bar to open the context-menu and then select Add Breakpoint; Use Ctrl+Shift+B to toggle the breakpoint in the line (if it doesn't work, go to the customize perspective and enable Breakpoints in Action Set Availability.

How do I run PyDev?

Go to the menu: Alt + R + S + The number of the Run you wish (It can be Python, Jython, unit-test, etc). Note: if you were using unit-tests, you could use: Ctrl+F9 to run the unit-tests from the module (and even selecting which tests should be run -- and if Shift is pressed it's launched in debug mode).


2 Answers

Here are the steps to set up an external launch configuration to launch 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.
  4. Enter launch_ie in the Name: field.
  5. Enter ${system_path:explorer.exe} in the Location: field.
  6. Enter http:/127.0.0.1 in the Arguments field.
  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
  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 external tools icon then click launch_ie
  2. Select 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)
like image 187
Rich Seller Avatar answered Sep 20 '22 15:09

Rich Seller


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"

like image 25
Trey Stout Avatar answered Sep 22 '22 15:09

Trey Stout