usage of __import__ across two files

John Roth newsgroups at
Sun Dec 12 16:13:32 CET 2004

"bwobbones" <bwobbones at> wrote in message 
news:mailman.7546.1102862143.5135.python-list at
> Hi,
>  I'm having trouble making __import__ work with the two classes attached. 
> The PrintHello() method can't be seen in the BMTest2 class - what am I 
> doing wrong here?


>        tb = __import__('BMTest2')
>        tb2.PrintHello()

Shouldn't this be tb.PrintHello() ?


> Any help will be much appreciated!
> Bones

John Roth 

More information about the Python-list mailing list