pprint

Stdlib — DataPython 2.0+Beginner

Pretty-printer for data structures

Quick Info

Documentation
Official Docs
Python Version
2.0+
Dependencies
None — Python Standard Library
Install
Included with Python

Learn by Difficulty

Quick Example

python
from pprint import pprint

data = {
    "users": [
        {"name": "Alice", "age": 30, "roles": ["admin", "user"]},
        {"name": "Bob", "age": 25, "roles": ["user"]},
    ],
    "settings": {"theme": "dark", "language": "en"},
}
pprint(data, width=50)

The pprint module is part of Python's standard library. Pretty-printer for data structures.

Try in Playground

Tags

stdlibdata-structure