如何将xml转为python中的字典 import cElementTree as ElementTree class XmlListConfig(list): def __init__(self, aList): for element in aList: if element: # treat like dict if len(element) == 1 or element[0].tag != element[1].tag: self.append(XmlDictConfig(elemen…
在django的html模板中获取字典中的值应当直接使用 字典.[key] 的方式 {% for i in lists %} <li id="{{i.id}}" class = "db_data"> <h2>{{i.question}}</h2> <h3>{{i.answer}}</h3> <h3>{{i.explain}}</h3> </li>…