string to dictionary (1) 썸네일형 리스트형 Python: json.loads() # string to dict # doble quotes # Boolean python에서 dictionary 모양으로 되어 있는 string을 dictionary 타입으로 바꿔주는 방법 중에 json이 있습니다. import json # Assume that dict_shaped_string string_to_dict = json.loads(dict_shaped_string) print(type(string_to_dict) # output: 'dict' 그런데 json.loads를 이용할 때 주의할 점이 있습니다. 대표적으로 - ' 이 아니라 " 을 써야하는 점(double quote) - Javascript 형태로 boolean을 써야하는 점입니다.(True/False: X, true/false: O) 구체적인 예제코드로 살펴보겠습니다. import json sample_1.. 이전 1 다음