import pprint
people = [{'first': 'Brian', 'last': 'Kernighan'}, {'first': 'Dennis',
    'last': 'Richie'}]
pprint.pformat(people, indent=4)
How do I get python's pprint to return a string instead of printing?