You want vars()
mixed with pprint()
:
from pprint import pprint
pprint(vars(your_object))
More Related Contents:
- Getting the class name of an instance?
- How to get method parameter names?
- How to watch for a variable change in python without dunder setattr or pdb
- What does the slash mean in help() output?
- How can I see the entire HTTP request that’s being sent by my Python application?
- Showing the stack trace from a running Python application
- How is the ‘is’ keyword implemented in Python?
- Implementing slicing in __getitem__
- Why (0-6) is -6 = False? [duplicate]
- Get fully qualified class name of an object in Python
- How do I run a Python program?
- Print a list of space-separated elements
- List all the modules that are part of a python package?
- Pretty-print a NumPy array without scientific notation and with given precision
- Trace Python imports
- What’s the biggest difference between dir() and __dict__ in Python
- Should __ne__ be implemented as the negation of __eq__?
- NumPy: Pretty print tabular data
- Introspection to get decorator names on a method?
- Using python’s logging module to log all exceptions and errors
- Multiply operator applied to list(data structure)
- How do you get all classes defined in a module but not imported?
- Schrödinger’s variable: the __class__ cell magically appears if you’re checking for its presence?
- Attaching a process with pdb
- What does the slash mean when help() is listing method signatures?
- “ValueError: zero length field name in format” error in Python 3.0,3.1,3.2
- Step-by-step debugging with IPython
- Pretty print a pandas dataframe in VS Code
- List comprehension scope error from Python debugger
- scipy convolve2d outputs wrong values