"Jyni" with Python mode

Dear all,

I have recently heard about Jyni (tries to enable Jython to use native CPython extensions) and would like to test it with Python mode.

I have 2 questions:

  • Do you think it is compatible with Processing ? (latest version requires Jython 2.7.1)
  • If so, how would you install it ?

Regarding the installation, the dedicated github page states the following:

  • make the folder JyNI.dll available on the Java classpath
  • have the JyNI.jar file on the Java classpath when calling Jython

Unfortunately, I have no understanding of how works the Java classpath (how to access and modify it) and would really appreciate your help.

2 Likes

Processing’s Python Mode is highly customized. So you should directly ask jdf for it: :flushed:

3 Likes
2 Likes

JFD is probably too busy to look at this issue. I’m a bit confused now and don’t really know where to ask for help. Folks from “Jyni” probably won’t have any clue as it is related to the Processing environment and at the same time this is too specific/technical to be asked on this forum (Python mode, Java classpath, Jython compatibilty…). SO doesn’t seem to be the best place either.

Yet another crazy idea… Maybe you could create a PyJnius interface to Processing…

Use vanilla CPython + PyJnius to acesss and run PApplet (sketch) objects…

https://pyjnius.readthedocs.io/en/stable/index.html

1 Like

Thank you for the suggestion.

I like crazy ideas, and this one is pretty interesting but I’m afraid this is way beyond my current level of capability.

@GoToLoop, do you know how to make the dll and jar file available on the Java classpath ?
I have spent quite some time trying to figure this out without success. All I could do so far (please don’t laugh) is to drop

  • JyNI.jar in C:\Program Files (x86)\Java\jre1.8.0_211\lib
  • JyNI.dll in C:\Program Files (x86)\Java\jre1.8.0_211\bin

and in Processing Python mode:

import sys
sys.path.append('C:/Python27/Lib/site-packages')

import numpy as np #one day, let's hope

Sorry, that is all a mystery to me, b/c I’ve never looked into the subject yet. :crying_cat_face:

Python Mode got 3 JAR files at “sketchbook.path.three”\modes\PythonMode\mode\ :

  1. PythonMode.jar
  2. jython.jar
  3. guava-17.0.jar

Most probably the file JyNI.jar & folder JyNI.dll\ should both go there as well.

However, they still need to be activated by making the JVM see they’re there.

That is, we have to somehow include them as part of the class path loading step, the same way jython.jar and other “.jar” files already are.

2 Likes
2 Likes