Re: [問題] __name__的使用時機?
推
06/24 13:54,
06/24 13:54
l大給的網頁講得有點模糊
Knowing this, you can design a test suite for your module within the module
itself by putting it in this if statement.
這句話讓我不太懂放了這個statement對於我的模組做出什麼樣的testing
This makes it easier to develop and debug new modules before integrating them into a larger
program.
結論看得懂 但不知道為什麼會有這個結論
還是不太懂if __name__=='__main__'的用意
不知道版友能不能幫不才的小弟解釋一下?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.167.24.92
※ 編輯: RUReady2 來自: 118.167.24.92 (06/24 14:15)
推
06/24 14:27, , 1F
06/24 14:27, 1F
→
06/24 14:28, , 2F
06/24 14:28, 2F
→
06/24 14:34, , 3F
06/24 14:34, 3F
推
06/24 14:35, , 4F
06/24 14:35, 4F
→
06/24 14:38, , 5F
06/24 14:38, 5F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 3 篇):