Module executed twice when imported!
Georg Brandl
g.brandl-nospam at gmx.net
Sat Jul 1 04:56:45 EDT 2006
Michael Abbott wrote:
> In article <e844h9$qkt$1 at news.albasani.net>,
> Georg Brandl <g.brandl-nospam at gmx.net> wrote:
>> That's because __name__ is normally set to the module's name in the package
>> hierarchy. When you set it to "some1.some2", Python thinks it's
>> in a subpackage
>
> Ahhhh.
>
> So what I *should* have set it to is the module name *without*
> extension, i.e. __name__='imptest'
>
> Thank you. Now I think I understand it.
You're welcome. This is indeed not easy to look through.
Georg
More information about the Python-list
mailing list