xxxxxxxxxx
class MyClass:
def __init__(self, attr1, attr2):
self.attr1 = attr1
self.attr2 = attr2
def method1(self):
pass
def method2(self):
pass
obj = MyClass(10, 20)
# Get all attributes of MyClass
class_attributes = [attr for attr in dir(MyClass) if not callable(getattr(MyClass, attr)) and not attr.startswith("__")]
print(class_attributes)