ASH84

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

python json 기반 conf 파일 로드하기(object_hook)

created:2015-02-12
updated:2016-08-13
edit

conf 를 json 파일로 쓰는 경우가 있는데 주로 개인 프로젝트 할때 많이 쓰는 편인데 결국 conf 라는것을 환경설정 파일이기 때문에 파일로 가져와서 읽어야 하는 경우가 많다. 이 경우 json 을 바로 dict 으로 loads 해서 사용하게 되면 conf[“port”] 이런식으로 접근해야 하는데 object_hook 를 이용하면 객체의 형태로 접근할수가 있다. 좀더 코드가 깔끔해 진다랄까. 

2015/01/30 – [Programming/Python] – [python] response data for flask

2014/11/25 – [Programming/Python] – 8.18. pprint — Data pretty printer — Python 2.7.8 documentation

2013/12/16 – [Programming/Python] – (python) daum_openapi 라이브러리 개발기

2013/09/17 – [Programming/iOS] – (iOS) JSON문자열 NSDictionary 변환

2013/05/14 – [Programming/iOS] – (iOS) JSONKit ARC 상에서 작업하기

2013/01/11 – [Programming/Java] – [Java] 간단 gson wrapping 하기

2012/02/18 – [Programming/Java] – [JAVA] Gson 라이브러리로 JSon 이용하기


#dev  #JSON  #loads  #object_hook  #Python  #파이썬