摘要: if __name__=='__main__': test() #hello模块中的最后两行代码 当我们在命令行运行hello模块文件时,Python解释器把一个特殊变量__name__置为__main__,而如果在其他地方导入该hello模块时,if判断将失败,因此,这种if测试可以让一个模块通过 阅读全文
posted @ 2020-03-17 07:32 纯白的拉法达 阅读(137) 评论(0) 推荐(0) 编辑