Module loading trickery

Jonas Galvez jonas at codeazur.com.br
Tue Oct 5 11:22:58 EDT 2010


Is there a way to "inject" something into a module right before it's loaded?

For instance, a.py defines "foo". b.py print()s "foo".

I want to load b.py into a.py, but I need to let b.py know about "foo"
before it can execute.

Is this any way to achieve this?

-- Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101005/172ade65/attachment.html>


More information about the Python-list mailing list