Loading new code...

Olivier Dagenais olivierS.dagenaisP at canadaA.comM
Fri Aug 11 14:14:42 EDT 2000


I'm storing code in a database.  I'd like to be able to import the code in
the global namespace (well, so that I only need to import/load it once, and
"everybody" can see it), but "from module_name import *" will try to read
from a file... (which I don't have, and don't feel like creating, otherwise
that would defeat the purpose of having a database)

So, as suggested in the documentation, I looked up the imp module..  Would
the load_module function do what I want it to, or should I just "exec" the
block of code I retrieve from the database?  What would be the most elegant
method, while still allowing me to reload the code by updating and
re-querying the database at a later time?

Thanks!

--
----------------------------------------------------------------------
Olivier A. Dagenais - Carleton University - Computer Science III






More information about the Python-list mailing list