Nov-05-2016, 10:20 PM
__name__ is the name of the scope in which top-level code executes.
a modules name is '__main__' when called from standard input, so
when checking for comparison of the two, is __name__ == '__main__'
will execute ifthe module is run like:
a modules name is '__main__' when called from standard input, so
when checking for comparison of the two, is __name__ == '__main__'
will execute ifthe module is run like:
if __name__ == '__main__': do thisbut not when imported as in:
import modulenamegreat for development