I did not use execnet for something serious, but it is possible that this is a good choice for you. execnet is a Python library for distributed execution across all versions, platforms, and network barriers.
Itβs easy to get started. This simple Jython script (which calls NumPy) worked without me:
import execnet gw = execnet.makegateway("popen//python=python") channel = gw.remote_exec(""" from numpy import * a = array([2,3,4]) channel.send(a.size) """) for item in channel: print item
Exit:
3
The documentation provides an example that goes in the opposite direction (CPython interpreter connecting to the Jython interpreter).
mzjn
source share