newb: What is the purpose of if __name__ == "__main__":

Robert Kern robert.kern at gmail.com
Wed Dec 6 22:10:56 EST 2006


johnny wrote:
> What is the purpose of
> if __name__ == "__main__":
> 
> If you have a module, does it get called automatically?

http://docs.python.org/lib/module-main.html

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list