0
当我尝试将Python字典转换为XML的dict2xml,我有这样的错误:的Python/dict2xml:类型错误:unhashable类型: '字典'
TypeError: unhashable type: 'dict'
这是我的代码:
import dict2xml
docs = {
{
'Id': '30',
'File': 'Overstock_com-US_Catalog_NonMedia.xml.gz',
'Section': 'beauty',
'name': 'Overstock.com',
'Logo': 'overstock.png',
'FtpId': '91567',
'Pool': 'CJ'
},
{
'Id': '31',
'File': 'Zappos_com-Product_Catalog_1.xml.gz',
'Section': 'beauty',
'name': 'Zappos.com',
'Logo': 'zappos.png',
'FtpId': '91567',
'Pool': 'CJ'
}
}
print(dict2xml(docs, 'add'))
你的意思是一组? – TerryA
@Haidro ouch!是。 –
@Haidro那个评论很有道理! – Babu