1. 程式人生 > >python中檢視module和function的方法

python中檢視module和function的方法

python中檢視module和function的方法

1. 使用幫助函式——help():

  1.1 檢視普通模組:首先,import  module_name,然後,help(module_name)

  

  1.2 檢視模組中的函式:首先,import  module_name,然後,dir(module_name)

  

2. 使用列印函式——print():

  檢視函式資訊:print(module_name.__doc__)