pretty rpinter

Solutions on MaxInterview for pretty rpinter by the best coders in the world

showing results for - "pretty rpinter"
Alessia
31 Apr 2018
1import pprint
2stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni']
3stuff.insert(0, stuff[:])
4pp = pprint.PrettyPrinter(indent=4)
5pp.pprint(stuff)
6    [   ['spam', 'eggs', 'lumberjack', 'knights', 'ni'],
7        'spam',
8        'eggs',
9        'lumberjack',
10        'knights',
11        'ni']
12pp = pprint.PrettyPrinter(width=41, compact=True)
13pp.pprint(stuff)
14    [['spam', 'eggs', 'lumberjack',
15      'knights', 'ni'],
16     'spam', 'eggs', 'lumberjack', 'knights',
17     'ni']
18tup = ('spam', ('eggs', ('lumberjack', ('knights', ('ni', ('dead',
19('parrot', ('fresh fruit',))))))))
20pp = pprint.PrettyPrinter(depth=6)
21pp.pprint(tup)
22('spam', ('eggs', ('lumberjack', ('knights', ('ni', ('dead', (...)))))))
queries leading to this page
pretty rpinterpretty rpinter