Hiding modules

Tommy Trojan hauck at gseos.com
Sun Feb 15 04:39:10 CET 2004


I have a custom application in which I have a Python interpreter embedded.
Everything works really well and Python is taking over bigger and bigger
chunks of the hosting application (it's spreading like a cancer :-). My
users have direct access to the interpreter through a console window. So
they can run pretty much any code they like. Now I have some modules that I
use in my code and that I don't want my users to access. Is there anything
that can be done to import modules conditionally?
I guess I could just check for import statements or write an __import__
hook, however, I want my code still to be able to access the modules in
Any ideas?


More information about the Python-list mailing list