views:

65

answers:

2

I have a Python application that is running as a console application. I did not like Python GUI libraries. That's why I want to use Java for GUI and python for application core. There are lots of details to read in the Jython documentation. I need a simple way to connect the GUI programmed in Java, and the core programmed in Python. What are your suggestions? Thanks in advance.

+1  A: 

Jython is already mostly Python; only code that uses some core libraries and most third-party libraries will have to be modified, with corresponding Java packages or classes used for those instead.

Ignacio Vazquez-Abrams
+2  A: 

You could first try by taking an inventory of all the features/modules in the console based CPython application and ascertain whether or not they can be run under Jython. As Ignacio mentioned, not all third-party libraries will have been ported to Jython.

You would also have to be familiar with either AWT or Swing development to build the gui in Jython. However, it shouldn't be too difficult to decouple the gui code from the console based functionality.

One benefit is that the entire application can be bundled into a single JAR file along with Jython interpreter bootstrap code and the only dependency would be the Jython standalone JAR file and the application can be run with the user's installed JRE environment.

I don't know how many people do this, but I normally copy the Jython standalone JAR file to the JRE/lib/ext or JDK/jre/lib/ext directory depending on the environment.

This Jython Wiki entry has a great explanation of deployment options.

jtp