📜  如何查看对象的所有属性和方法python代码示例

📅  最后修改于: 2022-03-11 14:46:07.782000             🧑  作者: Mango

代码示例2
class Person:
    def __init__(self,name,age):
        self.name = name
        self.age = age
    def printInfo(self):
        print("name: {}, age: {}".format(self.name,self.age))

p1 = Person('Tom',24)
# right below
print(p1.__dict__)