파이썬 xml to json1 [Python] - xml to json / json to xml 변환하기 xml to json (xml 데이터 json으로 변환)로직더보기로직import jsonimport xmltodictwith open("../data/xml_to_json.xml", "r") as f: xml_data = f.read()print(f"\nxml 데이터 파일 읽어와서 출력한 결과: \n{xml_data}")json_data = json.dumps(xmltodict.parse(xml_data), indent=4)print(f"\njson 데이터로 변환하여 출력한 결과: \n{json_data}")1. 모듈 임포트import jsonimport xmltodictjson: JSON 데이터를 파싱하거나 JSON 문자열로 변환하기 위한 표준 라이브러리.xmltodict: XML 데이터를 Pyt.. 2025. 1. 17. 이전 1 다음