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
相關文章
相關標籤/搜索