Is this right? Multiple imports of same module.

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Fri Mar 9 10:33:02 EST 2007


In <pecora-B92BB8.09304609032007 at ra.nrl.navy.mil>, Lou Pecora wrote:

> *In mod1.py
> 
> import mymodule
> 
> *In mod2.py
> 
> import mymodule
> 
> *In mod3.py
> 
> import mymodule as MM
> 
> Then mymodule is imported only once, but each module has access to it 
> through the module name (mod1 and mod2) and the alias MM (mod3).  Is 
> that right?

Yes, that's correct.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list