import hooks

Patrick Stinson patrickkidd.lists at
Wed Apr 16 03:14:18 CEST 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.


Patrick Kidd Stinson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list