From: Jim A. <ji...@tr...> - 2001-03-21 23:35:37
|
Mark Ackerman wrote: > Now I get: > > Traceback (innermost last): > File "<string>", line 1, in ? > AttributeError: class 'Util' has no attribute 'test' > > for the method: > > public static int test(int a, int b) > { > return a*b; > } > > in the class Util. I assume your Python code says something like ?: from <mypackage> import Util result = Util.test(a, b) This should work if the types of 'a' and 'b' can be coerced into 'int's (although if they can't you would be getting a different error ?) Have you seen Bruce Eckel's chapter in the downloadable book 'Thinking in Patterns' that is all about using Python?: http://www.bruceeckel.com/TIPatterns/index.html Chapter 9 is the "Interpreter Pattern" and Jython. Near the end is 'Controlling Java from Jython' that has what you need..and lots more! -- __o Jim Adrig _ \<,_ ji...@tr... ' `/ ' ` ___________ `-' `-' |