Pydev; How Do I Config *all* .py To NOT Run In Ant? - eclipse

Beginner config question here, guys.
So I am in eclipse, in pydev. Some of my src will run in the python compiler just fine, but others try and run in ant. When I click the 'Run' dropdown in the ones that work, and select 'Run As' I get two options. 'Python Run' and 'Python Unit-test'. When I try and run the ones that try and use Ant, I goto the same menu and it only displays '(none applicable)'
How do I fix this?

I was having the same problem. If you were,like me, trying to run code that you had written in IDLE and saved somewhere. You have to create blank project and import that code into the "src" folder of your project. then you should be able to run the code as python in eclipse.
For example. I had a bit of code I was trying out in IDLE saved in a folder in "My Docs". I moved it to my project "src" folder in "Mydocs/eclipse/projects/" and was able to run it in eclipse. Your paths will depend on where you opted to save your eclipse projects.
You should then be able to select your "Python: run option.
This was the link that helped me with this.
http://www.vogella.com/articles/Python/article.html#installation_python
Read the whole thing and it should help.

Related

How to run Julia project from GitHub in VS Code?

Could someone please tell me how one could run a project downloaded from github written in Julia in VS Code? I tried Executing the .jl files in REPL by right clicking on the file and clicking on "Execute File in REPL" but nothing.
I also tried "Activating the Environment" of the src file, and still nothing.
Any and all help would be highly appreciated.
You open the file you wish to run (you must know which one it is)
In the start menu you select "Run -> Run Without Debugging" or press "Ctrl+F5"

Running Jason applications in Eclipse

When I want to run my .mas2j file in Eclipse, I always have to right click the file and then select "Run as Jason application". Is there a way to add a shortcut to do this?
Jason's "Run" button should be added to eclipse toolbar ("Step 14" of jason eclipse-plugin installation guide) and it is supposed to work. Anyway, you can save some time using shell, following instructions in jason's github page:
git clone https://github.com/jason-lang/jason.git
cd jason
gradle config
And run a project using a command like bellow:
jason examples/gold-miners-II/miners.mas2j
Another way, and actually my recommendation is moving to JaCaMo (which has Jason embedded). JaCaMo offers a gradle script for your projects. You can easily download JaCaMo from the repository and create a project from zero in one shot (first, go to your project root folder and then type):
curl -s -O http://jacamo.sourceforge.net/nps/np07.gradle
gradle -b np07.gradle --console=plain
After downloading JaCaMo, the script will ask you to type a name for your project, for instance, "test". So, go to "test" folder and type:
gradle run
The just created JaCaMo project should launch after this command. Besides good compiling performance, another advantage is that gradle will manage package dependencies.
This is usually the issue with uncategorized commands in Eclipse. I had the same issue with the Run JaCaMo Application option. In order to see all your plugin commands:
Go to Preferences -> General -> Keys. Click on Filters... and de-select Filter uncategorized commands then Ok.
Then you should be able to find the desired command in the Command list and add a preferred Binding.
Note: If Eclipse offers a command, it should be listed in the pop-up window that appears when hitting the Show a table of all available commands button of the Oomph toolbar. The table shows all the available commands, where you can find them, and all the defined shortcut keys.

How do you open an existing .java file and compile it in eclipse?

I am just starting to consider using Eclipse, as I hear it is a very good debugging tool and excellent IDE. I have a .java file which I had written in JCreator and have saved in my Google Drive directory. However, I am having problems running this file within Eclipse. If I open Eclipse and then open my file, a few things happen. First, a .metadata folder appears inside my Google Drive. Second, the file opens, and I can edit and save changes. However, if I try to compile the file, I get a "Run As" popup window with the options "Ant Build" and "Ant Build..." Selecting either results in a "Build Failed" error.
I have a few questions:
1) What is the .metadata folder and why does Eclipse create it?
2) How do I open an existing .java file in Eclipse?
3) What is an "Ant Build"?
Sorry if these questions are very basic, but a search through online tutorials has only told me how to create and compile projects with Eclipse. If I start a project in Eclipse, then everything works fine, but otherwise, I can't get anything to work at all.
I do not know, but a simple Google search led me to this question and this other question which might be of help;
I don't know if it is possible to just open a file without starting a project, but once a project has been started, it is relatively easy to import a file: File>Import, find the directory, check the files you want to import, select import directory and go ahead. Now I haven't managed to run a program with GUI after importing because apparently it has problems loading classes like JFrame because of a restriction in the library, but I have imported and run a simpler program; oh, and when you import, you select General, then File System;
Try googling for Ant Build. I fount a few sites mentioning "Apache Ant", which seems to be related to GUI building.

Launch and debug a single script in PyDev

I am a beginner in using Eclipse and PyDev (Aptana Studio 3). I am not used to and i don't understand the workflow in such big IDEs as Eclipse.
I have a simple task: i have a simple Python script, which i want to open and run in Eclipse, having its output in Eclipse console. Or debug it.
Until now i used another IDE called Eric4, which allowed me to do what i want - open a file and run immediately, without creating a project or setting up launch configurations.
Is this possible in Eclipse, or i have to create a project for each file i want to run or debug? I want to understand how it works.
I guess i understand that creating a project is needed at least for settings up the paths (PYTHONPATH), but if it's a single script - somehow to use by default the current directory?
For example i have a folder called snippets where i keep a lot of python scripts which demonstrate some functionality. How do i open these files one by one and run them?
Most of my coworkers launch python scripts in a separate console - python my_scipt.py.
You need to have at least one project with the configuration you want (i.e.: syntax type, interpreter), then, open the file you want to run and press F9.
If it's an external file -- i.e.: a file that's not under a project in Eclipse -- it'll ask you to associate a project with the launch to get the needed information for the launch, but the file doesn't really have to be in the project (note that you can drag external files from your filesystem into Eclipse to open them).
I suggest you follow the steps on the getting started: http://pydev.org/manual_101_root.html (it guides you to configuring PyDev and explains how to do a run/debug session).

How to run only one test in TestCase in NetBeans PHP?

I can run all tests for current file, but how to run only one test?
There are buttons in the Test Results pane to rerun only the tests that failed during the previous run, but I know of no way to run a single test. Right-click a test in that same pane to see if you get an option to run it alone. I'm not at work to test out that theory.
There is a way to do it netbeans: Click Window -> Ide Tools -> Terminal and type:
phpunit --filter '/::testName$/' MyTest.php
Then click Enter.
as far as I know there is no button or something in Netbeans that does that. So using terminal seems like the easiest way. It still is quite convenient though, because it should remember the history and later on you can just copy paste the test name.
Note that you may have to navigate to the test folder first or specify path to your Test file first in case Netbeans terminal doesn't open in your test project folder already