看板
[ Python ]
討論串[問題] __name__的使用時機?
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
不是這件事可以讓你做什麼 test, 只是讓你方便執行 test.. 範例:. # lib.py. class Lib:. def greet():. print('hi'). def main():. print('my name is: ' + __name__). if __name__ ==
(還有761個字)
內容預覽:
l大給的網頁講得有點模糊. Knowing this, you can design a test suite for your module within the module. itself by putting it in this if statement.. 這句話讓我不太懂放了這個sta
(還有163個字)
首頁
上一頁
1
下一頁
尾頁