[Tutor] What is `if __name__ == "__main__"` for?

Ganesh Kumar bugcy013 at gmail.com
Fri May 20 13:09:59 CEST 2011


Hi Gurus,

I am new python programming.. I see many programs
if __name__ == '__main__':
 when I check __name__ always eq __main__.
what purpose use these structure.. please guide me..

-Ganesh

-- 
Did I learn something today? If not, I wasted it.


More information about the Tutor mailing list