Merge pull request #1 from Everfighting/Everfighting-patch-1

add python function indent
This commit is contained in:
everfight
2020-01-20 15:44:43 +08:00
committed by GitHub

View File

@@ -18,15 +18,15 @@
from xml.etree.ElementTree import Element
def dict_to_xml(tag, d):
'''
Turn a simple dict of key/value pairs into XML
'''
elem = Element(tag)
for key, val in d.items():
child = Element(key)
child.text = str(val)
elem.append(child)
return elem
'''
Turn a simple dict of key/value pairs into XML
'''
elem = Element(tag)
for key, val in d.items():
child = Element(key)
child.text = str(val)
elem.append(child)
return elem
下面是一个使用例子: