add python function indent

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

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
下面是一个使用例子: