What is if __name__ == ‘__main__’ in Python ?

The following is the most common pattern that trips people up.

Every Python module defines a variable called __name__. It can either contain module name or __main__ depending upon how a module is executed.

Read moreWhat is if __name__ == ‘__main__’ in Python ?