Saturday, February 14, 2009

With dynamic languages getting widespread acceptance and is being used in numerous applications, especially languages like CPython and JPython becoming popular among the developer community, Netbeans has added support for CPython and JPython in its IDE, the initial support is available in Netbeans 6.5, from my experiences with it, it looks very promising and is poised to become the best open source IDE for python and jython languages in near future.

Netbeans 6.5 supports all standard IDE features for python, if you are a java programmer using Netbeans IDE, this would be a welcome development, I know many Netbeans folks interested in python/jython asking me for a similar IDE available for these languages, if you are a core java developer, I agree that its not easy to come out of the Netbeans IDE style of work and thus the support for these languages is always imminent.

This tutorial is designed to quickstart you to Netbeans IDE with python and jython, its has three sections.

Python: Coincidentally at the time of this writing, Python 3.0 was released, but for some reasons, the Netbeans IDE early access doesn't detect python 3.0, but in future it should support Python 3.0 and I will update it in this post when it supports python 3.0.

Jython: The Netbeans IDE 6.5 comes with a default jython package installed (Jython 2.5 at the time of this writing), but if there are additional versions installed in your system, you can choose the one which will be used for that project.

Once you have python/jython installed, you can open a new project as shown in the figure below.

Step 1: Open File -> New Project

Fig 1: Opening a new python project

Step 2: Selecting or adding a new python platform

Fig 2: Default Python platform available

As shown in the above figure, by default, the jython 2.5 platform which is bundled with Netbeans will be shown, but you can add your own python platform

Step 3: Adding your own python platform

Even though this will not work for Python 3.0 currently, any 2.x python versions can be added as shown below, you can skip this part if you have an existing python 2.x installation detected by Netbeans.

Click Manage tab next to Python Platform selection option, select the path to python 2.5 executable, you can then see the new python platform added.

Fig 3: Adding your own python platform

After you add a python 2.x platform, you can set it as the default platform for your project if you want to compile it using CPython, see Fig 4 below.

Fig 4: Selecting the python platform for the project

Once you select the python version, click finish and you are all set you start your python journey with Netbeans as shown below.

Subscribe to:

About Me

Hi, I am Prasanna Seshadri, Software Engineer from CA, USA. My primary purpose behind blogging is to share some of my views about technology, best practices, code and technical tips which may be useful for others (of course I don't ignore the fun part). I blog to do more value add to users and sometimes the disappointment of not getting a solution through Google also inspires me to blog if I find one.