Differences between revisions 92 and 93
Revision 92 as of 2006-02-10 17:41:39
Size: 10479
Editor: mail
Comment: Make clearer what project Red Robin refers to.
Revision 93 as of 2006-02-13 22:10:18
Size: 7645
Editor: pmc216-241-226-59
Comment: Removed a good deal of outdated information (several years old) and added info
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
|| pyeclipse || http://sf.net/projects/pyeclipse/ || 0.0.1 || July 16, 2002 || || || dead? ||
|| pe4eclipse || http://sf.net/projects/pe4eclipse/ || 0.0.1 || September 17, 2002 || || || dead? ||
Line 20: Line 19:
== What these plug-ins actually do == == Some Features ==
Line 24: Line 23:

 * All three plug-ins (at the time of the writing, pyeclipse, pe4eclipse, and pythoneclipse -- more on pydev below) only really give you color highlighting for editing .py python/jython files. That's all. ''(as of May 2003)''
 * These plugins provide ''syntax highlighting'' to allow for easy location of code segments with just a glance.
Line 29: Line 27:

 * Red Robin/JyDT has been around since late 2003; it became open source in 2005.

Generic Useful Features:
Line 38: Line 31:
'''''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 the best? ==
Line 40: Line 33:
== Which plug-in is better? == Both PyDev and TruStudio are undergoing active development and both feature and extensive set of useful tools for developing in Eclipse. It's not hard to try either of them out, so you might as well just try them both out and see which you enjoy more.
Line 42: Line 35:
All three support the SHIFT-TAB de-indent keystroke. Going by the popularity on Google, (using a very unscientific method of just searching for the two words ''python eclipse'' it seems as though PyDev is more popular.
Line 44: Line 37:
 * pyeclipse, 0.0.1 - CAN configure editor syntax colors. Option to converts tabs to spaces.

 * pe4eclipse, 0.0.1 - NO configuration of colors. NO option to converts tabs to spaces. CAN override default text font and set this specifically. CAN turn line numbering on.

 * pythoneclipse - NO configuration of colors. Option to converts tabs to spaces.

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 ===
=== PyDev ===
Line 66: Line 43:
== Installing the plug-ins ==

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

    * pyeclipse is identified by the folder '''org.python.pyeclipse_0.0.1'''

    * pe4eclipse is identified by the folder '''net.sourceforge.pe4eclipse'''

    * pythoneclipse is identified by the folder '''org.pythoneclipse.pdt_0.0.3'''

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

 * '''Working Directory''': -> Browse Variables -> ${container_loc}

 * '''Tool Arguments''': -> Browse Variables -> ${resource_name}

== 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:

 * '''Name''': python

 * '''Tool Location''': E.g. /usr/bin/python or C:\Python22\python.exe

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:

Name

URL

Version

Last Update

Licensing

Supports Jython

Remarks

PyDev

http://pydev.sf.net/

1.0.1

February 6, 2006

EPL*

Yes

TruStudio

http://www.xored.com/products.php

1.0.x / 1.1

May 18, 2005

EPL* and commercial

JyDT

http://jydt.sf.net

1.4.11

September 12, 2005

CPL

Jython only

EclipseColorer

http://colorer.sf.net/

0.7.1

July 12, 2005

Mozilla PL / GPL

yes?

Syntax highlighting only

* Eclipse Public License

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

Some Features

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.


  • These plugins provide syntax highlighting to allow for easy location of code segments with just a glance.

  • Significantly, you can use Eclipse bookmarking and create task bookmarks inside the eclipse python editor. This is way cool.

  • Lines with def are given little notches in the scroll bar, which you can click on and jump to that python function/method.

  • You can run jython or python on the current file and get the output appear in the eclipse console window.

  • You can use the Search/Grep feature of Eclipse to search through your python source code modules.
  • You can define a "working set" which is a custom list of python files that you want to have listed in the left hand Navigator window.
  • Instead of importing a folder into eclipse (which copies the files into c:\eclipse\workspace\...) you can instead create a linked folder which means that you can edit files on your regular file system. To do this, create a new folder, then when prompted, click "Advanced" and select the folder on your file system to link to. Sometimes you have to 'refresh' the list by r.clicking on the folder and selecting 'refresh'.

Which plug-in is the best?

Both PyDev and TruStudio are undergoing active development and both feature and extensive set of useful tools for developing in Eclipse. It's not hard to try either of them out, so you might as well just try them both out and see which you enjoy more.

Going by the popularity on Google, (using a very unscientific method of just searching for the two words python eclipse it seems as though PyDev is more popular.

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.

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:

  • Name: jython

  • Tool Location: E.g. C:\jython-2.1\jython.bat

  • Working Directory: -> Browse Variables -> ${container_loc}

  • Tool Arguments: -> Browse Variables -> ${resource_name}

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

  • ${resource_name}

you would instead put

  • ${resource_name} c:\\

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:

  • Select the project and edit its properties.
  • From the Builder menu on the left, select new.
  • Enter the full path to "scons.bat" file that comes with your installation.
  • Add command line targets as necessary in the box below.
  • Make sure python is setup in the default environment.

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

  • project/file management (module organization)
  • package explorer
  • file manipulation (history, compare, replace, etc)
  • collapsible code outlining
  • integrated step-through debugging
  • UML
  • refactoring tools (rename of classes and methods)
  • indentation support (tab / backtab)
  • outline with classes and methods
  • search for references (who calls method X)
  • execution of code snippets from a file being edited
  • use the Eclipse update manager for plug-in and core jython updates
  • incremental compilation of Jython
  • syntax highlighting and auto-completion
  • support for pyunit (unittest)
  • a Jython console, where one could try short snippets of code, with access to the current project classpath

Eclipse would gain

  • Python/Jython support in the editor
    • this is what the existing plug-ins address, but they are incomplete
  • better scriptable customization
    • use Jython as the "glue" language for extending Eclipse
  • runtime interactive shell for trying and testing Java classes
  • simplifies mixing Jython/Java to broaden range of problems that can be solved
  • large user base of Jython/Python programmers

Other Links

["Jython"]

["Python"]


CategoryJython

EclipsePythonIntegration (last edited 2014-04-17 06:07:25 by DaleAthanasias)

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