Re: [Py4j-users] Calling Python from Java side?
Status: Beta
Brought to you by:
barthe
From: Stephen B. <ja...@gm...> - 2015-02-17 07:22:03
|
HI py4j is for going the other way: the Gateway serves java classes for use by python. 2015-02-16 20:38 GMT-08:00 Frank J. Iannarilli, Jr. <fr...@ae...>: > Hi, > > > Barthelemy, thanks for contributing Py4J! > > Is Py4J suitable for enabling me to call Python methods (e.g. SciPy > library) from my Java program? > > I've succeeded in exercising the Getting Started example: > http://py4j.sourceforge.net/getting_started.html > > I am trying to grok your example: > http://py4j.sourceforge.net/advanced_topics.html# > implementing-java-interfaces-from-python-callback > which was pointed to in response to a similar StackOverflow question: > http://stackoverflow.com/questions/23157424/py4j-how- > would-i-go-about-on-calling-a-python-method-in-java?rq=1 > > Although I can see (from the OperatorExample.java file in the > distribution) that Java File2 is not showing this method: > public static void main(String[] args) { > GatewayServer server = new GatewayServer(new OperatorExample()); > server.start(); > } > , > I still can't see from this example how to call Python functions from my > Java program. Where this example (final lines in Python code) show: > # "Sends" python object to the Java side. > numbers = operator_example.randomBinaryOperator(operator) > the meaning of "Sends" seems to imply a "non-stop round-trip" starting > from and ending on the Python side. > > Is Py4J the wrong tool to be using for what I'm seeking? Any advice > appreciated! > Thanks, > Frank > > > > -- > > Frank J. Iannarilli fr...@ae... > Aerodyne Research, Inc., 45 Manning Road, Billerica, MA 01821 USA > > > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > > http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk > _______________________________________________ > Py4j-users mailing list > Py4...@li... > https://lists.sourceforge.net/lists/listinfo/py4j-users > > |