Eclipse for basic text processing

Eclipse is a powerful integrated development environment (IDE) for programmers and other people working with code. Eclipse is especially geared towards the Java developer, but also offers a development environment for working with other programming languages. It has optional editors and parsers and support for many programming languages such as Python, Groovy, R, XML and others. It offers access to many tools that are useful for developers; examples are integrated software for working with SVN repositories, Maven repositories etc.

The Eclipse development window is complex at first sight, but offers an integrated environment for lots of the typical tasks encountered in software development. The initial screen shown after the first program start offers an overview and some tutorials to get novice users started.

Figure 1: Welcome screen

Installing Eclipse

Installing Eclipse is actually quite easy once you have decided which version you want and need. For most purposes, Eclipse Standard offers most of the functionality required to get started. This can then be configured and enhanced with further software to suit the user's individual needs.

As Eclipse is written in Java, Java needs to be installed. Go to the Eclipse download area and download the latest version of Eclipse Standard for your operating system: Eclipse download

First Steps in Eclipse

The first time you run Eclipse, a window will pop up asking you to set up a work space. Enter a file path where you want your Python scripts to be saved. Next, Eclipse is opening, displaying the welcome screen (see Figure 1). Close it to start programming. In the top right corner, the programming language can be chosen. In addition to Java, other programming languages can be integrated by means of plug-ins.

Using Python in Eclipse

Eclipse can be used as a Python IDE.

First, make sure you have Python installed. Next, open Eclipse. To be able to program in Python, PyDev which is the Python IDE for Eclipse, needs to be set up. In the Eclipse window, go to Help and then Install New Software…. Click Add in the next window. Enter pydev under name and under Location http://pydev.org/updates/. Click OK. Next, tick the box next to PyDev. After PyDev is installed, Eclipse needs to be restarted.

Next, go to Window in the Eclipse window, next Preferences and go down to PyDev and then Interpreter-Python. Here, you need to specify where the Python interpreter is located on your computer. Click on New and name it for example Python 2.6 and browse for the Python executable - this is the python.exe in your Python folder. As the Java perspective might be opened in Eclipse click on this symbol and open the PyDev perspective by choosing PyDev.

To create a new Python script, click on the arrow next to this symbol and choose PyDev Project. Give your project a name and click Finish. Next, right click on your new file, choose New and then PyDev Module. You can now give your module a name e.g. Test_Module. As a result a window opens up in which the different possible templates are listed. Choose the template that suits your task. It is then opened in the editor. In the first comment lines you can enter a description of what your code does. If you want to run your code, right click on the editor window and choose Run As and then Python Run. You can then choose which resources should be saved, click OK. The Console window opens up at the bottom of the editor with the output of your script. When it is finished, it says <terminated> next to the file path in the console. You can also click on this symbol to run the script.

This videotutorial leads you through the necessary steps for the PyDev installation.