« Return to Thread: Use Python libs or Java libs

Re: Use Python libs or Java libs

by Alan Kennedy-2 :: Rate this Message:

Reply to Author | View in Thread

[kilon]
> I am afraid I have some bad news for you.
>
> Jython CANNOT use python libraries.

That's not true.

Of the  375 libraries distributed with jython, 315 are taken directly,
unmodified, from cpython.

This talk by Jim and Tobias discusses the topic.

http://parleys.com/display/PARLEYS/Home#slide=1;talk=30375937;title=Jython

> Of course there ways that jython could use python libraries . Two come in
> mind this moment:
>
> a) Use a python library that uses pure python with no C/C++ wrappings. I am
> afraid that is very rare in python libraries

Actually, it is very common in python libraries. See above. Also see
Django, Turbogears, etc.

> b) Use C/C++ wrapped python libraries ported to Java through JNI. Very rare
> to do or find.

This is indeed currently rare, but will become less so when work on
the ctypes branch is complete.

http://fisheye3.atlassian.com/browse/jython/branches/ctypes-via-rawffi

> So as a general rule you are forced to use in 99% of cases Java libraries
> with jython, and python libraries with python.

That's not true.

Jython does make it extremely easy to use java libraries.

But most of the time you will find that cpython modules will work
straight out of the box on jython; increasing numbers of cpython
module providers are making sure that their code runs on jython.

Alan.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

 « Return to Thread: Use Python libs or Java libs