Mehrdad Mehrdad - 1 year ago 173
Python Question

Get all object attributes in Python?

Is there a way to get all attributes/methods/fields/etc. of an object in Python?

is close to what I want, but it doesn't work unless an object has a
, which isn't always true (e.g. it's not true for a
, a
, etc.).

Answer Source

Use the built-in function dir().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download