How can i convert an xml file into JSON using python?

前端 未结 3 1590
[愿得一人]
[愿得一人] 2021-01-18 04:12

I have an XML file which I want to convert into JSON file using python, but its nt working out for me.



    

        
3条回答
  •  被撕碎了的回忆
    2021-01-18 05:04

    This is probably what you are looking for:

    https://github.com/mutaku/xml2json

    import xml2json
    
    s = '''
    
       Tove
       Jani
       Reminder
       Don't forget me this weekend!
    '''
    print xml2json.xml2json(s)
    

提交回复
热议问题