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

View File

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