NetBeans Python Editor - Solaris Rss

This is a discussion on NetBeans Python Editor - Solaris Rss ; NetBeans 6.7, released earlier this summer, has a pretty nifty Python editor. To give it a spin a decided to set up a project for the Image Packaging System . If you want to try it yourself, here's the steps ...

NetBeans Python Editor

NetBeans 6.7, released earlier this summer, has a pretty nifty Python editor. To give it a spin a decided to set up a project for the Image Packaging System. If you want to try it yourself, here's the steps I took:

The IPS Python sources are in /usr/lib/python2.4/vendor-packages/pkg, with the exception of the pkg script, which is in /usr/bin. To keep the NetBeans project simple, I copied the pkg script from /usr/bin to /usr/lib/python2.4/vendor-packages/pkg. I also renamed the script to pkg2.py. Adding the .py extension allows it to be recognized as a Python script by NetBeans. Changing the name to pkg2 prevents it from conflicting with the existing script in /usr/bin:

pfexec cp /usr/bin/pkg /usr/lib/python2.4/vendor-packages/pkg/pkg2.py

In NetBeans select File > New Project and then select Python Project with Existing Sources:

[IMG]file:///tmp/moz-screenshot-3.png[/IMG]

Give the project a name such as PKG or IPS and set the Python Platform to Python 2.4.4:

Then add /usr/lib/python2.4/vendor-packages/pkg as a source root folder:

To give the project a quick test drive, right-click it and select Properties. Then set the Main Module to pkg2.py and the Application Arguments to something like 'info netbeans':

Then select Run > Run Main Project. You'll see the result in the Output window:

Editor Features

Now that we've got the project set up, let's look at some of the features provided by the editor.

Syntax Highlighting

The code is easy to read.

Code completion

Ctrl+Space to activate.

Hover Documentation and Hyperlink Navigation

Holding down the control key and hovering over Classes and methods will also show you the documentation:

And clicking on the hyper-link will take you to the class or method.

Navigator Window

Also, the Navigator window is a quick way to find your way around a script:

Go to Type

And Go to Type (Ctrl + O) will quickly take you to any type:

Debugger

And finally, one of the coolest features is the debugger. Select Debug > Debug Main Project to start it: