浅析python 中__name__ = '__main__' 的作用
很多新手刚开始学习python的时候经常会看到python 中__name__ = \'__main__\' 这样的代码,可能很多新手一开始学习的时候都比较疑惑,python 中__name__ = '__main__' 的作用,到底干嘛的?有句话经典的概括了这段代码的意义:“Make a script both importable and executable”意思就是说让你写的脚本模块既可以...
转载
2018-05-08 09:27:19 ·
140 阅读 ·
0 评论