8

I'm working on a framework right now, part of which requires Jython. I just added some plotting to it using MatPlotLib, without realizing that MatPlotLib is incompatible with Jython. Since these two parts are pretty isolated, and I would be fine running most of the program in Python and passing a small amount of information to the Jython part (or vice versa), I was wondering if there's a simple way to do this, while maintaining the modular nature of the framework. Ideas?

asked Mar 15, 2012 at 20:10
1
  • I'm thinking execnet might not be a bad choice. Thoughts? Commented Mar 15, 2012 at 22:00

2 Answers 2

11

I have not used execnet for anything serious, but it seems quite possible that it is a good choice for you. execnet is a Python library for distributed execution across version, platform, and network barriers.

It is not hard to get started. This simple Jython script (that invokes NumPy) worked for me without a hitch:

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

Output:

3

The documentation includes an example that goes in the opposite direction (a CPython interpreter connecting to a Jython interpreter).

answered Mar 22, 2012 at 19:15
Sign up to request clarification or add additional context in comments.

1 Comment

execnet is no longer actively developed. github.com/pytest-dev/execnet.
0

Didn't use MatPlotLib with execnet ...

But ...

For a quick tryout with execnet (on a win32 platform) you can use PortablePython2.7.2.1

PortablePython contains the MatPlotLib and is easy to install (and remove)

answered Mar 16, 2012 at 14:18

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.