pprint module offers more sophisticated control over printing : Pprint : Language Basics PYTHON examples


PYTHON examples » Language Basics » Pprint »

 

pprint module offers more sophisticated control over printing


pprint module offers more sophisticated control over printing

#The pprint module offers more sophisticated control over printing both built-in and 
#user defined objects in a way that is readable by the interpreter. When the result 
#is longer than one line, the ''pretty printer'' adds line breaks and indentation to 
#more clearly reveal data structure:

import pprint
t = [[[['black', 'cyan'], 'white', ['green', 'red']][['magenta',
      'yellow'], 'blue']]]
    
print pprint.pprint(t, width=30)



           
       



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Language Basics
» Pprint