A block like this is commonly used in many scripts to control the script execution when run directly versus when used as a library module.

    if __name__ == '__main__':
        main()