[EMAIL PROTECTED] wrote:

> Thanks for the replies.
> 
>> You can do both
>>
>> from module import *
>> import module
>>
>> as these kinds of import are not mutually exclusive.
> 
> Would this run the code in 'module' twice, or just make the objects in
> it accessible by several names ?

The latter. But why don't you try it yourself by putting a 

print "importing module" # you will see that once

statement in the module? 

There is one notable exception, the application's main module:

$ cat main.py
import main
print "importing main as", __name__
$ python main.py
importing main as main
importing main as __main__

Peter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to