Eclipse is an Integrated Development Environment (IDE) written in Python that I use for my Python projects. I was turned on to it by Sasha Vinčić several years ago at a LovelySystems SnowSprint in Austria. Without his help, I would probably never have given it a chance. I’d like to go over a few quick things to get you up and running quickly with Eclipse, since at first look it’s not very intuitive.
Eclipse is written in Java, so you’ll need to have a Java RTE installed on your machine. If you don’t have it already, this is beyond the scope of this document, but most OS’s have it available to you already, or can be installed quicky and easily. Being written in Java is great because it runs on most platforms with very few cross-platform idosyncracies. To me, this is great because you can avoid everyone’s platform/editor preferences and standardize on something. The helps break down barriers to pair programming (”oh, I use emacs, and s/he uses vi, so I can’t work on their system…”) and allows development groups to pool knowledge bases in terms of troubleshooting, features, and licensing. Anyhow, enough trying to convince you!
Download & Install
Downloading and installing Eclipse is really straightforward, so long as you have a Jave RTE installed. The first question you’ll encouter is which version to install. There are more than a few bundles of Eclipse suited for various types of development, including Java, Eclipse plugins, Modeling, and such. You can review the various bundles on the Eclipse download page. I have always used the Classic Eclipse (at the very bottom), which comes with the baseline for what you need. There doesn’t seem to be anything geared directly towards Python developers, so we’ll just add all that as we go. Download that, install it, and launch it.
Getting Oriented
When you first launch Eclipse, you get this weird screen that has a bunch of icons on it and no real clear way to proceed. You can check out the online help, which I’ve found pretty useful, but let’s just give right in. The icon you want (in Eclipse 3.4.1) is the circle with the arrow in it. This will take you straight to the Workbench in the Project Explorer perspective. On first launch, it’ll probably ask you to set up a folder for your Workbench to be stored in, I recommend putting in one of two places: you can put it in “My Documents\Workbench” or your OS’s equivalent (OS X: Documents) or you can put it at the root of your filesystem to save time browsing to it in terminals, diaglog boxes, etc. Your choice. From now on, this is where all of your Eclipse work will go. If you decide to move it later, you can just move the folder, launch Eclipse and it will ask you what you did with it.
Now that you’re in the workbench, you should see multiple panes with tabs on them. First good thing to know is that you can drag those tabs all over and arrange them how you want. The first thing that I like to do is drag the Outline view under the Project Explorer in the left column. The next thing to know is that you can minimize any section using the icon 2nd to the right (looks like a small white rectangle) in each area. so if you want more screen real estate, just minimize what you don’t need. Also, if you double click any tab, it’ll expand to full screen, also very useful. Finally, you can grab the edges of these areas like a framed website and resize them to your liking. Eventually you’ll settle on exactly what’s right for you.
Add ons
One of the great things about Eclipse is the amount of add ons available for it. We’re going to install a few of these now to get a useful environment for Python development. Eclipse comes ready to develop for Java. We’ll be turning that off.
Here are a few useful add ons we’ll be installing:
Subclipse: SVN for Eclipse
PyDev: Python environment for Eclipse
WebTools: Useful syntax highlighting for web-like files (HTML, CSS, etc.)
First, let’s take a look at how to add updates. Once you get the hang of it, it’s pretty easy and nice because it automatically looks for updates, so you can stay current with new developments and search for new features. To get to the Software Add ons manager, go to Help -> Software Updates. If it is not selected already, click the “Available Software” tab. On the right you should see an “Add Site…” button. This is where you add new sites that offer Eclipse software. Click the Add Site button and enter:
http://subclipse.tigris.org/update_1.4.x
And click OK. This new site will show up in the list. Click the topmost checkbox and click the “Install…” button. Follow all the prompts, accept the licenses, etc. and when you’re all done, you should have the Subclipse Add On installed into your Eclipse. Keep reading for how to manifest it…
Perspectives
Eclipse perspectives are basically customized collections of tabs. In the Package Explorer, you’ll see the Outline, Problems, Console, main editor window, and such. If you switch to another persective, the previous one is saved and you can re-arrange and customize the new perspective. Perspectives are usually associated with some form of task or Add On, for example, the Java perspective has Java-y things on it for you, and the Subclipse perspective shows you tools for dealing with SVN. Let’s remove the Java perspective, and add the Subclipse perspective to your perspective tab so you have easy access to it.
The perspective tab is in the upper right by default. Click on the “Add perspective” icon (it has a plus on it), and choose “Other…” From the window that opens up, choose “SVN Repository Exploring”, and you should notice a new icon appear in the Perspective Tab. If not, then the perspective bar is probably too small. You can drag it from right to left to make it bigger. Now right click on the Java Perspective icon and choose “Close”. You can get it back by using the process we added the SVN Perspective. Finally, I like to make this much more compact and useful: Right click on the SVN Perspective icon and deselect “Show Text”. Right click again and choose “Dock On -> Left”. This is how I like it, feel free to adjust to your liking.
Now we have the SVN perspective. Next we’ll add PyDev and we’ll add a Python Development Perspective to this bar too.
PyDev
PyDev’s website states “Pydev is a plugin that enables users to use Eclipse for Python and Jython development — making Eclipse a first class Python IDE — It comes with many goodies such as code completion, syntax highlighting, syntax analysis, refactor, debug and many others. If you want more details on the provided features, you can check here.” To install it, follow the same procedure for the Subclipse extension, but use the PyDev Update Site URL: http://pydev.sourceforge.net/updates/
When you’re all done, you can add the PyDev Perspective as outlined above. It’s that easy! And if there’s ever updates to any of these plugins, you’ll be notified and prompted to update them.
Web Tools
We’ll install the Web Tools add on a little differently; this gives you an idea on how to find other features of Eclipse available from Eclipse HQ. First, go to Software Updates. On the Installed Software tab, you should see “Ganymede” (the codename of Eclipse 3.4.x). Expand that section, and exapnd the “Web and Java EE Development” section. There, you should see “Web Developer Tools”. Feel free to add anything else you’re interested in, I added things like JavaScript Developer Tools, XML Editors, etc. Click the Install button and you’re on your way! The Web Developer tools adds a few great things like HTML syntax highlighting and associates .htm/.html file extensions to the HTML editor.
Word Wrap
Soft wrap is sorely lacking from Eclipse, you can add a sort-of working Add On to get Virtual Word Wrap in the editors by adding: http://ahtik.com/eclipse-update/ - Access it by right clicking in the editor and choosing “Virtual Word Wrap”. The problem is the line numbers don’t act properly. Speaking of Line Numbers:
Line Numbers:
Turning on line numbering is really easy. Go to the Preferences window. In there, go to General -> Editors -> Text Editors, You’ll see the “Show Line Numbers” checkbox.
Wrapping Up
OK, that’s it for today. In the future, I’m going to be figuring out how to integrate Python Unit testing into Python. I had it wokring years ago, but I forget how. This allowed you to write and run tests and use the debugger right from within Eclipse.

March 12th, 2009 - 10:07
I found your topic “kuh • pain´• kah − Eclipse for Python Development” when i was searching for Selenium and it is really intresting for me. If its OK for you i would like to translate your topic and post it on my german blog about Selenium. I link back to your topic of course!