Module Name Conflicts

ncf nothingcanfulfill at gmail.com
Thu Aug 18 19:38:44 EDT 2005


Maybe what you're looking for is __import__()?

>>> help(__import__)
Help on built-in function __import__ in module __builtin__:

__import__(...)
    __import__(name, globals, locals, fromlist) -> module

    Import a module.  The globals are only used to determine the
context;
    they are not modified.  The locals are currently unused.  The
fromlist
    should be a list of names to emulate ``from name import ...'', or
an
    empty list to emulate ``import name''.
    When importing a module from a package, note that __import__('A.B',
...)
    returns package A when fromlist is empty, but its submodule B when
    fromlist is not empty.




More information about the Python-list mailing list