add python function indent
add python function indent
This commit is contained in:
@@ -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
|
||||
|
||||
下面是一个使用例子:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user