java - Using/Creating Python objects with Jython -
Hi,
We say that I have java interface B, something like that. Bijavah:
Public interface B {String fur (string S); }
And I want to use it with a Python class D witch B. B, this way. D.A.P. FBBR S + 'E'
So how do I get an example now in D? I am sorry I am asking such a n00b question, but Jyothan Doctor is a poor / partially closed line.
Code above for your example, you need to change the implementation of the fobar to take the argument This is not a steady way.
You need jython.jar for this example, which is to compile and run it.
Import org.pyththon.core.PyObject; Import org.pyththon.core.PyString; Import org.pyththon.util.PythonInterpreter; Public Sector Main {Public Stable vs. B () {Python Interpreter Interpreter = New Python Interpreter (); Interpreter.exec ("D import from D"); PyObject DClass = interpreter.get ("D"); PyObject DObject = DClass .__ call __ (); Return (B) DObject .__ tojava __ (biclas); } Public static zero main (string [] args) {B b = create (); Println (b.FooBar ("wall")); }}
For more information see the lesson in
Comments
Post a Comment