special case loading modules with imp

Erendil at aol.com Erendil at aol.com
Wed Jul 30 11:24:21 EDT 2003


Alright, this is my first post here. =) Let's try to get this right?

I have a slight problem right now. I wrote a plugin architecture in Python, 
allowing any python app or python using app to use plugins. It's very flexible 
and open-ended, except for one thing: It has to use imp to load python source 
from files. Now, using imp is not the problem really. The plugin module works 
very well as of now, and I've used it lots of my other projects. What I need 
to do now is I've read Python code out of an SQLite database into a string, and 
I need my plugin module to use imp to load that string of code as a module. 
(I don't use import because I simply store the module object in an array. makes 
it unloadable later.)

So, I just want to switch from using real files to being able to use strings. 
The goal is to get a module object that I can place in an array.

       Thanks, Rob.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20030730/54807668/attachment.html>


More information about the Python-list mailing list