• XML in JSON konvertieren mit Python

    XML in JSON konvertieren mit Python

    Wollt ihr in Python ein XML-Dokument in ein JSON-Dokument umwandeln, könnt ihr Euch die Funktionen vom Modul xmltodict zunutze machen, indem ihr zuerst Eure XML-Datei in ein Python Dictionary einspeist und danach dieses Dictionary mit dem Python eigenen Modul json (import json) konvertiert und speichert. Dies kann dann wie folgt aussehen: import xmltodict, jsonwith open('deine-xml-datei.xml', 'r', encoding='utf-8', errors='ignore') as myfile: obj = xmltodict.parse(myfile.read()) myfile.close()...
You have successfully subscribed!
This email has been registered