[Tutor] diving into py question

Max Noel maxnoel_fr at yahoo.fr
Thu May 19 23:24:18 CEST 2005


On May 19, 2005, at 22:18, Chelan Farsight wrote:

> I am using the online book Dive Into Python.
> I ran the first program given and have run into an error on line 7 at
> the colon.  Now I imagine that there is probably a corrections page at
> the site, but I am interested in knowing why it won't work as much as
> what I need to do to correct it.  Any help would be appreciated.  The
> script follows:
>
>
> if_name_ == "_main_":

     The number of underscores is incorrect. "Magic" names in Python  
start and end with two underscores. The line should be changed to:


if __name__ == "__main__":


Hope that helps,
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic creature of meat and bone, panting  
and sweating as you run through my corridors... How can you challenge  
a perfect, immortal machine?"



More information about the Tutor mailing list