我們有時寫的python子產品需要自己測試, 簡單方法就是定義main函數, 然後測試自己的子產品接口。 def main(): test_yourCode() if __name__ == "__main__": main()