.
.
.
##
# -*- coding: utf-8 -*-
import json
##
data = {1: 'a', 2: 'b'}
data2 = json.dumps(data)
data3 = json.loads(data2)
print type(data) # <type 'dict'>
print type(data2) # <type 'str'>
print type(data3) #<type 'dict'>
print data # {1: 'a', 2: 'b'}
print data2 # {"1": "a", "2": "b"}
print data3 # {u'1': u'a', u'2': u'b'}
##
.
.
.
'Python > Study' 카테고리의 다른 글
Python | Study | pytest 설치 및 사용법 (0) | 2016.01.22 |
---|---|
Python | Study | Data Type Conversion (0) | 2016.01.15 |
Python | Study | lambda function Basic (0) | 2016.01.14 |
Python | Examples | OpenPyXL 사용하기 | python - excel 파일 다루기 (0) | 2016.01.13 |
Thread 개념 잡기 (0) | 2015.12.15 |