라벨이 pprint인 게시물 표시

파이썬[Python]: pprint - PrettyPrinter 클래스

pprint 모듈 - PrettyPrinter 클래스(class) /// 설명 PrettyPrinter 인스턴스를 생성합니다. indent 는 들여쓰기를 나타냅니다. width 는출력할 수 있는 최대 넓이를 나타냅니다. depth 는 표현할 수 있는 데이터 구조의 깊이를 나타냅니다. 데이터 구조가 깊다면 '...' 으로 표현을 합니다. stream 은 출력하는 파일 객체를 나타내며, 기본값으로 sys.stdout 이 설정되어 있습니다. compact 는 최대 넓이 안에서 라인 단위로 표현할지 결정합니다. False라면 라인단위로 출력합니다. sort_dicts 는 정렬을 결정합니다. True라면 정렬 후 출력합니다. underscore_numbers 는 정수를 표현함에 있어서 접두사로 '_'를 사용합니다. True일 경우 사용합니다. ※ 형식 class pprint.PrettyPrinter(indent=1, width=80, depth=None, stream=None, *, compact=False, sort_dicts=True, underscore_numbers=False) reference https://docs.python.org/3/library/pprint.html#module-pprint /// 예제 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 import  sys import  pprint   test  =  [ 'Other' ,  'values' ,  'configure' ,  'the' ,  'manner' ,  'in' ,  'which&