점프 투 파이썬 - 라이브러리 예제
pprint
데이터를 보기 좋게 출력하려면? ― pprint
- 'pretty print'라는 뜻
- 데이터를 보기 좋게 출력(pretty print)할 때 사용하는 모듈
- 구조가 복잡한 JSON 데이터를 디버깅 용도로 출력할 때 pprint를 자주 사용
>>> import pprint
>>> result = {'userId': 1, 'id': 1, 'title': 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit', 'body': 'quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto'}
>>> pprint.pprint(result)
{'body': 'quia et suscipit\n'
'suscipit recusandae consequuntur expedita et cum\n'
'reprehenderit molestiae ut ut quas totam\n'
'nostrum rerum est autem sunt rem eveniet architecto',
'id': 1,
'title': 'sunt aut facere repellat provident occaecati excepturi optio '
'reprehenderit',
'userId': 1}
html.parser
requests