if __name__ == '__main__'


__name__ is the current module name, and the module name is __main__ when the module is run directly. The meaning of this sentence is that when the module is run directly, the following code block will be run, when the module is imported, the code block will not be run.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325268484&siteId=291194637