some questions unanswered - new programmer ...

Lee Harr missive at frontiernet.net
Sun Aug 5 17:29:04 EDT 2001


On Sun, 5 Aug 2001 00:03:47 +0300, <whats_really_hot at hotmail.com>:
> thanks for ur time and ur precious answers.
> but, __name__ why doesn't take the __main__ value when we write code in the
> interpreter? besides that, this is the name of the current module.(?)
> 
> 

I'm sorry, but I am not sure what you mean.

>>>print __name__
__main__
>>>dir()
['__builtins__', '__doc__', '__name__']


__name__ is what the variable is called. The name of the variable
is not going to change. The value of the variable might change though.

>>>__name__='The Larch'
>>>print __name__
The Larch







More information about the Python-list mailing list