In JVM, you have Jython (though it only supports Python 2.7), and Graal, both of which are Java implementations of the Python engine which interpret and run Python code at runtime in the JVM and can interop with Java (or Kotlin/JVM) objects
r
Richard Gomez
08/23/2021, 5:51 PM
@Anil Kumar: what's your use case?
a
Anil Kumar
08/23/2021, 6:45 PM
I have a business logic which is shared across Android app, iOS app and website which is backed by a Flask (Python) server. Would be great if python interp could work in this case.
r
Richard Gomez
08/23/2021, 6:48 PM
IMO, the least painful approach is interacting via a Flask API. Native interop is possible, but far more painful and error-prone.
You could even expose an Open API spec for your Flask backend and generate code on Android & iOS.
c
CLOVIS
08/24/2021, 4:48 PM
It depends how soon you want it. See #python and #python-contributors, however that is a very, very early proof of concept. It is really interesting to follow, though.
If you need something now, then Richard's approach of using OpenAPI or any other API is probably the safest bet.