Merge pull request #313 from Everfighting/master

add python function indent
This commit is contained in:
XiongNeng
2020-08-02 21:31:03 +08:00
committed by GitHub
2 changed files with 10 additions and 10 deletions

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

View File

@@ -15,7 +15,7 @@
.. code-block:: python
>>> def myfun():
... return 1, 2, 3
... return 1, 2, 3
...
>>> a, b, c = myfun()
>>> a