In Python, very often we write a module and execute it within the module directly. However, sometime, we want to import another module to support our module. In this situation, to avoid running the main program from the imported module, we need to use main check.
This main check help us to execute the main program only if we want to run the module directly, and make sure that the main program will not be executed when the module is being imported by others.
Смотрите видео Python Tutorial: Learn if __name__ == '__main__' in 3 Minutes онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь eMaster Class Academy 15 Март 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 1,323 раз и оно понравилось 123 людям.