Python: Debugging with JEdit and JPyDebug on OpenSolaris

Hi - well off digging into Python for my sins and wanted to have an IDE for Python working on Solaris. Looking around came across JPyDebug, which has NetBeans and JEdit support.

I was able to get the JEdit support working [thanks to frred] but the NetBeans plugin is failing in NB 6.0 RC1 with a java.net.ConnectException when I try to debug a python file :( Hopefully this will be fixed. In the meantime here's the how to for JEdit on OpenSolaris (I'm on x86 nevada build 77).
 

Grab and Install the bits

  • JEdit - using 4.3pre11
    • installed using: java -jar jedit4.3pre11install.jar
  • JPyDebug - using 0.18.5
    • unpack and installed using: cp jpydebug-jedit43-0.0.18-5.jar ~/.jedit/jars
    • Note: current nbm not working in NetBeans, maybe some simple config issue, if anyone knows let me know :(
  • Jython - using 2.2.1
    • installed using: java -jar jython_installer-2.2.1.jar
    • Need to copy <jython install dir>/jython.jar to ~/.jedit/jars it's needed by JPyDebug

Configure 

Make sure Env setup, for me this in my ~/.bashrc

export JEDIT_HOME=~/jedit/4.3pre6/
export JAVA_HOME=/usr/jdk/jdk1.6.0_01/
 

Run JEdit and Configure the JPyDebug plugin: 

JEdit > Plugins > Plugin Options: JPyDebug

CPython Options:

    Python Interpreter location: /usr/bin/python

JPython Options:

    Jython JVM location: /usr/jdk/jdk1.6.0_01/bin/java

    Jython Home Path: /export/home/jr140578/jython2.2.1
 

Debug 

Shut down JEdit, relaunch and open a sample Python program to test. You should be able to set breakpoints by clicking on the left hand gutter of the View window, then Choose: 

    Plugins> JPyDebug > JPyDbg Python Debugger

I wanted to run this as a docked window, but the cursor seems to go a little crazy when I do. So for now I keep it floating, select the little Bug icon and I can debug the Python code. You can step through the code and look at variables as they are changing and so on. I'm using code from the Dive into Python online book in the image below:

 


Comments:

This works fine, but there is one more step needed to install:
"JPyDebug - using 0.18.5"

It complains about dependent modules, so you can get those from:
http://plugins.jedit.org/list.php

Simply unzip the files and copy to the:
~/.jedit/jars

This is how my ~/.jedit/jars looks like:
bash-3.2$ ls ~/.jedit/jars
Beauty
JythonInterpreter
SideKick
XercesPlugin
jythonlib.jar
Beauty.jar
JythonInterpreter.jar
SideKick.jar
XercesPlugin.jar
resolver.jar
ErrorList
PythonClient
XML
jpydebug-jedit43-0.0.18-5.jar xercesImpl.jar
ErrorList.jar
PythonClient.jar
XML.jar
jython.jar

Posted by Michal Pryc on November 28, 2007 at 07:06 AM GMT #

Post a Comment:
Comments are closed for this entry.
About

jmr

Search

Top Tags
Categories
Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today