« Return to Thread: Use Python libs or Java libs

Re: Use Python libs or Java libs

by kilon :: Rate this Message:

Reply to Author | View in Thread


I am afraid I have some bad news for you.

Jython CANNOT use python libraries.

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

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

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

Why choose python instead of java libraries ? Well because python libraries are much more "pythonic" thus easier to use and understand. However using jython makes it easy to jump from jython to python as the diffirences between the two languages are minimal.

So in the end , jython is a very useful for java developer who want some of the ease of use of python , or for python programmers that want access to myriads of Java libraries out there.  If you want to use both , Java and python libraries , then your porgramm should be made in both languages Jython and Python and make a way for the two to communicate with each other.

lodmod.dod@gmail.com wrote:
Hi list,This is probably a common question, but I figured I'd ask again.
There is a certain amount of overlap between the Java libraries and Python
libraries, so when using Jython, when does one know which to use?
For example, both have os and sys libs, that have similar functionality.
How does one decide?

Thanks.

------------------------------------------------------------------------------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users

 « Return to Thread: Use Python libs or Java libs