From: <bc...@wo...> - 2001-10-23 19:33:55
|
[Max Muller] >Hi, > So I've got the PythonInterpreter running inside my Java app >(thanks to everyone for the pointers to PyServlet example) and I >successfully get a Proxied class object from this bit of code that >looks something like: > > interpreter().execfile(testFile.getAbsolutePath()); > > PyObject cls = interpreter().get("Test"); > > Object o = cls.__tojava__(Class.class); > > Class testClass = (Class)o; I don't think we ever tested this when the code was create with exec/execfile. I believe it works when the python code is placed in a module. The proxy tries to import the module that the code was compiled from. Do you really need to call the java Constructor directly? Normally it it a lot easier to simple call the python class: PyObject instance = cls.__call__(Py.java2py(aWOContext)); regards, finn |