Plugin to switch run configuration quickly in eclipse - eclipse

Is there a plugin which can help to switch run configuration quickly in eclipse?
I am trying to learn django with practice a Eclipse with PyDev. I am follwing this page. This page frequently need to supply different parameters to manage.py, for example:
If you're interested, also run the following commands:
python manage.py validate -- Checks for any errors in the
construction of your models.
python manage.py sqlcustom polls -- Outputs any custom SQL
statements (such as table modifications or constraints) that are
defined for the application.
python manage.py sqlclear polls -- Outputs the necessary DROP
TABLE statements for this app, according to which tables already exist
in your database (if any).
To follow the tutorial, I will need to click the triangle next to the run button , then click "Run Configurations..", then select "Arguments" tab. Modify the argument, press "Apply", then press "Run".
I don't want to repeat each step to have different parameters. Is there other way to do it quickly? Maybe a plugin?
I am not sure if this is the right place to ask, if not, please help to move it to proper place.

Actually, for Django, the PyDev integration should have what you want builtin...
The steps on http://pydev.org/manual_adv_django.html should be more complete, but mainly you have to configure your project as Django and then in any PyDev editor you can do
Ctrl+2 dj (and then press enter)
to open a dialog to choose which django command to run.
Or you may enter the command directly there... i.e.:
Ctrl+2 dj syncdb (when pressing enter syncdb will be run directly)
-- note that it'll use the manage.py configured in the project to which the editor is related to run the command (so, the opened editor must be an editor from the project).
Another option would be right clicking the project and selecting the option under the 'Django menu'.
p.s.: If in some occasion you really had to change the command line all the time, the ${string_prompt} variable could help you -- although other variables in the run configuration could be more suited depending on your use case.
p.s.2: I think you could rename this question to note that what you want is related to running the django manage.py in PyDev (if that's really your use case).

Eclipse Runner could do this for you.

Related

Eclipse Run not asking how to run as, and opens wrong file

I'm brand new to learning Python and am using Eclipse to go through a Python course. When I first started doing exercises in Eclipse, every time I opened a file from the course examples, the first time I ran it I would click the green "run" button, and it would ask me how I wanted to launch the file (as Python Run or Python Unit Test). Somewhere along the way it stopped doing that and now if I open a file that has never been run before, when I click the green run button, it just runs a different file. I can click through the drop down menus to run as and select python module and then the run button works fine any time I use that file, but I can't figure out why it won't just run new files the way that it did when I first installed eclipse.
You probably have configured to run the last file... (PyDev asks if you want to do that in a dialog and does that for you if you confirm). Still, don't worry, this is probably for the best anyways as you can just hit F9 to run your file directly without clicking anything (and Ctrl+F11 or clicking the run should now re-run the last launch you did).
Make sure you take some minutes to read http://www.pydev.org/manual_101_run.html for tips on the best way to run Python modules from PyDev.

eclipse sh edit and run

What would be the best way to run and edit a .sh script within Eclipse?
Regarding the editing part, I've found the ShellEd plugin, but it seems very minimalistic, is there no alternative?
Regarding the running part, I've found that there's a built in console that can be accessed by right clicking the .sh, then clicking 'remote system view', then clicking 'local'. But it's very minimalistic, there is not even tab completion. I would like something that could be as close to Bash as possible.
You may find these two hyperlinks to be useful:
http://www.linuxforums.org/forum/applications/132034-running-shellscripts-eclipse.html
Bash script plugin for Eclipse?
I do not know much about Eclipse. I prefer Geany; however, it does not execute shell scripts.

Whats the shortcut to Debug in PyDev using Eclipse

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.
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.
So, did you have this option selected?
If you have launch at least once launch.py, then you can re-launch it easily.
Although this isn't strictly an answer to what was asked initially, it might help someone looking here that had the same problem as me...
I'm a Java developer mainly, so have the Java view open almost all the time. However, sometimes I want to run some python file to test something (or just create a quick python script, and run it)...
In the Java editor, if the current class has a main(String[] args) method, I run it with (and popup the dialog to ask me what exactly I'd like to run in the middle)
alt+shift+x, j
Unfortunately, that doesn't work in the Python view, and I've not found a similar solution - it just asks me if I'd like to run it as a Java app... however, as the VonC says, you can run the last run thing (provided you've set the preferences accordingly) with
ctrl+f11
and this seems work well with python run configurations too.
But... What if the last thing I ran was a Java program, but I now want to run the active .py file? Previously, to run the .py file, I'd have to go digging through the buttons on the toolbar with the mouse, and I tend to prefer keyboard shortcuts...
Solution! So, finally I come to the actual useful bit of this answer - I just discovered by accident (typing Ivan's suggested shortcut, but missing!), it appears that
f9
will run the currently active python file.
Hope that helps someone get just that little bit faster...
I use CTRL+SHIFT+F9 to relaunch the previous debug configuration in Pydev.

Getting Started with Sweave, Eclipse, and R

I am very new to LaTex and R, but I am learning on a daily basis. I really am getting into using Eclipse and want to join the party and start automating my work using Sweave; I am excited for the prospects.
That said, I followed Jeromy's post here and think (keyword, think) that everything is set up correctly. However, since I am very new to LaTex, how can I test it to know that I am up and running and can indeed create pdf's?
Simply, I want to test that my configurations are up and running before I start diving into templates and creating reports. What is the basic process, from within Eclipse, to create a pdf?
Any help will be very much appreciated!
Thanks,
Brock
Right, assuming you're using StatEt within Eclipse, then make sure you've done the following;
Configured Statet under Window >
Preferences ? StatEt, and setup
things like your R environment.
Configure TexClipse under Window >
Preferences > Texclipse, and tell it
where your latex commands live (I'm
on Windows, so this was c:\program
files\miktex\miktex\
Make sure RJava
is installed within your R
environment
Setup the R build
configuration, goto Run > Run
Configurations, click the New icon
and enter things like the R
environment, the working directory
and any parameter's you want.
Setup the Sweave command, goto Run >
External Tools > Externals Tool
Configurations, click the new icon
under Sweave and I think I left
everything default, to run sweave in
the R console and run pdflatex
Then create an eclipse project, and within that project create a new Sweave document, StatEt should give you a skeleton template that will succesfully build, so then open the R console (either from the icon or via Run > Run As), then with your Sweave skeleton document tab selected, run Sweave (either via the icon, or via Run > External Tools > Whatever you called it)
You should then see the R bits occur in the R console, then the latex'y bits happening in the background and a little progress bar at the bottom of the window. Eventually it will finish and a new (blank) PDF will pop up.
Voila !
I'd also recomend this guide and this one
Although this was asked a long time ago, I thought I would share how I solved the 113 error. Basically you have to change the R working directory to where in your workspace you have the .Rnw file. Once this was done Sweave ran perfectly on my machine.
Best, Thomas

Eclipse - Running programs not in the native eclipse console

I'm currently writing some ncurses code and the native Eclipse (3.2.2) console can't display its graphics. I'd instead like to run the program through xterm. What I want is to be able to start xterm and run from there. I'd prefer to not get involved with any plugins or that jazz. Just something simple.
EDIT
So I have the answer and it was pretty simple...
Run -> External Tools -> External Tools -> New Launch Config...
Then select location of your terminal emulator. /usr/bin/gnome-terminal in my case.
after that set the appropriate arguments. "-e ~/ncurses/start" in my case.
Then make sure you aren't allocating a console by unchecking that option in the "Common" tab.
Annon add to his question:
its a pain to keep switching back and forth from eclipse and the terminal. I'm looking for a way to just hit something like"F5" and have it run my ncurses program in a new xterm terminal process
The simplest way to do that is to report the command line into an external tool configuration, and point eclipse to use a shell (like described in this program)
In the argument, you will add the command line eclipse execute (command line which can be retrieved as mentioned in the second part of this answer below).
Of course, replace 'cmd.exe' by the shell of your choice, and try not setting the 'Allocate Console' checkbox in the Common tab of that external launcher.
To launch through a xterm, without eclipse involved (not what you are asking for, just keep here for archive)
You can launch your program through Eclipse (Run Configurations), and observe through a 'ps' command the exact Java command line used.
Or launch it in debug mode, and right click the task in Debug view and open Properties. It will show the command line, as documented here.
Then launch that command line directly in your console (Eclipse being not involved at all at this point).