Advertisement
Guest User

Untitled

a guest
Jun 13th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. def pprintDict(d, indent=None, sort_keys=None):
  2.     """
  3.    Pretty print a dictionary object.
  4.    
  5.    @param text: The json string to output.
  6.    @type text: <string>
  7.    @param indent: Number of spaces to use.
  8.    @type indent: <int>
  9.    @param sort_keys: If the keys should be sorted.
  10.    @type sort_keys: <boolean>
  11.    """
  12.     if(indent is None): indent = 4
  13.     if(sort_keys is None): sort_keys = False
  14.     pp = pprint.PrettyPrinter(indent, sort_keys)
  15.     pp.pprint(d)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement