Gruik wrote:

But before that 1 question: what if I'm in Python ?
Following your solution, I did that in Python :

    def load_buffer(buffer) :
        compiled_buffer = compile(buffer, "module_name", "exec")
        exec(compiled_buffer)

It works great except that I can't have a module object and that it is
as if I did "from module import *"
But I need the module object and not an "import *" behavior.
Any idea about the way to do that?

Something along the lines of:

import new
mymodule = new.module("mymodule")
exec <<<code>>> in mymodule.__dict__



--irmen
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to