Dynamic object import ??

Michael Hudson mwh at python.net
Tue Feb 19 07:46:32 EST 2002


"Thomas Weholt" <thomas at gatsoft.no> writes:

> I need a way to scan a given folder for modules, import the ones
> which fits a certain criteria ( ie. has a proper config-file present
> etc.), create instances and map this instance to the name of the
> module, all in a specific dictionary.

imp.load_module may be your friend.

Cheers,
M.

-- 
   This proposal, if accepted, will probably mean a heck of a lot of
   work for somebody.  But since I don't want it accepted, I don't
   care.                                   -- Laura Creighton, PEP 666



More information about the Python-list mailing list