内建方法
dir(__builtins__)
类和实例方法对比
class person:
def __init__(self, job):
self.job = job
name = "mao"
def show(self):
print(\'hello mao\')
- 打印类的属性和方法
for i in dir(person):
print(i)
- 打印对象的属性和方法
# p = person(\'it\')
# for i in dir(p):
# print(i)