views:

22

answers:

1

The shortcut key is F11 to start debugging. But issue is that I have to be on that file and then hit F11 to start debugging. Eg.

my file to launch the application is "launch.py" and "example.py".
example.py is open in the editor whereas launch.py is not.
Now, if I hit F11 it will try to launch the application using "example.py" and terminates due to error (as expected).

So then I have to open the "launch.py" in the editor and then hit F11 to start debugging the application.
Is there any neater way to configure the debugging, so that it starts the application in single hit/key?

Edit: example.py is some other file (some module). It does not launch the application.

+1  A: 

As this PyDev Eclipse Tutorial suggests:

After the first run, if you type Ctrl+F11, the last file ran is re-run. Or, if you type just F11, a debug session is started with your last run. Let's test this...

Note: This behavior changed in Eclipse 3.3 -- but it's generally recommended to restore it in the preferences at: window > preferences > Run/Debug > Launching and set the Launch Operation to Always launch the previously launched application.
This tutorial will always consider this as the default option.

alt text

So, did you have this option selected?
If you have launch at least once launch.py, then you can re-launch it easily.

VonC
even if my last launch file is "launch.py" ..
ssal
@ssal: especially if your last launch file is "`launch.py`".
VonC
Using mouse : 2 clicks. and Using keyboard not possible unless I hit F11 on "launch.py". My eclipse does not have options like the screen shot above. Which version it is? I am using Eclipse Java EE IDE for Web
ssal
@ssal: my point is: if your last launch was on "`launch.py`", then F11 will re-launch "`launch.py`" even if it is not your currently opened file, provided you did select the "`Always launch the previously launched application`" in the "`window > preferences > Run/Debug > Launching`" preference settings.
VonC
ahh .. I did not have the correct preferences set. Cool .. works perfect now .. :) ..thanks VonC
ssal