Has anyone tried Py4J with Processing (Java) app?

It seems that it’s be possible to hook Python interpreter with a Java app with Py4J. Based on the example at Py4j webpage, I cannot see why it wouldn’t work with Processing app, but has anyone tried it?

Reason why I’m interested on this is numpy and other data analysis libraries Python has. They cannot be run in processing.py. Especially numpy would be very handy with images.

Harri K

Maybe you may wanna try out some numpy lokalike solution for Java: :coffee:

You could look at using Py4J, JPype, or Pyjnius – each has advantages and drawbacks. In any case, you could just use them with the Processing library outside Processing (e.g. in Eclipse for Py4J) – or you would need to develop a Mode. In order to achieve a result that is anything like the native API feel of programming a sketch in processing.py, you will need to do some substantial mapping work, and it is a big API – I don’t think that you can just call Pyjinius “autoclass” and call it a data (although I haven’t tried!).

You might also be interested in pyprocessing, https://pypi.org/project/pyprocessing/ which is not a mode for PDE, but instead a native Python project. It is similar to the Processing API but doesn’t share its JVM / library ecosystem.

Thanks Jeremy,

pyprocessing even though development has ended ages ago looks interesting. It seems to have functionality I need from processing. I might for this project go all the way with python. Processing gives a nice framework for visuals, but my starting point is a photograph and so far I haven’t much done graphics drawing with processing.

1 Like

Hi @GoToLoop

I’m very interested in Java alternatives to numpy, would you mind sharing what’s your favourite solution so far ?

Sorry, never used 1. Just searched for them on GitHub repos. :disappointed: