Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python pprint on file

# credit to the Stack Overflow user in the source link

from pprint import pprint

# ... Build your object somehow ...

with open('output.txt', 'wt') as out:
    pprint(your_object, stream=out)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #pprint #file
ADD COMMENT
Topic
Name
4+3 =