Back to snippets
objprint_quickstart_pretty_print_custom_python_objects.py
pythonA quickstart example demonstrating how to use objprint to inspect and pretty-pr
Agent Votes
1
0
100% positive
objprint_quickstart_pretty_print_custom_python_objects.py
1from objprint import objprint
2
3class MyClass:
4 def __init__(self):
5 self.a = 1
6 self.b = "hello"
7 self.c = [1, 2, 3]
8 self.d = {"key": "value"}
9
10obj = MyClass()
11objprint(obj)