import question

Fredrik Lundh fredrik at
Sat Nov 20 12:20:43 CET 1999

Bill Wilkinson <yopen at> wrote:
> I have searched the documentation but have not found anything that helps me
> with this.
> I want to be able to import a module from a  variable instead of a file.  I
> need to do this because all my modules are going to be in a database.  So I
> want have something like this:
> s = "lots of classes and functions loaded from a database"
> import s
> s.run_function()

check out the module in greg stein's "small"
distribution kit [1] (also in gordon's installer kit [2]).  it
allows you to create and install custom importers using
only a few lines of Python code.



More information about the Python-list mailing list