Fredrik Lundh wrote: >John Abel wrote: > > > >>def _importModule( moduleName ): >> modName = __import__ ( moduleName ) >> modComponents = moduleName.split( '.' ) >> for indivComp in modComponents[ 1: ]: >> modName = getattr( modName, indivComp ) >> >> return modName >> >> > >__import__ takes a module name, not an arbitrary file name. > ></F> > > > > > Didn't mean to imply that it did. By pathToModule, I meant spam.ham as in http://localhost/documentation/Python-Docs-2.4.1/lib/built-in-funcs.html#l2h-6 ( hopefully, that should explain things to the OP ).
J -- http://mail.python.org/mailman/listinfo/python-list