473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 10665
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. ...
1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
0
by: FreeStyle | last post by:
Hi everybody, I'm using phpMyAdmin 2.2.6 with EasyPHP v.1.6.0.0 I wrote a php script which uses a username (added in the mysql base with phpMyAdmin). This user has no privileges. But in the...
0
by: Madhusudan Singh | last post by:
Hi I wonder if there is a clean way of using https with header() in PHP ? I am using statements like header("Location: script.php?arg1=argvalue") to transfer control in my application. Thanks,...
3
by: Marcus | last post by:
I'm really confused with something I never had any problems with before... I have a form with a textbox called password. On the second page that $password is posted to, if I test isset($password)...
25
by: Nafai | last post by:
Hello. I'll try to explain my problem with an example: I have the following classes: class A { public: string name; .... };
9
by: Exits Funnel | last post by:
Consider this code which is a very trimmed down version of some I've inherited and am trying to port from windows to g++: //Begin test1.cpp class foo { int i; int j; }; class bar { bar (int...
12
by: swellfr | last post by:
Hi if have simple macro defined this way: #define M_OPplus( classname ) typedef classname operator+(const classname& rhs); and a template class : template<typename X, typename Y> class...
17
Ganon11
by: Ganon11 | last post by:
Hey guys, OK, taking care of this beforehand; I AM a student in a university. This IS part of my homework, and (as a moderator), I'm doing my best to follow the posting guidelines I work so hard...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.