Search notes:

Python standard library: pprint

pprint stands for pretty print.
import pprint

data = {
    "foo":{ "42":"forty-two", "8" :"eight" }, "bar":[
    {"key":"1", "value": "one"  }, {"key":"2", "value":
    "two"  }, {"key":"3", "value": "three"}, {"key":"4",
    "value": "four" } ] }

pprint.pprint(data)

#
#  {'bar': [{'key': '1', 'value': 'one'},
#           {'key': '2', 'value': 'two'},
#           {'key': '3', 'value': 'three'},
#           {'key': '4', 'value': 'four'}],
#   'foo': {'42': 'forty-two', '8': 'eight'}}
Github repository about-Python, path: /standard-library/pprint/demo.py

See also

The built-in function print()
The standard library textwrap
standard library

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758203003, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Python/standard-library/pprint/index(62): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78