참고용

파이썬에서 딕셔너리(dict) ↔ JSON 변환하는 코드

tierr 2025. 5. 20. 15:23
import json

# dict → JSON 문자열
json_str = json.dumps(person)
print(json_str)

# JSON 문자열 → dict
person_dict = json.loads(json_str)
print(person_dict["name"])  # Alice