>> If - against normal behavior - it could be set to '__main__' the >> imported 'mymod' could be deceived leading to execution of code > >You can do that with the imp.load_module() function. Can it be done for hierarchical packages too? I tried for quit a while now but can't figure it out. Martin