Получить атрибуты объекта Python
for att in dir(your_object):
print (att, getattr(your_object,att))
Smoggy Serval
for att in dir(your_object):
print (att, getattr(your_object,att))
import inspect
class myclass:
a = 5
def method(b):
return b
for i in inspect.getmembers(myclass):
print(i)
getattr(object, 'attribute_name')
field_name = "fullName"
print getattr(user, field_name) # prints content of user.fullName