Python - 查看类的方法和属性

Python - 查看类的方法和属性,dir(),help()

1. dir()查看类的方法和属性

dir([object])

  

2.help()查看函数或模块用途的详细说明

help([object])

 

3.查看具体类中某方法的详细说明

help(object.method_name)

  例如:查看slice类中的indices方法

  help(slice.indices)

 

 

 

 

 

 
 
posted @ 2020-05-31 15:42  JIMfan  阅读(9777)  评论(0编辑  收藏  举报