On Feb 3, 8:51 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 03 Feb 2007 02:37:11 -0300, Paddy <[EMAIL PROTECTED]> > escribió: > > >> and what is > >> __name__ > >> __main__ > > >> use for in terms of Java? > > > With respect, (hehe), maybe you need to indicate that you've searched > > the Python documentation on __name__ and __main__? > > (Hah! I did that without saying RTFM. - Oh pooh! Fiddlesticks). > > Have you acually tried to do the search? The Python tutorial doesn't > menction that at all. And no one should expect that a beginner would have > to read section 26.3 on the Language Reference (__main__ -- Top-level > script environment) just to know what's that stuff about __name__ and > "__main__"... > > -- > Gabriel Genellina
Good point. Googling for : tutorial "if __name__ = '__main__'" http://www.google.co.uk/search?hl=en&safe=off&q=tutorial+%22if +__name__+%3D+%27__main__%27%22&btnG=Search&meta= Gives this excellent page by the effbot: http://effbot.org/pyfaq/tutor-what-is-if-name-main-for.htm In fact, fatwallet should add its index page to his bookmarks: http://effbot.org/pyfaq/ Thanks Gabriel, - Paddy. -- http://mail.python.org/mailman/listinfo/python-list