Revision 86 as of 2006-01-10 16:10:54

Clear message

Using Eclipse as a Python editor

It is not known which version of Eclipse these comments refer to, some versions of the plugins require Eclipse 3 to work with. Please be careful read the release notes for the plugin you choose.

A few plugins for ["Eclipse"] are in progress that will enable Eclipse to be used as a Python IDE. Some of these are stable enough for early use:

Inactive/dead (apparently) plugin projects:

To point out the obvious, it would be nice if some of these teams would combine their efforts.

What these plug-ins actually do

The next seven sections of documentation, up to and including "Supplying parameters to your jython or python program" are contributed by Andy Bulka abulka@netspace.net.au.


Generic Useful Features:

Note: The ability to run jython or python on the current file needs to be configured manually (see step 2, below) and doesn't require either of these plugins to do.

Which plug-in is better?

All three support the SHIFT-TAB de-indent keystroke.

The pyeclipse plug-in provides a python' perspective which ensures that the console window is visible and hides the 'launch' button (which is only for running java apps).

Note: once you have this perspective installed, you can switch to one of the other python plugins (see how to do this in the next section), and the "perspective view" will remain installed. In fact you can easily create a python perspective yourself, from within Eclipse (a perspective is just a configuration of what panels and windows you want open at the one time).

My choice

added by EliasSoong

When I wrote this, it is the September of 2004. I found PyDev and Tru Studio have been progressed very much. Both of them could be a mature IDE for Python. Especially, I tried the open source version of Tru Studio 1.0M4, I feel it is as good as JDT. Tru Studio could do perfect analysis of the code outline and good code assist.

Re: PyDev

added by KirbyUrner urnerk@python.org

I saw a demo of this at OSCON 2004, presented by Dana Moore. Alex Totek has done the majority of the work so far, with help from Fabio Zadrozny. pydev includes a debugger. Dana previewed auto-completion but as of this writing it's not in the most recent release (0.5.3). I also saw the Python shell integrated into Eclipse. The development language for the plugin itself is Java, not Jython.

Installing the plug-ins

Unzip the plugin and drag the folder into the eclipse/plugins directory, then restart eclipse.

You can switch between the plug-ins by moving one directory out of the plugins folder and the other in to the plugins folder.

Eclipse 3.0 Interim Build Problem

Moving the pyeclipse folder, org.python.pyeclipse_0.0.1, to the eclipse/plugins directory does not install it into the environment. Eclipse does not see it at all. I am attempting to install in Eclipse Version: 3.0.0, Build id: 200402122000.

I have no answer for this yet but will update this comment if I find one.

In general, unless a plugin SAYS it supports Eclipse 3, assume it doesn't, or doesn't fully. Eclipse 3 has been enough of a moving target that many plugin developers have been taking a wait-and-see approach to porting their plugins.

Configuring Eclipse for running Python and Jython

Jython

To configure Eclipse to run jython on the current file you are editing:

Select from the menu: Run -> External Tools -> Configure -> New

then fill in the following values:

Python

Instructions for configuring to run regular python from within Eclipse can be found in the pyeclipse forum http://sourceforge.net/forum/forum.php?thread_id=717580&forum_id=194323

However, I prefer to set my Working Directory to ${container_loc} since this lets you launch python on files that are inside folders within your project. More resilient. Here are my instructions:

Select from the menu: Run -> External Tools -> Configure -> New

then fill in the following values:

Supplying parameters to your jython or python program

If you need to run an app which requires arguments, you will need to make another tool configuration (just copy the jython one) and simply add the necessary arguments to the Tool Arguments field.

For example instead of just

you would instead put

Notice I have supplied the argument c:\\

Embedding Jython into Eclipse

Don Coleman has written a jython code completion shell which he says he would be happy to rewrite for Eclipse.

This URL was given by Don Coleman in an ASPN jython users newsgroup,

How to make Jython unit tests... and see them inside Junit plugin : [http://www.devx.com/Java/Article/26602/1954?pf=true here] and modification and completion [http://lauploix.blogspot.com/2005/03/test-driven-development-why-using.html here]

Running SCons from CDT Eclipse

SCons is a powerful software construction tool in python, more flexible than ant and simpler than make. It is primarily intended to manage builts for C/C++ programs. To set up SCons as the builder from CDT, add it as a custom builder:

Note: Eclipse cannot currently spawn arbitrary shell programs, so even if the .py extension is registered, calling scons.py will fail from Eclipse.

There is now an [http://nic-nac-project.de/~lothar/eclipse/update/SConsBuilderPlugin.html Scons Builder Plugin] for the Eclipse CDT.

For more information about SCons, see http://www.scons.org/

Some Eclipse features people want with Jython/Python

Eclipse would gain

Other Links

["Jython"]

["Python"]


CategoryJython

Unable to edit the page? See the FrontPage for instructions.