import hooks

Patrick Stinson patrickkidd.lists at gmail.com
Tue Apr 15 21:14:18 EDT 2008


What's the current way to install an import hook? I've got an embedded app
that has a few scripts that I want to import each other, but that are not in
sys.modules. I intentionally keep them out of sys.modules because their
names will not be unique across the app. They will, however, be unique
between scripts that I (do* want to see each other).
Basically, I want to return a certain module from a name-based filter. I've
already written a type in C with find_module and load_module, but it doesn't
seem to work when I add the type to sys.path_hooks. I wrote a simple one
that worked just fine from a pure script file run through python.exe.

Thanks!

-- 
Patrick Kidd Stinson
http://www.patrickkidd.com/
http://pkaudio.sourceforge.net/
http://pksampler.sourceforge.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080415/96243e9f/attachment.html>


More information about the Python-list mailing list