How to list all functions in a Python module?

前端 未结 17 1977
野性不改
野性不改 2020-11-22 05:38

I have a python module installed on my system and I\'d like to be able to see what functions/classes/methods are available in it.

I want to call the doc function

17条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 06:03

    This will do the trick:

    dir(module) 
    

    However, if you find it annoying to read the returned list, just use the following loop to get one name per line.

    for i in dir(module): print i
    

提交回复
热议问题