📜  对象中每个属性的python - Python代码示例

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

代码示例1
#Python 2
for attr, value in k.__dict__.iteritems():
        print attr, value

#Python 3
for attr, value in k.__dict__.items():
        print(attr, value)