Bill Wilkinson <yopen@my-Deja.com> 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 imputil.py 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.
</F>
1) http://www.lyra.org/greg/small/
2) http://starship.python.net/crew/gmcm/install.html
> 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 imputil.py 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.
</F>
1) http://www.lyra.org/greg/small/
2) http://starship.python.net/crew/gmcm/install.html