python2
for attr, value in k.__dict__.iteritems():
print attr, value
python3
class Test():
def __init__(self) -> None:
self.name='eee'
self.pp='ppp'
test = Test()
for attr, value in test.__dict__.items():
print(attr, value)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)