Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to create Eclipse plugins with Python?

As far as I understand Eclipse doesn't provide user with python bindings by default. Nor any projects of such kind was I able to find with google.

Are there any third-party plugins for that? Any tutorial? May be with Jython?..

like image 932
lithuak Avatar asked Sep 27 '11 14:09

lithuak


People also ask

Can Python be used in Eclipse?

Running Python from within Eclipsepy, and Eclipse will recognize it as Python code. Type in some Python code (for instance: print 2+2 ), then right-click on the Python file you've created and select Run As >> Python run . You should see the output of your Python code in the console at the bottom of the Eclipse window.

Is Eclipse a good IDE for Python?

Eclipse is one of the most popular IDE among developers which is written in Java but you can install the Pydev plugin in eclipse and use it for Python as well. The primary focus of this IDE is the analysis of code, debugging in the graphical pattern, refactoring of python code, etc.


1 Answers

As far as I know, you need to use Java. Eclipse is written in Java, and even the vanilla application is made up of several Java components glued together by the core plugin loader. Jython might work if:

  • you can cross-compile Python to Java bytecode (indeed you can, thanks to sayth for pointing that out), and
  • you can access the Eclipse APIs inside Jython.

So, here's more or less what your plugin's architecture might look like. If you can get at the Eclipse APIs, then you can write most of it in Jython, and then make a Java wrapper for it with the Embedding Jython instructions.

If you can't get the Eclipse functionality into your Jython, then you can still write some of your code in python, and then have the Eclipse API access happening on your Java layer. This will be annoying in proportion to how evenly split your code is between python and Java. I've worked on a project before where we embedded python into C++ (or it might have been the other way around...), and it's a major headache if you don't plan it out right.

like image 109
andronikus Avatar answered Sep 23 '22 14:09

andronikus