From: Edward P. <epo...@te...> - 2002-03-21 02:36:25
|
Hello all. I am trying to create and use objects created in Jython from java. ... interp.exec("class PyJavaTestClass(JavaTestClass): pass"); interp.exec("ptc=PyJavaTestClass()"); ... JavaTestClass jtc = (JavaTestClass)interp.get("ptc",JavaTestClass.class); jtc.something(); // ok jtc = jtc.getClass().newInstance(); // error I get: Traceback (innermost last): (no code object) at line 0 ImportError: no module named main Is it possible at all to do this? I am trying to integrate python created object in a java plugin framework. In hava using forName() and newInstance() was easy. Not sure I can even do the above. I can think of an alternative way to do this, but that would mean reimplementing my java plugin stuff too. Any hints on how to fix the above? Thanks -Ed |