python中 if __name__=='__main__' 是什么意思

在理解这个以前请你们先任意建两个个python脚本,输入python 第一个test1.pyspa #coding:utf-8 def hello(): print(__name__) hello() 运行该程序输出结果是什么:__main__utf-8 第二个test2.pyit import test1 print(__name__) test1.hello() 输出结果是:test
相关文章
相关标签/搜索