(May be OT) developing in jython, using in java?

Diez B. Roggisch deets at nospam.web.de
Tue Jul 31 18:04:02 EDT 2007


Gerardo Herzig schrieb:
> Hi all. I dont know if this is the right place for asking this, but 
> maybe some of you know where i must go.
> The thing is:
> 
> Im writing a very simple class (in python) to access some LDAP server. A 
> companion will access to the same LDAP server too, but his developing in 
> java. So i said "ok, wait, i dont think we have to make the exact same 
> thing twice! Let me see if jython can help us"....I can find (after a 
> quick review) an answer to this: "Can i, using jython, make a package so 
> my companion can import that package as a webservice??"
> 
> As im farly new in python, *very* new at Java, and *even newer* at 
> jython, my brain just said to me "ok, i dont know, i want a beer", so 
> maybe some of you can gide me to where i must go in order to clarify my 
> ideas.

There is a jython mailing list, which is probably a better place to ask 
jython-related questions.


The problem is that jython essentially brings the syntax of python to 
the library of Java, plus it tries to wrap as much Python libs using the 
corresponding Java-libs. But there are gaping holes in that effort due 
to lacks of the JDK - think of e.g. posix functionalities.

And while accessing Java from Jython is a piece of cake, the other way 
round isn't so easy.

For you actual problem I'd say: it's the wrong way - because if you need 
your LDAP-class from CPython, you won't be able to help the Java-guy, 
because the libraries for accessing LDAP in Java differ from the one
in CPython, and making the Jython class accessible from Java isn't worth 
the effort.

diez



More information about the Python-list mailing list