if __name__ == '__main__': #your unit testing code
经常在代码最后看到这一行,主要作用是:
(1)直接运行该文件时,将执行unit testing code部分
(2)调用该文件时,不会执行unit testing code部分
if __name__ == '__main__': #your unit testing code
经常在代码最后看到这一行,主要作用是:
(1)直接运行该文件时,将执行unit testing code部分
(2)调用该文件时,不会执行unit testing code部分
转载于:https://www.cnblogs.com/0-618/p/9322098.html