1.

if __name__ == "__main__" in Python

Answer»

__main__ is the name of the scope in which the top-level code executes. It can check if it is running in its own scope by checking its own __name__.
Format of checking:

>>> if __name__ == "__main__":
... main()


Discussion

No Comment Found