471,330 Members | 1,251 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

A big problem with _name_ == '_main_'

Hi,

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.
Sep 2 '07 #1
2 10492
Oh, i solve the problem. It should be double underscore.. I am so
careless..!

Onuray.

"onurays" <on*******@gmail.com>, haber iletisinde şunları
yazdı:fb**********@aioe.org...
Hi,

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.

Sep 2 '07 #2
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

Sep 2 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
reply views Thread by FreeStyle | last post: by
reply views Thread by Madhusudan Singh | last post: by
3 posts views Thread by Marcus | last post: by
25 posts views Thread by Nafai | last post: by
9 posts views Thread by Exits Funnel | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.