Module executed twice when imported!

John Salerno johnjsal at NOSPAMgmail.com
Fri Jun 30 14:30:20 EDT 2006


Simon Forman wrote:

> I don't get it either but there may be a clue in the docs for the
> execfile() function
> (http://docs.python.org/lib/built-in-funcs.html#l2h-24)
> 
> "It is different from the import statement in that it does not use the
> module administration --"

Just after the above statement, it also says:

"it reads the file unconditionally and does not create a new module."

so perhaps that means that it isn't really being imported the second 
time, just that the contents are being executed?



More information about the Python-list mailing list