Introduction

Like the original CPython the Jython project ships with a simple command line  interpreter. And, just like in CPython you can't embed the Jython interpreter in your own Java Swing application without extra work.

The CPython developers have a long history of evolving an Enhanced Python Interpreter shell called  iPython.

iJython is a simple interactive Jython shell that appears to have been inspired by iPython. iJython is written in pure Java and Swing and allows you to easily embed Jython into a Java application.

Downloading IJython

You can download the source code using anonymous svn access  here. We will create downloadable jar files and a java webstart version soon.

What is it good for?

We have barely scratched the surface of what can be achieved using a combination of Java and Jython. The resulting applications can use the best language for the task at hand and the end result is trivial to deploy on to all the major operating systems.

The GeoCraft application uses the shell for a few simple tasks:

  1. GeoCraft  screenshot
  2. Jython manages the namespace for an object repository - see Domain Driven Design in InterestingLinks section.
  3. we use the Python interpreter as an expression parser.
    • admittedly, Python is way over-engineered for parsing a + b but it works really well.
  4. Jython allows for interactive examination of the state of the Java application - debugging.
  5. Simple plotting functionality for data quality assurance - see JyPlot for examples.
    • one day this may evolve into a more powerful data exploration tool.
    • screenshots

Current Situation

Our primary interest is in making the shell a great interactive console widget that can be embedded in Java applications. This does not preclude continuing loeuser's work to replicate the iPython shell if anyone would like to contribute.

We weren't setting out to recreate iPython when we started using the jythonshell project created by leouser. The original jythonshell project seems to have disappeared and we wanted to update the jythonshell to work with the latest versions of Jython.

We are renaming the project to be iJython because there is a second jythonshell project  here. We chose the name, not to goad the  iPython developers :-) but because it seemed like an appropriate name for leouser's work.

The current version has been updated to compile against the Jython2.2.1 api. It has not been tested and we are not yet using it in production.

You can download the source code via anonymous svn access from  svn using anonymous access. We build it and run it in Eclipse and it should be easy to use from other IDEs.

Prerequisites are:

  1. install Jython2.2.1
  2. add jython.jar and junit3.8.1.jar to the path
  3. pass -Dpython.home=/your path to jython as a JVM argument
    • if the shell complains it can't find shutil python.home is not getting set correctly
  4. not sure what the minimum jvm is but we are using 1.6

Future Plans

Our goals are fairly modest right now:

  1. try and simplify the code a little
  2. churn the apis a lot as we rename everything from jythonshell to ijython
  3. minor enhancements to the console
    • some users don't like the color scheme
    • autocomplete doesn't work for foo.bar().[what is next?]
  4. add the iJython project to our continuous integration builds
  5. generate metrics, code coverage etc.
  6. add some unit tests
  7. fix up the license so that it is the same as GeoCraft.

Early days.

Finally

Leouser I would love to hear from you.