import unknown module name

deckerben bdeck at lycos.co.uk
Fri Jan 10 07:29:52 EST 2003


"Thomas Heller" <theller at python.net> wrote in message
news:d6n5jvj6.fsf at python.net...
> Andrew Dalke <adalke at mindspring.com> writes:
>
> > In general, __import__ returns the top-level module,
> > and not the submodules.  You'll need to do
> >
> >    codepage = getattar(__import__(pagename), "oldpage")

Thanks! The solution was:
codepage = getattr(__import__(pagename), oldpage)

Ben






More information about the Python-list mailing list