For IronPython there is a project - IronClad, that aims to transparently run C extensions in it. Is there a similiar project for Jython?
Keep an eye on JyNI (http://www.jyni.org), which is to Jython exactly what is Ironclad to IronPython. As of this writing JyNI is still alpha state though.
If you just want to use some C-library from Jython, simply use JNA from Jython like you would do from Java. If you need finer control, look at JNI or SWIG.
Also, you might want to take a look at JEP (https://github.com/mrj0/jep) or JPY (https://github.com/bcdev/jpy).
You can probably use Java's loadLibrary to do that (provided it works in your platform's java). It is in the java library: java.System.loadLibrary().
Note that sometimes you will have to write a wrapper in C and/or in Java depending on the library you want to use and target system, since details are platform dependant. Refer to the documentation for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With