ASH84

Software Engineer/Developer, co-founder of Payhere. Ex-Banksalad. Intereseted in iteroperability, bootstrap company, writting.

8.18. pprint — Data pretty printer — Python 2.7.8 documentation

created:2014-11-25
updated:2015-07-03
edit

8.18. pprint — Data pretty printer — Python 2.7.8 documentation

우연히 json 을 이쁘게 보여줘야할 필요성이 있어서 이걸 js에서 할까 파이썬에서 할까 생각하다가 좀더 익숙한 파이썬에서 해보자는 생각에 찾아봤는데 기본 라이브러리에 있을줄을 몰랐다. 사용법도 간단한데 print 하기 전에 indet 와 depth 의 수를 정하면 되고, pprint 는 print 를 하는 함수이고, pformat 은 정돈된 문자열을 변수로 반환할때 사용하는 함수이다. dict 이나 list 객체를 던져지고 indet, depth 만 정하면 끝. 


#dev  #json pretty  #pprint  #Python