python学习笔记1-自调用
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部分