1

Actually i'm about to start a project, in the company we are using java as a main technology in owr web app server (IBM WebSpher), but now we need to integrate existing technology with a new product recently purchased and is developed in C/CPython and ofer a SDK also in C and implementation in CPython (.pyd file), now i want to know if the kind of libraries are supported in jython actyally i'm working with Jython 2.7b1? or is there a way to use these kind of libraries?

Thanks and regards, Serch

1 Answers1

3

From the Jython FAQ...

Jython programs cannot use CPython extension modules written in C. These modules usually have files with the extension .pyc, .pyd or .dll. If you want to use such a module, you should look for an equivalent written in pure Python or Java.

The only workaround would be to use JNI to embed CPython in Java, although it would probably defeat the purpose of using Jython.

Aya
  • 39,884
  • 6
  • 55
  • 55
  • 2
    Since when is `.pyc` an extension module? I've only ever seen it used for cached bytecode (which it likely incompatible too, but it still seems out of place in that sentence). –  Apr 25 '13 at 15:47
  • 1
    @delnan Heh. Didn't notice that. I guess they figured it was easier to add that in there, rather than add a new FAQ entry specifically for CPython bytecode incompatibilities. ;-) – Aya Apr 25 '13 at 15:53
  • Thanks a lot for your answer, i will try to use directly the C libraries provided by the vendor, [JNA](https://github.com/twall/jna/) has good look – Sergio Valdez Apr 25 '13 at 21:26