2011/11/9 Philipp Zech <zech.ph@gmail.com>
Hi Pierre,

thanks for your answer, however, there should be anything wrong with my importing statements (see below):


        public JythonObjectFactory (Class<?> interfaceType, String moduleName, String className)
        {
            this.interfaceType = interfaceType;
            final PyObject importer = state.builtins.__getitem__(Py.newString("__import__"));
            final PyObject module = importer.__call__(Py.newString(moduleName));
            clazz = module.__getattr__(className);sepp
        }



Hi Philipp,

If you want to import "building" from "base" with the "__import__" function you'll need to import like:

__import__(name="base.building", fromlist="base")


This will return the module "building" from "base".
 
Pierre Thibault

Python Developer/Développeur Python
Montréal, QC
pierre.thibault1@gmail.com