From: Kenworthy, E. <Edw...@ma...> - 2002-07-17 15:14:21
|
That's exactly what I needed. Thanks very much. -----Original Message----- From: Jeff Emanuel [mailto:je...@ad...] Sent: 17 July 2002 16:11 To: Kenworthy, Edward; jyt...@so... Subject: Re: [Jython-users] Help with calling Jython scripts from Java I don't have the O'Reilly book, so I don't know whether this is similar to the example Samuele cited. Perhaps it will be helpful. I.java: package my.package; public interface I { public Object doSomething(Object o); } PyI.py: from my.package import I class MyI(I): def doSomething(self, o): return "did it" myI=MyI() calling java code: interp.execfile("PyI.py"); I myI = (I)interp.get("myI); myI.doSomething(someObject); Hope that's not too opaque. |