how to import from variable source

Martin Bless m.bless at gmx.de
Sun Apr 15 17:01:21 EDT 2001


>> 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



More information about the Python-list mailing list