> The global variable __name__ is equal to '__main__' when the python > script is run. > If the script is imported, __name__ is something other than '__main__' > (not sure what.)
it will be the name of your module. so for foo.py, if you execute it (as a script), __name__ == '__main__', but if you 'import foo', __name__ == 'foo'. hope this helps! -- wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "Core Python Programming", Prentice Hall, (c)2007,2001 http://corepython.com wesley.j.chun :: wescpy-at-gmail.com python training and technical consulting cyberweb.consulting : silicon valley, ca http://cyberwebconsulting.com _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor