This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from java.util.concurrent.Executors import newFixedThreadPool | |
| from java.util.concurrent import Callable | |
| import execnet | |
| nThreads = 8 | |
| executorService = newFixedThreadPool(nThreads) | |
| group = execnet.Group() | |
| group.defaultspec = "popen//python=python" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from icy.main import Icy | |
| from icy.sequence import Sequence | |
| from icyexecnetgateway import IcyExecnetGateway, unpack_image | |
| code = """ | |
| from numpyexecnet import pack_image | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| print "Hello from remote" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from icy.main import Icy | |
| from icy.sequence import SequenceUtil | |
| from icy.type import DataType | |
| from icyexecnetgateway import IcyExecnetGateway, pack_image | |
| code = """ | |
| from numpyexecnet import unpack_image | |
| import matplotlib.pyplot as plt | |
| print "Hello from remote" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from icyexecnetgateway import IcyExecnetGateway | |
| # setups a remote python interpreter and returns the associated gateway | |
| with IcyExecnetGateway() as gateway: | |
| # print some text in the remote interpreter | |
| # it will be sent to Icy and printed in the console output of Icy's Script Editor | |
| gateway.remote_exec("""print "Hello from remote Python" """) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import execnet | |
| print "making gateway" | |
| gw = execnet.makegateway("popen//python=python") | |
| print "executing" | |
| channel = gw.remote_exec(""" | |
| loads = channel.receive() | |
| channel.send(loads) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| sys.path += ['/Users/tlecomte/jython2.5.3stdln+execnet/Lib/site-packages/execnet-1.1-py2.5.egg'] | |
| import execnet | |
| from icy.main import Icy | |
| im = Icy.getMainInterface().getFocusedImage() | |
| data = im.getDataXYAsDouble(0) | |
| print data[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| sys.path += ['/Users/tlecomte/jython2.5.3stdln+execnet/Lib/site-packages/execnet-1.1-py2.5.egg'] | |
| import execnet | |
| from icy.main import Icy | |
| im = Icy.getMainInterface().getFocusedImage() | |
| data = im.getDataXYAsDouble(0) | |
| print data[0] |