Netbeans IDE support for python and jython and its usage

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.


1. Netbeans IDE features, Installation, Creating a Python Project and Settings
2. Configuring and running Python projects from Netbeans IDE and Shortcuts
3. Configuring and running Jython projects from Netbeans IDE and Shortcuts

1. Netbeans IDE features, Installation, Creating a Python Project and Settings

1.1 Download: Netbeans 6.5 for python early access version here.

1.2 Opening a new python/jython project

Prerequisites:

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.


Fig 5: Python Project IDE

2. Configuring and running Python projects from Netbeans IDE and Shortcuts

3. Configuring and running Jython projects from Netbeans IDE and Shortcuts

No comments:


Copyright © 2008 Prasanna Seshadri, www.prasannatech.net, All Rights Reserved.
No part of the content or this site may be reproduced without prior written permission of the author.