How do I get python's pprint to return a string instead of printing? How do I get python's pprint to return a string instead of printing? python python