A big problem with _name_ == '_main_'

Tommy Grav tgrav at mac.com
Sat Sep 1 20:45:37 EDT 2007


On Sep 1, 2007, at 8:35 PM, onurays wrote:
> I have begun to teach me Python today. The problem is :
>
>     NameError: name 'name' is not defined.
>
> I am using winXP and i used that:
>
>     if  _name_ == '_main_' :
>         MyClass()
>         gtk.main()
>
> Onuray.

I believe that should be a double underscore

if __name__ == '__main__':
	MyClass()
	gtk.main()

Cheers
   Tommy




More information about the Python-list mailing list