From: Kay <ka...@gm...> - 2003-10-12 22:58:24
|
Hello! I want to start the method "run()" (with an embedded interpreter) from 'MyClass.java', but i'm getting the following exception: --> Traceback (innermost last): (no code object) at line 0 TypeError: run(): expected 1 args; got 0 <-- ... dir() shows "obj1"; The InteractiveConsole starts 'run' without problems! Do you know, where is the mistake? Thx! Regards, Kay -=> App.java <=- : Object obj; : interp = new PythonInterpreter(); interp.set("obj1", obj); PyObject pyObject = interp.eval("obj1"); pyObject.__getattr__("run").__call__(); <--- doesn't work?! : -=> MyClass.java <=- public class MyClass implements Runnable{ public JFrame frame = new JFrame(); public void run() { System.out.println("Starting..."); frame.setSize(200,200); frame.show(); } } ******************************************************************** |