We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c84911b commit 7d45738Copy full SHA for 7d45738
source/c06/p05_turning_dictionary_into_xml.rst
@@ -18,15 +18,15 @@
18
from xml.etree.ElementTree import Element
19
20
def dict_to_xml(tag, d):
21
- '''
22
- Turn a simple dict of key/value pairs into XML
23
24
- elem = Element(tag)
25
- for key, val in d.items():
26
- child = Element(key)
27
- child.text = str(val)
28
- elem.append(child)
29
- 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
30
31
下面是一个使用例子:
32
0 commit comments